diff options
Diffstat (limited to 'core/js/js.js')
-rw-r--r-- | core/js/js.js | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/core/js/js.js b/core/js/js.js index a4f66ac7d90..f01c0eb77c1 100644 --- a/core/js/js.js +++ b/core/js/js.js @@ -66,6 +66,7 @@ var OC={ PERMISSION_DELETE:8, PERMISSION_SHARE:16, PERMISSION_ALL:31, + TAG_FAVORITE: '_$!<Favorite>!$_', /* jshint camelcase: false */ webroot:oc_webroot, appswebroots:(typeof oc_appswebroots !== 'undefined') ? oc_appswebroots:false, @@ -212,6 +213,24 @@ var OC={ }, /** + * URI-Encodes a file path but keep the path slashes. + * + * @param path path + * @return encoded path + */ + encodePath: function(path) { + if (!path) { + return path; + } + var parts = path.split('/'); + var result = []; + for (var i = 0; i < parts.length; i++) { + result.push(encodeURIComponent(parts[i])); + } + return result.join('/'); + }, + + /** * Load a script for the server and load it. If the script is already loaded, * the event handler will be called directly * @param {string} app the app id to which the script belongs |