diff options
author | Christoph Wurst <christoph@winzerhof-wurst.at> | 2019-05-08 10:03:13 +0200 |
---|---|---|
committer | Christoph Wurst <christoph@winzerhof-wurst.at> | 2019-05-08 19:58:43 +0200 |
commit | 73f9f15607ba23f37ef78b84b6240cce49c1b69b (patch) | |
tree | b63d7141168bb5c464375f27d4087a91b882a52f /core/js/js.js | |
parent | df1f53c5c343ff6ac9c7bbe616b2c0cffe8a6380 (diff) | |
download | nextcloud-server-73f9f15607ba23f37ef78b84b6240cce49c1b69b.tar.gz nextcloud-server-73f9f15607ba23f37ef78b84b6240cce49c1b69b.zip |
Move the legacy OC.addScript and OC.addStyle helpers to the bundle
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
Diffstat (limited to 'core/js/js.js')
-rw-r--r-- | core/js/js.js | 45 |
1 files changed, 0 insertions, 45 deletions
diff --git a/core/js/js.js b/core/js/js.js index 55bc4ffb963..13e0e11b0fb 100644 --- a/core/js/js.js +++ b/core/js/js.js @@ -118,48 +118,6 @@ Object.assign(window.OC, { }, /** - * Load a script for the server and load it. If the script is already loaded, - * the event handler will be called directly - * @param {string} app the app id to which the script belongs - * @param {string} script the filename of the script - * @param ready event handler to be called when the script is loaded - * @deprecated 16.0.0 Use OCP.Loader.loadScript - */ - addScript:function(app,script,ready){ - var deferred, path=OC.filePath(app,'js',script+'.js'); - if(!OC.addScript.loaded[path]) { - deferred = $.Deferred(); - $.getScript(path, function() { - deferred.resolve(); - }); - OC.addScript.loaded[path] = deferred; - } else { - if (ready) { - ready(); - } - } - return OC.addScript.loaded[path]; - }, - /** - * Loads a CSS file - * @param {string} app the app id to which the css style belongs - * @param {string} style the filename of the css file - * @deprecated 16.0.0 Use OCP.Loader.loadStylesheet - */ - addStyle:function(app,style){ - var path=OC.filePath(app,'css',style+'.css'); - if(OC.addStyle.loaded.indexOf(path)===-1){ - OC.addStyle.loaded.push(path); - if (document.createStyleSheet) { - document.createStyleSheet(path); - } else { - style=$('<link rel="stylesheet" type="text/css" href="'+path+'"/>'); - $('head').append(style); - } - } - }, - - /** * Loads translations for the given app asynchronously. * * @param {String} app app name @@ -511,9 +469,6 @@ Object.assign(window.OC, { } }); -OC.addStyle.loaded=[]; -OC.addScript.loaded=[]; - /** * Initializes core */ |