summaryrefslogtreecommitdiffstats
path: root/core/js/js.js
diff options
context:
space:
mode:
authorJoas Schilling <nickvergessen@owncloud.com>2015-11-16 14:21:45 +0100
committerJoas Schilling <nickvergessen@owncloud.com>2015-11-16 14:23:43 +0100
commit78c456b8958e15d10109e2cf4a6fea99d4b7ea46 (patch)
tree656ed0e4f3c45267cb12e877190c3238df18fc64 /core/js/js.js
parenta03b1f1ee9a5b641544847d0efd22b29e2e41b30 (diff)
downloadnextcloud-server-78c456b8958e15d10109e2cf4a6fea99d4b7ea46.tar.gz
nextcloud-server-78c456b8958e15d10109e2cf4a6fea99d4b7ea46.zip
Allow creating OCS v2 links in JS
Diffstat (limited to 'core/js/js.js')
-rw-r--r--core/js/js.js6
1 files changed, 4 insertions, 2 deletions
diff --git a/core/js/js.js b/core/js/js.js
index 07320a1d225..57c9871233b 100644
--- a/core/js/js.js
+++ b/core/js/js.js
@@ -119,10 +119,12 @@ var OC={
/**
* Gets the base path for the given OCS API service.
* @param {string} service name
+ * @param {int} version OCS API version
* @return {string} OCS API base path
*/
- linkToOCS: function(service) {
- return window.location.protocol + '//' + window.location.host + OC.webroot + '/ocs/v1.php/' + service + '/';
+ linkToOCS: function(service, version) {
+ version = (version !== 2) ? 1 : 2;
+ return window.location.protocol + '//' + window.location.host + OC.webroot + '/ocs/v' + version + '.php/' + service + '/';
},
/**