aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Somerville <matthew-github@dracos.co.uk>2016-04-26 17:43:56 +0100
committerMatthew Somerville <matthew-github@dracos.co.uk>2016-04-26 17:43:56 +0100
commit823a89616d40ebaaf769bff155f88c1e37dd1d00 (patch)
treeba06b1d9c9b18c44dee21db9e85b38b5898a474a
parent3eaca677cb5fe6bdab674339b42027bcc2102751 (diff)
Specify that FMS_URL should not have an end slash.
This way round is better in case of URLs returned from the server (e.g. for photos) that will have a starting slash.
-rw-r--r--www/js/config.js-example3
-rw-r--r--www/js/locate.js2
-rw-r--r--www/js/models/report.js6
3 files changed, 6 insertions, 5 deletions
diff --git a/www/js/config.js-example b/www/js/config.js-example
index 3e69b2d..33b4276 100644
--- a/www/js/config.js-example
+++ b/www/js/config.js-example
@@ -6,7 +6,8 @@ var CONFIG = {
APP_NAME: 'FixMyStreet',
// URL of the fixmystreet install to report to. See also config.xml-example
- FMS_URL: 'http://fixmystreet.example.org/',
+ // Make sure it does *not* end with a slash.
+ FMS_URL: 'http://fixmystreet.example.org',
// Name of the cobrand to use for templates, stylesheets etc.
// Cobrand files should be placed in a new directory within www/cobrands/
diff --git a/www/js/locate.js b/www/js/locate.js
index 97beece..b589ddf 100644
--- a/www/js/locate.js
+++ b/www/js/locate.js
@@ -108,7 +108,7 @@
}
var that = this;
$.ajax( {
- url: CONFIG.FMS_URL + 'report/new/ajax',
+ url: CONFIG.FMS_URL + '/report/new/ajax',
global: showSpinner,
dataType: 'json',
data: {
diff --git a/www/js/models/report.js b/www/js/models/report.js
index 9e6290c..19ad503 100644
--- a/www/js/models/report.js
+++ b/www/js/models/report.js
@@ -1,7 +1,7 @@
(function(FMS, Backbone, _, $) {
_.extend( FMS, {
Report: Backbone.Model.extend({
- urlRoot: CONFIG.FMS_URL + 'report/ajax',
+ urlRoot: CONFIG.FMS_URL + '/report/ajax',
defaults: {
lat: 0,
@@ -177,12 +177,12 @@
});
window.setTimeout( checkUpload, 15000 );
FMS.uploading = true;
- ft.upload(fileURI, CONFIG.FMS_URL + "report/new/mobile", fileUploadSuccess, fileUploadFail, fileOptions);
+ ft.upload(fileURI, CONFIG.FMS_URL + "/report/new/mobile", fileUploadSuccess, fileUploadFail, fileOptions);
};
setupChecker();
} else {
$.ajax( {
- url: CONFIG.FMS_URL + "report/new/mobile",
+ url: CONFIG.FMS_URL + "/report/new/mobile",
type: 'POST',
data: params,
dataType: 'json',