diff options
Diffstat (limited to 'admin/themes/default/js/common.js')
-rw-r--r-- | admin/themes/default/js/common.js | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/admin/themes/default/js/common.js b/admin/themes/default/js/common.js index a017115db..0f6435387 100644 --- a/admin/themes/default/js/common.js +++ b/admin/themes/default/js/common.js @@ -8,6 +8,29 @@ function str_repeat(i, m) { return o.join(''); } +if (!Array.prototype.indexOf) +{ + Array.prototype.indexOf = function(elt /*, from*/) + { + var len = this.length; + + var from = Number(arguments[1]) || 0; + from = (from < 0) + ? Math.ceil(from) + : Math.floor(from); + if (from < 0) + from += len; + + for (; from < len; from++) + { + if (from in this && + this[from] === elt) + return from; + } + return -1; + }; +} + function sprintf() { var i = 0, a, f = arguments[i++], o = [], m, p, c, x, s = ''; while (f) { |