Allow creating OCS v2 links in JS

This commit is contained in:
Joas Schilling 2015-11-16 14:21:45 +01:00
parent a03b1f1ee9
commit 78c456b895
1 changed files with 4 additions and 2 deletions

View File

@ -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 + '/';
},
/**