diff options
author | Jo-Philipp Wich <jo@mein.io> | 2018-05-30 16:04:07 +0200 |
---|---|---|
committer | Jo-Philipp Wich <jo@mein.io> | 2018-05-30 16:04:07 +0200 |
commit | c3da1fc2325e6b59a9625e4f4f4047019820af48 (patch) | |
tree | 3e3ae71e4c21260463175d9e69da30406ef8f307 /modules/luci-base/htdocs/luci-static/resources/cbi.js | |
parent | d1df5a6b7d39dea0fcc9ace778d15dce6682a36a (diff) |
luci-base: cbi.js: remove unused serialize functions
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
Diffstat (limited to 'modules/luci-base/htdocs/luci-static/resources/cbi.js')
-rw-r--r-- | modules/luci-base/htdocs/luci-static/resources/cbi.js | 64 |
1 files changed, 0 insertions, 64 deletions
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 = [ ]; |