X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=_source%2Fcore%2Ftools.js;h=9407fd70f715f05092d723980d742a08f12ffe1a;hb=refs%2Ftags%2Fv3.3.2;hp=80555664350599c2e471fee3284fc093e848eaed;hpb=66f4ae0bf0280ed56bf7c0f4ab175424dd1d47a0;p=ckeditor.git diff --git a/_source/core/tools.js b/_source/core/tools.js index 8055566..9407fd7 100644 --- a/_source/core/tools.js +++ b/_source/core/tools.js @@ -220,6 +220,10 @@ For licensing, see LICENSE.html or http://ckeditor.com/license return ( !!object && object instanceof Array ); }, + /** + * Whether the object contains no properties of it's own. + * @param object + */ isEmpty : function ( object ) { for ( var i in object ) @@ -229,6 +233,7 @@ For licensing, see LICENSE.html or http://ckeditor.com/license } return true; }, + /** * Transforms a CSS property name to its relative DOM style name. * @param {String} cssName The CSS property name. @@ -337,7 +342,7 @@ For licensing, see LICENSE.html or http://ckeditor.com/license */ htmlEncodeAttr : function( text ) { - return text.replace( /"/g, '"' ).replace( //, '>' ); + return text.replace( /"/g, '"' ).replace( //g, '>' ); }, /** @@ -668,6 +673,10 @@ For licensing, see LICENSE.html or http://ckeditor.com/license return fn && fn.apply( window, Array.prototype.slice.call( arguments, 1 ) ); }, + /** + * Append the 'px' length unit to the size if it's missing. + * @param length + */ cssLength : (function() { var decimalRegex = /^\d+(?:\.\d+)?$/; @@ -677,11 +686,20 @@ For licensing, see LICENSE.html or http://ckeditor.com/license }; })(), + /** + * String specified by {@param str} repeats {@param times} times. + * @param str + * @param times + */ repeat : function( str, times ) { return new Array( times + 1 ).join( str ); }, + /** + * Return the first successfully executed function's return value that + * doesn't throw any exception. + */ tryThese : function() { var returnValue;