Ticket #4463: 4463_2.patch
File 4463_2.patch, 12.1 KB (added by , 13 years ago) |
---|
-
_source/core/tools.js
220 220 } )(), 221 221 222 222 /** 223 * Build the HTML snippet of a set of <style>/<link>. 224 * @param css {String|Array} Each of which are url (absolute) of a CSS file or 225 * a trunk of style text. 226 */ 227 buildStyleHtml : function ( css ) 228 { 229 css = [].concat( css ); 230 var item, retval = []; 231 for ( var i = 0; i < css.length; i++ ) 232 { 233 item = css[ i ]; 234 // Is CSS style text ? 235 if ( /@import|[{}]/.test(item) ) 236 retval.push('<style>' + item + '</style>'); 237 else 238 retval.push('<link type="text/css" rel=stylesheet href="' + item + '">'); 239 } 240 return retval.join( '' ); 241 }, 242 243 /** 223 244 * Replace special HTML characters in a string with their relative HTML 224 245 * entity values. 225 246 * @param {String} text The string to be encoded. -
_source/plugins/wysiwygarea/plugin.js
560 560 editor.config.docType + 561 561 '<html dir="' + editor.config.contentsLangDirection + '">' + 562 562 '<head>' + 563 '<link type="text/css" rel="stylesheet" href="' + 564 [].concat( editor.config.contentsCss ).join( '"><link type="text/css" rel="stylesheet" href="' ) + 565 '">' + 563 CKEDITOR.tools.buildStyleHtml( editor.config.contentsCss ) + 566 564 '<style type="text/css" _fcktemp="true">' + 567 565 editor._.styles.join( '\n' ) + 568 566 '</style>'+ -
_source/core/skins.js
23 23 var loadedPart = function( skinName, part, callback ) 24 24 { 25 25 // Get the skin definition. 26 var skinDefinition = loaded[ skinName ];26 var skinDefinition = CKEDITOR.skins[ skinName ] = loaded[ skinName ]; 27 27 28 28 var appendSkinPath = function( fileNames ) 29 29 { … … 33 33 } 34 34 }; 35 35 36 function fixCSSTextRelativePath( cssStyleText, baseUrl ) 37 { 38 return cssStyleText.replace( /url\s*\(([\s'"]*)(.*?)([\s"']*)\)/g, 39 function( match, opener, path, closer ) 40 { 41 if ( /^\/|^\w?:/.test( path ) ) 42 return match; 43 else 44 return 'url(' + baseUrl + opener + path + closer + ')'; 45 } ); 46 } 47 36 48 // Check if we need to preload images from it. 37 49 if ( !preloaded[ skinName ] ) 38 50 { … … 96 108 // Load the "css" pieces. 97 109 if ( !cssIsLoaded ) 98 110 { 99 appendSkinPath( part.css );111 var cssPart = part.css; 100 112 101 for ( var c = 0 ; c < part.css.length ; c++ ) 102 CKEDITOR.document.appendStyleSheet( part.css[ c ] ); 103 113 if ( CKEDITOR.tools.isArray( cssPart ) ) 114 { 115 appendSkinPath( cssPart ); 116 for ( var c = 0 ; c < cssPart.length ; c++ ) 117 CKEDITOR.document.appendStyleSheet( cssPart[ c ] ); 118 } 119 else 120 { 121 cssPart = fixCSSTextRelativePath( 122 cssPart, CKEDITOR.getUrl( paths[ skinName ] ) ); 123 // Processing Inline CSS part. 124 CKEDITOR.document.appendStyleText( cssPart ); 125 } 126 127 part.css = cssPart; 128 104 129 cssIsLoaded = 1; 105 130 } 106 131 -
_source/plugins/menu/plugin.js
132 132 { 133 133 panel = this._.panel = new CKEDITOR.ui.floatPanel( this.editor, CKEDITOR.document.getBody(), 134 134 { 135 css : [ CKEDITOR.getUrl( editor.skinPath + 'editor.css' ) ],135 css : CKEDITOR.skins[ editor.skinName ].editor.css, 136 136 level : this._.level - 1, 137 137 className : editor.skinClass + ' cke_contextmenu' 138 138 }, -
_source/plugins/panel/plugin.js
160 160 // It looks strange, but for FF2, the styles must go 161 161 // after <body>, so it (body) becames immediatelly 162 162 // available. (#3031) 163 '<link type="text/css" rel=stylesheet href="' + this.css.join( '"><link type="text/css" rel="stylesheet" href="' ) + '">'+163 CKEDITOR.tools.buildStyleHtml( this.css ) + 164 164 '<\/html>' ); 165 165 doc.$.close(); 166 166 -
_source/core/editor.js
124 124 editor.fireOnce( 'configLoaded' ); 125 125 126 126 // Load language file. 127 load Lang( editor );127 loadSkin( editor ); 128 128 }; 129 129 130 130 var loadLang = function( editor ) … … 246 246 247 247 // Load the editor skin. 248 248 editor.fire( 'pluginsLoaded' ); 249 loadSkin( editor ); 249 CKEDITOR.fireOnce( 'pluginsLoaded' ); 250 loadTheme( editor ); 250 251 }); 251 252 }); 252 253 }; … … 255 256 { 256 257 CKEDITOR.skins.load( editor, 'editor', function() 257 258 { 258 load Theme( editor );259 loadLang( editor ); 259 260 }); 260 261 }; 261 262 -
_source/core/dom/document.js
52 52 } 53 53 }, 54 54 55 appendStyleText : function( cssStyleText ) 56 { 57 if ( this.$.createStyleSheet ) 58 { 59 var styleSheet = this.$.createStyleSheet( "" ); 60 styleSheet.cssText = cssStyleText ; 61 } 62 else 63 { 64 var style = new CKEDITOR.dom.element( 'style', this ); 65 style.append( new CKEDITOR.dom.text( cssStyleText, this ) ); 66 this.getHead().append( style ); 67 } 68 }, 69 55 70 createElement : function( name, attribsAndStyles ) 56 71 { 57 72 var element = new CKEDITOR.dom.element( name, this ); -
_source/plugins/preview/plugin.js
37 37 '<head>' + 38 38 baseTag + 39 39 '<title>' + editor.lang.preview + '</title>' + 40 '<link type="text/css" rel="stylesheet" href="' + 41 [].concat( editor.config.contentsCss ).join( '"><link type="text/css" rel="stylesheet" href="' ) + 42 '">' + 40 CKEDITOR.tools.buildStyleHtml( editor.config.contentsCss ) + 43 41 '</head>' + bodyHtml + 44 42 editor.getData() + 45 43 '</body></html>'; -
_source/plugins/dialog/plugin.js
73 73 return null; 74 74 } 75 75 76 // Stores dialog related data from skin definitions. e.g. margin sizes.77 var skinData = {};78 79 76 /** 80 77 * This is the base class for runtime dialog objects. An instance of this 81 78 * class represents a single named dialog for a single editor instance. … … 1437 1434 element = dialog.getElement().getFirst(), 1438 1435 editor = dialog.getParentEditor(), 1439 1436 magnetDistance = editor.config.dialog_magnetDistance, 1440 margins = skinData[ editor.skinName ].margins || [ 0, 0, 0, 0 ];1437 margins = CKEDITOR.skins[ editor.skinName ].margins || [ 0, 0, 0, 0 ]; 1441 1438 1442 1439 if ( typeof magnetDistance == 'undefined' ) 1443 1440 magnetDistance = 20; … … 1515 1512 minWidth = definition.minWidth || 0, 1516 1513 minHeight = definition.minHeight || 0, 1517 1514 resizable = definition.resizable, 1518 margins = skinData[ dialog.getParentEditor().skinName ].margins || [ 0, 0, 0, 0 ];1515 margins = CKEDITOR.skins[ dialog.getParentEditor().skinName ].margins || [ 0, 0, 0, 0 ]; 1519 1516 1520 1517 function topSizer( coords, dy ) 1521 1518 { … … 2672 2669 } 2673 2670 }; 2674 2671 })(); 2675 2676 // Grab the margin data from skin definition and store it away. 2677 CKEDITOR.skins.add = ( function() 2678 { 2679 var original = CKEDITOR.skins.add; 2680 return function( skinName, skinDefinition ) 2681 { 2682 skinData[ skinName ] = { margins : skinDefinition.margins }; 2683 return original.apply( this, arguments ); 2684 }; 2685 } )(); 2686 })(); 2672 })(); 2687 2673 2688 2674 // Extend the CKEDITOR.editor class with dialog specific functions. 2689 2675 CKEDITOR.tools.extend( CKEDITOR.editor.prototype, -
_source/plugins/font/plugin.js
36 36 37 37 panel : 38 38 { 39 css : [ CKEDITOR.getUrl( editor.skinPath + 'editor.css' ) ].concat( config.contentsCss ),39 css : CKEDITOR.skins[ editor.skinName ].editor.css.concat( config.contentsCss ), 40 40 voiceLabel : lang.panelVoiceLabel 41 41 }, 42 42 -
_source/plugins/colorbutton/plugin.js
31 31 32 32 panel : 33 33 { 34 css : [ CKEDITOR.getUrl( editor.skinPath + 'editor.css' ) ]34 css : CKEDITOR.skins[ editor.skinName ].editor.css.concat( config.contentsCss ) 35 35 }, 36 36 37 37 onBlock : function( panel, blockName ) -
_source/plugins/format/plugin.js
33 33 34 34 panel : 35 35 { 36 css : [ CKEDITOR.getUrl( editor.skinPath + 'editor.css' ) ].concat( config.contentsCss ),36 css : CKEDITOR.skins[ editor.skinName ].editor.css.concat( config.contentsCss ), 37 37 voiceLabel : lang.panelVoiceLabel 38 38 }, 39 39 -
_source/skins/kama/skin.js
203 203 }; 204 204 })() ); 205 205 206 if ( CKEDITOR.dialog)206 CKEDITOR.on( 'pluginsLoaded', function() 207 207 { 208 CKEDITOR.dialog .on( 'resize', function( evt )208 CKEDITOR.dialog && CKEDITOR.dialog.on( 'resize', function( evt ) 209 209 { 210 210 var data = evt.data, 211 211 width = data.width, … … 258 258 el.setStyle( 'height', ( body.$.offsetHeight - 31 - 14 ) + 'px' ); 259 259 }, 260 260 100 ); 261 } );262 } 261 } ); 262 } ); 263 263 264 264 /** 265 265 * The base user interface color to be used by the editor. Not all skins are -
_source/skins/office2003/skin.js
23 23 }; 24 24 })() ); 25 25 26 if ( CKEDITOR.dialog)26 CKEDITOR.on( 'pluginsLoaded', function() 27 27 { 28 CKEDITOR.dialog .on( 'resize', function( evt )28 CKEDITOR.dialog && CKEDITOR.dialog.on( 'resize', function( evt ) 29 29 { 30 30 var data = evt.data, 31 31 width = data.width, … … 73 73 // Ensure size is correct for RTL mode. (#4003) 74 74 if ( evt.editor.lang.dir == 'rtl' ) 75 75 setTimeout( fixSize, 1000 ); 76 } );77 } 76 } ); 77 } ); -
_source/skins/v2/skin.js
23 23 }; 24 24 })() ); 25 25 26 if ( CKEDITOR.dialog)26 CKEDITOR.on( 'pluginsLoaded', function() 27 27 { 28 CKEDITOR.dialog .on( 'resize', function( evt )28 CKEDITOR.dialog && CKEDITOR.dialog.on( 'resize', function( evt ) 29 29 { 30 30 var data = evt.data, 31 31 width = data.width, … … 69 69 el.setStyle( 'height', ( body.$.offsetHeight - 31 - 14 ) + 'px' ); 70 70 }, 71 71 100 ); 72 } );73 } 72 } ); 73 } );