diff options
Diffstat (limited to 'core/js/js.js')
-rw-r--r-- | core/js/js.js | 76 |
1 files changed, 0 insertions, 76 deletions
diff --git a/core/js/js.js b/core/js/js.js index bfe11d267cc..556de157e67 100644 --- a/core/js/js.js +++ b/core/js/js.js @@ -1,18 +1,6 @@ -var oc_webroot; var oc_current_user = document.getElementsByTagName('head')[0].getAttribute('data-user'); var oc_requesttoken = document.getElementsByTagName('head')[0].getAttribute('data-requesttoken'); -if (typeof oc_webroot === "undefined") { - oc_webroot = location.pathname; - var pos = oc_webroot.indexOf('/index.php/'); - if (pos !== -1) { - oc_webroot = oc_webroot.substr(0, pos); - } - else { - oc_webroot = oc_webroot.substr(0, oc_webroot.lastIndexOf('/')); - } -} - /** @namespace OCP */ var OCP = Object.assign({}, window.OCP); @@ -30,24 +18,12 @@ Object.assign(window.OC, { TAG_FAVORITE: '_$!<Favorite>!$_', /* jshint camelcase: false */ /** - * Relative path to Nextcloud root. - * For example: "/nextcloud" - * - * @type string - * - * @deprecated since 8.2, use OC.getRootPath() instead - * @see OC#getRootPath - */ - webroot:oc_webroot, - - /** * Capabilities * * @type array */ _capabilities: window.oc_capabilities || null, - appswebroots:(typeof oc_appswebroots !== 'undefined') ? oc_appswebroots:false, /** * Currently logged in user or null if none * @@ -55,7 +31,6 @@ Object.assign(window.OC, { * @deprecated use {@link OC.getCurrentUser} instead */ currentUser:(typeof oc_current_user!=='undefined')?oc_current_user:false, - appConfig: window.oc_appconfig || {}, theme: window.oc_defaults || {}, coreApps:['', 'admin','log','core/search','settings','core','3rdparty'], requestToken: oc_requesttoken, @@ -117,20 +92,6 @@ Object.assign(window.OC, { }, /** - * Returns the web root path where this Nextcloud instance - * is accessible, with a leading slash. - * For example "/nextcloud". - * - * @return {string} web root path - * - * @since 8.2 - */ - getRootPath: function() { - return OC.webroot; - }, - - - /** * Returns the capabilities * * @return {array} capabilities @@ -1154,41 +1115,4 @@ if (window.history.pushState) { else { $(window).on('hashchange', _.bind(OC.Util.History._onPopState, OC.Util.History)); } - -/** - * Get a variable by name - * @param {string} name - * @return {*} */ -OC.get=function(name) { - var namespaces = name.split("."); - var tail = namespaces.pop(); - var context=window; - - for(var i = 0; i < namespaces.length; i++) { - context = context[namespaces[i]]; - if(!context){ - return false; - } - } - return context[tail]; -}; - -/** - * Set a variable by name - * @param {string} name - * @param {*} value - */ -OC.set=function(name, value) { - var namespaces = name.split("."); - var tail = namespaces.pop(); - var context=window; - - for(var i = 0; i < namespaces.length; i++) { - if(!context[namespaces[i]]){ - context[namespaces[i]]={}; - } - context = context[namespaces[i]]; - } - context[tail]=value; -}; |