summaryrefslogtreecommitdiffstats
path: root/core/js
diff options
context:
space:
mode:
authorRobin Appelman <robin@icewind.nl>2017-03-27 16:21:24 +0200
committerGitHub <noreply@github.com>2017-03-27 16:21:24 +0200
commitdc5ba954693ba95b687c517b1bad895f706c8309 (patch)
treee5056d979ca43a8e8604812a4ede27dc7ca6d3fd /core/js
parentfc044caab1813db961281cf0688867640edf7288 (diff)
parent4174d75f8661ca3a26ef8cdfd48a6f955491fdfe (diff)
downloadnextcloud-server-dc5ba954693ba95b687c517b1bad895f706c8309.tar.gz
nextcloud-server-dc5ba954693ba95b687c517b1bad895f706c8309.zip
Merge pull request #4027 from nextcloud/better-spreed-call-urls
Better spreed call urls
Diffstat (limited to 'core/js')
-rw-r--r--core/js/js.js24
1 files changed, 15 insertions, 9 deletions
diff --git a/core/js/js.js b/core/js/js.js
index 8c1a2e157d0..883431b2b02 100644
--- a/core/js/js.js
+++ b/core/js/js.js
@@ -2010,11 +2010,13 @@ OC.Util.History = {
* Note: this includes a workaround for IE8/IE9 that uses
* the hash part instead of the search part.
*
- * @param params to append to the URL, can be either a string
+ * @param {Object|string} params to append to the URL, can be either a string
* or a map
+ * @param {string} [url] URL to be used, otherwise the current URL will be used,
+ * using the params as query string
* @param {boolean} [replace=false] whether to replace instead of pushing
*/
- _pushState: function(params, replace) {
+ _pushState: function(params, url, replace) {
var strParams;
if (typeof(params) === 'string') {
strParams = params;
@@ -2023,7 +2025,7 @@ OC.Util.History = {
strParams = OC.buildQueryString(params);
}
if (window.history.pushState) {
- var url = location.pathname + '?' + strParams;
+ url = url || location.pathname + '?' + strParams;
// Workaround for bug with SVG and window.history.pushState on Firefox < 51
// https://bugzilla.mozilla.org/show_bug.cgi?id=652991
var isFirefox = navigator.userAgent.toLowerCase().indexOf('firefox') > -1;
@@ -2058,11 +2060,13 @@ OC.Util.History = {
* Note: this includes a workaround for IE8/IE9 that uses
* the hash part instead of the search part.
*
- * @param params to append to the URL, can be either a string
+ * @param {Object|string} params to append to the URL, can be either a string
* or a map
+ * @param {string} [url] URL to be used, otherwise the current URL will be used,
+ * using the params as query string
*/
- pushState: function(params) {
- return this._pushState(params, false);
+ pushState: function(params, url) {
+ return this._pushState(params, url, false);
},
/**
@@ -2071,11 +2075,13 @@ OC.Util.History = {
* Note: this includes a workaround for IE8/IE9 that uses
* the hash part instead of the search part.
*
- * @param params to append to the URL, can be either a string
+ * @param {Object|string} params to append to the URL, can be either a string
* or a map
+ * @param {string} [url] URL to be used, otherwise the current URL will be used,
+ * using the params as query string
*/
- replaceState: function(params) {
- return this._pushState(params, true);
+ replaceState: function(params, url) {
+ return this._pushState(params, url, true);
},
/**