diff --git a/_source/core/_bootstrap.js b/_source/core/_bootstrap.js index 2f8c3f332c..c8dc78d52f 100644 --- a/_source/core/_bootstrap.js +++ b/_source/core/_bootstrap.js @@ -20,7 +20,7 @@ For licensing, see LICENSE.html or http://ckeditor.com/license hcDetect.appendTo( CKEDITOR.document.getHead() ); // Update CKEDITOR.env. - if ( CKEDITOR.env.hc = ( hcDetect.getComputedStyle( 'background-image' ) == 'none' ) ) + if ( ( CKEDITOR.env.hc = ( hcDetect.getComputedStyle( 'background-image' ) == 'none' ) ) ) CKEDITOR.env.cssClass += ' cke_hc'; hcDetect.remove(); diff --git a/_source/core/dom/range.js b/_source/core/dom/range.js index 9c35b0c22d..f698e4b541 100644 --- a/_source/core/dom/range.js +++ b/_source/core/dom/range.js @@ -265,7 +265,7 @@ CKEDITOR.dom.range = function( document ) { function elementBoundaryEval( node ) { // Reject any text node unless it's being bookmark. return node.type != CKEDITOR.NODE_TEXT && node.getName() in CKEDITOR.dtd.$removeEmpty || node.getParent().hasAttribute( '_fck_bookmark' ); - }; + } CKEDITOR.dom.range.prototype = { clone: function() { @@ -987,8 +987,10 @@ CKEDITOR.dom.range = function( document ) { case CKEDITOR.ENLARGE_LIST_ITEM_CONTENTS: // Enlarging the start boundary. - var walkerRange = new CKEDITOR.dom.range( this.document ), - body = this.document.getBody(); + var walkerRange = new CKEDITOR.dom.range( this.document ); + + body = this.document.getBody(); + walkerRange.setStartAt( body, CKEDITOR.POSITION_AFTER_START ); walkerRange.setEnd( this.startContainer, this.startOffset ); @@ -1034,7 +1036,7 @@ CKEDITOR.dom.range = function( document ) { walker.guard = ( unit == CKEDITOR.ENLARGE_LIST_ITEM_CONTENTS ) ? tailBrGuard : boundaryGuard; blockBoundary = null; // End the range right before the block boundary node. - ; + if ( ( enlargeable = walker.lastForward() ) ) { // It's the body which stop the enlaring if no block boundary found. blockBoundary = blockBoundary || body; diff --git a/_source/plugins/dialog/plugin.js b/_source/plugins/dialog/plugin.js index 92a51bbb2d..427feba204 100644 --- a/_source/plugins/dialog/plugin.js +++ b/_source/plugins/dialog/plugin.js @@ -1,5 +1,4 @@ - -/* +/* Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license */ diff --git a/_source/plugins/domiterator/plugin.js b/_source/plugins/domiterator/plugin.js index a9053c1041..4e45434d69 100755 --- a/_source/plugins/domiterator/plugin.js +++ b/_source/plugins/domiterator/plugin.js @@ -62,8 +62,8 @@ CKEDITOR.plugins.add( 'domiterator' ); range = null; } - var currentNode = this._.nextNode, - lastNode = this._.lastNode; + var currentNode = this._.nextNode; + lastNode = this._.lastNode; this._.nextNode = null; while ( currentNode ) { diff --git a/_source/plugins/find/dialogs/find.js b/_source/plugins/find/dialogs/find.js index bbf7fab9dc..27bf1476d9 100755 --- a/_source/plugins/find/dialogs/find.js +++ b/_source/plugins/find/dialogs/find.js @@ -340,6 +340,7 @@ For licensing, see LICENSE.html or http://ckeditor.com/license this._.state = this._.overlap[ this._.state ]; } + return null; }, reset: function() { diff --git a/_source/plugins/htmldataprocessor/plugin.js b/_source/plugins/htmldataprocessor/plugin.js index ca1a126cb8..3703b3a333 100644 --- a/_source/plugins/htmldataprocessor/plugin.js +++ b/_source/plugins/htmldataprocessor/plugin.js @@ -76,7 +76,7 @@ For licensing, see LICENSE.html or http://ckeditor.com/license var defaultDataBlockFilterRules = { elements: {} }; - for ( var i in blockLikeTags ) + for ( i in blockLikeTags ) defaultDataBlockFilterRules.elements[ i ] = extendBlockForDisplay; /** @@ -153,7 +153,7 @@ For licensing, see LICENSE.html or http://ckeditor.com/license var defaultHtmlBlockFilterRules = { elements: {} }; - for ( var i in blockLikeTags ) + for ( i in blockLikeTags ) defaultHtmlBlockFilterRules.elements[ i ] = extendBlockForOutput; if ( CKEDITOR.env.ie ) { diff --git a/_source/plugins/resize/plugin.js b/_source/plugins/resize/plugin.js index 6a4964fa7a..b284b1c60c 100644 --- a/_source/plugins/resize/plugin.js +++ b/_source/plugins/resize/plugin.js @@ -31,7 +31,7 @@ CKEDITOR.plugins.add( 'resize', { } var mouseDownFn = CKEDITOR.tools.addFunction( function( $event ) { - if ( container == null ) + if ( !container ) container = editor.getResizable(); startSize = { width: container.$.offsetWidth || 0, height: container.$.offsetHeight || 0 }; diff --git a/_source/plugins/richcombo/plugin.js b/_source/plugins/richcombo/plugin.js index 0616243bc5..99b10d2e78 100644 --- a/_source/plugins/richcombo/plugin.js +++ b/_source/plugins/richcombo/plugin.js @@ -1,5 +1,4 @@ - -/* +/* Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license */ @@ -235,7 +234,7 @@ CKEDITOR.ui.richCombo = CKEDITOR.tools.createClass({ panel.getBlock( this.id ).onHide = function() { me._.on = 0; me.setState( CKEDITOR.TRISTATE_OFF ); - } + }; if ( this.init ) this.init(); diff --git a/_source/plugins/scayt/dialogs/options.js b/_source/plugins/scayt/dialogs/options.js index 790fc785e8..3bef2379c8 100644 --- a/_source/plugins/scayt/dialogs/options.js +++ b/_source/plugins/scayt/dialogs/options.js @@ -23,7 +23,7 @@ CKEDITOR.dialog.add( 'scaytcheck', function( editor ) { i; // Add buttons titles - for ( var i in buttons ) { + for ( i in buttons ) { var button = buttons[ i ]; doc.getById( button ).setHtml( '' + captions[ 'button_' + button ] + '' ); } @@ -96,7 +96,7 @@ CKEDITOR.dialog.add( 'scaytcheck', function( editor ) { } // user dictionary handlers - dic = {}; + var dic = {}; dic.dic_create = function( el, dic_name, dic_buttons ) { // comma separated button's ids include repeats if exists var all_buttons = dic_buttons[ 0 ] + ',' + dic_buttons[ 1 ]; @@ -117,7 +117,7 @@ CKEDITOR.dialog.add( 'scaytcheck', function( editor ) { dic_error_message( err_massage + "( " + ( arg.message || "" ) + ")" ); }); - } + }; dic.dic_rename = function( el, dic_name, dic_buttons ) { // @@ -135,9 +135,9 @@ CKEDITOR.dialog.add( 'scaytcheck', function( editor ) { //console.info( "dic_rename errorback called with args" , arg ) err_massage = err_massage.replace( "%s", arg.dname ); set_dic_name( dic_name ); - dic_error_message( err_massage + "( " + ( arg.message || "" ) + " )" ) + dic_error_message( err_massage + "( " + ( arg.message || "" ) + " )" ); }); - } + }; dic.dic_delete = function( el, dic_name, dic_buttons ) { var all_buttons = dic_buttons[ 0 ] + ',' + dic_buttons[ 1 ]; @@ -158,7 +158,8 @@ CKEDITOR.dialog.add( 'scaytcheck', function( editor ) { err_massage = err_massage.replace( "%s", arg.dname ); dic_error_message( err_massage ); }); - } + }; + dic.dic_restore = dialog.dic_restore || function( el, dic_name, dic_buttons ) { // try to restore existing dictionary @@ -177,9 +178,12 @@ CKEDITOR.dialog.add( 'scaytcheck', function( editor ) { err_massage = err_massage.replace( "%s", arg.dname ); dic_error_message( err_massage ); }); - } + }; + // ** bind event listeners - var arr_buttons = ( dic_buttons[ 0 ] + ',' + dic_buttons[ 1 ] ).split( ',' ); + var arr_buttons = ( dic_buttons[ 0 ] + ',' + dic_buttons[ 1 ] ).split( ',' ), + l; + for ( i = 0, l = arr_buttons.length; i < l; i += 1 ) { var dic_button = doc.getById( arr_buttons[ i ] ); @@ -191,6 +195,8 @@ CKEDITOR.dialog.add( 'scaytcheck', function( editor ) { } //apply handler dic[ this.getId() ].apply( null, [ this, dic_name, dic_buttons ] ); + + return true; }); } }; @@ -227,8 +233,7 @@ CKEDITOR.dialog.add( 'scaytcheck', function( editor ) { doc.getById( 'dic_name' ).setValue( "" ); }); - dic_success_message( "" ) - var dic_flag = 0; + dic_success_message( "" ); }; function dic_error_message( m ) { @@ -253,7 +258,7 @@ CKEDITOR.dialog.add( 'scaytcheck', function( editor ) { sIds = new String( sIds ); var aIds = sIds.split( ',' ); for ( var i = 0, l = aIds.length; i < l; i += 1 ) { - doc.getById( aIds[ i ] ).$.style.display = "none" + doc.getById( aIds[ i ] ).$.style.display = "none"; } } @@ -299,7 +304,7 @@ CKEDITOR.dialog.add( 'scaytcheck', function( editor ) { // Set up options if any was set. for ( var oN in this.options ) { - if ( o[ oN ] != this.options[ oN ] && c == 0 ) { + if ( o[ oN ] != this.options[ oN ] && c === 0 ) { scayt_control.option( this.options ); c++; } diff --git a/_source/plugins/scayt/plugin.js b/_source/plugins/scayt/plugin.js index 92292559ac..fd59483771 100644 --- a/_source/plugins/scayt/plugin.js +++ b/_source/plugins/scayt/plugin.js @@ -46,9 +46,10 @@ For licensing, see LICENSE.html or http://ckeditor.com/license editor.on( 'contentDom', createInstance ); editor.on( 'contentDomUnload', function() { // Remove scripts. - var scripts = CKEDITOR.document.getElementsByTag( 'script' ); - scaytIdRegex = /^dojoIoScript(\d+)$/i; - scaytSrcRegex = /^https?:\/\/svc\.spellchecker\.net\/spellcheck\/script\/ssrv\.cgi/i; + var scripts = CKEDITOR.document.getElementsByTag( 'script' ), + scaytIdRegex = /^dojoIoScript(\d+)$/i, + scaytSrcRegex = /^https?:\/\/svc\.spellchecker\.net\/spellcheck\/script\/ssrv\.cgi/i; + for ( var i = 0; i < scripts.count(); i++ ) { var script = scripts.getItem( i ), id = script.getId(), @@ -134,16 +135,16 @@ For licensing, see LICENSE.html or http://ckeditor.com/license // assign diojo configurable vars var parseUrl = function( data ) { var m = data.match( /(.*)[\/\\]([^\/\\]+\.\w+)$/ ); - return { path: m[ 1 ], file: m[ 2 ] } - } + return { path: m[ 1 ], file: m[ 2 ] }; + }; - // compose scayt url + // compose scayt url var protocol = document.location.protocol; var baseUrl = "svc.spellchecker.net/spellcheck/lf/scayt/scayt.js"; var scaytUrl = editor.config.scaytParams.srcScayt || ( protocol + "//" + baseUrl ); var scaytConfigBaseUrl = parseUrl( scaytUrl ).path + "/"; - djScaytConfig = { + var djScaytConfig = { baseUrl: scaytConfigBaseUrl, addOnLoad: [ function() @@ -160,6 +161,8 @@ For licensing, see LICENSE.html or http://ckeditor.com/license src: scaytUrl } })); + + return null; } }; @@ -297,7 +300,7 @@ For licensing, see LICENSE.html or http://ckeditor.com/license var sLang = scayt_control.getLang(), _r = {}, items_suggestion = scayt.getSuggestion( word, sLang ); - if ( !items_suggestion || !items_suggestion.length || items_suggestion.length == 0 ) + if ( !items_suggestion || !items_suggestion.length ) return null; // Remove unused commands and menuitems for ( i in moreSuggestions ) { @@ -310,7 +313,8 @@ For licensing, see LICENSE.html or http://ckeditor.com/license } moreSuggestions = {}; // Reset items. mainSuggestions = {}; - moreSuggestionsUnable = false; + + var moreSuggestionsUnable = false; for ( var i = 0, l = items_suggestion.length; i < l; i += 1 ) { var commandName = 'scayt_suggestion_' + items_suggestion[ i ].replace( ' ', '_' ); diff --git a/_source/plugins/selection/plugin.js b/_source/plugins/selection/plugin.js index b5ed217113..95f105e79e 100644 --- a/_source/plugins/selection/plugin.js +++ b/_source/plugins/selection/plugin.js @@ -1,5 +1,4 @@ - -/* +/* Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license */ @@ -751,8 +750,9 @@ For licensing, see LICENSE.html or http://ckeditor.com/license for ( var i = 0; i < length; i++ ) { retval.push( bookmark = ranges[ i ].createBookmark( serializable, true ) ); - var serializable = bookmark.serializable, - bookmarkStart = serializable ? this.document.getById( bookmark.startNode ) : bookmark.startNode, + serializable = bookmark.serializable; + + var bookmarkStart = serializable ? this.document.getById( bookmark.startNode ) : bookmark.startNode, bookmarkEnd = serializable ? this.document.getById( bookmark.endNode ) : bookmark.endNode; // Updating the offset values for rest of ranges which have been mangled(#3256). diff --git a/_source/plugins/styles/plugin.js b/_source/plugins/styles/plugin.js index 5720ffe512..bd9469cb2e 100644 --- a/_source/plugins/styles/plugin.js +++ b/_source/plugins/styles/plugin.js @@ -483,7 +483,7 @@ CKEDITOR.STYLE_OBJECT = 3; // new range. if ( boundaryElement ) { var clonedElement = startNode; - for ( var i = 0;; i++ ) { + for ( i = 0;; i++ ) { var newElement = startPath.elements[ i ]; if ( newElement.equals( boundaryElement ) ) break; diff --git a/_source/plugins/uicolor/dialogs/uicolor.js b/_source/plugins/uicolor/dialogs/uicolor.js index 658ea203df..d5180deace 100644 --- a/_source/plugins/uicolor/dialogs/uicolor.js +++ b/_source/plugins/uicolor/dialogs/uicolor.js @@ -15,7 +15,7 @@ CKEDITOR.dialog.add( 'uicolor', function( editor ) { picker.setValue( color, true ); // Refresh picker UI. picker.refresh( 'cke_uicolor_picker' ); - }; + } function setNewUiColor( color, force ) { if ( force || dialog._.contents.tab1.livePeview.getValue() ) @@ -23,7 +23,7 @@ CKEDITOR.dialog.add( 'uicolor', function( editor ) { // Write new config string into textbox. dialog._.contents.tab1.configBox.setValue( 'config.uiColor = "#' + picker.get( "hex" ) + '"' ); - }; + } pickerContents = { id: 'yuiColorPicker', @@ -113,7 +113,7 @@ CKEDITOR.dialog.add( 'uicolor', function( editor ) { [ '' ], [ 'Light blue', '#9AB8F3' ], [ 'Sand', '#D2B48C' ], - [ 'Metallic', '#949AAA', ], + [ 'Metallic', '#949AAA' ], [ 'Purple', '#C2A3C7' ], [ 'Olive', '#A2C980' ], [ 'Happy green', '#9BD446' ], @@ -130,7 +130,7 @@ CKEDITOR.dialog.add( 'uicolor', function( editor ) { [ 'Down', '#BCBCA4' ], [ 'Mark Twain', '#CFE91D' ], [ 'Specks of dust', '#D1B596' ], - [ 'Lollipop', '#F6CE23' ], + [ 'Lollipop', '#F6CE23' ] ], onChange: function() { var color = this.getValue(); @@ -169,8 +169,8 @@ CKEDITOR.dialog.add( 'uicolor', function( editor ) { } } ] - }, - ] + } + ] } ], buttons: [ CKEDITOR.dialog.okButton ] diff --git a/_source/plugins/uicolor/yui/yui.js b/_source/plugins/uicolor/yui/yui.js index f93fa3752e..8fe3f1c556 100644 --- a/_source/plugins/uicolor/yui/yui.js +++ b/_source/plugins/uicolor/yui/yui.js @@ -1,3 +1,4 @@ +/*jsl:ignoreall*/ /* Copyright (c) 2009, Yahoo! Inc. All rights reserved. Code licensed under the BSD License: diff --git a/_source/plugins/undo/plugin.js b/_source/plugins/undo/plugin.js index 4e495e4e4b..b10196f9d4 100644 --- a/_source/plugins/undo/plugin.js +++ b/_source/plugins/undo/plugin.js @@ -95,7 +95,7 @@ For licensing, see LICENSE.html or http://ckeditor.com/license // Create the first image. editor.fire( 'saveSnapshot' ); - } + }; } }); @@ -321,7 +321,7 @@ For licensing, see LICENSE.html or http://ckeditor.com/license // IE BUG: If I don't set the selection to *somewhere* after setting // document contents, then IE would create an empty paragraph at the bottom // the next time the document is modified. - $range = this.editor.document.getBody().$.createTextRange(); + var $range = this.editor.document.getBody().$.createTextRange(); $range.collapse( true ); $range.select(); } diff --git a/_source/plugins/wsc/dialogs/tmpFrameset.html b/_source/plugins/wsc/dialogs/tmpFrameset.html index 0ed93f96fb..622a8a794c 100644 --- a/_source/plugins/wsc/dialogs/tmpFrameset.html +++ b/_source/plugins/wsc/dialogs/tmpFrameset.html @@ -22,9 +22,9 @@ return true ; } -function tryLoad () +function tryLoad() { - opener = window.parent; + var opener = window.parent; // get access to global parameters var oParams = window.opener.oldFramesetPageParams ; diff --git a/_source/plugins/wysiwygarea/plugin.js b/_source/plugins/wysiwygarea/plugin.js index 10db07bca1..f9f9ecb962 100644 --- a/_source/plugins/wysiwygarea/plugin.js +++ b/_source/plugins/wysiwygarea/plugin.js @@ -71,12 +71,14 @@ For licensing, see LICENSE.html or http://ckeditor.com/license clone = !i && element || element.clone( true ); - // If we're inserting a block at dtd-violated positoin, split + // If we're inserting a block at dtd-violated position, split // the parent blocks until we reach blockLimit. var parent, dtd; - if ( this.config.enterMode != CKEDITOR.ENTER_BR && isBlock ) - while ( ( parent = range.getCommonAncestor( false, true ) ) && ( dtd = CKEDITOR.dtd[ parent.getName() ] ) && !( dtd && dtd[ elementName ] ) ) - range.splitBlock(); + if ( this.config.enterMode != CKEDITOR.ENTER_BR && isBlock ) { + while ( ( parent = range.getCommonAncestor( false, true ) ) && ( dtd = CKEDITOR.dtd[ parent.getName() ] ) && !( dtd && dtd[ elementName ] ) ) { + range.splitBlock(); + } + } // Insert the new node. range.insertNode( clone ); @@ -132,9 +134,10 @@ For licensing, see LICENSE.html or http://ckeditor.com/license if ( CKEDITOR.env.ie ) { var brNodeList = fixedBlock.getElementsByTag( 'br' ), brNode; - for ( var i = 0; i < brNodeList.count(); i++ ) + for ( var i = 0; i < brNodeList.count(); i++ ) { if ( ( brNode = brNodeList.getItem( i ) ) && brNode.hasAttribute( '_cke_bogus' ) ) - brNode.remove(); + brNode.remove(); + } } selection.selectBookmarks( bms ); diff --git a/_source/skins/kama/skin.js b/_source/skins/kama/skin.js index 6c31b7594a..99aee6a2e6 100644 --- a/_source/skins/kama/skin.js +++ b/_source/skins/kama/skin.js @@ -23,7 +23,7 @@ CKEDITOR.skins.add( 'kama', ( function() { function menuSetUiColor( color ) { if ( !menuHead ) - return; + return null; var uiStyle = menuHead.append( 'style' ); @@ -156,7 +156,7 @@ CKEDITOR.skins.add( 'kama', ( function() { menuHead = this._.element.getDocument().getHead(); menuSetUiColor( editor.getUiColor() ); } - } + }; } // Apply UI color if specified in config. diff --git a/_source/tests/core/htmlparser/htmlparser.html b/_source/tests/core/htmlparser/htmlparser.html index ba69ec1a45..8515ee8014 100644 --- a/_source/tests/core/htmlparser/htmlparser.html +++ b/_source/tests/core/htmlparser/htmlparser.html @@ -39,8 +39,7 @@ return CKEDITOR.document.getById( id ).getValue().replace( /\r/gi, '' ); } - return - { + return { /** * Test
 tag formatting.
 		 */