diff --git a/core/js/dist/main.js b/core/js/dist/main.js index 667815b02d276a02f1b35a85fee52ff2f13e71de..618aaaf897722a3aa9684f2ad5e9a0bb2f1c31d8 100644 Binary files a/core/js/dist/main.js and b/core/js/dist/main.js differ diff --git a/core/js/dist/main.js.map b/core/js/dist/main.js.map index 67264b66f0237d2548ef964195d57073a6078eef..4d0eac8e0160edb0976c8829694df5179cf37aad 100644 Binary files a/core/js/dist/main.js.map and b/core/js/dist/main.js.map differ diff --git a/core/js/js.js b/core/js/js.js index 5e8532883b41444cb0c87b8a302d5fd7e16f0aa6..445b628855a95251e6ac0818fecff644c079612a 100644 --- a/core/js/js.js +++ b/core/js/js.js @@ -206,21 +206,6 @@ Object.assign(window.OC, { return !!(file.match(oc_config.blacklist_files_regex)); }, - /** - * Redirect to the target URL, can also be used for downloads. - * @param {string} targetURL URL to redirect to - */ - redirect: function(targetURL) { - window.location = targetURL; - }, - - /** - * Reloads the current page - */ - reload: function() { - window.location.reload(); - }, - /** * Protocol that is used to access this Nextcloud instance * @return {string} Used protocol diff --git a/core/src/OC/index.js b/core/src/OC/index.js index 63ba47ca7fa8816d2a02e969744105ac41fae931..6a918cc52260a01a4ad03e5dadab8554eeeb5680 100644 --- a/core/src/OC/index.js +++ b/core/src/OC/index.js @@ -31,6 +31,7 @@ import PasswordConfirmation from './password-confirmation' import Plugins from './plugins' import search from './search' import Util from './util' +import {redirect, reload} from './navigation' /** @namespace OC */ export default { @@ -46,4 +47,6 @@ export default { Plugins, search, Util, + redirect, + reload, } diff --git a/core/src/OC/navigation.js b/core/src/OC/navigation.js new file mode 100644 index 0000000000000000000000000000000000000000..c841ed5751eab6677bd394d92afd957bad9a5a67 --- /dev/null +++ b/core/src/OC/navigation.js @@ -0,0 +1,31 @@ +/* + * @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/>. + */ + +/** + * Redirect to the target URL, can also be used for downloads. + * @param {string} targetURL URL to redirect to + */ +export const redirect = targetURL => window.location = targetURL + +/** + * Reloads the current page + */ +export const reload = () => window.location.reload()