Changeset 3131 for trunk/expressoMail1_2/js/jscode/rich_text_editor.js
- Timestamp:
- 08/04/10 10:53:48 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/expressoMail1_2/js/jscode/rich_text_editor.js
r2630 r3131 37 37 document.getElementById('fontsize').selectedIndex = 0; 38 38 }; 39 40 cRichTextEditor.prototype.loadStyle = function(tag, css_file) { 41 var theRules = new Array(); 42 var stylePRE = ""; 43 for(var s = 0; s < document.styleSheets.length; s++) { 44 if(document.styleSheets[s].href != null && 45 document.styleSheets[s].href.match("templates/"+template+"/"+css_file)){ 46 if (document.styleSheets[s].cssRules) 47 theRules = document.styleSheets[s].cssRules; 48 else if (document.styleSheets[s].rules) 49 theRules = document.styleSheets[s].rules; 50 break; 51 } 52 } 53 for(var s = 0;s < theRules.length; s++){ 54 if(theRules[s].selectorText.toLowerCase() == tag.toLowerCase()){ 55 stylePRE = theRules[s].style; 56 break; 57 } 58 } 59 var _body = Element(this.editor); 60 var i_doc = (document.all) ? _body.contentWindow.document: _body.contentDocument; 61 var hh1 = i_doc.getElementsByTagName('head')[0]; 62 // For IE 63 if(typeof(hh1) == 'undefined'){ 64 hh1 = i_doc.createElement("head"); 65 i_doc.appendChild(hh1); 66 } 67 var ss1 = i_doc.createElement('style'); 68 ss1.setAttribute("type", "text/css"); 69 var def = tag.toLowerCase()+' {'+stylePRE.cssText+'}'; 70 if (ss1.styleSheet) { 71 ss1.styleSheet.cssText = def; 72 } else { 73 var tt1 = i_doc.createTextNode(def); 74 ss1.appendChild(tt1); 75 } 76 hh1.appendChild(ss1); 77 } 39 78 40 79 cRichTextEditor.prototype.createElementEditor = function(pObj)
Note: See TracChangeset
for help on using the changeset viewer.