diff options
author | Vincent Petry <pvince81@owncloud.com> | 2013-08-17 13:07:18 +0200 |
---|---|---|
committer | Vincent Petry <pvince81@owncloud.com> | 2013-09-13 19:59:14 +0200 |
commit | 1304b511e9533dee4cf1125e625568c8a74719a1 (patch) | |
tree | 2430ff5abeeb0f378547e49cb4b311b41c035421 /core/js/js.js | |
parent | c149b57d3b4020c65d33966d5dc8395b8b821fc9 (diff) | |
download | nextcloud-server-1304b511e9533dee4cf1125e625568c8a74719a1.tar.gz nextcloud-server-1304b511e9533dee4cf1125e625568c8a74719a1.zip |
Ajax calls for "files" and "files_trashbin" apps
Frontend:
- The files app list now uses ajax calls to refresh the list.
- Added support the browser back button (history API).
- Added mask + spinner while loading file list
Backend:
- Added utility function in core JS for parsing query strings.
- Moved file list + breadcrumb template data code to helper
functions
- Fixed some file paths in trashbin app to be similar to the files app
Diffstat (limited to 'core/js/js.js')
-rw-r--r-- | core/js/js.js | 32 |
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¶m2=abcde¶m3=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 |