Ticket #4048: 4048.patch
File 4048.patch, 5.3 KB (added by , 14 years ago) |
---|
-
_source/skins/kama/skin.js
22 22 margins : [ 0, 0, 0, 0 ], 23 23 init : function( editor ) 24 24 { 25 var menuHead; 26 function menuSetUiColor( color ) 27 { 28 if ( !menuHead ) 29 return null; 30 31 var uiStyle = menuHead.append('style'); 32 33 var cssSrc = "/* UI Color Support */\ 25 var uiColorMenus = {}; 26 var uiColorRegex = /\$color/g; 27 var uiColorMenuCss = "/* UI Color Support */\ 34 28 .cke_skin_kama .cke_menuitem .cke_icon_wrapper\ 35 29 {\ 36 30 background-color: $color !important;\ … … 85 79 background-color: $color !important;\ 86 80 }"; 87 81 88 uiStyle.setAttribute( "type", "text/css" ); 89 var regex = /\$color/g; 82 function uiColorAddMenu( id, head ) 83 { 84 uiColorMenus[ id ] = head.append( 'style' ); 85 uiColorMenus[ id ].setAttribute( "type", "text/css" ); 90 86 91 87 // We have to split CSS declarations for webkit. 92 88 if ( CKEDITOR.env.webkit ) 93 89 { 94 cssSrc = cssSrc.split( '}' ).slice( 0, -1 );95 for ( var i in cssSrc)96 cssSrc[ i ] = cssSrc[ i ].split( '{' );90 uiColorMenuCss = uiColorMenuCss.split( '}' ).slice( 0, -1 ); 91 for ( var i in uiColorMenuCss ) 92 uiColorMenuCss[ i ] = uiColorMenuCss[ i ].split( '{' ); 97 93 } 94 } 98 95 99 return ( menuSetUiColor = 100 function( color ) 101 { 102 if ( CKEDITOR.env.webkit ) 103 { 104 for ( var i in cssSrc ) 105 uiStyle.$.sheet.addRule( 106 cssSrc[ i ][ 0 ], cssSrc[ i ][ 1 ].replace( regex, color ) 107 ); 108 } 109 else 110 { 111 var css = cssSrc.replace( regex, color ); 96 function uiColorUpdateMenus( color ) 97 { 98 for ( var id in uiColorMenus ) 99 { 100 if ( CKEDITOR.env.webkit ) 101 { 102 for ( var i in uiColorMenuCss ) 103 uiColorMenus[ id ].$.sheet.addRule( 104 uiColorMenuCss[ i ][ 0 ], uiColorMenuCss[ i ][ 1 ].replace( uiColorRegex, color ) 105 ); 106 } 107 else 108 { 109 var css = uiColorMenuCss.replace( uiColorRegex, color ); 112 110 113 114 uiStyle.$.styleSheet.cssText = css;115 116 uiStyle.setHtml( css );117 118 })( color );119 } 111 if ( CKEDITOR.env.ie ) 112 uiColorMenus[ id ].$.styleSheet.cssText = css; 113 else 114 uiColorMenus[ id ].setHtml( css ); 115 } 116 } 117 } 120 118 121 119 CKEDITOR.tools.extend( editor, 122 120 { … … 156 154 else 157 155 uiStyle.setHtml( cssSelectors + '{' + css + '}' ); 158 156 159 menuSetUiColor( color );157 uiColorUpdateMenus( color ); 160 158 })( color ); 161 159 } 162 160 }); … … 170 168 { 171 169 old.apply( this, arguments ); 172 170 173 if ( ! menuHead&& editor == this.editor )171 if ( !uiColorMenus[ this.id ] && editor == this.editor ) 174 172 { 175 // Save reference. 176 menuHead = this._.element.getDocument().getHead(); 177 menuSetUiColor( editor.getUiColor() ); 173 uiColorAddMenu( this.id, this._.element.getDocument().getHead() ); 174 uiColorUpdateMenus( editor.getUiColor() ); 178 175 } 179 176 }; 180 177 } … … 182 179 // Apply UI color if specified in config. 183 180 if ( editor.config.uiColor ) 184 181 editor.setUiColor( editor.config.uiColor ); 185 186 // Fix editor's width. HPadding and 100% width iframe issue.187 // if ( CKEDITOR.env.ie && CKEDITOR.env.quirks )188 // {189 // editor.on( 'mode', function( event )190 // {191 // var container = editor.getResizable();192 // editor.resize( container.$.offsetWidth-10, container.$.offsetHeight );193 // event.removeListener();194 // });195 // }196 197 // if ( CKEDITOR.env.ie && ( CKEDITOR.env.quirks || CKEDITOR.env.version < 7 ) )198 // {199 // editor.on( 'themeLoaded', function( event )200 // {201 // var toolbars = editor.container.getChild( [0, 0, 0, 0, 0, 0, 0] ).getChildren();202 // for ( var i = 0 ; i < toolbars.count() ; i++ )203 // {204 // var toolbar = toolbars.getItem( i );205 206 // var last = toolbar.getLast();207 // if ( !last || !last.getPrevious().hasClass( 'cke_rcombo' ) )208 // continue;209 //210 // last.addClass( 'cke_toolbar_end_last' );211 // }212 // });213 // }214 182 } 215 183 }; 216 184 })() ); -
CHANGES.html
162 162 ckeditor2.html test case.</li> 163 163 <li><a href="http://dev.fckeditor.net/ticket/3989">#3989</a> : Host page horizontal scrolling a lot when on having righ-to-left direction.</li> 164 164 <li><a href="http://dev.fckeditor.net/ticket/4001">#4001</a> : Create link around existing image result incorrect.</li> 165 <li><a href="http://dev.fckeditor.net/ticket/4048">#4048</a> : Context submenu lacks uiColor.</li> 165 166 </ul> 166 167 <h3> 167 168 CKEditor 3.0 RC</h3> -
_source/plugins/menu/plugin.js
122 122 123 123 show : function( offsetParent, corner, offsetX, offsetY ) 124 124 { 125 console.log( 'menu#show' ) 125 126 var items = this.items, 126 127 editor = this.editor, 127 128 panel = this._.panel,