I have change the Style dropdown menu, so it automatically loads the data from the loaded stylsheets.
Add to fck_editor.js:
Add to fck_editor.js on line 61:
I hope this works.
Add to fck_editor.js:
// Method: loadStylesheet() // Description: Loads data from the stylesheet into the combobox // Author: byFly.net function loadStylesheet(){ var a,b; var styleList = new Array(); passedValue = objContent.DOM.styleSheets; for (var i = 0; passedValue && i < passedValue.length; i++) { for (var j = 0; j < passedValue[i].rules.length; j++) { // Extract the rule and the rule definition from the passed style // data. a = passedValue[i].rules[j].selectorText.toString(); b = passedValue[i].rules[j].style.cssText; //alert(a + " --> " + b); //document.body.innerHTML += a + " --> " + b + "<Br>"; // Ignore non-style entries if (!a || !b) continue; // Id: These are added to the document style sheet but are not // available in the style dropdown if (a.indexOf("#") != -1) { continue; } // Class: Append a cless element to the style list if (a.indexOf(".") == 0) { styleList[styleList.length] = [a.substr(1), "Class " + a, 1]; } // SubClass: Append the sub-class to the style list else if(a.indexOf(".") > 0) { l = a.split("."); styleList[styleList.length] = [l[1], a, 1]; } // Otherwise, assume it's a tag and select the existing tag entry // in the style list. else { styleList[styleList.length] = [a, a.toLowerCase(), 1]; } } } for (var i = 0; i < styleList.length; i++) { var oOption = document.createElement("OPTION"); if (styleList[i][0]) oOption.value = styleList[i][0]; oOption.text = styleList[i][1]; oOption.style.backgroundColor = 'white'; // Choose the combobox, in this case cmbFontStyle if(document.all.cmbFontStyle){ document.all.cmbFontStyle.add(oOption); } } }
Add to fck_editor.js on line 61:
// Loads stylesheet data into combobox // Timeout is to load the stylesheet from te server, this may cost a few seconds setTimeout("loadStylesheet()",1000);
I hope this works.