From d911779eee21cdc983b2d92331298e8887052674 Mon Sep 17 00:00:00 2001 From: fredck Date: Sun, 10 May 2009 10:42:28 +0000 Subject: [PATCH] Run jslint and fixlinebreaks. git-svn-id: https://svn.ckeditor.com/CKEditor/trunk@3477 da63caf2-3823-0410-a1e8-d69ccee00dfb --- _source/core/ckeditor_base.js | 4 +- _source/core/dom/range.js | 5 +- _source/core/dom/walker.js | 10 +- _source/core/env.js | 2 +- _source/core/htmlparser/element.js | 2 +- _source/lang/_translationstatus.txt | 2 +- _source/plugins/button/plugin.js | 2 +- _source/plugins/clipboard/plugin.js | 2 +- _source/plugins/colorbutton/plugin.js | 5 +- _source/plugins/contextmenu/plugin.js | 2 +- _source/plugins/dialog/plugin.js | 2 +- _source/plugins/domiterator/plugin.js | 4 +- _source/plugins/find/dialogs/find.js | 9 +- _source/plugins/htmldataprocessor/plugin.js | 2 +- _source/plugins/maximize/plugin.js | 3 +- _source/plugins/selection/plugin.js | 7 +- _source/plugins/sourcearea/plugin.js | 2 +- _source/plugins/styles/plugin.js | 22 +-- _source/plugins/table/dialogs/table.js | 6 +- .../plugins/tabletools/dialogs/tableCell.js | 11 +- _source/plugins/tabletools/plugin.js | 38 ++--- _source/plugins/toolbar/plugin.js | 2 +- _source/plugins/wysiwygarea/plugin.js | 2 +- _source/skins/office2003/reset.css | 4 +- _source/skins/office2003/toolbar.css | 8 +- _source/skins/v2/reset.css | 4 +- _source/skins/v2/toolbar.css | 8 +- _source/tests/core/dom/document.html | 2 +- _source/tests/core/dom/element.html | 6 +- _source/tests/core/dom/range.html | 36 ++--- _source/tests/core/dom/walker.html | 142 ++++++++---------- _source/tests/core/htmlparser/fragment.html | 10 +- .../plugins/domiterator/domiterator.html | 28 ++-- _source/tests/plugins/list/list.html | 88 +++++------ _source/tests/plugins/styles/styles.html | 4 +- contents.css | 1 - 36 files changed, 233 insertions(+), 254 deletions(-) diff --git a/_source/core/ckeditor_base.js b/_source/core/ckeditor_base.js index a76fbbf2b3..7211c3aa31 100644 --- a/_source/core/ckeditor_base.js +++ b/_source/core/ckeditor_base.js @@ -45,7 +45,7 @@ if ( !window.CKEDITOR ) { timestamp : '%TIMESTAMP%', */ // %REMOVE_LINE% /** - * Contains the CKEditor version number. + * Contains the CKEditor version number. * @type String * @example * alert( CKEDITOR.version ); // e.g. 'CKEditor 3.0 Beta' @@ -54,7 +54,7 @@ if ( !window.CKEDITOR ) { /** * Contains the CKEditor revision number. - * Revision number is incremented automatically after each modification of CKEditor source code. + * Revision number is incremented automatically after each modification of CKEditor source code. * @type String * @example * alert( CKEDITOR.revision ); // e.g. '3975' diff --git a/_source/core/dom/range.js b/_source/core/dom/range.js index 49af7db115..063d64095a 100644 --- a/_source/core/dom/range.js +++ b/_source/core/dom/range.js @@ -249,6 +249,7 @@ CKEDITOR.dom.range = function( document ) { return false; } } + return true; }; } @@ -954,6 +955,7 @@ CKEDITOR.dom.range = function( document ) { var walkerRange = new CKEDITOR.dom.range( this.document ); walkerRange.setStartAt( this.document.getBody(), CKEDITOR.POSITION_AFTER_START ); walkerRange.setEnd( this.startContainer, this.startOffset ); + var walker = new CKEDITOR.dom.walker( walkerRange ), guard = CKEDITOR.dom.walker.blockBoundary( @@ -964,8 +966,7 @@ CKEDITOR.dom.range = function( document ) { if ( !result && node.is && node.is( 'br' ) ) tailBr = node; return result; - }, - enlargeable; + }; walker.guard = guard; if ( ( enlargeable = walker.lastBackward() ) ) diff --git a/_source/core/dom/walker.js b/_source/core/dom/walker.js index e8431829bd..ecc96f009e 100644 --- a/_source/core/dom/walker.js +++ b/_source/core/dom/walker.js @@ -40,7 +40,7 @@ For licensing, see LICENSE.html or http://ckeditor.com/license this._.guardLTR = function( node, movingOut ) { return ( ( !movingOut || !limitLTR.equals( node ) ) && ( !blockerLTR || !node.equals( blockerLTR ) ) && ( node.type != CKEDITOR.NODE_ELEMENT || node.getName() != 'body' ) ); - } + }; } // Create the RTL guard function, if necessary. @@ -51,11 +51,11 @@ For licensing, see LICENSE.html or http://ckeditor.com/license this._.guardRTL = function( node, movingOut ) { return ( ( !movingOut || !limitRTL.equals( node ) ) && ( !blockerRTL || !node.equals( blockerRTL ) ) && ( node.type != CKEDITOR.NODE_ELEMENT || node.getName() != 'body' ) ); - } + }; } // Define which guard function to use. - stopGuard = rtl ? this._.guardRTL : this._.guardLTR; + var stopGuard = rtl ? this._.guardRTL : this._.guardLTR; // Make the user defined guard function participate in the process, // otherwise simply use the boundary guard. @@ -65,7 +65,7 @@ For licensing, see LICENSE.html or http://ckeditor.com/license return false; return userGuard( node ); - } + }; } else guard = stopGuard; @@ -115,7 +115,7 @@ For licensing, see LICENSE.html or http://ckeditor.com/license var node, last = null; - while ( node = iterate.call( this, rtl ) ) + while ( ( node = iterate.call( this, rtl ) ) ) last = node; return last; diff --git a/_source/core/env.js b/_source/core/env.js index 101cf341ab..83b2be5f0d 100644 --- a/_source/core/env.js +++ b/_source/core/env.js @@ -101,7 +101,7 @@ if ( !CKEDITOR.env ) { env.ie6Compat = ( version < 7 || env.quirks ); /** - * Indicate IE8. + * Indicate IE8. */ env.ie8 = ( version >= 8 ); } diff --git a/_source/core/htmlparser/element.js b/_source/core/htmlparser/element.js index 10718fda4f..041ddba001 100644 --- a/_source/core/htmlparser/element.js +++ b/_source/core/htmlparser/element.js @@ -150,7 +150,7 @@ CKEDITOR.htmlParser.element = function( name, attributes ) { } } else { for ( a in attributes ) { - var value = attributes[ a ]; + value = attributes[ a ]; if ( filter && ( !( a = filter.onAttributeName( a ) ) || ( value = filter.onAttribute( element, a, value ) ) === false ) ) continue; diff --git a/_source/lang/_translationstatus.txt b/_source/lang/_translationstatus.txt index 9f40c1435c..41b3333f71 100644 --- a/_source/lang/_translationstatus.txt +++ b/_source/lang/_translationstatus.txt @@ -56,4 +56,4 @@ tr.js Found: 333 Missing: 63 uk.js Found: 328 Missing: 68 vi.js Found: 327 Missing: 69 zh-cn.js Found: 333 Missing: 63 -zh.js Found: 328 Missing: 68 \ No newline at end of file +zh.js Found: 328 Missing: 68 diff --git a/_source/plugins/button/plugin.js b/_source/plugins/button/plugin.js index 45dcf22351..dbd5cc03dd 100644 --- a/_source/plugins/button/plugin.js +++ b/_source/plugins/button/plugin.js @@ -206,7 +206,7 @@ CKEDITOR.ui.button._ = { if ( instance.onfocus ) retVal = ( instance.onfocus( instance, new CKEDITOR.dom.event( ev ) ) !== false ); - // FF2: prevent focus event been bubbled up to editor container, which caused unexpected editor focus. + // FF2: prevent focus event been bubbled up to editor container, which caused unexpected editor focus. if ( CKEDITOR.env.gecko && CKEDITOR.env.version < 10900 ) ev.preventBubble(); return retVal; diff --git a/_source/plugins/clipboard/plugin.js b/_source/plugins/clipboard/plugin.js index 70fc5e4675..264915d156 100644 --- a/_source/plugins/clipboard/plugin.js +++ b/_source/plugins/clipboard/plugin.js @@ -108,7 +108,7 @@ For licensing, see LICENSE.html or http://ckeditor.com/license case CKEDITOR.SHIFT + 46: // SHIFT+DEL // Save Undo snapshot. - var editor = this; + editor = this; editor.fire( 'saveSnapshot' ); // Save before paste setTimeout( function() { editor.fire( 'saveSnapshot' ); // Save after paste diff --git a/_source/plugins/colorbutton/plugin.js b/_source/plugins/colorbutton/plugin.js index 695879c299..9be7d545e1 100644 --- a/_source/plugins/colorbutton/plugin.js +++ b/_source/plugins/colorbutton/plugin.js @@ -123,10 +123,9 @@ CKEDITOR.config.colorButton_colors = '000,800000,8B4513,2F4F4F,008080,000080,4B0 'B22222,A52A2A,DAA520,006400,40E0D0,0000CD,800080,808080,' + 'F00,FF8C00,FFD700,008000,0FF,00F,EE82EE,A9A9A9,' + 'FFA07A,FFA500,FFFF00,00FF00,AFEEEE,ADD8E6,DDA0DD,D3D3D3,' + - 'FFF0F5,FAEBD7,FFFFE0,F0FFF0,F0FFFF,F0F8FF,E6E6FA,FFF' + 'FFF0F5,FAEBD7,FFFFE0,F0FFF0,F0FFFF,F0F8FF,E6E6FA,FFF'; -CKEDITOR.config.colorButton_foreStyle = - { +CKEDITOR.config.colorButton_foreStyle = { element: 'span', styles: { 'color': '#(color)' }, overrides: [ { diff --git a/_source/plugins/contextmenu/plugin.js b/_source/plugins/contextmenu/plugin.js index b1e8c02663..6423471f1c 100644 --- a/_source/plugins/contextmenu/plugin.js +++ b/_source/plugins/contextmenu/plugin.js @@ -46,7 +46,7 @@ CKEDITOR.plugins.contextMenu = CKEDITOR.tools.createClass({ menu.onClick = CKEDITOR.tools.bind( function( item ) { menu.onHide = null; - noUnlock = true; + var noUnlock = true; menu.hide(); if ( CKEDITOR.env.ie ) diff --git a/_source/plugins/dialog/plugin.js b/_source/plugins/dialog/plugin.js index bbfd4f95f1..327bb5c976 100644 --- a/_source/plugins/dialog/plugin.js +++ b/_source/plugins/dialog/plugin.js @@ -2365,7 +2365,7 @@ CKEDITOR.tools.extend( CKEDITOR.editor.prototype, body.setStyle( 'cursor', 'wait' ); CKEDITOR.scriptLoader.load( CKEDITOR.getUrl( dialogDefinitions ), function() { - // In case of plugin error, mark it as loading failed. + // In case of plugin error, mark it as loading failed. if ( typeof CKEDITOR.dialog._.dialogDefinitions[ dialogName ] != 'function' ) CKEDITOR.dialog._.dialogDefinitions[ dialogName ] = 'failed'; me.openDialog( dialogName ); diff --git a/_source/plugins/domiterator/plugin.js b/_source/plugins/domiterator/plugin.js index 1954a986c8..fac43a924f 100755 --- a/_source/plugins/domiterator/plugin.js +++ b/_source/plugins/domiterator/plugin.js @@ -13,7 +13,7 @@ CKEDITOR.plugins.add( 'domiterator' ); /** * Find next source order node, ignore bookmark nodes and stop at the specified end node. - * @param {Object} currentNode + * @param {Object} currentNode * @param {Object} endNode */ function getNextSourceNode( currentNode, endNode, startFromSibling ) { @@ -60,7 +60,7 @@ CKEDITOR.plugins.add( 'domiterator' ); var boundary = range.getBoundaryNodes(); this._.nextNode = boundary.startNode; this._.lastNode = boundary.endNode.getNextSourceNode( true ); - // Probably the document end is reached, we need a marker node. + // Probably the document end is reached, we need a marker node. if ( !this._.lastNode ) { this._.lastNode = range.document.createText( '' ); this._.lastNode.insertAfter( boundary.endNode ); diff --git a/_source/plugins/find/dialogs/find.js b/_source/plugins/find/dialogs/find.js index f4cdb5533e..b76a2cf6c6 100755 --- a/_source/plugins/find/dialogs/find.js +++ b/_source/plugins/find/dialogs/find.js @@ -5,7 +5,7 @@ For licensing, see LICENSE.html or http://ckeditor.com/license (function() { function guardDomWalkerNonEmptyTextNode( node ) { - return ( node.type == CKEDITOR.NODE_TEXT && node.getLength() > 0 ) + return ( node.type == CKEDITOR.NODE_TEXT && node.getLength() > 0 ); } /** @@ -64,7 +64,7 @@ For licensing, see LICENSE.html or http://ckeditor.com/license * Iterator which walk through document char by char. * @param {Object} start * @param {Number} offset - * @param {Boolean} isStrict + * @param {Boolean} isStrict */ var characterWalker = function( range, matchWord ) { var walker = new CKEDITOR.dom.walker( range ); @@ -418,7 +418,10 @@ For licensing, see LICENSE.html or http://ckeditor.com/license var cursors = this.matchRange.getCursors(), tail = cursors[ cursors.length - 1 ], head = cursors[ 0 ]; - headWalker = new characterWalker( getRangeBeforeCursor( head ), true ), tailWalker = new characterWalker( getRangeAfterCursor( tail ), true ); + + var headWalker = new characterWalker( getRangeBeforeCursor( head ), true ), + tailWalker = new characterWalker( getRangeAfterCursor( tail ), true ); + if ( !( isWordSeparator( headWalker.back().character ) && isWordSeparator( tailWalker.next().character ) ) ) continue; } diff --git a/_source/plugins/htmldataprocessor/plugin.js b/_source/plugins/htmldataprocessor/plugin.js index 3106cbc527..bc0e9be86f 100644 --- a/_source/plugins/htmldataprocessor/plugin.js +++ b/_source/plugins/htmldataprocessor/plugin.js @@ -61,7 +61,7 @@ For licensing, see LICENSE.html or http://ckeditor.com/license }, /** - * IE sucks with dynamic 'name' attribute after element is created, '_cke_saved_name' is used instead for this attribute. + * IE sucks with dynamic 'name' attribute after element is created, '_cke_saved_name' is used instead for this attribute. */ input: function( element ) { var attribs = element.attributes; diff --git a/_source/plugins/maximize/plugin.js b/_source/plugins/maximize/plugin.js index 03b87b5bb5..0b0f2a0a1b 100644 --- a/_source/plugins/maximize/plugin.js +++ b/_source/plugins/maximize/plugin.js @@ -169,7 +169,8 @@ For licensing, see LICENSE.html or http://ckeditor.com/license restoreStyles( editorElements[ i ], editorElements[ i ].getCustomData( 'maximize_saved_styles' ) ); editorElements[ i ].removeCustomData( 'maximize_saved_styles' ); } - var currentNode = editor.container; + + currentNode = editor.container; while ( ( currentNode = currentNode.getParent() ) ) { restoreStyles( currentNode, currentNode.getCustomData( 'maximize_saved_styles' ) ); currentNode.removeCustomData( 'maximize_saved_styles' ); diff --git a/_source/plugins/selection/plugin.js b/_source/plugins/selection/plugin.js index 51ab31dba3..07d34ae69a 100644 --- a/_source/plugins/selection/plugin.js +++ b/_source/plugins/selection/plugin.js @@ -25,7 +25,7 @@ For licensing, see LICENSE.html or http://ckeditor.com/license this.fire( 'selectionChange', { selection: sel, path: currentPath, element: firstElement } ); } } catch ( e ) {} - }; + } var checkSelectionChangeTimer, checkSelectionChangeTimeoutPending; @@ -275,6 +275,8 @@ For licensing, see LICENSE.html or http://ckeditor.com/license this.isInvalid = true; } } + + return this; }; var styleObjectElements = { img:1,hr:1,li:1,table:1,tr:1,td:1,embed:1,object:1,ol:1,ul:1,a:1,input:1,form:1,select:1,textarea:1,button:1,fieldset:1,th:1,thead:1,tfoot:1 }; @@ -677,7 +679,6 @@ For licensing, see LICENSE.html or http://ckeditor.com/license if ( CKEDITOR.env.ie ) { this.getNative().empty(); - var range; try { // Try to select the node as a control. range = this.document.$.body.createControlRange(); @@ -693,7 +694,7 @@ For licensing, see LICENSE.html or http://ckeditor.com/license this.reset(); } else { // Create the range for the element. - var range = this.document.$.createRange(); + range = this.document.$.createRange(); range.selectNode( element.$ ); // Select the range. diff --git a/_source/plugins/sourcearea/plugin.js b/_source/plugins/sourcearea/plugin.js index 350e4a0b11..f76ed8b331 100644 --- a/_source/plugins/sourcearea/plugin.js +++ b/_source/plugins/sourcearea/plugin.js @@ -54,7 +54,7 @@ CKEDITOR.plugins.add( 'sourcearea', { return { height: holderElement.$.clientHeight + 'px', width: holderElement.$.clientWidth + 'px' - } + }; } onResize = function() { diff --git a/_source/plugins/styles/plugin.js b/_source/plugins/styles/plugin.js index 761ffb68ef..8de7062b72 100644 --- a/_source/plugins/styles/plugin.js +++ b/_source/plugins/styles/plugin.js @@ -181,18 +181,18 @@ CKEDITOR.STYLE_OBJECT = 3; return true; for ( var i = 0; i < attribs.length; i++ ) { - var attName = attribs[ i ][ 0 ], - actualAttrValue; - if ( actualAttrValue = element.getAttribute( attName ) ) { + attName = attribs[ i ][ 0 ]; + var actualAttrValue = element.getAttribute( attName ); + if ( actualAttrValue ) { var attValue = attribs[ i ][ 1 ]; // Remove the attribute if: // - The override definition value is null; - // - The override definition valie is a string that + // - The override definition value is a string that // matches the attribute value exactly. // - The override definition value is a regex that // has matches in the attribute value. - if ( attValue == null || ( typeof attValue == 'string' && actualAttrValue == attValue ) || attValue.test( actualAttrValue ) ) + if ( attValue === null || ( typeof attValue == 'string' && actualAttrValue == attValue ) || attValue.test( actualAttrValue ) ) return true; } } @@ -269,7 +269,7 @@ CKEDITOR.STYLE_OBJECT = 3; var firstNode = boundaryNodes.startNode; var lastNode = boundaryNodes.endNode.getNextSourceNode( true ); - // Probably the document end is reached, we need a marker node. + // Probably the document end is reached, we need a marker node. if ( !lastNode ) { lastNode = document.createText( '' ); lastNode.insertAfter( range.endContainer ); @@ -607,7 +607,7 @@ CKEDITOR.STYLE_OBJECT = 3; } } - // Remove definition attributes/style from the elemnt. + // Remove definition attributes/style from the elemnt. removeAttrs(); for ( var styleName in styles ) element.removeStyle( styleName ); @@ -635,8 +635,8 @@ CKEDITOR.STYLE_OBJECT = 3; // defined to be overriden. for ( var overrideElement in overrides ) { if ( overrideElement != style.element ) { - var innerElements = element.getElementsByTag( overrideElement ); - for ( var i = innerElements.count() - 1; i >= 0; i-- ) { + innerElements = element.getElementsByTag( overrideElement ); + for ( i = innerElements.count() - 1; i >= 0; i-- ) { var innerElement = innerElements.getItem( i ); removeOverrides( innerElement, overrides[ overrideElement ] ); } @@ -659,7 +659,7 @@ CKEDITOR.STYLE_OBJECT = 3; var attName = attributes[ i ][ 0 ], actualAttrValue; - if ( actualAttrValue = element.getAttribute( attName ) ) { + if ( ( actualAttrValue = element.getAttribute( attName ) ) ) { var attValue = attributes[ i ][ 1 ]; // Remove the attribute if: @@ -668,7 +668,7 @@ CKEDITOR.STYLE_OBJECT = 3; // matches the attribute value exactly. // - The override definition value is a regex that // has matches in the attribute value. - if ( attValue == null || ( attValue.test && attValue.test( actualAttrValue ) ) || ( typeof attValue == 'string' && actualAttrValue == attValue ) ) + if ( attValue === null || ( attValue.test && attValue.test( actualAttrValue ) ) || ( typeof attValue == 'string' && actualAttrValue == attValue ) ) element.removeAttribute( attName ); } } diff --git a/_source/plugins/table/dialogs/table.js b/_source/plugins/table/dialogs/table.js index fa2990f1c7..8afa5c6646 100755 --- a/_source/plugins/table/dialogs/table.js +++ b/_source/plugins/table/dialogs/table.js @@ -98,7 +98,7 @@ For licensing, see LICENSE.html or http://ckeditor.com/license var th = theRow.getChild( i ); if ( th.type == CKEDITOR.NODE_ELEMENT ) { th.renameNode( 'th' ); - if ( i == 0 ) + if ( !i ) th.setAttribute( 'scope', 'col' ); } } @@ -128,7 +128,7 @@ For licensing, see LICENSE.html or http://ckeditor.com/license // Should we make all first cells in a row TH? if ( !this.hasColumnHeaders && ( headers == 'col' || headers == 'both' ) ) { for ( row = 0; row < table.$.rows.length; row++ ) { - var newCell = new CKEDITOR.dom.element( table.$.rows[ row ].cells[ 0 ] ); + newCell = new CKEDITOR.dom.element( table.$.rows[ row ].cells[ 0 ] ); newCell.renameNode( 'th' ); newCell.setAttribute( 'scope', 'col' ); } @@ -139,7 +139,7 @@ For licensing, see LICENSE.html or http://ckeditor.com/license for ( i = 0; i < table.$.rows.length; i++ ) { row = new CKEDITOR.dom.element( table.$.rows[ i ] ); if ( row.getParent().getName() == 'tbody' ) { - var newCell = new CKEDITOR.dom.element( row.$.cells[ 0 ] ); + newCell = new CKEDITOR.dom.element( row.$.cells[ 0 ] ); newCell.renameNode( 'td' ); newCell.removeAttribute( 'scope' ); } diff --git a/_source/plugins/tabletools/dialogs/tableCell.js b/_source/plugins/tabletools/dialogs/tableCell.js index ecb7ec373f..a0f59bc586 100644 --- a/_source/plugins/tabletools/dialogs/tableCell.js +++ b/_source/plugins/tabletools/dialogs/tableCell.js @@ -13,7 +13,7 @@ CKEDITOR.dialog.add( 'cellProperties', function( editor ) { var bind = CKEDITOR.tools.bind; function spacer() { - return { type: 'html', html: ' ' } + return { type: 'html', html: ' ' }; } return { @@ -52,7 +52,7 @@ CKEDITOR.dialog.add( 'cellProperties', function( editor ) { }, commit: function( selectedCell ) { var unit = this.getDialog().getValueOf( 'info', 'widthType' ); - if ( this.getValue() != '' ) + if ( this.getValue() !== '' ) selectedCell.$.style.width = this.getValue() + unit; else selectedCell.$.style.width = ''; @@ -96,7 +96,7 @@ CKEDITOR.dialog.add( 'cellProperties', function( editor ) { this.setValue( heightMatch[ 1 ] ); }, commit: function( selectedCell ) { - if ( this.getValue() != '' ) + if ( this.getValue() !== '' ) selectedCell.$.style.height = this.getValue() + 'px'; else selectedCell.$.style.height = ''; @@ -174,9 +174,8 @@ CKEDITOR.dialog.add( 'cellProperties', function( editor ) { else selectedCell.removeAttribute( 'vAlign' ); } - }, - - ] + } + ] }, spacer(), { diff --git a/_source/plugins/tabletools/plugin.js b/_source/plugins/tabletools/plugin.js index 9b0a734987..9764f2ece6 100644 --- a/_source/plugins/tabletools/plugin.js +++ b/_source/plugins/tabletools/plugin.js @@ -55,7 +55,7 @@ For licensing, see LICENSE.html or http://ckeditor.com/license var c = -1; for ( var j = 0; j < $rows[ i ].cells.length; j++ ) { - var $cell = $row[ i ].cells[ j ]; + var $cell = $rows[ i ].cells[ j ]; c++; while ( map[ r ][ c ] ) @@ -68,7 +68,7 @@ For licensing, see LICENSE.html or http://ckeditor.com/license if ( !map[ r + rs ] ) map[ r + rs ] = []; - for ( var cs = 0; cs < colspan; cs++ ) + for ( var cs = 0; cs < colSpan; cs++ ) map[ r + rs ][ c + cs ] = $rows[ i ].cells[ j ]; } @@ -101,9 +101,9 @@ For licensing, see LICENSE.html or http://ckeditor.com/license // Scan by rows and set colSpan. var maxCol = 0; - for ( var i = 0; i < tableMap.length; i++ ) { - for ( var j = 0; j < tableMap[ i ].length; j++ ) { - var $cell = tableMap[ i ][ j ]; + for ( i = 0; i < tableMap.length; i++ ) { + for ( j = 0; j < tableMap[ i ].length; j++ ) { + $cell = tableMap[ i ][ j ]; if ( !$cell ) continue; if ( j > maxCol ) @@ -118,11 +118,11 @@ For licensing, see LICENSE.html or http://ckeditor.com/license } // Scan by columns and set rowSpan. - for ( var i = 0; i <= maxCol; i++ ) { - for ( var j = 0; j < tableMap.length; j++ ) { + for ( i = 0; i <= maxCol; i++ ) { + for ( j = 0; j < tableMap.length; j++ ) { if ( !tableMap[ j ] ) continue; - var $cell = tableMap[ j ][ i ]; + $cell = tableMap[ j ][ i ]; if ( !$cell || $cell[ '_cke_rowScanned' ] ) continue; if ( tableMap[ j - 1 ] && tableMap[ j - 1 ][ i ] == $cell ) @@ -133,26 +133,26 @@ For licensing, see LICENSE.html or http://ckeditor.com/license } // Clear all temporary flags. - for ( var i = 0; i < tableMap.length; i++ ) { - for ( var j = 0; j < tableMap[ i ].length; j++ ) { - var $cell = tableMap[ i ][ j ]; + for ( i = 0; i < tableMap.length; i++ ) { + for ( j = 0; j < tableMap[ i ].length; j++ ) { + $cell = tableMap[ i ][ j ]; removeRawAttribute( $cell, '_cke_colScanned' ); removeRawAttribute( $cell, '_cke_rowScanned' ); } } // Insert physical rows and columns to table. - for ( var i = 0; i < tableMap.length; i++ ) { + for ( i = 0; i < tableMap.length; i++ ) { var $row = $table.ownerDocument.createElement( 'tr' ); - for ( var j = 0; j < tableMap[ i ].length; ) { - var $cell = tableMap[ i ][ j ]; + for ( j = 0; j < tableMap[ i ].length; ) { + $cell = tableMap[ i ][ j ]; if ( tableMap[ i - 1 ] && tableMap[ i - 1 ][ j ] == $cell ) { j += $cell.colSpan; continue; } $row.appendChild( $cell ); if ( rowSpanAttr != 'rowSpan' ) { - $cell.rowSpan = cell[ rowSpanAttr ]; + $cell.rowSpan = $cell[ rowSpanAttr ]; $cell.removeAttribute( rowSpanAttr ); } j += $cell.colSpan; @@ -214,7 +214,7 @@ For licensing, see LICENSE.html or http://ckeditor.com/license rowsToDelete[ row.$.rowIndex ] = row; } - for ( var i = rowsToDelete.length; i >= 0; i-- ) { + for ( i = rowsToDelete.length; i >= 0; i-- ) { if ( rowsToDelete[ i ] ) deleteRows( rowsToDelete[ i ] ); } @@ -280,12 +280,12 @@ For licensing, see LICENSE.html or http://ckeditor.com/license * Loop through all rows from down to up, coz it's possible that some rows * will be deleted. */ - for ( var i = table.$.rows.length - 1; i >= 0; i-- ) { + for ( i = table.$.rows.length - 1; i >= 0; i-- ) { // Get the row. var row = new CKEDITOR.dom.element( table.$.rows[ i ] ); // If the cell to be removed is the first one and the row has just one cell. - if ( cellIndex == 0 && row.$.cells.length == 1 ) { + if ( !cellIndex && row.$.cells.length == 1 ) { deleteRows( row ); continue; } @@ -559,4 +559,4 @@ For licensing, see LICENSE.html or http://ckeditor.com/license } } }); -})() +})(); diff --git a/_source/plugins/toolbar/plugin.js b/_source/plugins/toolbar/plugin.js index 0c4c21a7d8..e09f20dba0 100644 --- a/_source/plugins/toolbar/plugin.js +++ b/_source/plugins/toolbar/plugin.js @@ -262,7 +262,7 @@ CKEDITOR.config.toolbar_Full = [ * [ 'Source', '-', 'Bold', 'Italic' ] * ]; * // Load toolbar_Name where Name = Basic. - * CKEDITOR.config.toolbar = 'Basic'; + * CKEDITOR.config.toolbar = 'Basic'; */ CKEDITOR.config.toolbar = 'Full'; diff --git a/_source/plugins/wysiwygarea/plugin.js b/_source/plugins/wysiwygarea/plugin.js index 1b64f5cdac..6aff420b18 100644 --- a/_source/plugins/wysiwygarea/plugin.js +++ b/_source/plugins/wysiwygarea/plugin.js @@ -227,7 +227,7 @@ For licensing, see LICENSE.html or http://ckeditor.com/license domWindow = editor.window = new CKEDITOR.dom.window( domWindow ); domDocument = editor.document = new CKEDITOR.dom.document( domDocument ); - // Gecko/Webkit need some help when selecting control type elements. (#3448) + // Gecko/Webkit need some help when selecting control type elements. (#3448) if ( !( CKEDITOR.env.ie || CKEDITOR.env.opera ) ) { domDocument.on( 'mousedown', function( ev ) { var control = ev.data.getTarget(); diff --git a/_source/skins/office2003/reset.css b/_source/skins/office2003/reset.css index 96d1d5e8f0..e9cb51846e 100644 --- a/_source/skins/office2003/reset.css +++ b/_source/skins/office2003/reset.css @@ -68,11 +68,11 @@ For licensing, see LICENSE.html or http://ckeditor.com/license .cke_skin_office2003 input[type="text"], .cke_skin_office2003 input[type="password"] { - cursor: text; + cursor: text; } .cke_skin_office2003 input[type="text"][disabled], .cke_skin_office2003 input[type="password"][disabled] { - cursor: default; + cursor: default; } diff --git a/_source/skins/office2003/toolbar.css b/_source/skins/office2003/toolbar.css index f0a4bf401d..e861eba1fe 100644 --- a/_source/skins/office2003/toolbar.css +++ b/_source/skins/office2003/toolbar.css @@ -11,7 +11,7 @@ For licensing, see LICENSE.html or http://ckeditor.com/license } } -.cke_skin_office2003 a.cke_toolbox_collapser, +.cke_skin_office2003 a.cke_toolbox_collapser, .cke_skin_office2003 a:hover.cke_toolbox_collapser { background-image: url(images/arrowtop.gif); @@ -25,20 +25,20 @@ For licensing, see LICENSE.html or http://ckeditor.com/license cursor: pointer; } -.cke_skin_office2003 .cke_rtl a.cke_toolbox_collapser, +.cke_skin_office2003 .cke_rtl a.cke_toolbox_collapser, .cke_skin_office2003 .cke_rtl a:hover.cke_toolbox_collapser { float: left; } -.cke_skin_office2003 a.cke_toolbox_collapser_min, +.cke_skin_office2003 a.cke_toolbox_collapser_min, .cke_skin_office2003 a:hover.cke_toolbox_collapser_min { background-image: url(images/arrowleft.gif); margin: 2px; } -.cke_skin_office2003 .cke_rtl a.cke_toolbox_collapser_min, +.cke_skin_office2003 .cke_rtl a.cke_toolbox_collapser_min, .cke_skin_office2003 .cke_rtl a:hover.cke_toolbox_collapser_min { background-image: url(images/arrowright.gif); diff --git a/_source/skins/v2/reset.css b/_source/skins/v2/reset.css index e0ed9f1680..b9f820bc92 100644 --- a/_source/skins/v2/reset.css +++ b/_source/skins/v2/reset.css @@ -68,11 +68,11 @@ For licensing, see LICENSE.html or http://ckeditor.com/license .cke_skin_v2 input[type="text"], .cke_skin_v2 input[type="password"] { - cursor: text; + cursor: text; } .cke_skin_v2 input[type="text"][disabled], .cke_skin_v2 input[type="password"][disabled] { - cursor: default; + cursor: default; } diff --git a/_source/skins/v2/toolbar.css b/_source/skins/v2/toolbar.css index eb95471759..77d78cf1a0 100644 --- a/_source/skins/v2/toolbar.css +++ b/_source/skins/v2/toolbar.css @@ -16,7 +16,7 @@ For licensing, see LICENSE.html or http://ckeditor.com/license } } -.cke_skin_v2 a.cke_toolbox_collapser, +.cke_skin_v2 a.cke_toolbox_collapser, .cke_skin_v2 a:hover.cke_toolbox_collapser { background-image: url(images/arrowtop.gif); @@ -30,20 +30,20 @@ For licensing, see LICENSE.html or http://ckeditor.com/license cursor: pointer; } -.cke_skin_v2 .cke_rtl a.cke_toolbox_collapser, +.cke_skin_v2 .cke_rtl a.cke_toolbox_collapser, .cke_skin_v2 .cke_rtl a:hover.cke_toolbox_collapser { float: left; } -.cke_skin_v2 a.cke_toolbox_collapser_min, +.cke_skin_v2 a.cke_toolbox_collapser_min, .cke_skin_v2 a:hover.cke_toolbox_collapser_min { background-image: url(images/arrowleft.gif); margin: 2px; } -.cke_skin_v2 .cke_rtl a.cke_toolbox_collapser_min, +.cke_skin_v2 .cke_rtl a.cke_toolbox_collapser_min, .cke_skin_v2 .cke_rtl a:hover.cke_toolbox_collapser_min { background-image: url(images/arrowright.gif); diff --git a/_source/tests/core/dom/document.html b/_source/tests/core/dom/document.html index a288fdef3c..5c25590e39 100644 --- a/_source/tests/core/dom/document.html +++ b/_source/tests/core/dom/document.html @@ -105,7 +105,7 @@ assert.areSame( 'target', node.getText(), 'Addressing target doesn\'t match.' ); }, - + test_getElementsByTag : function() { var nodeList = new CKEDITOR.dom.document( document ).getElementsByTag( 'span' ), diff --git a/_source/tests/core/dom/element.html b/_source/tests/core/dom/element.html index 424e09ec6b..21e6366c65 100644 --- a/_source/tests/core/dom/element.html +++ b/_source/tests/core/dom/element.html @@ -400,9 +400,9 @@ var element = new CKEDITOR.dom.element( document.getElementById( 'tabIndexScriptDef' ) ); assert.areEqual( null, element.getAttribute( 'tabindex' ) ); }, - + /** - * Test getAttribute and getAttribute will ingore '_cke_expando' attribute. + * Test getAttribute and getAttribute will ingore '_cke_expando' attribute. */ test_getAttribute_ignoreExpandoAttributes : function() { @@ -413,7 +413,7 @@ element.removeAttribute( 'class' ); if( CKEDITOR.env.ie ) assert.areEqual( 'FLOAT: right', element.getAttribute( 'style' ) ); - else + else assert.areEqual( 'float: right;', element.getAttribute( 'style' ) ); element.removeAttribute( 'style' ); element.removeAttribute( 'id' ); diff --git a/_source/tests/core/dom/range.html b/_source/tests/core/dom/range.html index d20947337f..0d63fefd0a 100644 --- a/_source/tests/core/dom/range.html +++ b/_source/tests/core/dom/range.html @@ -1036,7 +1036,7 @@ assert.areSame( 2, range.endOffset, 'range.endOffset' ); assert.isFalse( range.collapsed, 'range.collapsed' ); }, - + test_enlarge_block4 : function() { var range = getRange( 'S7', null ); @@ -1733,7 +1733,7 @@ assert.areSame( 5, range.endOffset, 'range.endOffset' ); assert.isFalse( range.collapsed, 'range.collapsed' ); }, - + test_checkStartOfBlock1 : function() { var p = doc.getById( 'playground' ); @@ -1744,7 +1744,7 @@ range.setStartAt( p, CKEDITOR.POSITION_AFTER_START ); range.collapse( true ); - + assert.isTrue( range.checkStartOfBlock() ); }, @@ -1758,7 +1758,7 @@ range.setStartAt( p, CKEDITOR.POSITION_BEFORE_END ); range.collapse( true ); - + assert.isFalse( range.checkStartOfBlock() ); }, @@ -1772,7 +1772,7 @@ range.setStartAt( p.getFirst(), CKEDITOR.POSITION_AFTER_START ); range.collapse( true ); - + assert.isTrue( range.checkStartOfBlock() ); }, @@ -1786,7 +1786,7 @@ range.setStartAt( p.getFirst(), CKEDITOR.POSITION_BEFORE_END ); range.collapse( true ); - + assert.isFalse( range.checkStartOfBlock() ); }, @@ -1802,7 +1802,7 @@ // So, let's just check it and make it pass. range.setStart( el, ( el.substring( 0, 1 ) == 'T' ) ? 0 : 1 ); range.collapse( true ); - + assert.isTrue( range.checkStartOfBlock() ); }, @@ -1816,7 +1816,7 @@ range.setStart( p.getFirst(), 5 ); range.collapse( true ); - + assert.isFalse( range.checkStartOfBlock() ); }, @@ -1828,7 +1828,7 @@ var range = new CKEDITOR.dom.range( doc ); range.selectNodeContents( el ); - + assert.isTrue( range.checkStartOfBlock() ); }, @@ -1840,7 +1840,7 @@ var range = new CKEDITOR.dom.range( doc ); range.selectNodeContents( el ); - + assert.isFalse( range.checkStartOfBlock() ); }, @@ -1854,7 +1854,7 @@ range.setStartAt( p, CKEDITOR.POSITION_AFTER_START ); range.collapse( true ); - + assert.isFalse( range.checkEndOfBlock() ); }, @@ -1868,7 +1868,7 @@ range.setStartAt( p, CKEDITOR.POSITION_BEFORE_END ); range.collapse( true ); - + assert.isTrue( range.checkEndOfBlock() ); }, @@ -1882,7 +1882,7 @@ range.setStartAt( p.getFirst(), CKEDITOR.POSITION_AFTER_START ); range.collapse( true ); - + assert.isFalse( range.checkEndOfBlock() ); }, @@ -1896,7 +1896,7 @@ range.setStartAt( p.getFirst(), CKEDITOR.POSITION_BEFORE_END ); range.collapse( true ); - + assert.isTrue( range.checkEndOfBlock() ); }, @@ -1910,7 +1910,7 @@ range.setStart( p.getFirst(), 1 ); range.collapse( true ); - + assert.isFalse( range.checkEndOfBlock() ); }, @@ -1924,7 +1924,7 @@ range.setStart( p.getFirst(), 5 ); range.collapse( true ); - + assert.isTrue( range.checkEndOfBlock() ); }, @@ -1936,7 +1936,7 @@ var range = new CKEDITOR.dom.range( doc ); range.selectNodeContents( el ); - + assert.isTrue( range.checkEndOfBlock() ); }, @@ -1948,7 +1948,7 @@ var range = new CKEDITOR.dom.range( doc ); range.selectNodeContents( el ); - + assert.isFalse( range.checkEndOfBlock() ); }, diff --git a/_source/tests/core/dom/walker.html b/_source/tests/core/dom/walker.html index 9e553abcef..8c978f9270 100644 --- a/_source/tests/core/dom/walker.html +++ b/_source/tests/core/dom/walker.html @@ -18,11 +18,11 @@ var assert = CKEDITOR.test.assert; var doc = new CKEDITOR.dom.document( document ); - + function assertNodesList( wanted, nodes ) { var simplifiedNodes = []; - + for ( var i = 0 ; i < nodes.length ; i++ ) simplifiedNodes.push( nodes[i].type == CKEDITOR.NODE_TEXT ? nodes[i].getText() : ( '<' + nodes[i].getName() + '>' ) ); @@ -40,9 +40,9 @@ range.setStartAt( node.getFirst(), CKEDITOR.POSITION_AFTER_START ); range.collapse( true ); - + var walker = new CKEDITOR.dom.walker( range ); - + assert.isNull( walker.next() ); }, @@ -53,15 +53,12 @@ var range = new CKEDITOR.dom.range( doc ); range.selectNodeContents( node ); - + var walker = new CKEDITOR.dom.walker( range ); - var nodes = [], - node; - while ( node = walker.next() ) - { + var nodes = []; + while ( ( node = walker.next() ) ) nodes.push( node ); - } assertNodesList( [ '

