X-Git-Url: https://jasonwoof.com/gitweb/?p=ckeditor.git;a=blobdiff_plain;f=_source%2Fcore%2Ftools.js;h=a1bff9af0da81409fca280cd54ae3a24aff4b923;hp=9407fd70f715f05092d723980d742a08f12ffe1a;hb=e371ddf8abcb89013e20e6d0dd746adec344d0e5;hpb=055b6b0792ce7dc53d47af606b367c04b927c2ab diff --git a/_source/core/tools.js b/_source/core/tools.js index 9407fd7..a1bff9a 100644 --- a/_source/core/tools.js +++ b/_source/core/tools.js @@ -377,6 +377,20 @@ For licensing, see LICENSE.html or http://ckeditor.com/license })(), /** + * Gets a unique ID for CKEditor's interface elements. It returns a + * string with the "cke_" prefix and a progressive number. + * @function + * @returns {String} A unique ID. + * @example + * alert( CKEDITOR.tools.getNextId() ); // "cke_1" (e.g.) + * alert( CKEDITOR.tools.getNextId() ); // "cke_2" + */ + getNextId : function() + { + return 'cke_' + this.getNextNumber(); + }, + + /** * Creates a function override. * @param {Function} originalFunction The function to be overridden. * @param {Function} functionBuilder A function that returns the new