Changeset 4470
- Timestamp:
- 11/12/09 16:14:03 (4 years ago)
- Location:
- CKEditor/branches/versions/3.1.x
- Files:
-
- 19 edited
-
CHANGES.html (modified) (1 diff)
-
_source/core/dom/document.js (modified) (1 diff)
-
_source/core/editor.js (modified) (3 diffs)
-
_source/core/resourcemanager.js (modified) (1 diff)
-
_source/core/skins.js (modified) (6 diffs)
-
_source/core/tools.js (modified) (2 diffs)
-
_source/plugins/colorbutton/plugin.js (modified) (1 diff)
-
_source/plugins/dialog/plugin.js (modified) (6 diffs)
-
_source/plugins/font/plugin.js (modified) (1 diff)
-
_source/plugins/format/plugin.js (modified) (1 diff)
-
_source/plugins/menu/plugin.js (modified) (1 diff)
-
_source/plugins/panel/plugin.js (modified) (1 diff)
-
_source/plugins/preview/plugin.js (modified) (1 diff)
-
_source/plugins/stylescombo/plugin.js (modified) (1 diff)
-
_source/plugins/wysiwygarea/plugin.js (modified) (1 diff)
-
_source/skins/kama/skin.js (modified) (2 diffs)
-
_source/skins/office2003/skin.js (modified) (2 diffs)
-
_source/skins/v2/skin.js (modified) (2 diffs)
-
config.js (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
CKEditor/branches/versions/3.1.x/CHANGES.html
r4466 r4470 64 64 <li><a href="http://dev.fckeditor.net/ticket/4219">#4219</a> : Added fallback mechanism for config.language.</li> 65 65 <li><a href="http://dev.fckeditor.net/ticket/4194">#4194</a> : Added support for using multiple css style sheets within the editor.</li> 66 <li><a href="http://dev.fckeditor.net/ticket/4463">#4463</a> : Added inline CSS support in all places where custom stylesheet could apply.</li> 66 67 </ul> 67 68 <p> -
CKEditor/branches/versions/3.1.x/_source/core/dom/document.js
r4466 r4470 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 { -
CKEditor/branches/versions/3.1.x/_source/core/editor.js
r4466 r4470 125 125 126 126 // Load language file. 127 load Lang( editor );127 loadSkin( editor ); 128 128 }; 129 129 … … 247 247 // Load the editor skin. 248 248 editor.fire( 'pluginsLoaded' ); 249 load Skin( editor );249 loadTheme( editor ); 250 250 }); 251 251 }); … … 256 256 CKEDITOR.skins.load( editor, 'editor', function() 257 257 { 258 load Theme( editor );258 loadLang( editor ); 259 259 }); 260 260 }; -
CKEditor/branches/versions/3.1.x/_source/core/resourcemanager.js
r4466 r4470 87 87 throw '[CKEDITOR.resourceManager.add] The resource name "' + name + '" is already registered.'; 88 88 89 this.registered[ name ] = definition || {}; 89 CKEDITOR.fire( name + CKEDITOR.tools.capitalize( this.fileName ) + 'Ready', 90 this.registered[ name ] = definition || {} ); 90 91 }, 91 92 -
CKEditor/branches/versions/3.1.x/_source/core/skins.js
r4466 r4470 21 21 var paths = {}; 22 22 23 var load edPart = function( skinName, part, callback )23 var loadPart = function( skinName, part, callback ) 24 24 { 25 25 // Get the skin definition. … … 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 ] ) … … 44 56 { 45 57 preloaded[ skinName ] = 1; 46 load edPart( skinName, part, callback );58 loadPart( skinName, part, callback ); 47 59 } ); 48 60 return; … … 97 109 if ( !cssIsLoaded ) 98 110 { 99 appendSkinPath( part.css ); 100 101 for ( var c = 0 ; c < part.css.length ; c++ ) 102 CKEDITOR.document.appendStyleSheet( part.css[ c ] ); 103 111 var cssPart = part.css; 112 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 } … … 157 182 158 183 if ( loaded[ skinName ] ) 159 { 160 loadedPart( skinName, skinPart, callback ); 161 162 // Get the skin definition. 163 var skinDefinition = loaded[ skinName ]; 164 165 // Trigger init function if any. 166 if ( skinDefinition.init ) 167 skinDefinition.init( editor ); 168 } 184 loadPart( skinName, skinPart, callback ); 169 185 else 170 186 { … … 172 188 CKEDITOR.scriptLoader.load( skinPath + 'skin.js', function() 173 189 { 174 loadedPart( skinName, skinPart, callback );175 176 190 // Get the skin definition. 177 var skinDefinition = loaded[ skinName ];191 var skinDefinition = editor.skin = loaded[ skinName ]; 178 192 179 193 // Trigger init function if any. 180 194 if ( skinDefinition.init ) 181 195 skinDefinition.init( editor ); 196 197 loadPart( skinName, skinPart, callback ); 182 198 }); 183 199 } -
CKEditor/branches/versions/3.1.x/_source/core/tools.js
r4466 r4470 99 99 100 100 /** 101 * Turn the first letter of string to upper-case. 102 * @param {String} str 103 */ 104 capitalize: function( str ) 105 { 106 return str.charAt( 0 ).toUpperCase() + str.substring( 1 ).toLowerCase(); 107 }, 108 109 /** 101 110 * Copy the properties from one object to another. By default, properties 102 111 * already present in the target object <strong>are not</strong> overwritten. … … 230 239 231 240 /** 241 * Build the HTML snippet of a set of <style>/<link>. 242 * @param css {String|Array} Each of which are url (absolute) of a CSS file or 243 * a trunk of style text. 244 */ 245 buildStyleHtml : function ( css ) 246 { 247 css = [].concat( css ); 248 var item, retval = []; 249 for ( var i = 0; i < css.length; i++ ) 250 { 251 item = css[ i ]; 252 // Is CSS style text ? 253 if ( /@import|[{}]/.test(item) ) 254 retval.push('<style>' + item + '</style>'); 255 else 256 retval.push('<link type="text/css" rel=stylesheet href="' + item + '">'); 257 } 258 return retval.join( '' ); 259 }, 260 261 /** 232 262 * Replace special HTML characters in a string with their relative HTML 233 263 * entity values. -
CKEditor/branches/versions/3.1.x/_source/plugins/colorbutton/plugin.js
r4466 r4470 32 32 panel : 33 33 { 34 css : [ CKEDITOR.getUrl( editor.skinPath + 'editor.css' ) ]34 css : editor.skin.editor.css 35 35 }, 36 36 -
CKEditor/branches/versions/3.1.x/_source/plugins/dialog/plugin.js
r4466 r4470 7 7 * @fileOverview The floating dialog plugin. 8 8 */ 9 10 CKEDITOR.plugins.add( 'dialog',11 {12 requires : [ 'dialogui' ]13 });14 9 15 10 /** … … 73 68 return null; 74 69 } 75 76 // Stores dialog related data from skin definitions. e.g. margin sizes.77 var skinData = {};78 70 79 71 /** … … 1438 1430 editor = dialog.getParentEditor(), 1439 1431 magnetDistance = editor.config.dialog_magnetDistance, 1440 margins = skinData[ editor.skinName ].margins || [ 0, 0, 0, 0 ];1432 margins = editor.skin.margins || [ 0, 0, 0, 0 ]; 1441 1433 1442 1434 if ( typeof magnetDistance == 'undefined' ) … … 1516 1508 minHeight = definition.minHeight || 0, 1517 1509 resizable = definition.resizable, 1518 margins = skinData[ dialog.getParentEditor().skinName ].margins || [ 0, 0, 0, 0 ];1510 margins = dialog.getParentEditor().skin.margins || [ 0, 0, 0, 0 ]; 1519 1511 1520 1512 function topSizer( coords, dy ) … … 2673 2665 }; 2674 2666 })(); 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 2667 })(); 2687 2668 … … 2735 2716 return null; 2736 2717 } 2718 }); 2719 2720 CKEDITOR.plugins.add( 'dialog', 2721 { 2722 requires : [ 'dialogui' ] 2737 2723 }); 2738 2724 -
CKEditor/branches/versions/3.1.x/_source/plugins/font/plugin.js
r4466 r4470 37 37 panel : 38 38 { 39 css : [ CKEDITOR.getUrl( editor.skinPath + 'editor.css' ) ].concat( config.contentsCss ),39 css : editor.skin.editor.css.concat( config.contentsCss ), 40 40 voiceLabel : lang.panelVoiceLabel 41 41 }, -
CKEditor/branches/versions/3.1.x/_source/plugins/format/plugin.js
r4466 r4470 34 34 panel : 35 35 { 36 css : [ CKEDITOR.getUrl( editor.skinPath + 'editor.css' ) ].concat( config.contentsCss ),36 css : editor.skin.editor.css.concat( config.contentsCss ), 37 37 voiceLabel : lang.panelVoiceLabel 38 38 }, -
CKEditor/branches/versions/3.1.x/_source/plugins/menu/plugin.js
r4466 r4470 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 : editor.skin.editor.css, 136 136 level : this._.level - 1, 137 137 className : editor.skinClass + ' cke_contextmenu' -
CKEditor/branches/versions/3.1.x/_source/plugins/panel/plugin.js
r4466 r4470 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(); -
CKEditor/branches/versions/3.1.x/_source/plugins/preview/plugin.js
r4466 r4470 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() + -
CKEditor/branches/versions/3.1.x/_source/plugins/stylescombo/plugin.js
r4466 r4470 27 27 panel : 28 28 { 29 css : [ CKEDITOR.getUrl( editor.skinPath + 'editor.css' ) ].concat( config.contentsCss ),29 css : editor.skin.editor.css.concat( config.contentsCss ), 30 30 voiceLabel : lang.panelVoiceLabel 31 31 }, -
CKEditor/branches/versions/3.1.x/_source/plugins/wysiwygarea/plugin.js
r4466 r4470 564 564 '<html dir="' + editor.config.contentsLangDirection + '">' + 565 565 '<head>' + 566 '<link type="text/css" rel="stylesheet" href="' + 567 [].concat( editor.config.contentsCss ).join( '"><link type="text/css" rel="stylesheet" href="' ) + 568 '">' + 566 CKEDITOR.tools.buildStyleHtml( editor.config.contentsCss ) + 569 567 '<style type="text/css" _fcktemp="true">' + 570 568 editor._.styles.join( '\n' ) + -
CKEditor/branches/versions/3.1.x/_source/skins/kama/skin.js
r4466 r4470 204 204 })() ); 205 205 206 if ( CKEDITOR.dialog)206 CKEDITOR.on( 'dialogPluginReady', function() 207 207 { 208 208 CKEDITOR.dialog.on( 'resize', function( evt ) … … 259 259 }, 260 260 100 ); 261 } );262 } 261 } ); 262 } ); 263 263 264 264 /** -
CKEditor/branches/versions/3.1.x/_source/skins/office2003/skin.js
r4466 r4470 24 24 })() ); 25 25 26 if ( CKEDITOR.dialog)26 CKEDITOR.on( 'dialogPluginReady', function() 27 27 { 28 28 CKEDITOR.dialog.on( 'resize', function( evt ) … … 74 74 if ( evt.editor.lang.dir == 'rtl' ) 75 75 setTimeout( fixSize, 1000 ); 76 } );77 } 76 } ); 77 } ); -
CKEditor/branches/versions/3.1.x/_source/skins/v2/skin.js
r4466 r4470 24 24 })() ); 25 25 26 if ( CKEDITOR.dialog)26 CKEDITOR.on( 'dialogPluginReady', function() 27 27 { 28 28 CKEDITOR.dialog.on( 'resize', function( evt ) … … 70 70 }, 71 71 100 ); 72 } );73 } 72 } ); 73 } ); -
CKEditor/branches/versions/3.1.x/config.js
r4036 r4470 1 /*1 /* 2 2 Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved. 3 3 For licensing, see LICENSE.html or http://ckeditor.com/license … … 9 9 // config.language = 'fr'; 10 10 // config.uiColor = '#AADC6E'; 11 config.contentsCss = 'body { background-color:#fff; color:#222; font-family:Arial, Verdana, sans-serif; font-size:12px; } html { _overflow-y:scroll; } img:-moz-broken { -moz-force-broken-image-icon:1; height:24px; width:24px; } img,input,textarea { cursor:default; }'; 11 12 };
Note: See TracChangeset
for help on using the changeset viewer.