', 'This is ', '', 'a ', '', 'simple', ' test' ], nodes ); }, @@ -74,15 +71,12 @@ var range = new CKEDITOR.dom.range( doc ); range.setStartAt( node.getFirst(), CKEDITOR.POSITION_AFTER_START ); range.setEnd( node.getChild( [0,1,1,0] ), 2 ); - + var walker = new CKEDITOR.dom.walker( range ); - var nodes = [], - node; - while ( node = walker.next() ) - { + var nodes = []; + while ( ( node = walker.next() ) ) nodes.push( node ); - } assertNodesList( [ 'This is ', '', 'a ', '', 'si' ], nodes ); }, @@ -95,15 +89,12 @@ var range = new CKEDITOR.dom.range( doc ); range.setStartAt( node.getChild( 1 ), CKEDITOR.POSITION_BEFORE_START ); range.setEndAt( node.getChild( 1 ), CKEDITOR.POSITION_AFTER_START ); - + var walker = new CKEDITOR.dom.walker( range ); - var nodes = [], - node; - while ( node = walker.next() ) - { + var nodes = []; + while ( ( node = walker.next() ) ) nodes.push( node ); - } assertNodesList( [ '

' ], nodes ); }, @@ -116,15 +107,12 @@ var range = new CKEDITOR.dom.range( doc ); range.setStartAt( node.getChild( 0 ), CKEDITOR.POSITION_BEFORE_END ); range.setEndAt( node.getChild( 0 ), CKEDITOR.POSITION_AFTER_END ); - + var walker = new CKEDITOR.dom.walker( range ); - var nodes = [], - node; - while ( node = walker.next() ) - { + var nodes = []; + while ( ( node = walker.next() ) ) nodes.push( node ); - } assertNodesList( [], nodes ); }, @@ -137,15 +125,12 @@ var range = new CKEDITOR.dom.range( doc ); range.setStartAt( node.getChild( 0 ), CKEDITOR.POSITION_BEFORE_END ); range.setEndAt( node.getChild( 1 ), CKEDITOR.POSITION_AFTER_START ); - + var walker = new CKEDITOR.dom.walker( range ); - var nodes = [], - node; - while ( node = walker.next() ) - { + var nodes = []; + while ( ( node = walker.next() ) ) nodes.push( node ); - } assertNodesList( [ '

' ], nodes ); }, @@ -157,15 +142,12 @@ var range = new CKEDITOR.dom.range( doc ); range.selectNodeContents( node ); - + var walker = new CKEDITOR.dom.walker( range ); - var nodes = [], - node; - while ( node = walker.previous() ) - { + var nodes = []; + while ( ( node = walker.previous() ) ) nodes.push( node ); - } assertNodesList( [ '

', ' test', '', '', 'simple', 'a ', 'This is ' ], nodes ); }, @@ -178,15 +160,12 @@ var range = new CKEDITOR.dom.range( doc ); range.setEnd( node.getChild( [0,0] ), 2 ); range.setEnd( node.getChild( [0,1,1,0] ), 2 ); - + var walker = new CKEDITOR.dom.walker( range ); - var nodes = [], - node; - while ( node = walker.previous() ) - { + var nodes = []; + while ( ( node = walker.previous() ) ) nodes.push( node ); - } assertNodesList( [ 'si', 'a ', 'is is ' ], nodes ); }, @@ -199,15 +178,12 @@ var range = new CKEDITOR.dom.range( doc ); range.setStartAt( node.getChild( 1 ), CKEDITOR.POSITION_BEFORE_START ); range.setEndAt( node.getChild( 1 ), CKEDITOR.POSITION_AFTER_START ); - + var walker = new CKEDITOR.dom.walker( range ); - var nodes = [], - node; - while ( node = walker.previous() ) - { + var nodes = []; + while ( ( node = walker.previous() ) ) nodes.push( node ); - } assertNodesList( [ '' ], nodes ); }, @@ -220,15 +196,12 @@ var range = new CKEDITOR.dom.range( doc ); range.setStartAt( node.getChild( 0 ), CKEDITOR.POSITION_BEFORE_END ); range.setEndAt( node.getChild( 0 ), CKEDITOR.POSITION_AFTER_END ); - + var walker = new CKEDITOR.dom.walker( range ); - var nodes = [], - node; - while ( node = walker.previous() ) - { + var nodes = []; + while ( ( node = walker.previous() ) ) nodes.push( node ); - } assertNodesList( [ '

