From a5bb66f4a723bce5c5fbe919a48cd5133204ef62 Mon Sep 17 00:00:00 2001 From: Vincent Petry Date: Tue, 18 Nov 2014 18:53:45 +0100 Subject: Added favorites feature to the files app --- core/js/js.js | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'core/js/js.js') diff --git a/core/js/js.js b/core/js/js.js index cc3a548de28..d1713bf14a5 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: '_$!!$_', /* jshint camelcase: false */ webroot:oc_webroot, appswebroots:(typeof oc_appswebroots !== 'undefined') ? oc_appswebroots:false, @@ -211,6 +212,24 @@ var OC={ return OC.filePath(app,'img',file); }, + /** + * 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 -- cgit v1.2.3