diff options
author | Jesus Macias Portela <jesus.macias.portela@gmail.com> | 2015-12-03 12:35:49 +0100 |
---|---|---|
committer | Jesus Macias Portela <jesus.macias.portela@gmail.com> | 2015-12-03 12:35:49 +0100 |
commit | dcfbbe4737e9939b6c038f8e48b49957c66a52e8 (patch) | |
tree | 8163f2d7537708d7d5486a093bb3dab9cc63f9d2 /core/js/js.js | |
parent | a79ae4ae086c08c75a6d974966458251e2167347 (diff) | |
parent | e62b6c1617886b2cdd7553ea9b119c431e4eb363 (diff) | |
download | nextcloud-server-dcfbbe4737e9939b6c038f8e48b49957c66a52e8.tar.gz nextcloud-server-dcfbbe4737e9939b6c038f8e48b49957c66a52e8.zip |
Merge branch 'master' into issue_20427
Diffstat (limited to 'core/js/js.js')
-rw-r--r-- | core/js/js.js | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/core/js/js.js b/core/js/js.js index 07320a1d225..cbdffd0f016 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 + '/'; }, /** @@ -158,7 +160,11 @@ var OC={ url = '/' + url; } - // TODO save somewhere whether the webserver is able to skip the index.php to have shorter links (e.g. for sharing) + + if(oc_config.modRewriteWorking == true) { + return OC.webroot + _build(url, params); + } + return OC.webroot + '/index.php' + _build(url, params); }, @@ -1426,7 +1432,6 @@ function initCore() { $('body').delegate('#app-content', 'apprendered appresized', adjustControlsWidth); } - } $(document).ready(initCore); |