diff options
author | Thomas Müller <thomas.mueller@tmit.eu> | 2015-11-16 15:15:53 +0100 |
---|---|---|
committer | Thomas Müller <thomas.mueller@tmit.eu> | 2015-11-16 15:15:53 +0100 |
commit | 9ea81b71f51c1bddc37213821b17fd576da8df8a (patch) | |
tree | fc443546909fa5b986f33728c684bd775d514cbe | |
parent | 28ed2d8072879953fb197ef80ecbc6468874b62e (diff) | |
parent | 78c456b8958e15d10109e2cf4a6fea99d4b7ea46 (diff) | |
download | nextcloud-server-9ea81b71f51c1bddc37213821b17fd576da8df8a.tar.gz nextcloud-server-9ea81b71f51c1bddc37213821b17fd576da8df8a.zip |
Merge pull request #20532 from owncloud/ocs-allow-v2
Allow creating OCS v2 links in JS
-rw-r--r-- | core/js/js.js | 6 |
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 + '/'; }, /** |