Skip to content

Commit

Permalink
Run jslint and fixlinebreaks.
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.ckeditor.com/CKEditor/trunk@3477 da63caf2-3823-0410-a1e8-d69ccee00dfb
  • Loading branch information
fredck committed May 10, 2009
1 parent 657a68a commit d911779
Show file tree
Hide file tree
Showing 36 changed files with 233 additions and 254 deletions.
4 changes: 2 additions & 2 deletions _source/core/ckeditor_base.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand All @@ -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'
Expand Down
5 changes: 3 additions & 2 deletions _source/core/dom/range.js
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,7 @@ CKEDITOR.dom.range = function( document ) {
return false;
}
}
return true;
};
}

Expand Down Expand Up @@ -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(
Expand All @@ -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() ) )
Expand Down
10 changes: 5 additions & 5 deletions _source/core/dom/walker.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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.
Expand All @@ -65,7 +65,7 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
return false;

return userGuard( node );
}
};
} else
guard = stopGuard;

Expand Down Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion _source/core/env.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ if ( !CKEDITOR.env ) {
env.ie6Compat = ( version < 7 || env.quirks );

/**
* Indicate IE8.
* Indicate IE8.
*/
env.ie8 = ( version >= 8 );
}
Expand Down
2 changes: 1 addition & 1 deletion _source/core/htmlparser/element.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion _source/lang/_translationstatus.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
zh.js Found: 328 Missing: 68
2 changes: 1 addition & 1 deletion _source/plugins/button/plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion _source/plugins/clipboard/plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 2 additions & 3 deletions _source/plugins/colorbutton/plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -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: [ {
Expand Down
2 changes: 1 addition & 1 deletion _source/plugins/contextmenu/plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 )
Expand Down
2 changes: 1 addition & 1 deletion _source/plugins/dialog/plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
Expand Down
4 changes: 2 additions & 2 deletions _source/plugins/domiterator/plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 ) {
Expand Down Expand Up @@ -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 );
Expand Down
9 changes: 6 additions & 3 deletions _source/plugins/find/dialogs/find.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
}

/**
Expand Down Expand Up @@ -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 );
Expand Down Expand Up @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion _source/plugins/htmldataprocessor/plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
3 changes: 2 additions & 1 deletion _source/plugins/maximize/plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -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' );
Expand Down
7 changes: 4 additions & 3 deletions _source/plugins/selection/plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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 };
Expand Down Expand Up @@ -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();
Expand All @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion _source/plugins/sourcearea/plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ CKEDITOR.plugins.add( 'sourcearea', {
return {
height: holderElement.$.clientHeight + 'px',
width: holderElement.$.clientWidth + 'px'
}
};
}

onResize = function() {
Expand Down
22 changes: 11 additions & 11 deletions _source/plugins/styles/plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
Expand Down Expand Up @@ -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 );
Expand Down Expand Up @@ -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 );
Expand Down Expand Up @@ -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 ] );
}
Expand All @@ -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:
Expand All @@ -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 );
}
}
Expand Down
6 changes: 3 additions & 3 deletions _source/plugins/table/dialogs/table.js
Original file line number Diff line number Diff line change
Expand Up @@ -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' );
}
}
Expand Down Expand Up @@ -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' );
}
Expand All @@ -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' );
}
Expand Down
Loading

0 comments on commit d911779

Please sign in to comment.