diff options
Diffstat (limited to 'core/src')
-rw-r--r-- | core/src/OC/index.js | 3 | ||||
-rw-r--r-- | core/src/OC/navigation.js | 31 |
2 files changed, 34 insertions, 0 deletions
diff --git a/core/src/OC/index.js b/core/src/OC/index.js index 63ba47ca7fa..6a918cc5226 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 00000000000..c841ed5751e --- /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() |