Ticket #3912: 3912_2.patch
File 3912_2.patch, 2.3 KB (added by , 14 years ago) |
---|
-
_source/skins/kama/skin.js
5 5 6 6 CKEDITOR.skins.add( 'kama', (function() 7 7 { 8 var preload = []; 8 var preload = [], 9 uiColorStylesheetId = 'cke_ui_color'; 9 10 10 11 if ( CKEDITOR.env.ie && CKEDITOR.env.version < 7 ) 11 12 { … … 89 90 uiColorMenuCss[ i ] = uiColorMenuCss[ i ].split( '{' ); 90 91 } 91 92 92 function addStylesheet( document )93 function getStylesheet( document ) 93 94 { 94 var node = document.getHead().append( 'style' ); 95 node.setAttribute( "id", "cke_ui_color" ); 96 node.setAttribute( "type", "text/css" ); 97 95 var node = document.getById( uiColorStylesheetId ); 96 if( !node ) 97 { 98 node = document.getHead().append( 'style' ); 99 node.setAttribute( "id", uiColorStylesheetId ); 100 node.setAttribute( "type", "text/css" ); 101 } 98 102 return node; 99 103 } 100 104 … … 105 109 { 106 110 if ( CKEDITOR.env.webkit ) 107 111 { 108 // Truncate manually.109 for ( i = 0 ; i < styleNodes[ id ].$.sheet.rules.length ; i++ )110 styleNodes[ id ].$.sheet.removeRule( i );111 112 112 for ( i = 0 ; i < styleContent.length ; i++ ) 113 113 { 114 114 content = styleContent[ i ][ 1 ]; … … 125 125 content = content.replace( replace[ r ][ 0 ], replace[ r ][ 1 ] ); 126 126 127 127 if ( CKEDITOR.env.ie ) 128 styleNodes[ id ].$.styleSheet.cssText = content;128 styleNodes[ id ].$.styleSheet.cssText += content; 129 129 else 130 styleNodes[ id ]. setHtml( content );130 styleNodes[ id ].$.innerHTML += content; 131 131 } 132 132 } 133 133 } … … 146 146 setUiColor : function( color ) 147 147 { 148 148 var cssContent, 149 uiStyle = addStylesheet( CKEDITOR.document ),149 uiStyle = getStylesheet( CKEDITOR.document ), 150 150 cssId = '#cke_' + CKEDITOR.tools.escapeCssSelector( editor.name ); 151 151 152 152 var cssSelectors = … … 186 186 // Add stylesheet if missing. 187 187 if ( !iframe.getById( 'cke_ui_color' ) ) 188 188 { 189 var node = addStylesheet( iframe );189 var node = getStylesheet( iframe ); 190 190 uiColorMenus.push( node ); 191 191 192 192 var color = editor.getUiColor();