X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=_source%2Fcore%2Feditor.js;h=352c4b22826f0fcb450c948f345cd3967462bc9a;hb=refs%2Ftags%2Fv3.5.3;hp=3f1f54da9c9d037a91da5494a7a5ee5d215ee357;hpb=48b1db88210b4160dce439c6e3e32e14af8c106b;p=ckeditor.git diff --git a/_source/core/editor.js b/_source/core/editor.js index 3f1f54d..352c4b2 100644 --- a/_source/core/editor.js +++ b/_source/core/editor.js @@ -272,7 +272,7 @@ For licensing, see LICENSE.html or http://ckeditor.com/license // is not available, get the first one (default one). lang = ( CKEDITOR.tools.indexOf( pluginLangs, editor.langCode ) >= 0 ? editor.langCode : pluginLangs[ 0 ] ); - if ( !plugin.lang[ lang ] ) + if ( !plugin.langEntries || !plugin.langEntries[ lang ] ) { // Put the language file URL into the list of files to // get downloaded. @@ -280,7 +280,7 @@ For licensing, see LICENSE.html or http://ckeditor.com/license } else { - CKEDITOR.tools.extend( editor.lang, plugin.lang[ lang ] ); + CKEDITOR.tools.extend( editor.lang, plugin.langEntries[ lang ] ); lang = null; } } @@ -305,7 +305,7 @@ For licensing, see LICENSE.html or http://ckeditor.com/license // Uses the first loop to update the language entries also. if ( m === 0 && languageCodes[ i ] && plugin.lang ) - CKEDITOR.tools.extend( editor.lang, plugin.lang[ languageCodes[ i ] ] ); + CKEDITOR.tools.extend( editor.lang, plugin.langEntries[ languageCodes[ i ] ] ); // Call the plugin method (beforeInit and init). if ( plugin[ methods[ m ] ] ) @@ -547,9 +547,9 @@ CKEDITOR.tools.extend( CKEDITOR.editor.prototype, if ( !noUpdate ) this.updateElement(); + this.fire( 'destroy' ); this.theme && this.theme.destroy( this ); - this.fire( 'destroy' ); CKEDITOR.remove( this ); CKEDITOR.fire( 'instanceDestroyed', null, this ); }, @@ -684,6 +684,7 @@ CKEDITOR.tools.extend( CKEDITOR.editor.prototype, * editor. * @param {Function} callback Function to be called after the setData * is completed. + *@param {Boolean} internal Whether suppress any event firing when copying data internally inside editor. * @example * CKEDITOR.instances.editor1.setData( '<p>This is the editor data.</p>' ); * @example @@ -692,7 +693,7 @@ CKEDITOR.tools.extend( CKEDITOR.editor.prototype, * this.checkDirty(); // true * }); */ - setData : function( data , callback ) + setData : function( data , callback, internal ) { if( callback ) { @@ -705,11 +706,11 @@ CKEDITOR.tools.extend( CKEDITOR.editor.prototype, // Fire "setData" so data manipulation may happen. var eventData = { dataValue : data }; - this.fire( 'setData', eventData ); + !internal && this.fire( 'setData', eventData ); this._.data = eventData.dataValue; - this.fire( 'afterSetData', eventData ); + !internal && this.fire( 'afterSetData', eventData ); }, /**