Skip to content

Commit

Permalink
Apply automated code style fixes on project (exclude lang file and yu…
Browse files Browse the repository at this point in the history
…i.js).
  • Loading branch information
Piotr Jasiun committed Dec 10, 2013
1 parent ef0febb commit 0c63d85
Show file tree
Hide file tree
Showing 173 changed files with 1,253 additions and 1,239 deletions.
4 changes: 2 additions & 2 deletions adapters/jquery.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -372,4 +372,4 @@
};
} );
}
})( window.jQuery );
} )( window.jQuery );
4 changes: 2 additions & 2 deletions ckeditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ else {
script.type = 'text/javascript';
script.src = CKEDITOR.getUrl( 'core/loader.js' );
document.body.appendChild( script );
} else {
} else
document.write( '<script type="text/javascript" src="' + CKEDITOR.getUrl( 'core/loader.js' ) + '"></script>' );
}

}

/**
Expand Down
4 changes: 2 additions & 2 deletions core/_bootstrap.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @fileOverview API initialization code.
*/

(function() {
( function() {
// Disable HC detection in WebKit. (#5429)
if ( CKEDITOR.env.webkit )
CKEDITOR.env.hc = false;
Expand Down Expand Up @@ -49,7 +49,7 @@
CKEDITOR.add( pending[ i ][ 0 ] );
}
}
})();
} )();

/**
* Indicates that CKEditor is running on a High Contrast environment.
Expand Down
14 changes: 7 additions & 7 deletions core/ckeditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
};
Expand All @@ -70,7 +70,7 @@ CKEDITOR.remove = function( editor ) {
delete CKEDITOR.instances[ editor.name ];
};

(function() {
( function() {
var tpls = {};

/**
Expand Down Expand Up @@ -102,9 +102,9 @@ CKEDITOR.remove = function( editor ) {
CKEDITOR.getTemplate = function( name ) {
return tpls[ name ];
};
})();
} )();

(function() {
( function() {
var styles = [];

/**
Expand Down Expand Up @@ -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%
Expand Down
12 changes: 6 additions & 6 deletions core/ckeditor_base.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ if ( !window.CKEDITOR ) {
* @class CKEDITOR
* @singleton
*/
window.CKEDITOR = (function() {
window.CKEDITOR = ( function() {
var CKEDITOR = {

/**
Expand Down Expand Up @@ -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".

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -194,7 +194,7 @@ if ( !window.CKEDITOR ) {
* @method
* @todo
*/
domReady: (function() {
domReady: ( function() {
// Based on the original jQuery code.

var callbacks = [];
Expand Down Expand Up @@ -276,7 +276,7 @@ if ( !window.CKEDITOR ) {
}
};

})()
} )()
};

// Make it possible to override the "url" function with a custom
Expand All @@ -290,7 +290,7 @@ if ( !window.CKEDITOR ) {
}

return CKEDITOR;
})();
} )();
}

/**
Expand Down
8 changes: 4 additions & 4 deletions core/ckeditor_basic.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
*/

if ( CKEDITOR.status == 'unloaded' ) {
(function() {
( function() {
CKEDITOR.event.implementOn( CKEDITOR );

/**
Expand Down Expand Up @@ -66,7 +66,7 @@ if ( CKEDITOR.status == 'unloaded' ) {
pending.push( editor );
};

(function() {
( function() {
var onload = function() {
var loadFullCore = CKEDITOR.loadFullCore,
loadFullCoreTimeout = CKEDITOR.loadFullCoreTimeout;
Expand All @@ -87,8 +87,8 @@ if ( CKEDITOR.status == 'unloaded' ) {
};

CKEDITOR.domReady( onload );
})();
} )();

CKEDITOR.status = 'basic_loaded';
})();
} )();
}
4 changes: 2 additions & 2 deletions core/command.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 );
Expand Down
4 changes: 2 additions & 2 deletions core/creators/inline.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* For licensing, see LICENSE.md or http://ckeditor.com/license
*/

(function() {
( function() {
/** @class CKEDITOR */

/**
Expand Down Expand Up @@ -141,7 +141,7 @@
CKEDITOR.domReady( function() {
!CKEDITOR.disableAutoInline && CKEDITOR.inlineAll();
} );
})();
} )();

/**
* Disables creating the inline editor automatically for elements with
Expand Down
25 changes: 12 additions & 13 deletions core/creators/themedui.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*/
CKEDITOR.replaceClass = 'ckeditor';

(function() {
( function() {
/**
* Replaces a `<textarea>` or a DOM element (`<div>`) with a CKEditor
* instance. For textareas, the initial value in the editor will be the
Expand Down Expand Up @@ -76,7 +76,7 @@ CKEDITOR.replaceClass = 'ckeditor';
* // You can also customize the editor instance by having the function
* // modify the "config" parameter.
* } );
*
*
* @param {String} [className] The `<textarea>` class name.
* @param {Function} [function] An assertion function that must return `true` for a `<textarea>`
* to be replaced with the editor. If the function returns `false`, the `<textarea>` element
Expand Down Expand Up @@ -171,16 +171,15 @@ CKEDITOR.replaceClass = 'ckeditor';
// Set the current mode.
editor.mode = newMode;

if ( isDirty !== undefined ) {
if ( isDirty !== undefined )
!isDirty && editor.resetDirty();
}

// Delay to avoid race conditions (setMode inside setMode).
setTimeout( function() {
editor.fire( 'mode' );
callback && callback.call( editor );
}, 0);
});
}, 0 );
} );
};

/**
Expand Down Expand Up @@ -280,8 +279,8 @@ CKEDITOR.replaceClass = 'ckeditor';
editor.status = 'ready';
editor.fireOnce( 'instanceReady' );
CKEDITOR.fire( 'instanceReady', null, editor );
});
});
} );
} );

editor.on( 'destroy', destroy );
return editor;
Expand Down Expand Up @@ -336,7 +335,7 @@ CKEDITOR.replaceClass = 'ckeditor';
'</{outerEl}>' );
}

var container = CKEDITOR.dom.element.createFromHtml( themedTpl.output({
var container = CKEDITOR.dom.element.createFromHtml( themedTpl.output( {
id: editor.id,
name: name,
langDir: editor.lang.dir,
Expand All @@ -346,7 +345,7 @@ CKEDITOR.replaceClass = 'ckeditor';
contentId: editor.ui.spaceId( 'contents' ),
bottomHtml: bottomHtml ? '<span id="' + editor.ui.spaceId( 'bottom' ) + '" class="cke_bottom cke_reset_all" role="presentation">' + bottomHtml + '</span>' : '',
outerEl: CKEDITOR.env.ie ? 'span' : 'div' // #9571
}));
} ) );

if ( elementMode == CKEDITOR.ELEMENT_MODE_REPLACE ) {
element.hide();
Expand Down Expand Up @@ -375,16 +374,16 @@ CKEDITOR.replaceClass = 'ckeditor';
// Redirect the focus into editor for webkit. (#5713)
CKEDITOR.env.webkit && container.on( 'focus', function() {
editor.focus();
});
} );

editor.fireOnce( 'uiReady' );
}

// Replace all textareas with the default class name.
CKEDITOR.domReady( function() {
CKEDITOR.replaceClass && CKEDITOR.replaceAll( CKEDITOR.replaceClass );
});
})();
} );
} )();

/**
* The current editing mode. An editing mode basically provides
Expand Down
2 changes: 1 addition & 1 deletion core/dom/comment.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,4 @@ CKEDITOR.tools.extend( CKEDITOR.dom.comment.prototype, {
getOuterHtml: function() {
return '<!--' + this.$.nodeValue + '-->';
}
});
} );
9 changes: 4 additions & 5 deletions core/dom/document.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,11 @@ CKEDITOR.tools.extend( CKEDITOR.dom.document.prototype, {
this.$.createStyleSheet( cssFileUrl );
else {
var link = new CKEDITOR.dom.element( 'link' );
link.setAttributes({
link.setAttributes( {
rel: 'stylesheet',
type: 'text/css',
href: cssFileUrl
});
} );

this.getHead().append( link );
}
Expand Down Expand Up @@ -162,9 +162,8 @@ CKEDITOR.tools.extend( CKEDITOR.dom.document.prototype, {
for ( var j = 0; j < $.childNodes.length; j++ ) {
var candidate = $.childNodes[ j ];

if ( normalized === true && candidate.nodeType == 3 && candidate.previousSibling && candidate.previousSibling.nodeType == 3 ) {
if ( normalized === true && candidate.nodeType == 3 && candidate.previousSibling && candidate.previousSibling.nodeType == 3 )
continue;
}

currentIndex++;

Expand Down Expand Up @@ -314,4 +313,4 @@ CKEDITOR.tools.extend( CKEDITOR.dom.document.prototype, {

return $frag;
}
});
} );
2 changes: 1 addition & 1 deletion core/dom/documentfragment.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,4 @@ CKEDITOR.tools.extend( CKEDITOR.dom.documentFragment.prototype, CKEDITOR.dom.ele
node = node.$;
node.parentNode.insertBefore( this.$, node.nextSibling );
}
}, true, { 'append':1,'appendBogus':1,'getFirst':1,'getLast':1,'getParent':1,'getNext':1,'getPrevious':1,'appendTo':1,'moveChildren':1,'insertBefore':1,'insertAfterNode':1,'replace':1,'trim':1,'type':1,'ltrim':1,'rtrim':1,'getDocument':1,'getChildCount':1,'getChild':1,'getChildren':1 } );
}, true, { 'append': 1, 'appendBogus': 1, 'getFirst': 1, 'getLast': 1, 'getParent': 1, 'getNext': 1, 'getPrevious': 1, 'appendTo': 1, 'moveChildren': 1, 'insertBefore': 1, 'insertAfterNode': 1, 'replace': 1, 'trim': 1, 'type': 1, 'ltrim': 1, 'rtrim': 1, 'getDocument': 1, 'getChildCount': 1, 'getChild': 1, 'getChildren': 1 } );
10 changes: 5 additions & 5 deletions core/dom/domobject.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ CKEDITOR.dom.domObject = function( nativeDomObject ) {
}
};

CKEDITOR.dom.domObject.prototype = (function() {
CKEDITOR.dom.domObject.prototype = ( function() {
// Do not define other local variables here. We want to keep the native
// listener closures as clean as possible.

Expand Down Expand Up @@ -138,14 +138,14 @@ CKEDITOR.dom.domObject.prototype = (function() {
}
}
};
})();
} )();

(function( domObjectProto ) {
( function( domObjectProto ) {
var customData = {};

CKEDITOR.on( 'reset', function() {
customData = {};
});
} );

/**
* Determines whether the specified object is equal to the current object.
Expand Down Expand Up @@ -255,4 +255,4 @@ CKEDITOR.dom.domObject.prototype = (function() {
// Implement CKEDITOR.event.
CKEDITOR.event.implementOn( domObjectProto );

})( CKEDITOR.dom.domObject.prototype );
} )( CKEDITOR.dom.domObject.prototype );
Loading

0 comments on commit 0c63d85

Please sign in to comment.