Allow creating OCS v2 links in JS
This commit is contained in:
parent
a03b1f1ee9
commit
78c456b895
1 changed files with 4 additions and 2 deletions
|
@ -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 + '/';
|
||||
},
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue