diff --git a/adapters/jquery.js b/adapters/jquery.js index ed01e854507..8fe24a610b9 100644 --- a/adapters/jquery.js +++ b/adapters/jquery.js @@ -18,7 +18,7 @@ * @aside guide dev_jquery */ -(function( $ ) { +( function( $ ) { /** * Allows CKEditor to override `jQuery.fn.val()`. When set to `true`, the `val()` function * used on textarea elements replaced with CKEditor uses the CKEditor API. @@ -372,4 +372,4 @@ }; } ); } -})( window.jQuery ); \ No newline at end of file +} )( window.jQuery ); \ No newline at end of file diff --git a/ckeditor.js b/ckeditor.js index a848ce59c04..07c7f7b6251 100644 --- a/ckeditor.js +++ b/ckeditor.js @@ -20,9 +20,9 @@ else { script.type = 'text/javascript'; script.src = CKEDITOR.getUrl( 'core/loader.js' ); document.body.appendChild( script ); - } else { + } else document.write( '' ); - } + } /** diff --git a/core/_bootstrap.js b/core/_bootstrap.js index afaedd91a97..be568814a4f 100644 --- a/core/_bootstrap.js +++ b/core/_bootstrap.js @@ -7,7 +7,7 @@ * @fileOverview API initialization code. */ -(function() { +( function() { // Disable HC detection in WebKit. (#5429) if ( CKEDITOR.env.webkit ) CKEDITOR.env.hc = false; @@ -49,7 +49,7 @@ CKEDITOR.add( pending[ i ][ 0 ] ); } } -})(); +} )(); /** * Indicates that CKEditor is running on a High Contrast environment. diff --git a/core/ckeditor.js b/core/ckeditor.js index 8391490da23..460ff1b06b5 100644 --- a/core/ckeditor.js +++ b/core/ckeditor.js @@ -47,14 +47,14 @@ CKEDITOR.add = function( editor ) { CKEDITOR.currentInstance = editor; CKEDITOR.fire( 'currentInstance' ); } - }); + } ); editor.on( 'blur', function() { if ( CKEDITOR.currentInstance == editor ) { CKEDITOR.currentInstance = null; CKEDITOR.fire( 'currentInstance' ); } - }); + } ); CKEDITOR.fire( 'instance', null, editor ); }; @@ -70,7 +70,7 @@ CKEDITOR.remove = function( editor ) { delete CKEDITOR.instances[ editor.name ]; }; -(function() { +( function() { var tpls = {}; /** @@ -102,9 +102,9 @@ CKEDITOR.remove = function( editor ) { CKEDITOR.getTemplate = function( name ) { return tpls[ name ]; }; -})(); +} )(); -(function() { +( function() { var styles = []; /** @@ -133,14 +133,14 @@ CKEDITOR.remove = function( editor ) { CKEDITOR.getCss = function() { return styles.join( '\n' ); }; -})(); +} )(); // Perform global clean up to free as much memory as possible // when there are no instances left CKEDITOR.on( 'instanceDestroyed', function() { if ( CKEDITOR.tools.isEmpty( this.instances ) ) CKEDITOR.fire( 'reset' ); -}); +} ); // Load the bootstrap script. CKEDITOR.loader.load( '_bootstrap' ); // %REMOVE_LINE% diff --git a/core/ckeditor_base.js b/core/ckeditor_base.js index 7711cc2083c..0293c32fc02 100644 --- a/core/ckeditor_base.js +++ b/core/ckeditor_base.js @@ -26,7 +26,7 @@ if ( !window.CKEDITOR ) { * @class CKEDITOR * @singleton */ - window.CKEDITOR = (function() { + window.CKEDITOR = ( function() { var CKEDITOR = { /** @@ -112,7 +112,7 @@ if ( !window.CKEDITOR ) { * * @property {String} */ - basePath: (function() { + basePath: ( function() { // ATTENTION: fixes to this code must be ported to // var basePath in "core/loader.js". @@ -147,7 +147,7 @@ if ( !window.CKEDITOR ) { throw 'The CKEditor installation path could not be automatically detected. Please set the global variable "CKEDITOR_BASEPATH" before creating editor instances.'; return path; - })(), + } )(), /** * Gets the full URL for CKEditor resources. By default, URLs @@ -194,7 +194,7 @@ if ( !window.CKEDITOR ) { * @method * @todo */ - domReady: (function() { + domReady: ( function() { // Based on the original jQuery code. var callbacks = []; @@ -276,7 +276,7 @@ if ( !window.CKEDITOR ) { } }; - })() + } )() }; // Make it possible to override the "url" function with a custom @@ -290,7 +290,7 @@ if ( !window.CKEDITOR ) { } return CKEDITOR; - })(); + } )(); } /** diff --git a/core/ckeditor_basic.js b/core/ckeditor_basic.js index ad45dfda8c6..c2ae38fa341 100644 --- a/core/ckeditor_basic.js +++ b/core/ckeditor_basic.js @@ -10,7 +10,7 @@ */ if ( CKEDITOR.status == 'unloaded' ) { - (function() { + ( function() { CKEDITOR.event.implementOn( CKEDITOR ); /** @@ -66,7 +66,7 @@ if ( CKEDITOR.status == 'unloaded' ) { pending.push( editor ); }; - (function() { + ( function() { var onload = function() { var loadFullCore = CKEDITOR.loadFullCore, loadFullCoreTimeout = CKEDITOR.loadFullCoreTimeout; @@ -87,8 +87,8 @@ if ( CKEDITOR.status == 'unloaded' ) { }; CKEDITOR.domReady( onload ); - })(); + } )(); CKEDITOR.status = 'basic_loaded'; - })(); + } )(); } diff --git a/core/command.js b/core/command.js index ddaff892006..529cede6929 100644 --- a/core/command.js +++ b/core/command.js @@ -126,7 +126,7 @@ CKEDITOR.command = function( editor, commandDefinition ) { * * @see CKEDITOR.editor#mode */ - modes: { wysiwyg:1 }, + modes: { wysiwyg: 1 }, /** * Indicates that the editor will get the focus before executing @@ -166,7 +166,7 @@ CKEDITOR.command = function( editor, commandDefinition ) { * @property {Number} [=CKEDITOR.TRISTATE_DISABLED] */ state: CKEDITOR.TRISTATE_DISABLED - }); + } ); // Call the CKEDITOR.event constructor to initialize this instance. CKEDITOR.event.call( this ); diff --git a/core/creators/inline.js b/core/creators/inline.js index 1addadcb6c5..b4a612ded62 100644 --- a/core/creators/inline.js +++ b/core/creators/inline.js @@ -3,7 +3,7 @@ * For licensing, see LICENSE.md or http://ckeditor.com/license */ -(function() { +( function() { /** @class CKEDITOR */ /** @@ -141,7 +141,7 @@ CKEDITOR.domReady( function() { !CKEDITOR.disableAutoInline && CKEDITOR.inlineAll(); } ); -})(); +} )(); /** * Disables creating the inline editor automatically for elements with diff --git a/core/creators/themedui.js b/core/creators/themedui.js index 7ab7feae620..d4dab02b601 100644 --- a/core/creators/themedui.js +++ b/core/creators/themedui.js @@ -15,7 +15,7 @@ */ CKEDITOR.replaceClass = 'ckeditor'; -(function() { +( function() { /** * Replaces a `'; return '' + encodeURIComponent( match ) + ''; - }); + } ); } function unprotectElements( html ) { return html.replace( encodedElementsRegex, function( match, encoded ) { return decodeURIComponent( encoded ); - }); + } ); } function protectElementsNames( html ) { @@ -807,13 +807,13 @@ '{C}' + encodeURIComponent( match ).replace( /--/g, '%2D%2D' ) + '-->'; - }); + } ); } function unprotectRealComments( html ) { return html.replace( //g, function( match, data ) { return decodeURIComponent( data ); - }); + } ); } function unprotectSource( html, editor ) { @@ -821,15 +821,15 @@ return html.replace( //g, function( match, data ) { return decodeURIComponent( data ); - }).replace( /\{cke_protected_(\d+)\}/g, function( match, id ) { + } ).replace( /\{cke_protected_(\d+)\}/g, function( match, id ) { return store && store[ id ] || ''; - }); + } ); } function protectSource( data, editor ) { var protectedHtml = [], protectRegexes = editor.config.protectedSource, - store = editor._.dataStore || ( editor._.dataStore = { id:1 } ), + store = editor._.dataStore || ( editor._.dataStore = { id: 1 } ), tempRegex = /<\!--\{cke_temp(comment)?\}(\d*?)-->/g; var regexes = [ @@ -847,25 +847,25 @@ // transform them when applying filters. data = data.replace( ( //g ), function( match ) { return ''; - }); + } ); for ( var i = 0; i < regexes.length; i++ ) { data = data.replace( regexes[ i ], function( match ) { match = match.replace( tempRegex, // There could be protected source inside another one. (#3869). function( $, isComment, id ) { return protectedHtml[ id ]; - }); + } ); // Avoid protecting over protected, e.g. /\{.*?\}/ return ( /cke_temp(comment)?/ ).test( match ) ? match : ''; - }); + } ); } data = data.replace( tempRegex, function( $, isComment, id ) { return ''; - }); + } ); // Different protection pattern is used for those that // live in attributes to avoid from being HTML encoded. @@ -873,10 +873,10 @@ return match.replace( //g, function( match, data ) { store[ store.id ] = decodeURIComponent( data ); return '{cke_protected_' + ( store.id++ ) + '}'; - }); - }); + } ); + } ); } -})(); +} )(); /** * Whether a filler text (non-breaking space entity — ` `) will be diff --git a/core/htmlparser.js b/core/htmlparser.js index 78c08215900..9f97bb02aff 100644 --- a/core/htmlparser.js +++ b/core/htmlparser.js @@ -21,9 +21,9 @@ CKEDITOR.htmlParser = function() { }; }; -(function() { +( function() { var attribsRegex = /([\w\-:.]+)(?:(?:\s*=\s*(?:(?:"([^"]*)")|(?:'([^']*)')|([^\s>]+)))|(?=\s|$))/g, - emptyAttribs = { checked:1,compact:1,declare:1,defer:1,disabled:1,ismap:1,multiple:1,nohref:1,noresize:1,noshade:1,nowrap:1,readonly:1,selected:1 }; + emptyAttribs = { checked: 1, compact: 1, declare: 1, defer: 1, disabled: 1, ismap: 1, multiple: 1, nohref: 1, noresize: 1, noshade: 1, nowrap: 1, readonly: 1, selected: 1 }; CKEDITOR.htmlParser.prototype = { /** @@ -204,4 +204,4 @@ CKEDITOR.htmlParser = function() { this.onText( html.substring( nextIndex, html.length ) ); } }; -})(); +} )(); diff --git a/core/htmlparser/basicwriter.js b/core/htmlparser/basicwriter.js index a7f617975be..948f9876b0b 100644 --- a/core/htmlparser/basicwriter.js +++ b/core/htmlparser/basicwriter.js @@ -9,7 +9,7 @@ * @class * @todo */ -CKEDITOR.htmlParser.basicWriter = CKEDITOR.tools.createClass({ +CKEDITOR.htmlParser.basicWriter = CKEDITOR.tools.createClass( { /** * Creates a basicWriter class instance. * @@ -149,4 +149,4 @@ CKEDITOR.htmlParser.basicWriter = CKEDITOR.tools.createClass({ return html; } } -}); +} ); diff --git a/core/htmlparser/cdata.js b/core/htmlparser/cdata.js index 8e76db1fb38..36a25326889 100644 --- a/core/htmlparser/cdata.js +++ b/core/htmlparser/cdata.js @@ -5,7 +5,7 @@ 'use strict'; -(function() { +( function() { /** * A lightweight representation of HTML CDATA. @@ -45,4 +45,4 @@ writer.write( this.value ); } } ); -})(); +} )(); diff --git a/core/htmlparser/element.js b/core/htmlparser/element.js index 206b29098ab..a88b9afa25a 100644 --- a/core/htmlparser/element.js +++ b/core/htmlparser/element.js @@ -75,7 +75,7 @@ CKEDITOR.htmlParser.cssStyle = function() { ( styleText || '' ).replace( /"/g, '"' ).replace( /\s*([^ :;]+)\s*:\s*([^;]+)\s*(?=;|$)/g, function( match, name, value ) { name == 'font-family' && ( value = value.replace( /["']/g, '' ) ); rules[ name.toLowerCase() ] = value; - }); + } ); return { @@ -88,9 +88,9 @@ CKEDITOR.htmlParser.cssStyle = function() { */ populate: function( obj ) { var style = this.toString(); - if ( style ) { + if ( style ) obj instanceof CKEDITOR.dom.element ? obj.setAttribute( 'style', style ) : obj instanceof CKEDITOR.htmlParser.element ? obj.attributes.style = style : obj.style = style; - } + }, /** @@ -108,7 +108,7 @@ CKEDITOR.htmlParser.cssStyle = function() { }; /** @class CKEDITOR.htmlParser.element */ -(function() { +( function() { // Used to sort attribute entries in an array, where the first element of // each object is the attribute name. var sortAttribs = function( a, b ) { @@ -510,4 +510,4 @@ CKEDITOR.htmlParser.cssStyle = function() { ( typeof condition == 'string' ? el.name == condition : el.name in condition ); }; } -})(); +} )(); diff --git a/core/htmlparser/filter.js b/core/htmlparser/filter.js index 10f242d1822..21c21866552 100644 --- a/core/htmlparser/filter.js +++ b/core/htmlparser/filter.js @@ -5,7 +5,7 @@ 'use strict'; -(function() { +( function() { /** * Filter is a configurable tool for transforming and filtering {@link CKEDITOR.htmlParser.node nodes}. * It is mainly used during data processing phase which is done not on real DOM nodes, @@ -131,7 +131,7 @@ options = {}; // Add the elementNames. - if ( rules.elementNames) + if ( rules.elementNames ) this.elementNameRules.addMany( rules.elementNames, priority, options ); // Add the attributeNames. @@ -394,7 +394,7 @@ return !context.nonEditable || rule.options.applyToAll; } -})(); +} )(); /** * @class CKEDITOR.htmlParser.filterRulesDefinition diff --git a/core/htmlparser/fragment.js b/core/htmlparser/fragment.js index 01a73fb57a1..dd91ecccff0 100644 --- a/core/htmlparser/fragment.js +++ b/core/htmlparser/fragment.js @@ -34,15 +34,15 @@ CKEDITOR.htmlParser.fragment = function() { }; }; -(function() { +( function() { // Block-level elements whose internal structure should be respected during // parser fixing. - var nonBreakingBlocks = CKEDITOR.tools.extend( { table:1,ul:1,ol:1,dl:1 }, CKEDITOR.dtd.table, CKEDITOR.dtd.ul, CKEDITOR.dtd.ol, CKEDITOR.dtd.dl ); + var nonBreakingBlocks = CKEDITOR.tools.extend( { table: 1, ul: 1, ol: 1, dl: 1 }, CKEDITOR.dtd.table, CKEDITOR.dtd.ul, CKEDITOR.dtd.ol, CKEDITOR.dtd.dl ); - var listBlocks = { ol:1,ul:1 }; + var listBlocks = { ol: 1, ul: 1 }; // Dtd of the fragment element, basically it accept anything except for intermediate structure, e.g. orphan
  • . - var rootDtd = CKEDITOR.tools.extend( {}, { html:1 }, CKEDITOR.dtd.html, CKEDITOR.dtd.body, CKEDITOR.dtd.head, { style:1,script:1 } ); + var rootDtd = CKEDITOR.tools.extend( {}, { html: 1 }, CKEDITOR.dtd.html, CKEDITOR.dtd.body, CKEDITOR.dtd.head, { style: 1, script: 1 } ); function isRemoveEmpty( node ) { // Keep marked element event if it is empty. @@ -628,4 +628,4 @@ CKEDITOR.htmlParser.fragment = function() { return context || {}; } }; -})(); +} )(); diff --git a/core/htmlparser/node.js b/core/htmlparser/node.js index 3e517c34660..a0c618002f5 100644 --- a/core/htmlparser/node.js +++ b/core/htmlparser/node.js @@ -5,7 +5,7 @@ 'use strict'; -(function() { +( function() { /** * A lightweight representation of HTML node. * @@ -147,4 +147,4 @@ return context || {}; } }; -})(); +} )(); diff --git a/core/htmlparser/text.js b/core/htmlparser/text.js index d3409be66dc..5e29a12a53c 100644 --- a/core/htmlparser/text.js +++ b/core/htmlparser/text.js @@ -5,7 +5,7 @@ 'use strict'; -(function() { +( function() { /** * A lightweight representation of HTML text. * @@ -67,4 +67,4 @@ writer.text( this.value ); } } ); -})(); +} )(); diff --git a/core/keystrokehandler.js b/core/keystrokehandler.js index cbda00184c1..9cd08350e31 100644 --- a/core/keystrokehandler.js +++ b/core/keystrokehandler.js @@ -37,7 +37,7 @@ CKEDITOR.keystrokeHandler = function( editor ) { return this; }; -(function() { +( function() { var cancel; var onKeyDown = function( event ) { @@ -91,7 +91,7 @@ CKEDITOR.keystrokeHandler = function( editor ) { domObject.on( 'keypress', onKeyPress, this ); } }; -})(); +} )(); /** * A list associating keystrokes to editor commands. Each element in the list diff --git a/core/lang.js b/core/lang.js index 4fe937baaaa..9a075c6753a 100644 --- a/core/lang.js +++ b/core/lang.js @@ -3,7 +3,7 @@ * For licensing, see LICENSE.md or http://ckeditor.com/license */ -(function() { +( function() { var loadedLangs = {}; /** @@ -18,12 +18,17 @@ * * alert( CKEDITOR.lang.en ); // 1 */ - languages: { af:1,ar:1,bg:1,bn:1,bs:1,ca:1,cs:1,cy:1,da:1,de:1,el:1,'en-au':1,'en-ca':1,'en-gb':1,en:1,eo:1,es:1,et:1,eu:1,fa:1,fi:1,fo:1,'fr-ca':1,fr:1,gl:1,gu:1,he:1,hi:1,hr:1,hu:1,id:1,is:1,it:1,ja:1,ka:1,km:1,ko:1,ku:1,lt:1,lv:1,mk:1,mn:1,ms:1,nb:1,nl:1,no:1,pl:1,'pt-br':1,pt:1,ro:1,ru:1,si:1,sk:1,sl:1,sq:1,'sr-latn':1,sr:1,sv:1,th:1,tr:1,ug:1,uk:1,vi:1,'zh-cn':1,zh:1 }, + languages: { af: 1, ar: 1, bg: 1, bn: 1, bs: 1, ca: 1, cs: 1, cy: 1, da: 1, de: 1, el: 1, + 'en-au': 1, 'en-ca': 1, 'en-gb': 1, en: 1, eo: 1, es: 1, et: 1, eu: 1, fa: 1, fi: 1, fo: 1, + 'fr-ca': 1, fr: 1, gl: 1, gu: 1, he: 1, hi: 1, hr: 1, hu: 1, id: 1, is: 1, it: 1, ja: 1, ka: 1, + km: 1, ko: 1, ku: 1, lt: 1, lv: 1, mk: 1, mn: 1, ms: 1, nb: 1, nl: 1, no: 1, pl: 1, 'pt-br': 1, + pt: 1, ro: 1, ru: 1, si: 1, sk: 1, sl: 1, sq: 1, 'sr-latn': 1, sr: 1, sv: 1, th: 1, tr: 1, ug: 1, + uk: 1, vi: 1, 'zh-cn': 1, zh: 1 }, /** * The list of languages that are written Right-To-Left (RTL) and are supported by the editor. */ - rtl: { ar:1,fa:1,he:1,ku:1,ug:1 }, + rtl: { ar: 1, fa: 1, he: 1, ku: 1, ug: 1 }, /** * Loads a specific language file, or auto detects it. A callback is @@ -92,4 +97,4 @@ } }; -})(); +} )(); diff --git a/core/loader.js b/core/loader.js index 81756072d40..ef4dec57795 100644 --- a/core/loader.js +++ b/core/loader.js @@ -18,7 +18,7 @@ if ( !CKEDITOR.loader ) { * @class * @singleton */ - CKEDITOR.loader = (function() { + CKEDITOR.loader = ( function() { // Table of script names and their dependencies. var scripts = { '_bootstrap': [ 'config', 'creators/inline', 'creators/themedui', 'editable', 'ckeditor', 'plugins', 'scriptloader', 'style', 'tools', /* The following are entries that we want to force loading at the end to avoid dependence recursion */ 'dom/comment', 'dom/elementpath', 'dom/text', 'dom/rangelist', 'skin' ], @@ -54,7 +54,7 @@ if ( !CKEDITOR.loader ) { 'htmldataprocessor': [ 'htmlparser', 'htmlparser/basicwriter', 'htmlparser/fragment', 'htmlparser/filter' ], 'htmlparser': [], 'htmlparser/comment': [ 'htmlparser', 'htmlparser/node' ], - 'htmlparser/element': [ 'htmlparser', 'htmlparser/fragment','htmlparser/node' ], + 'htmlparser/element': [ 'htmlparser', 'htmlparser/fragment', 'htmlparser/node' ], 'htmlparser/fragment': [ 'htmlparser', 'htmlparser/comment', 'htmlparser/text', 'htmlparser/cdata' ], 'htmlparser/text': [ 'htmlparser', 'htmlparser/node' ], 'htmlparser/cdata': [ 'htmlparser', 'htmlparser/node' ], @@ -76,7 +76,7 @@ if ( !CKEDITOR.loader ) { 'creators/inline': [] }; - var basePath = (function() { + var basePath = ( function() { // This is a copy of CKEDITOR.basePath, but requires the script having // "_source/loader.js". if ( CKEDITOR && CKEDITOR.basePath ) @@ -107,7 +107,7 @@ if ( !CKEDITOR.loader ) { } return path; - })(); + } )(); var timestamp = ( CKEDITOR && CKEDITOR.timestamp ) || ( new Date() ).valueOf(); // %REMOVE_LINE% /* // %REMOVE_LINE% @@ -237,7 +237,7 @@ if ( !CKEDITOR.loader ) { } } }; - })(); + } )(); } // Check if any script has been defined for autoload. diff --git a/core/plugins.js b/core/plugins.js index 16565d87627..4a54046abd4 100644 --- a/core/plugins.js +++ b/core/plugins.js @@ -87,7 +87,7 @@ CKEDITOR.plugins.load = CKEDITOR.tools.override( CKEDITOR.plugins.load, function loadPlugins.call( this, name ); }; -}); +} ); /** * Loads a specific language file, or auto detect it. A callback is diff --git a/core/scriptloader.js b/core/scriptloader.js index f95f4f3cb1f..ebca51861c2 100644 --- a/core/scriptloader.js +++ b/core/scriptloader.js @@ -14,7 +14,7 @@ * @class * @singleton */ -CKEDITOR.scriptLoader = (function() { +CKEDITOR.scriptLoader = ( function() { var uniqueScripts = {}, waitingList = {}; @@ -113,7 +113,7 @@ CKEDITOR.scriptLoader = (function() { // Create the