Allow creating OCS v2 links in JS
This commit is contained in:
parent
a03b1f1ee9
commit
78c456b895
|
@ -119,10 +119,12 @@ var OC={
|
||||||
/**
|
/**
|
||||||
* Gets the base path for the given OCS API service.
|
* Gets the base path for the given OCS API service.
|
||||||
* @param {string} service name
|
* @param {string} service name
|
||||||
|
* @param {int} version OCS API version
|
||||||
* @return {string} OCS API base path
|
* @return {string} OCS API base path
|
||||||
*/
|
*/
|
||||||
linkToOCS: function(service) {
|
linkToOCS: function(service, version) {
|
||||||
return window.location.protocol + '//' + window.location.host + OC.webroot + '/ocs/v1.php/' + service + '/';
|
version = (version !== 2) ? 1 : 2;
|
||||||
|
return window.location.protocol + '//' + window.location.host + OC.webroot + '/ocs/v' + version + '.php/' + service + '/';
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue