summaryrefslogtreecommitdiffstats
path: root/core/js/js.js
diff options
context:
space:
mode:
authorBjoern Schiessle <schiessle@owncloud.com>2013-09-16 10:40:06 +0200
committerBjoern Schiessle <schiessle@owncloud.com>2013-09-16 10:40:06 +0200
commit534d93d2d3d549039db2661cdc4b9e939a0abe0d (patch)
tree7868026ba14b6558c8e50b601a9a5fa85fdc585b /core/js/js.js
parentf8563ec5831713b341db1b2cd480328912818607 (diff)
parent46f59b165e5bd1908509e8a62b67bf983cfd6224 (diff)
downloadnextcloud-server-534d93d2d3d549039db2661cdc4b9e939a0abe0d.tar.gz
nextcloud-server-534d93d2d3d549039db2661cdc4b9e939a0abe0d.zip
Merge branch 'master' into sharing_mail_notification_master
Conflicts: apps/files/index.php
Diffstat (limited to 'core/js/js.js')
-rw-r--r--core/js/js.js32
1 files changed, 32 insertions, 0 deletions
diff --git a/core/js/js.js b/core/js/js.js
index 1999ff73d23..c09f80369f9 100644
--- a/core/js/js.js
+++ b/core/js/js.js
@@ -322,6 +322,38 @@ var OC={
return date.getDate()+'.'+(date.getMonth()+1)+'.'+date.getFullYear()+', '+date.getHours()+':'+date.getMinutes();
},
/**
+ * Parses a URL query string into a JS map
+ * @param queryString query string in the format param1=1234&param2=abcde&param3=xyz
+ * @return map containing key/values matching the URL parameters
+ */
+ parseQueryString:function(queryString){
+ var parts,
+ components,
+ result = {},
+ key,
+ value;
+ if (!queryString){
+ return null;
+ }
+ if (queryString[0] === '?'){
+ queryString = queryString.substr(1);
+ }
+ parts = queryString.split('&');
+ for (var i = 0; i < parts.length; i++){
+ components = parts[i].split('=');
+ if (!components.length){
+ continue;
+ }
+ key = decodeURIComponent(components[0]);
+ if (!key){
+ continue;
+ }
+ value = components[1];
+ result[key] = value && decodeURIComponent(value);
+ }
+ return result;
+ },
+ /**
* Opens a popup with the setting for an app.
* @param appid String. The ID of the app e.g. 'calendar', 'contacts' or 'files'.
* @param loadJS boolean or String. If true 'js/settings.js' is loaded. If it's a string