aboutsummaryrefslogtreecommitdiffstats
path: root/core/js/js.js
diff options
context:
space:
mode:
Diffstat (limited to 'core/js/js.js')
-rw-r--r--core/js/js.js13
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);