diff options
author | Christoph Wurst <christoph@winzerhof-wurst.at> | 2019-04-29 18:04:45 +0200 |
---|---|---|
committer | Christoph Wurst <christoph@winzerhof-wurst.at> | 2019-05-02 09:42:32 +0200 |
commit | 9b79aa664dcb00adf558ce6b36d7b2455134e8ee (patch) | |
tree | f14768b0df52a835c1f94fd238f82c75d52c7a36 /core/src | |
parent | ac700506bd9d502a97fbee8635535dc03ce6eb92 (diff) | |
download | nextcloud-server-9b79aa664dcb00adf558ce6b36d7b2455134e8ee.tar.gz nextcloud-server-9b79aa664dcb00adf558ce6b36d7b2455134e8ee.zip |
Move oc_config to the bundle
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
Diffstat (limited to 'core/src')
-rw-r--r-- | core/src/OC/config.js | 24 | ||||
-rw-r--r-- | core/src/OC/index.js | 2 | ||||
-rw-r--r-- | core/src/globals.js | 9 |
3 files changed, 33 insertions, 2 deletions
diff --git a/core/src/OC/config.js b/core/src/OC/config.js new file mode 100644 index 00000000000..d1a3211cf62 --- /dev/null +++ b/core/src/OC/config.js @@ -0,0 +1,24 @@ +/* + * @copyright 2019 Christoph Wurst <christoph@winzerhof-wurst.at> + * + * @author 2019 Christoph Wurst <christoph@winzerhof-wurst.at> + * + * @license GNU AGPL version 3 or any later version + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + */ + +const config = window._oc_config || {} + +export default config diff --git a/core/src/OC/index.js b/core/src/OC/index.js index 76b244adf3d..789b5b22fa7 100644 --- a/core/src/OC/index.js +++ b/core/src/OC/index.js @@ -22,6 +22,7 @@ import Apps from './apps' import AppConfig from './appconfig' import Backbone from './backbone' +import Config from './config' import ContactsMenu from './contactsmenu' import Dialogs from './dialogs' import EventSource from './eventsource' @@ -40,6 +41,7 @@ export default { AppConfig, Backbone, ContactsMenu, + config: Config, dialogs: Dialogs, EventSource, L10N, diff --git a/core/src/globals.js b/core/src/globals.js index cbb26cfc2a8..b84ef10d22b 100644 --- a/core/src/globals.js +++ b/core/src/globals.js @@ -34,7 +34,10 @@ const deprecate = (func, funcName) => { return newFunc } -const setDeprecatedProp = (global, val, msg) => +const setDeprecatedProp = (global, val, msg) => { + if (window[global] !== undefined) { + delete window[global] + } Object.defineProperty(window, global, { get: () => { if (msg) { @@ -45,6 +48,7 @@ const setDeprecatedProp = (global, val, msg) => return val } }) +} import _ from 'underscore' import $ from 'jquery' @@ -103,7 +107,8 @@ window['md5'] = md5 window['moment'] = moment window['OC'] = OC -setDeprecatedProp('OCDialogs', OC.dialogs, 'use OC.dialogs') +setDeprecatedProp('oc_config', OC.config, 'use OC.config instead') +setDeprecatedProp('OCDialogs', OC.dialogs, 'use OC.dialogs instead') window['OCP'] = OCP window['OCA'] = OCA window['escapeHTML'] = deprecate(escapeHTML, 'escapeHTML') |