Changeset 2090
- Timestamp:
- 06/18/08 19:04:27 (5 years ago)
- Location:
- CKEditor/branches/prototype/_source
- Files:
-
- 1 added
- 4 edited
-
core/ckeditor.js (modified) (5 diffs)
-
core/ckeditor_basic.js (modified) (5 diffs)
-
tests/core/ckeditor.html (added)
-
tests/test.js (modified) (2 diffs)
-
tests/testall.html (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
CKEditor/branches/prototype/_source/core/ckeditor.js
r2083 r2090 37 37 38 38 var loadedConfig = loadConfigLoaded[ customConfig ] || ( loadConfigLoaded[ customConfig ] = { editors : [] } ); 39 39 40 40 // If the custom config has already been downloaded, reuse it. 41 41 if ( loadedConfig.fn ) … … 53 53 { 54 54 // Add the editor to the list of editors waiting for this config. 55 loadedConfig.editors.push( editor ); 55 loadedConfig.editors.push( editor ); 56 56 57 57 // Load the custom configuration file. … … 73 73 loadConfig( editor ); 74 74 }); 75 75 76 76 delete loadedConfig.editors; 77 77 } ); 78 78 } 79 79 80 80 return true; 81 81 }; … … 85 85 { 86 86 var textarea = new CKEDITOR.dom.element( textarea ); 87 textarea.hide();88 87 89 88 // Create the editor instance. 90 89 var editor = new CKEDITOR.editor( textarea ); 90 91 // Abort it there is already an instance with that name. 92 if ( CKEDITOR.instances[ editor.name ] ) 93 return; 94 95 textarea.hide(); 96 91 97 CKEDITOR.instances[ editor.name ] = editor; 92 98 93 99 // Setup the lister for the "configloaded" event. 94 100 editor.on( 'configloaded', function() … … 99 105 100 106 // Fire the "instancecreated" event. 101 CKEDITOR.fire( 'instancecreated', editor.name, editor ); 107 CKEDITOR.fire( 'instancecreated', editor.name, editor ); 102 108 }); 103 109 -
CKEditor/branches/prototype/_source/core/ckeditor_basic.js
r2083 r2090 22 22 CKEDITOR.event.implementOn( CKEDITOR ); 23 23 24 /** 24 /** 25 25 * The class name used to identify <textarea> elements to be replace 26 26 * by CKEditor instances. … … 43 43 CKEDITOR.replaceByClassEnabled = true; 44 44 45 /** 45 /** 46 46 * Replaces a specific <textarea> with a CKEditor instance. 47 47 * @param {object|string} elementOrIdOrName The DOM element (textarea), its … … 81 81 if ( !textarea ) 82 82 { 83 alert( '[CKEDITOR.replace] The <textarea> with id or name "' + elementOrIdOrName + '" was not found' );83 throw '[CKEDITOR.replace] The <textarea> with id or name "' + elementOrIdOrName + '" was not found.'; 84 84 return; 85 85 } 86 86 } 87 87 88 88 CKEDITOR.replace._replaceElement( textarea, config ); 89 89 } 90 90 }; 91 91 92 // This function will be overwritten by the f ill core code implementation.92 // This function will be overwritten by the full core code implementation. 93 93 CKEDITOR.replace._replaceElement = function( textarea, config ) 94 94 { … … 132 132 var name = textarea.name; 133 133 134 // The "name" a ttribute must exist.135 if ( ! name || name.length == 0)134 // The "name" and/or "id" attribute must exist. 135 if ( !textarea.name && !textarea.id ) 136 136 continue; 137 137 … … 166 166 { 167 167 }; 168 168 169 169 if ( CKEDITOR.status == 'unloaded' ) 170 170 { -
CKEditor/branches/prototype/_source/tests/test.js
r2083 r2090 41 41 div.innerHTML = text; 42 42 }; 43 44 var htmlEncode = function( data ) 45 { 46 if ( typeof data != 'string' ) 47 return data; 48 49 return data.replace( 50 '&', '&' ).replace( 51 '<', '<' ).replace( 52 '>', '>' ); 53 }; 43 54 44 55 window.onload = function() … … 52 63 { 53 64 case runner.TEST_FAIL_EVENT: 54 outputResult( '<span class="testFail">FAIL</span> Test named "' + data.testName + '" failed with message: "' + data.error.message + '".<div>Expected:</div><pre>' + data.error.expected + '</pre><div>Actual:</div><pre>' + data.error.actual+ '</pre>' );65 outputResult( '<span class="testFail">FAIL</span> Test named "' + data.testName + '" failed with message: "' + htmlEncode( data.error.message ) + '".<div>Expected:</div><pre>' + htmlEncode( data.error.expected ) + '</pre><div>Actual:</div><pre>' + htmlEncode( data.error.actual ) + '</pre>' ); 55 66 break; 56 67 case runner.TEST_PASS_EVENT: -
CKEditor/branches/prototype/_source/tests/testall.html
r2083 r2090 10 10 [ 11 11 'core/ajax', 12 'core/ckeditor', 12 13 'core/dom/element', 13 14 'core/env',
Note: See TracChangeset
for help on using the changeset viewer.