' ], nodes ); }, @@ -241,15 +214,12 @@ var range = new CKEDITOR.dom.range( doc ); range.setStartAt( node.getChild( 0 ), CKEDITOR.POSITION_BEFORE_END ); range.setEndAt( node.getChild( 1 ), CKEDITOR.POSITION_AFTER_START ); - + var walker = new CKEDITOR.dom.walker( range ); - var nodes = [], - node; - while ( node = walker.previous() ) - { + var nodes = []; + while ( ( node = walker.previous() ) ) nodes.push( node ); - } assertNodesList( [ '

' ], nodes ); }, @@ -264,16 +234,18 @@ var range = new CKEDITOR.dom.range( doc ); range.selectNodeContents( node ); - + var walker = new CKEDITOR.dom.walker( range ); - var nodes = [], - node; - walker.guard = function( node ){ + var nodes = []; + + walker.guard = function( node ) + { nodes.push( node ); return true; }; - while ( node = walker.next() ) - {} + + while ( ( node = walker.next() ) ) + { /*jsl:pass*/ } assertNodesList( [ '

', 'This is ', '', 'a ', '', 'simple', '', '',' test' , '

' ], nodes ); }, @@ -288,16 +260,18 @@ var range = new CKEDITOR.dom.range( doc ); range.selectNodeContents( node ); - + var walker = new CKEDITOR.dom.walker( range ); - var nodes = [], - node; - walker.guard = function( node ){ + var nodes = []; + + walker.guard = function( node ) + { nodes.push( node ); return true; }; - while ( node = walker.previous() ) - {} + + while ( ( node = walker.previous() ) ) + { /*jsl:pass*/ } assertNodesList( [ '

