aboutsummaryrefslogtreecommitdiffstats
path: root/core/js/js.js
diff options
context:
space:
mode:
authorRobin Appelman <icewind1991@gmail.com>2011-07-27 16:42:58 +0200
committerRobin Appelman <icewind1991@gmail.com>2011-07-27 16:42:58 +0200
commit0dad1f8ccb01f5c60ef919bdc347d8a22cb728f8 (patch)
tree71c72c8a805d81f07022c196b4f3007190528d90 /core/js/js.js
parent00da23faf6b17cc39c310fab163d122f646098a5 (diff)
parent606dec8da026d3aceb75abb64c936a09a3bd9133 (diff)
downloadnextcloud-server-0dad1f8ccb01f5c60ef919bdc347d8a22cb728f8.tar.gz
nextcloud-server-0dad1f8ccb01f5c60ef919bdc347d8a22cb728f8.zip
merge master into interface
Diffstat (limited to 'core/js/js.js')
-rw-r--r--core/js/js.js38
1 files changed, 29 insertions, 9 deletions
diff --git a/core/js/js.js b/core/js/js.js
index 2dac6907d96..3a820544b78 100644
--- a/core/js/js.js
+++ b/core/js/js.js
@@ -1,26 +1,27 @@
-var _l10ncache = {};
function t(app,text){
- if( !( app in _l10ncache )){
- $.post( oc_webroot+'/core/ajax/translations.php', {'app': app}, function(jsondata){
- _l10ncache[app] = jsondata.data;
+ if( !( app in t.cache )){
+
+ $.post( OC.filePath('core','ajax','translations.php'), {'app': app}, function(jsondata){
+ t.cache[app] = jsondata.data;
});
// Bad answer ...
- if( !( app in _l10ncache )){
- _l10ncache[app] = [];
+ if( !( app in t.cache )){
+ t.cache[app] = [];
}
}
- if( typeof( _l10ncache[app][text] ) !== 'undefined' ){
- return _l10ncache[app][text];
+ if( typeof( t.cache[app][text] ) !== 'undefined' ){
+ return t.cache[app][text];
}
else{
return text;
}
}
+t.cache={};
OC={
webroot:oc_webroot,
- coreApps:['files','admin','log','search','settings'],
+ coreApps:['files','admin','log','search','settings','core'],
linkTo:function(app,file){
return OC.filePath(app,'',file);
},
@@ -72,5 +73,24 @@ if (!Array.prototype.filter) {
}
}
return res;
+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;
};
} \ No newline at end of file