diff options
author | Robin Appelman <icewind1991@gmail.com> | 2011-07-26 16:43:12 +0200 |
---|---|---|
committer | Robin Appelman <icewind1991@gmail.com> | 2011-07-26 16:43:12 +0200 |
commit | b0f166fc836129464a2bdfa03357e844568c1104 (patch) | |
tree | 41d59d3ca6540d48d238ed697427e8eecafe1796 /core/js | |
parent | 543bdb8ccd8971f0c7123c1a2f9f5b01ba536e2c (diff) | |
download | nextcloud-server-b0f166fc836129464a2bdfa03357e844568c1104.tar.gz nextcloud-server-b0f166fc836129464a2bdfa03357e844568c1104.zip |
some javascript changes
Diffstat (limited to 'core/js')
-rw-r--r-- | core/js/js.js | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/core/js/js.js b/core/js/js.js index 9117f08349a..2dac6907d96 100644 --- a/core/js/js.js +++ b/core/js/js.js @@ -55,3 +55,22 @@ OC={ $('head').append(style); } } + +if (!Array.prototype.filter) { + Array.prototype.filter = function(fun /*, thisp*/) { + var len = this.length >>> 0; + if (typeof fun != "function") + throw new TypeError(); + + var res = []; + var thisp = arguments[1]; + for (var i = 0; i < len; i++) { + if (i in this) { + var val = this[i]; // in case fun mutates this + if (fun.call(thisp, val, i, this)) + res.push(val); + } + } + return res; + }; +}
\ No newline at end of file |