diff options
author | Christoph Wurst <christoph@winzerhof-wurst.at> | 2019-05-14 18:25:47 +0200 |
---|---|---|
committer | Christoph Wurst <christoph@winzerhof-wurst.at> | 2019-05-14 22:00:22 +0200 |
commit | 07699c199d02a41afa165a1dac0c2e5a1e8761fd (patch) | |
tree | 47ccc8fed3939dc4129022e9c8410ba2f9e7e27c /core/js/js.js | |
parent | b8c01dc2cde6cf69c6a0139fc433a7951cccabeb (diff) | |
download | nextcloud-server-07699c199d02a41afa165a1dac0c2e5a1e8761fd.tar.gz nextcloud-server-07699c199d02a41afa165a1dac0c2e5a1e8761fd.zip |
Move OC.appSettings to the bundle and deprecate it
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
Diffstat (limited to 'core/js/js.js')
-rw-r--r-- | core/js/js.js | 57 |
1 files changed, 0 insertions, 57 deletions
diff --git a/core/js/js.js b/core/js/js.js index 1002e751548..8b9fae0a921 100644 --- a/core/js/js.js +++ b/core/js/js.js @@ -5,63 +5,6 @@ Object.assign(window.OC, { /* jshint camelcase: false */ /** - * Opens a popup with the setting for an app. - * @param {string} appid The ID of the app e.g. 'calendar', 'contacts' or 'files'. - * @param {boolean|string} loadJS If true 'js/settings.js' is loaded. If it's a string - * it will attempt to load a script by that name in the 'js' directory. - * @param {boolean} [cache] If true the javascript file won't be forced refreshed. Defaults to true. - * @param {string} [scriptName] The name of the PHP file to load. Defaults to 'settings.php' in - * the root of the app directory hierarchy. - */ - appSettings:function(args) { - if(typeof args === 'undefined' || typeof args.appid === 'undefined') { - throw { name: 'MissingParameter', message: 'The parameter appid is missing' }; - } - var props = {scriptName:'settings.php', cache:true}; - $.extend(props, args); - var settings = $('#appsettings'); - if(settings.length === 0) { - throw { name: 'MissingDOMElement', message: 'There has be be an element with id "appsettings" for the popup to show.' }; - } - var popup = $('#appsettings_popup'); - if(popup.length === 0) { - $('body').prepend('<div class="popup hidden" id="appsettings_popup"></div>'); - popup = $('#appsettings_popup'); - popup.addClass(settings.hasClass('topright') ? 'topright' : 'bottomleft'); - } - if(popup.is(':visible')) { - popup.hide().remove(); - } else { - var arrowclass = settings.hasClass('topright') ? 'up' : 'left'; - var jqxhr = $.get(OC.filePath(props.appid, '', props.scriptName), function(data) { - popup.html(data).ready(function() { - popup.prepend('<span class="arrow '+arrowclass+'"></span><h2>'+t('core', 'Settings')+'</h2><a class="close"></a>').show(); - popup.find('.close').bind('click', function() { - popup.remove(); - }); - if(typeof props.loadJS !== 'undefined') { - var scriptname; - if(props.loadJS === true) { - scriptname = 'settings.js'; - } else if(typeof props.loadJS === 'string') { - scriptname = props.loadJS; - } else { - throw { name: 'InvalidParameter', message: 'The "loadJS" parameter must be either boolean or a string.' }; - } - if(props.cache) { - $.ajaxSetup({cache: true}); - } - $.getScript(OC.filePath(props.appid, 'js', scriptname)) - .fail(function(jqxhr, settings, e) { - throw e; - }); - } - }).show(); - }, 'html'); - } - }, - - /** * Warn users that the connection to the server was lost temporarily * * This function is throttled to prevent stacked notfications. |