X-Git-Url: http://git.roojs.org/?p=roojs1;a=blobdiff_plain;f=Roo%2Fhtmleditor%2FTidyEntities.js;h=fef4683994e8b0f457a971f50d6ee499aa858a12;hp=5db0ea6723a614541f5ac362e011236a5c23db19;hb=356f5ee4ec78e1c538f224acb762c98e75be3d39;hpb=0f0774d7fe6b1f6bb2e34cb961bb516159ac3a3f diff --git a/Roo/htmleditor/TidyEntities.js b/Roo/htmleditor/TidyEntities.js index 5db0ea6723..fef4683994 100644 --- a/Roo/htmleditor/TidyEntities.js +++ b/Roo/htmleditor/TidyEntities.js @@ -3,6 +3,8 @@ * @class Roo.htmleditor.TidyEntities * @static * https://github.com/thorn0/tinymce.html/blob/master/tinymce.html.js + * + * Not 100% sure this is actually used or needed. */ Roo.htmleditor.TidyEntities = { @@ -11,32 +13,31 @@ Roo.htmleditor.TidyEntities = { * initialize data.. */ init : function (){ - - - - this.namedEntities = buildEntitiesLookup(this.namedEntitiesData.join(','), 32); + + this.namedEntities = this.buildEntitiesLookup(this.namedEntitiesData, 32); }, - buildEntitiesLookup: function(items, radix) { + buildEntitiesLookup: function(items, radix) { var i, chr, entity, lookup = {}; - if (items) { - items = items.split(','); - radix = radix || 10; - // Build entities lookup table - for (i = 0; i < items.length; i += 2) { - chr = String.fromCharCode(parseInt(items[i], radix)); - // Only add non base entities - if (!baseEntities[chr]) { - entity = '&' + items[i + 1] + ';'; - lookup[chr] = entity; - lookup[entity] = chr; - } + if (!items) { + return {}; + } + items = typeof(items) == 'string' ? items.split(',') : items; + radix = radix || 10; + // Build entities lookup table + for (i = 0; i < items.length; i += 2) { + chr = String.fromCharCode(parseInt(items[i], radix)); + // Only add non base entities + if (!this.baseEntities[chr]) { + entity = '&' + items[i + 1] + ';'; + lookup[chr] = entity; + lookup[entity] = chr; } - return lookup; } - return {}; + return lookup; + }, asciiMap : {