Here are some nice changes to the editor, maybe they are usefull for others:
- - - Select style used in text : - - -
(The editor display's the style wich is applyed to the (Selected)text (under the cursor))
fck_displaychange.js :
function CheckStyle(comboName)
{
if (oFontStyle == null) oFontStyle = document.getElementById(comboName) ;
// * * * Non Orrigional Code * * *
if(objContent.DOM.selection.type != "Control"){
var oClassFont = objContent.DOM.selection.createRange().parentElement();
while(oClassFont.className == "" && oClassFont.parentNode != null){
oClassFont = oClassFont.parentNode;
}
}
if(oClassFont != null){
SetComboValue(oFontStyle, oClassFont.className);
}else{
oFontStyle.value = "";
}
// * * * Non Orrigional Code End * * *
//CheckComboValue(oFontFormatCombo,DECMD_GETBLOCKFMT) ;
}
// * * * Non Orrigional Code * * *
function SetComboValue(oCombo, sValue){
// Sets the value of oCombo to sValue if sValue exists in options, else the value will be set to ""
if(!oCombo) return ;
var bFound = false;
for(var x = 0; x < oCombo.options.length; x++){
if(oCombo.options(x).value == sValue){
bFound = true;
oCombo.value = sValue;
break;
}
}
if(bFound == false)
{
oCombo.value = "";
}
}
// * * * Non Orrigional Code End * * *
- - - Select style used in text : - - -
(The editor display's the style wich is applyed to the (Selected)text (under the cursor))
fck_displaychange.js :
function CheckStyle(comboName)
{
if (oFontStyle == null) oFontStyle = document.getElementById(comboName) ;
// * * * Non Orrigional Code * * *
if(objContent.DOM.selection.type != "Control"){
var oClassFont = objContent.DOM.selection.createRange().parentElement();
while(oClassFont.className == "" && oClassFont.parentNode != null){
oClassFont = oClassFont.parentNode;
}
}
if(oClassFont != null){
SetComboValue(oFontStyle, oClassFont.className);
}else{
oFontStyle.value = "";
}
// * * * Non Orrigional Code End * * *
//CheckComboValue(oFontFormatCombo,DECMD_GETBLOCKFMT) ;
}
// * * * Non Orrigional Code * * *
function SetComboValue(oCombo, sValue){
// Sets the value of oCombo to sValue if sValue exists in options, else the value will be set to ""
if(!oCombo) return ;
var bFound = false;
for(var x = 0; x < oCombo.options.length; x++){
if(oCombo.options(x).value == sValue){
bFound = true;
oCombo.value = sValue;
break;
}
}
if(bFound == false)
{
oCombo.value = "";
}
}
// * * * Non Orrigional Code End * * *
Thats helping
Custom feature: editor select applied style
thx 4 this great tips ^^