summaryrefslogtreecommitdiffstats
path: root/core/src/OC
diff options
context:
space:
mode:
authorChristoph Wurst <christoph@winzerhof-wurst.at>2019-04-29 17:55:27 +0200
committerChristoph Wurst <christoph@winzerhof-wurst.at>2019-04-29 17:55:27 +0200
commit1ee03bd683e23eb36b4f3a9b0cc773e384167a6e (patch)
tree5e8c8ec7e7b68393cffab0e80cc5b26cf90dbc04 /core/src/OC
parent01410491b982a9ed5fffe1adf63ee8c00f565d5b (diff)
downloadnextcloud-server-1ee03bd683e23eb36b4f3a9b0cc773e384167a6e.tar.gz
nextcloud-server-1ee03bd683e23eb36b4f3a9b0cc773e384167a6e.zip
Move OC navigation methods to the bundle
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
Diffstat (limited to 'core/src/OC')
-rw-r--r--core/src/OC/index.js3
-rw-r--r--core/src/OC/navigation.js31
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()