summaryrefslogtreecommitdiffstats
path: root/core/js/js.js
diff options
context:
space:
mode:
authorLukas Reschke <lukas@owncloud.com>2014-12-15 19:55:18 +0100
committerLukas Reschke <lukas@owncloud.com>2014-12-15 19:55:18 +0100
commitbe3d4fd303569a99554dbc6c62ce8992a45c51ad (patch)
tree6ef59f62bee77bf49bdd313810e43eaaa67cc21e /core/js/js.js
parent76357af2d50b7f040109311286cc57ee53c44cf1 (diff)
parent207d77e5cdf6386dd22d87a5851adae38ad9f77f (diff)
downloadnextcloud-server-be3d4fd303569a99554dbc6c62ce8992a45c51ad.tar.gz
nextcloud-server-be3d4fd303569a99554dbc6c62ce8992a45c51ad.zip
Merge pull request #12360 from owncloud/files-tags
Add favorites to files app
Diffstat (limited to 'core/js/js.js')
-rw-r--r--core/js/js.js19
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