diff options
author | Christoph Wurst <christoph@winzerhof-wurst.at> | 2019-04-29 18:16:15 +0200 |
---|---|---|
committer | Christoph Wurst <christoph@winzerhof-wurst.at> | 2019-04-30 11:11:24 +0200 |
commit | 35d8e7a4e036dc7eda504a4fd7e5f587cfb69cc2 (patch) | |
tree | d7a27d66637b04dee96caee564cdc28fc5498646 /core/src/globals.js | |
parent | 2e0199a04a077db17a74a6018b8f3957f0b37eb9 (diff) | |
download | nextcloud-server-35d8e7a4e036dc7eda504a4fd7e5f587cfb69cc2.tar.gz nextcloud-server-35d8e7a4e036dc7eda504a4fd7e5f587cfb69cc2.zip |
Move OC.dialogs to the main bundle
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
Diffstat (limited to 'core/src/globals.js')
-rw-r--r-- | core/src/globals.js | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/core/src/globals.js b/core/src/globals.js index 7d201ec5b0b..cbb26cfc2a8 100644 --- a/core/src/globals.js +++ b/core/src/globals.js @@ -20,7 +20,7 @@ */ /** - * + * * @param {Function} func the library to deprecate * @param {String} funcName the name of the library */ @@ -34,6 +34,18 @@ const deprecate = (func, funcName) => { return newFunc } +const setDeprecatedProp = (global, val, msg) => + Object.defineProperty(window, global, { + get: () => { + if (msg) { + console.warn(`${global} is deprecated: ${msg}`) + } else { + console.warn(`${global} is deprecated`) + } + return val + } + }) + import _ from 'underscore' import $ from 'jquery' import 'jquery-migrate/dist/jquery-migrate.min' @@ -91,6 +103,7 @@ window['md5'] = md5 window['moment'] = moment window['OC'] = OC +setDeprecatedProp('OCDialogs', OC.dialogs, 'use OC.dialogs') window['OCP'] = OCP window['OCA'] = OCA window['escapeHTML'] = deprecate(escapeHTML, 'escapeHTML') |