diff options
author | Roeland Jago Douma <rullzer@users.noreply.github.com> | 2019-05-08 20:52:08 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-05-08 20:52:08 +0200 |
commit | 83679b33b802fee99d89b97947be7ec1b4013172 (patch) | |
tree | f8820d000a4784c21de37a3e22a4f73eae7f7e90 /core/js/js.js | |
parent | fad3f1af3b74585c947ec87e6a50f3bbfe4f3595 (diff) | |
parent | 73f9f15607ba23f37ef78b84b6240cce49c1b69b (diff) | |
download | nextcloud-server-83679b33b802fee99d89b97947be7ec1b4013172.tar.gz nextcloud-server-83679b33b802fee99d89b97947be7ec1b4013172.zip |
Merge pull request #15437 from nextcloud/refactor/oc-addscript-addstyle-bundle
Move the legacy OC.addScript and OC.addStyle helpers to the bundle
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 */ |