diff options
author | Vincent Petry <pvince81@owncloud.com> | 2014-11-18 18:53:45 +0100 |
---|---|---|
committer | Vincent Petry <pvince81@owncloud.com> | 2014-12-15 12:10:54 +0100 |
commit | a5bb66f4a723bce5c5fbe919a48cd5133204ef62 (patch) | |
tree | b2e067bde8aaa1de6973adc7760fafb1e37e9084 /core/js | |
parent | c6be491a89a4eebe15bcb20f6e0b01f23a093761 (diff) | |
download | nextcloud-server-a5bb66f4a723bce5c5fbe919a48cd5133204ef62.tar.gz nextcloud-server-a5bb66f4a723bce5c5fbe919a48cd5133204ef62.zip |
Added favorites feature to the files app
Diffstat (limited to 'core/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 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: '_$!<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 |