JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
vanilla ckeditor-3.5.4
[ckeditor.git] / _source / core / editor.js
index 3f1f54d..1e56a12 100644 (file)
@@ -272,7 +272,7 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
                                                // is not available, get the first one (default one).\r
                                                lang = ( CKEDITOR.tools.indexOf( pluginLangs, editor.langCode ) >= 0 ? editor.langCode : pluginLangs[ 0 ] );\r
 \r
-                                               if ( !plugin.lang[ lang ] )\r
+                                               if ( !plugin.langEntries || !plugin.langEntries[ lang ] )\r
                                                {\r
                                                        // Put the language file URL into the list of files to\r
                                                        // get downloaded.\r
@@ -280,7 +280,7 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
                                                }\r
                                                else\r
                                                {\r
-                                                       CKEDITOR.tools.extend( editor.lang, plugin.lang[ lang ] );\r
+                                                       CKEDITOR.tools.extend( editor.lang, plugin.langEntries[ lang ] );\r
                                                        lang = null;\r
                                                }\r
                                        }\r
@@ -305,7 +305,7 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
 \r
                                                                // Uses the first loop to update the language entries also.\r
                                                                if ( m === 0 && languageCodes[ i ] && plugin.lang )\r
-                                                                       CKEDITOR.tools.extend( editor.lang, plugin.lang[ languageCodes[ i ] ] );\r
+                                                                       CKEDITOR.tools.extend( editor.lang, plugin.langEntries[ languageCodes[ i ] ] );\r
 \r
                                                                // Call the plugin method (beforeInit and init).\r
                                                                if ( plugin[ methods[ m ] ] )\r
@@ -547,9 +547,9 @@ CKEDITOR.tools.extend( CKEDITOR.editor.prototype,
                        if ( !noUpdate )\r
                                this.updateElement();\r
 \r
+                       this.fire( 'destroy' );\r
                        this.theme && this.theme.destroy( this );\r
 \r
-                       this.fire( 'destroy' );\r
                        CKEDITOR.remove( this );\r
                        CKEDITOR.fire( 'instanceDestroyed', null, this );\r
                },\r
@@ -561,7 +561,7 @@ CKEDITOR.tools.extend( CKEDITOR.editor.prototype,
                 * @returns {Boolean} "true" if the command has been successfuly\r
                 *              executed, otherwise "false".\r
                 * @example\r
-                * editorInstance.execCommand( 'Bold' );\r
+                * editorInstance.execCommand( 'bold' );\r
                 */\r
                execCommand : function( commandName, data )\r
                {\r
@@ -684,6 +684,7 @@ CKEDITOR.tools.extend( CKEDITOR.editor.prototype,
                 *              editor.\r
                 * @param {Function} callback Function to be called after the setData\r
                 *              is completed.\r
+                *@param {Boolean} internal Whether suppress  any event firing when copying data internally inside editor.\r
                 * @example\r
                 * CKEDITOR.instances.editor1.<b>setData</b>( '&lt;p&gt;This is the editor data.&lt;/p&gt;' );\r
                 * @example\r
@@ -692,7 +693,7 @@ CKEDITOR.tools.extend( CKEDITOR.editor.prototype,
                 *         this.checkDirty();    // true\r
                 *     });\r
                 */\r
-               setData : function( data , callback )\r
+               setData : function( data , callback, internal )\r
                {\r
                        if( callback )\r
                        {\r
@@ -705,11 +706,11 @@ CKEDITOR.tools.extend( CKEDITOR.editor.prototype,
 \r
                        // Fire "setData" so data manipulation may happen.\r
                        var eventData = { dataValue : data };\r
-                       this.fire( 'setData', eventData );\r
+                       !internal && this.fire( 'setData', eventData );\r
 \r
                        this._.data = eventData.dataValue;\r
 \r
-                       this.fire( 'afterSetData', eventData );\r
+                       !internal && this.fire( 'afterSetData', eventData );\r
                },\r
 \r
                /**\r