diff options
author | Bart Visscher <bartv@thisnet.nl> | 2012-08-30 21:49:28 +0200 |
---|---|---|
committer | Bart Visscher <bartv@thisnet.nl> | 2012-08-30 21:49:28 +0200 |
commit | b483f2aab856e3324026588a9702043072fd7ad2 (patch) | |
tree | 9a5696d43ae53160bee592e1b6874185cbd98ad4 /core/js/js.js | |
parent | cbaf858dea0f2094805edb6aa223bdd6877fff5b (diff) | |
parent | 598815b21e94219eb66684c64802e165a35180ad (diff) | |
download | nextcloud-server-b483f2aab856e3324026588a9702043072fd7ad2.tar.gz nextcloud-server-b483f2aab856e3324026588a9702043072fd7ad2.zip |
Merge branch 'master' into routing
Conflicts:
apps/contacts/js/contacts.js
apps/contacts/lib/search.php
apps/files_archive/js/archive.js
apps/gallery/lib/tiles.php
apps/gallery/templates/index.php
lib/ocs.php
Diffstat (limited to 'core/js/js.js')
-rw-r--r-- | core/js/js.js | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/core/js/js.js b/core/js/js.js index e50b407bacf..f1ed6070c32 100644 --- a/core/js/js.js +++ b/core/js/js.js @@ -29,6 +29,16 @@ function t(app,text){ } t.cache={}; +/** +* Get the path to download a file +* @param file The filename +* @param dir The directory the file is in - e.g. $('#dir').val() +* @return string +*/ +function fileDownloadPath(dir, file) { + return OC.filePath('files', 'ajax', 'download.php')+encodeURIComponent('?files='+encodeURIComponent(file)+'&dir='+encodeURIComponent(dir)); +} + OC={ webroot:oc_webroot, appswebroots:oc_appswebroots, @@ -110,18 +120,19 @@ OC={ */ addScript:function(app,script,ready){ var path=OC.filePath(app,'js',script+'.js'); - if(OC.addScript.loaded.indexOf(path)==-1){ - OC.addScript.loaded.push(path); + if(!OC.addScript.loaded[path]){ if(ready){ - $.getScript(path,ready); + var deferred=$.getScript(path,ready); }else{ - $.getScript(path); + var deferred=$.getScript(path); } + OC.addScript.loaded[path]=deferred; }else{ if(ready){ ready(); } } + return OC.addScript.loaded[path]; }, /** * load a css file and load it |