diff options
author | Robin Appelman <icewind1991@gmail.com> | 2011-07-26 16:14:20 +0200 |
---|---|---|
committer | Robin Appelman <icewind1991@gmail.com> | 2011-07-26 16:16:47 +0200 |
commit | 543bdb8ccd8971f0c7123c1a2f9f5b01ba536e2c (patch) | |
tree | a2bf8d8515f9fb8da3315cd08fa4e348153b0667 /core/js/js.js | |
parent | de7c110225a7831e84c89b86cff459804583426f (diff) | |
parent | 0e05a8648404d48fb974bb069e1b465219165a44 (diff) | |
download | nextcloud-server-543bdb8ccd8971f0c7123c1a2f9f5b01ba536e2c.tar.gz nextcloud-server-543bdb8ccd8971f0c7123c1a2f9f5b01ba536e2c.zip |
merge master into interface
Diffstat (limited to 'core/js/js.js')
-rw-r--r-- | core/js/js.js | 40 |
1 files changed, 37 insertions, 3 deletions
diff --git a/core/js/js.js b/core/js/js.js index 9a14cb8ed4f..9117f08349a 100644 --- a/core/js/js.js +++ b/core/js/js.js @@ -18,6 +18,40 @@ function t(app,text){ } } -$(document).ready(function(){ - // Put fancy stuff in here -}); +OC={ + webroot:oc_webroot, + coreApps:['files','admin','log','search','settings'], + linkTo:function(app,file){ + return OC.filePath(app,'',file); + }, + filePath:function(app,type,file){ + var isCore=OC.coreApps.indexOf(app)!=-1; + app+='/'; + var link=OC.webroot+'/'; + if(!isCore){ + link+='apps/'; + } + link+=app; + if(type){ + link+=type+'/' + } + link+=file; + return link; + }, + imagePath:function(app,file){ + return OC.filePath(app,'img',file); + }, + addScript:function(app,script,ready){ + var path=OC.filePath(app,'js',script+'.js'); + if(ready){ + $.getScript(path,ready); + }else{ + $.getScript(path); + } + }, + addStyle:function(app,style){ + var path=OC.filePath(app,'css',style+'.css'); + var style=$('<link rel="stylesheet" type="text/css" href="'+path+'"/>'); + $('head').append(style); + } +} |