Changeset 2098
- Timestamp:
- 2008-06-20 00:48:29 (7 months ago)
- Location:
- CKEditor/branches/prototype
- Files:
-
- 3 added
- 2 removed
- 12 modified
-
ckeditor.js (modified) (1 diff)
-
config.js (modified) (1 diff)
-
_source/core/_bootstrap.js (modified) (1 diff)
-
_source/core/ckeditor_base.js (modified) (1 diff)
-
_source/core/ckeditor_basic.js (modified) (3 diffs)
-
_source/core/ckeditor.js (modified) (2 diffs)
-
_source/core/config.js (modified) (1 diff)
-
_source/core/dom/element.js (modified) (2 diffs)
-
_source/core/editor.js (modified) (3 diffs)
-
_source/core/loader.js (modified) (3 diffs)
-
_source/core/plugins.js (added)
-
_source/core/scriptloader.js (modified) (2 diffs)
-
_source/core/tools.js (modified) (1 diff)
-
_source/plugins/adapters (deleted)
-
_source/plugins/sample (added)
-
_source/plugins/sample/plugin.js (added)
-
_source/plugins/themes (deleted)
Legend:
- Unmodified
- Added
- Removed
-
CKEditor/branches/prototype/ckeditor.js
r2083 r2098 23 23 if (!window.CKEDITOR){window.CKEDITOR=(function(){return {status:'unloaded',basePath:(function(){var A='';var B=document.getElementsByTagName('script');for (var i=0;i<B.length;i++){var C=B[i].src.match(/(^|.*[\\\/])ckeditor(?:_basic)?.js(?:\?.*)?$/i);if (C){A=C[1];break;}};if (A.indexOf('://')==-1){if (A.indexOf('/')==0) A=location.href.match(/^.*?:\/\/[^\/]*/)[0]+A;else A=location.href.match(/^[^\?]*\//)[0]+A;};return A;})()};})();}; 24 24 25 // Set the script name to be loaded by the loader. 26 CKEDITOR._autoLoad = 'core/ckeditor'; 25 if ( CKEDITOR.loader ) 26 CKEDITOR.loader.load( 'core/ckeditor' ); 27 else 28 { 29 // Set the script name to be loaded by the loader. 30 CKEDITOR._autoLoad = 'core/ckeditor'; 27 31 28 // Include the loader script. 29 document.write( 30 '<script type="text/javascript" src="' + CKEDITOR.basePath + '_source/core/loader.js"></script>' ); 32 // Include the loader script. 33 document.write( 34 '<script type="text/javascript" src="' + CKEDITOR.basePath + '_source/core/loader.js"></script>' ); 35 } -
CKEditor/branches/prototype/config.js
r2083 r2098 1 /*1 /* 2 2 * CKEditor - The text editor for Internet - http://ckeditor.com 3 3 * Copyright (C) 2003-2008 Frederico Caldeira Knabben -
CKEditor/branches/prototype/_source/core/_bootstrap.js
r2083 r2098 20 20 */ 21 21 22 (function() 23 { 24 // Process all pending replacements. 25 var pending = CKEDITOR.replace._pending; 26 if ( pending ) 22 // Load core plugins. 23 CKEDITOR.plugins.load( CKEDITOR.config.corePlugins.split( ',' ), function() 27 24 { 28 delete CKEDITOR.replace._pending; 25 // Process all pending <textarea> replacements. 26 var pending = CKEDITOR.replace._pending; 27 if ( pending ) 28 { 29 delete CKEDITOR.replace._pending; 29 30 30 CKEDITOR.tools.each( pending, function() 31 { 32 CKEDITOR.replace( this[0], this[1] ); 33 } ); 34 } 35 })(); 31 CKEDITOR.tools.each( pending, function( replaceInfo ) 32 { 33 // replaceInfo[0] == <textarea> DOM element 34 // replaceInfo[1] == in-page configurations object 35 CKEDITOR.replace( replaceInfo[0], replaceInfo[1] ); 36 } ); 37 } 38 }); -
CKEditor/branches/prototype/_source/core/ckeditor_base.js
r2083 r2098 46 46 * <li><b>unloaded</b>: the API is not yet loaded.</li> 47 47 * <li><b>basic_loaded</b>: the basic API features are available.</li> 48 * <li><b>basic_ready</b>: the basic API is ready to load the full core code.</li> 48 49 * <li><b>loading</b>: the full API is being loaded.</li> 49 50 * <li><b>ready</b>: the API can be fully used.</li> -
CKEditor/branches/prototype/_source/core/ckeditor_basic.js
r2090 r2098 21 21 22 22 CKEDITOR.event.implementOn( CKEDITOR ); 23 24 CKEDITOR.loadFullCore = function() 25 { 26 delete CKEDITOR.loadFullCore; 27 28 var script = document.createElement( 'script' ); 29 script.type = 'text/javascript'; 30 script.src = CKEDITOR.basePath + 'ckeditor.js'; 31 32 document.getElementsByTagName( 'head' )[0].appendChild( script ); 33 }; 23 34 24 35 /** … … 100 111 var pending = CKEDITOR.replace._pending || ( CKEDITOR.replace._pending = [] ); 101 112 pending.push( [ textarea, config ] ); 113 114 // Check if it is time to load the full core code. 115 if ( CKEDITOR.loadFullCore && CKEDITOR.status == 'basic_ready' ) 116 CKEDITOR.loadFullCore(); 102 117 }; 103 118 … … 176 191 if ( CKEDITOR.replaceByClassEnabled ) 177 192 CKEDITOR.replaceAll( CKEDITOR.replaceClass ); 193 194 if ( CKEDITOR.replace._pending && CKEDITOR.status == 'basic_loaded' && CKEDITOR.loadFullCore ) 195 CKEDITOR.loadFullCore(); 196 197 CKEDITOR.status = 'basic_ready'; 178 198 }; 179 199 -
CKEditor/branches/prototype/_source/core/ckeditor.js
r2091 r2098 20 20 */ 21 21 22 // Remove the CKEDITOR.loadFullCore reference defined on ckeditor_basic. 23 delete CKEDITOR.loadFullCore; 24 22 25 CKEDITOR.instances = {}; 23 26 … … 28 31 // instance. 29 32 textarea = new CKEDITOR.dom.element( textarea ); 30 33 31 34 // Create the editor instance. 32 35 CKEDITOR.add( new CKEDITOR.editor( textarea, config ) ); -
CKEditor/branches/prototype/_source/core/config.js
r2083 r2098 39 39 baseHref : '', 40 40 41 corePlugins : '', 42 43 plugins : '', 44 41 45 /** 42 46 * The theme to be used to build the UI. -
CKEditor/branches/prototype/_source/core/dom/element.js
r2093 r2098 54 54 element.append( this ); 55 55 }, 56 57 insertAfter : function( element ) 58 { 59 element.$.parentNode.insertBefore( this.$, element.$.nextSibling ); 60 }, 61 62 insertBefore : function( element ) 63 { 64 element.$.parentNode.insertBefore( this.$, element.$ ); 65 }, 56 66 57 67 appendText : function( text ) … … 63 73 { 64 74 this.$.text = text; 75 }, 76 77 setHtml : function( html ) 78 { 79 this.$.innerHTML = html; 65 80 }, 66 81 -
CKEditor/branches/prototype/_source/core/editor.js
r2091 r2098 36 36 return CKEDITOR.instances[ name ] ? getNewName() : name; 37 37 }; 38 39 // ##### START: Config Privates 38 40 39 41 // These function loads custom configuration files and cache the … … 104 106 105 107 // Fire the "configloaded" event. 106 editor.fire( 'configloaded' ); 108 editor.fireOnce( 'configloaded' ); 109 110 // Start loading the plugins. 111 loadPlugins( editor ); 107 112 }); 108 113 … … 121 126 {} 122 127 config.prototype = CKEDITOR.config; 128 129 // ##### END: Config Privates 130 131 var loadPlugins = function( editor ) 132 { 133 // Load all plugins defined in the "plugins" setting. 134 CKEDITOR.plugins.load( editor.config.plugins.split( ',' ), function( plugins ) 135 { 136 // Cache the loaded plugin names. 137 editor.plugins = plugins; 138 139 // Initialize all plugins that have the "init" method defined. 140 CKEDITOR.tools.each( plugins, function( plugin ) 141 { 142 var plugin = CKEDITOR.plugins.get( plugin ); 143 if ( plugin && plugin.init ) 144 plugin.init( editor ); 145 }); 146 }); 147 }; 123 148 124 149 return function( element, instanceConfig ) -
CKEditor/branches/prototype/_source/core/loader.js
r2083 r2098 33 33 var scripts = 34 34 { 35 'core/_bootstrap' : [ 'core/config', 'core/ckeditor', 'core/ scriptLoader', 'core/tools' ],35 'core/_bootstrap' : [ 'core/config', 'core/ckeditor', 'core/plugins', 'core/scriptLoader', 'core/tools' ], 36 36 'core/ajax' : [ 'core/xml' ], 37 37 'core/ckeditor' : [ 'core/ajax', 'core/ckeditor_basic', 'core/dom', 'core/editor', 'core/dom/element', 'core/event', 'core/tools' ], … … 44 44 'core/env' : [], 45 45 'core/event' : [], 46 'core/plugins' : [ 'core/scriptLoader', 'core/tools' ], 46 47 'core/scriptLoader' : [ 'core/dom/element', 'core/env' ], 47 48 'core/tools' : [ 'core/env' ], … … 118 119 this.loadedScripts.push( scriptName ); 119 120 121 var scriptSrc = this.basePath + '_source/' + scriptName + '.js'; 122 120 123 // Append the <script> element to the DOM. 121 document.write( '<script src="' + this.basePath + '_source/' + scriptName + '.js" type="text/javascript"><\/script>' ); 124 if ( document.body ) 125 { 126 var script = document.createElement( 'script' ); 127 script.type = 'text/javascript'; 128 script.src = scriptSrc; 129 130 document.body.appendChild( script ); 131 } 132 else 133 document.write( '<script src="' + scriptSrc + '" type="text/javascript"><\/script>' ); 122 134 } 123 135 }; -
CKEditor/branches/prototype/_source/core/scriptloader.js
r2083 r2098 50 50 if ( CKEDITOR.env.ie ) 51 51 { 52 // FIXME: For IE, we are not able to return false on error (like 404). 53 52 54 script.$.onreadystatechange = function () 53 55 { 54 56 if ( script.$.readyState == 'loaded' || script.$.readyState == 'complete' ) 55 callback.call( scope || CKEDITOR ); 57 { 58 script.$.onreadystatechange = null; 59 callback.call( scope || CKEDITOR, true ); 60 } 56 61 } 57 62 } … … 60 65 script.$.onload = function() 61 66 { 62 callback.call( scope || CKEDITOR ); 67 callback.call( scope || CKEDITOR, true ); 68 } 69 70 // FIXME: Opera and Safari will not fire onerror. 71 72 script.$.onerror = function() 73 { 74 callback.call( scope || CKEDITOR, false ); 63 75 } 64 76 } -
CKEditor/branches/prototype/_source/core/tools.js
r2083 r2098 123 123 {} 124 124 } 125 }, 126 127 isArray : function( object ) 128 { 129 return ( object && object instanceof Array ); 125 130 } 126 131 };