', ' test', '', '', 'simple', '', 'a ', '', 'This is ', '

' ], nodes ); }, @@ -312,16 +286,18 @@ var range = new CKEDITOR.dom.range( doc ); range.selectNodeContents( node ); - + var walker = new CKEDITOR.dom.walker( range ); - var nodes = [], - node; - walker.evaluator = function( node ){ + var nodes = []; + + walker.evaluator = function( node ) + { nodes.push( node ); return true; }; - while ( node = walker.previous() ) - {} + + while ( ( node = walker.previous() ) ) + { /*jsl:pass*/ } assertNodesList( [ '

', ' test', '', '', 'simple', 'a ', 'This is ' ], nodes ); }, @@ -336,4 +312,4 @@

- \ No newline at end of file + diff --git a/_source/tests/core/htmlparser/fragment.html b/_source/tests/core/htmlparser/fragment.html index 129e11ec60..f5e2a42bed 100644 --- a/_source/tests/core/htmlparser/fragment.html +++ b/_source/tests/core/htmlparser/fragment.html @@ -93,9 +93,9 @@ testParser( '

text

', '

text

' ); }, - + /** - * Test remove multiple empty inline elements. + * Test remove multiple empty inline elements. */ test_parser_8_2 : function() { @@ -117,7 +117,7 @@ testParser( '
A
', '
A
' ); }, - + /** * Test fixing paragraph inside table row. */ @@ -126,7 +126,7 @@ testParser( '

2

13
', '

2

13
' ); }, - + /** * Test fixing paragraph inside list. */ @@ -144,7 +144,7 @@ testParser( '

1

2
3

', '

1

2

3

' ); }, - + name : document.title }; })() ); diff --git a/_source/tests/plugins/domiterator/domiterator.html b/_source/tests/plugins/domiterator/domiterator.html index f103a8f146..100c1894e1 100644 --- a/_source/tests/plugins/domiterator/domiterator.html +++ b/_source/tests/plugins/domiterator/domiterator.html @@ -18,7 +18,7 @@ /** * IE always returning CRLF for linefeed, so remove it when retrieve pre-formated text from text area. * @param {Object} id - */ + */ function getTextAreaValue( id ) { return CKEDITOR.document.getById( id ).getValue().replace(/\r/gi,''); @@ -26,11 +26,11 @@ CKEDITOR.test.addTestCase( (function() { - + // Local references. var assert = CKEDITOR.test.assert, arrayAssert = YAHOO.util.ArrayAssert; - + var doc = new CKEDITOR.dom.document( document ); // In these tests, we may "reset" the writer rules to avoid it formatting @@ -60,7 +60,7 @@ var html = getDataProcessor().toDataFormat( container.getHtml() ); assert.areSame( getTextAreaValue( textareaId ) , html ); } - + function assumeElementAreSame( element, textareaId ) { if( typeof element == 'string' ) @@ -69,9 +69,9 @@ var html = getDataProcessor().toDataFormat( element.getOuterHtml() ); assert.areSame( getTextAreaValue( textareaId ) , html ); } - + /** - * + * * @param {String|CKEDITOR.dom.range} containerId|range Either the id of html container which contents are treated as range, or a exisiting range object. * @param {Object} iteratorOption * @param {Array} expectedTagList block elements tagName list in iteration orders. @@ -86,19 +86,19 @@ } else range = containerIdOrRange; - + var iter = range.createIterator(); CKEDITOR.tools.extend( iter, iteratorOption, true ); var blockList = [], block; - while (( block = iter.getNextParagraph() ) ) + while (( block = iter.getNextParagraph() ) ) { blockList.push( block.getName() ); } arrayAssert.itemsAreEqual( expectedTagList, blockList ); } - + return { - + /** * Test iterating over table cells. */ @@ -196,10 +196,10 @@ head1 - +

cell1

- + cell2
@@ -210,9 +210,9 @@
  • item2

    • item3
    -
    • item5

    +
    • item5

  • -
  • item5
  • +
  • item5
  • diff --git a/_source/tests/plugins/list/list.html b/_source/tests/plugins/list/list.html index 734e092531..5230997fee 100755 --- a/_source/tests/plugins/list/list.html +++ b/_source/tests/plugins/list/list.html @@ -20,9 +20,9 @@ CKEDITOR.on( 'instanceReady', function( evt ) { - var isMe = mode == CKEDITOR.ELEMENT_MODE_REPLACE ? + var isMe = mode == CKEDITOR.ELEMENT_MODE_REPLACE ? evt.editor.name == elementId - : evt.editor.element.$ == + : evt.editor.element.$ == document.getElementById( elementId ); if ( isMe ) { @@ -53,9 +53,9 @@ CKEDITOR.test.addTestCase( ( function() { - + // Local references. - var assert = CKEDITOR.test.assert, + var assert = CKEDITOR.test.assert, doc = CKEDITOR.document, action = YAHOO.util.UserAction, selector = YAHOO.util.Selector; @@ -64,15 +64,15 @@ * Set the range with the start/end position specified by the locator, which in form of bookmark2. * @param {Object} range * @param {Array} startPosition range start path including offset - * @param {Array|Boolean} endPositoin range end path including offset or is collapsed + * @param {Array|Boolean} endPositoin range end path including offset or is collapsed */ function setRange( range, startPosition, endPositoin ) { var bm = { - end : null, - start : null, - is2: true, - startOffset : 0, + end : null, + start : null, + is2: true, + startOffset : 0, endoffset : 0 }; bm.start = startPosition.slice( 0, startPosition.length - 1 ); @@ -91,42 +91,42 @@ } return { - + /** - * Test remove numbered list with 'enterMode = BR'. + * Test remove numbered list with 'enterMode = BR'. */ test_ticket_3151 : function() { - prepareEditor( 'test_ticket_3151_editor', null, - { enterMode : CKEDITOR.ENTER_BR }, + prepareEditor( 'test_ticket_3151_editor', null, + { enterMode : CKEDITOR.ENTER_BR }, function( editor ) { this.resume( function() { editor.focus(); - + // Force result data unformatted. editor.dataProcessor.writer._.rules = {}; - - var doc = editor.document, + + var doc = editor.document, range = new CKEDITOR.dom.range( doc ); - + setRange( range, [ 1, 0, 0, 0, 0 ], true ); var sel = editor.getSelection(); sel.selectRanges( [ range ] ); - + // Waiting for 'comand state' effected. this.wait( function(){ // Remove list. editor.execCommand( 'numberedlist' ); - assert.areSame( getTextAreaValue( 'test_ticket_3151_resultContent' ), - editor.getData(), + assert.areSame( getTextAreaValue( 'test_ticket_3151_resultContent' ), + editor.getData(), 'Remove list result not correct.' ); }, 1000); - + } ); }, this ); - this.wait(); + this.wait(); }, name :document.title @@ -162,9 +162,9 @@ CKEDITOR.on( 'instanceReady', function( evt ) { - var isMe = mode == CKEDITOR.ELEMENT_MODE_REPLACE ? + var isMe = mode == CKEDITOR.ELEMENT_MODE_REPLACE ? evt.editor.name == elementId - : evt.editor.element.$ == + : evt.editor.element.$ == document.getElementById( elementId ); if ( isMe ) { @@ -195,9 +195,9 @@ CKEDITOR.test.addTestCase( ( function() { - + // Local references. - var assert = CKEDITOR.test.assert, + var assert = CKEDITOR.test.assert, doc = CKEDITOR.document, action = YAHOO.util.UserAction, selector = YAHOO.util.Selector; @@ -206,15 +206,15 @@ * Set the range with the start/end position specified by the locator, which in form of bookmark2. * @param {Object} range * @param {Array} startPosition range start path including offset - * @param {Array|Boolean} endPositoin range end path including offset or is collapsed + * @param {Array|Boolean} endPositoin range end path including offset or is collapsed */ function setRange( range, startPosition, endPositoin ) { var bm = { - end : null, - start : null, - is2: true, - startOffset : 0, + end : null, + start : null, + is2: true, + startOffset : 0, endoffset : 0 }; bm.start = startPosition.slice( 0, startPosition.length - 1 ); @@ -233,42 +233,42 @@ } return { - + /** - * Test remove numbered list with 'enterMode = BR'. + * Test remove numbered list with 'enterMode = BR'. */ test_ticket_3151 : function() { - prepareEditor( 'test_ticket_3151_editor', null, - { enterMode : CKEDITOR.ENTER_BR }, + prepareEditor( 'test_ticket_3151_editor', null, + { enterMode : CKEDITOR.ENTER_BR }, function( editor ) { this.resume( function() { editor.focus(); - + // Force result data unformatted. editor.dataProcessor.writer._.rules = {}; - - var doc = editor.document, + + var doc = editor.document, range = new CKEDITOR.dom.range( doc ); - + setRange( range, [ 1, 0, 0, 0, 0 ], true ); var sel = editor.getSelection(); sel.selectRanges( [ range ] ); - + // Waiting for 'comand state' effected. this.wait( function(){ // Remove list. editor.execCommand( 'numberedlist' ); - assert.areSame( getTextAreaValue( 'test_ticket_3151_resultContent' ), - editor.getData(), + assert.areSame( getTextAreaValue( 'test_ticket_3151_resultContent' ), + editor.getData(), 'Remove list result not correct.' ); }, 1000); - + } ); }, this ); - this.wait(); + this.wait(); }, name :document.title diff --git a/_source/tests/plugins/styles/styles.html b/_source/tests/plugins/styles/styles.html index d7fc82f1b2..4697a111d2 100644 --- a/_source/tests/plugins/styles/styles.html +++ b/_source/tests/plugins/styles/styles.html @@ -427,8 +427,8 @@ var range = new CKEDITOR.dom.range( doc ); range.selectNodeContents( element ); - - var styleDef = + + var styleDef = { element : 'span', styles : { 'font-family' : '#(family)' }, diff --git a/contents.css b/contents.css index 8e45af47da..b50657a016 100644 --- a/contents.css +++ b/contents.css @@ -21,4 +21,3 @@ img:-moz-broken width : 24px; height : 24px; } -