return ( !!object && object instanceof Array );\r
},\r
\r
+ /**\r
+ * Whether the object contains no properties of it's own.\r
+ * @param object\r
+ */\r
isEmpty : function ( object )\r
{\r
for ( var i in object )\r
}\r
return true;\r
},\r
+\r
/**\r
* Transforms a CSS property name to its relative DOM style name.\r
* @param {String} cssName The CSS property name.\r
*/\r
htmlEncodeAttr : function( text )\r
{\r
- return text.replace( /"/g, '"' ).replace( /</g, '<' ).replace( />/, '>' );\r
- },\r
-\r
- /**\r
- * Replace characters can't be represented through CSS Selectors string\r
- * by CSS Escape Notation where the character escape sequence consists\r
- * of a backslash character (\) followed by the orginal characters.\r
- * Ref: http://www.w3.org/TR/css3-selectors/#grammar\r
- * @param cssSelectText\r
- * @return the escaped selector text.\r
- */\r
- escapeCssSelector : function( cssSelectText )\r
- {\r
- return cssSelectText.replace( /[\s#:.,$*^\[\]()~=+>]/g, '\\$&' );\r
+ return text.replace( /"/g, '"' ).replace( /</g, '<' ).replace( />/g, '>' );\r
},\r
\r
/**\r
})(),\r
\r
/**\r
+ * Gets a unique ID for CKEditor's interface elements. It returns a\r
+ * string with the "cke_" prefix and a progressive number.\r
+ * @function\r
+ * @returns {String} A unique ID.\r
+ * @example\r
+ * alert( CKEDITOR.tools.<b>getNextId()</b> ); // "cke_1" (e.g.)\r
+ * alert( CKEDITOR.tools.<b>getNextId()</b> ); // "cke_2"\r
+ */\r
+ getNextId : function()\r
+ {\r
+ return 'cke_' + this.getNextNumber();\r
+ },\r
+\r
+ /**\r
* Creates a function override.\r
* @param {Function} originalFunction The function to be overridden.\r
* @param {Function} functionBuilder A function that returns the new\r
{\r
return functions.push( function()\r
{\r
- fn.apply( scope || this, arguments );\r
+ return fn.apply( scope || this, arguments );\r
}) - 1;\r
},\r
\r
return fn && fn.apply( window, Array.prototype.slice.call( arguments, 1 ) );\r
},\r
\r
+ /**\r
+ * Append the 'px' length unit to the size if it's missing.\r
+ * @param length\r
+ */\r
cssLength : (function()\r
{\r
var decimalRegex = /^\d+(?:\.\d+)?$/;\r
};\r
})(),\r
\r
+ /**\r
+ * String specified by {@param str} repeats {@param times} times.\r
+ * @param str\r
+ * @param times\r
+ */\r
repeat : function( str, times )\r
{\r
return new Array( times + 1 ).join( str );\r
},\r
\r
+ /**\r
+ * Return the first successfully executed function's return value that\r
+ * doesn't throw any exception.\r
+ */\r
tryThese : function()\r
{\r
var returnValue;\r