From c3da1fc2325e6b59a9625e4f4f4047019820af48 Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Wed, 30 May 2018 16:04:07 +0200 Subject: luci-base: cbi.js: remove unused serialize functions Signed-off-by: Jo-Philipp Wich --- .../luci-base/htdocs/luci-static/resources/cbi.js | 64 ---------------------- 1 file changed, 64 deletions(-) (limited to 'modules/luci-base') diff --git a/modules/luci-base/htdocs/luci-static/resources/cbi.js b/modules/luci-base/htdocs/luci-static/resources/cbi.js index 724691ace2..0a1961916c 100644 --- a/modules/luci-base/htdocs/luci-static/resources/cbi.js +++ b/modules/luci-base/htdocs/luci-static/resources/cbi.js @@ -1311,58 +1311,6 @@ function cbi_tag_last(container) } } -String.prototype.serialize = function() -{ - var o = this; - switch(typeof(o)) - { - case 'object': - // null - if( o == null ) - { - return 'null'; - } - - // array - else if( o.length ) - { - var i, s = ''; - - for( var i = 0; i < o.length; i++ ) - s += (s ? ', ' : '') + String.serialize(o[i]); - - return '[ ' + s + ' ]'; - } - - // object - else - { - var k, s = ''; - - for( k in o ) - s += (s ? ', ' : '') + k + ': ' + String.serialize(o[k]); - - return '{ ' + s + ' }'; - } - - break; - - case 'string': - // complex string - if( o.match(/[^a-zA-Z0-9_,.: -]/) ) - return 'decodeURIComponent("' + encodeURIComponent(o) + '")'; - - // simple string - else - return '"' + o + '"'; - - break; - - default: - return o.toString(); - } -} - String.prototype.format = function() { if (!RegExp) @@ -1473,10 +1421,6 @@ String.prototype.format = function() subst = esc(param, quot_esc); break; - case 'j': - subst = String.serialize(param); - break; - case 't': var td = 0; var th = 0; @@ -1543,14 +1487,6 @@ String.prototype.nobr = function() return this.replace(/[\s\n]+/g, ' '); } -String.serialize = function() -{ - var a = [ ]; - for (var i = 1; i < arguments.length; i++) - a.push(arguments[i]); - return ''.serialize.apply(arguments[0], a); -} - String.format = function() { var a = [ ]; -- cgit v1.2.3