summaryrefslogtreecommitdiffstats
path: root/core/js
diff options
context:
space:
mode:
authorRobin Appelman <icewind1991@gmail.com>2011-07-26 16:43:12 +0200
committerRobin Appelman <icewind1991@gmail.com>2011-07-26 16:43:12 +0200
commitb0f166fc836129464a2bdfa03357e844568c1104 (patch)
tree41d59d3ca6540d48d238ed697427e8eecafe1796 /core/js
parent543bdb8ccd8971f0c7123c1a2f9f5b01ba536e2c (diff)
downloadnextcloud-server-b0f166fc836129464a2bdfa03357e844568c1104.tar.gz
nextcloud-server-b0f166fc836129464a2bdfa03357e844568c1104.zip
some javascript changes
Diffstat (limited to 'core/js')
-rw-r--r--core/js/js.js19
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