diff options
author | Struan Donald <struan@exo.org.uk> | 2012-03-13 16:24:59 +0000 |
---|---|---|
committer | Struan Donald <struan@exo.org.uk> | 2012-03-13 16:24:59 +0000 |
commit | c18dc4eae8a42ac90b4eceb74af5d347f9d868ec (patch) | |
tree | 0a6aed16ec2e7a9d6ac70387cf3301de87d85d56 | |
parent | c8980b86f8dfc37ede19463d7d126bc49e5cb2c4 (diff) |
move config out to file
-rw-r--r-- | phonegap/www/around.html | 2 | ||||
-rw-r--r-- | phonegap/www/index.html | 1 | ||||
-rw-r--r-- | phonegap/www/js/fixmystreet.js | 2 | ||||
-rw-r--r-- | phonegap/www/js/map-OpenLayers.js | 4 | ||||
-rw-r--r-- | phonegap/www/js/mobile.js | 10 |
5 files changed, 11 insertions, 8 deletions
diff --git a/phonegap/www/around.html b/phonegap/www/around.html index 0200b47ca..6367d4bf2 100644 --- a/phonegap/www/around.html +++ b/phonegap/www/around.html @@ -9,6 +9,8 @@ <link rel="stylesheet" href="css/base.css"> <link rel="stylesheet" href="css/layout.css" media="(min-width:48em)"> + +<script type="text/javascript" src="js/config.js"></script> <script type="text/javascript" charset="utf-8" src="cordova-1.5.0.js"></script> diff --git a/phonegap/www/index.html b/phonegap/www/index.html index 83602dfec..e113791a8 100644 --- a/phonegap/www/index.html +++ b/phonegap/www/index.html @@ -8,6 +8,7 @@ <link rel="stylesheet" href="css/base.css"> <!-- If your application is targeting iOS BEFORE 4.0 you MUST put json2.js from http://www.JSON.org/json2.js into your www directory and include it here --> + <script type="text/javascript" src="js/config.js"></script> <script type="text/javascript" charset="utf-8" src="cordova-1.5.0.js"></script> <script type="text/javascript" src="js/jquery-1.7.0.min.js"></script> <script src="js/jquery.validate.min.js" type="text/javascript" charset="utf-8"></script> diff --git a/phonegap/www/js/fixmystreet.js b/phonegap/www/js/fixmystreet.js index 13100aaca..de04ae2b6 100644 --- a/phonegap/www/js/fixmystreet.js +++ b/phonegap/www/js/fixmystreet.js @@ -17,7 +17,7 @@ function form_category_onchange() { args.longitude = $('input[name="longitude"]').val(); } - $.getJSON('http://struan.fixmystreet.com/report/new/category_extras', args, function(data) { + $.getJSON( CONFIG.FMS_URL + 'report/new/category_extras', args, function(data) { if ( data.category_extra ) { if ( $('#category_meta').size() ) { $('#category_meta').html( data.category_extra); diff --git a/phonegap/www/js/map-OpenLayers.js b/phonegap/www/js/map-OpenLayers.js index c3195761e..7eb92c3b1 100644 --- a/phonegap/www/js/map-OpenLayers.js +++ b/phonegap/www/js/map-OpenLayers.js @@ -102,7 +102,7 @@ function fixmystreet_onload() { fixmystreet.bbox_strategy = new OpenLayers.Strategy.BBOX({ ratio: 1 }); pin_layer_options.strategies = [ fixmystreet.bbox_strategy ]; pin_layer_options.protocol = new OpenLayers.Protocol.HTTP({ - url: 'http://matthew.fixmystreet.dev.mysociety.org/ajax', + url: CONFIG.FMS_URL + 'ajax', params: fixmystreet.all_pins ? { all_pins: 1 } : { }, format: new OpenLayers.Format.FixMyStreet() }); @@ -419,7 +419,7 @@ OpenLayers.Control.Click = OpenLayers.Class(OpenLayers.Control, { /*if (fixmystreet.page == 'new') { return; }*/ - $.getJSON('http://photek.local:3000/report/new/ajax', { + $.getJSON( CONFIG.FMS_URL + 'report/new/ajax', { latitude: $('#fixmystreet\\.latitude').val(), longitude: $('#fixmystreet\\.longitude').val() }, function(data) { diff --git a/phonegap/www/js/mobile.js b/phonegap/www/js/mobile.js index 7300e752c..73bb10e38 100644 --- a/phonegap/www/js/mobile.js +++ b/phonegap/www/js/mobile.js @@ -57,7 +57,7 @@ function lookup_string(q) { } var url = "http://dev.virtualearth.net/REST/v1/Locations?q=" + escape(q); - url += '&c=en-GB&key=Au4rfRu-kpWgzddOjaTRlLhvB8wkTAr5_ky96BOxlmtjM-3FRJhjSsfauaWQnS0Z'; + url += '&c=en-GB&key=' + CONFIG.BING_KEY; var x = jQuery.get( url, function(data, status) { if ( status == 'success' ) { var valid_locations = 0; @@ -105,7 +105,7 @@ function locate() { location_error(''); $("#multiple").remove(); var pc = $('#pc').val(); - + if (!pc) { location_error( "Please enter your location" ); return false; @@ -119,7 +119,7 @@ function locate() { } loadingStart( { 'backgroundOpacity' : 0.5, labelText: 'Getting Location...', minDuration: 1 } ); if ( valid_postcode( pc ) ) { - jQuery.get( 'http://mapit.mysociety.org/postcode/' + pc + '.json', function(data, status) { + jQuery.get( CONFIG.MAPIT_URL + 'postcode/' + pc + '.json', function(data, status) { if ( status == 'success' ) { show_around( data.wgs84_lat, data.wgs84_lon ); loadingStop(); @@ -221,10 +221,10 @@ function postReport(e) { options.params = params; var ft = new FileTransfer(); - ft.upload(fileURI, "http://photek.local:3000/report/new/mobile", fileUploadSuccess, fileUploadFail, options); + ft.upload(fileURI, CONFIG.FMS_URL + "report/new/mobile", fileUploadSuccess, fileUploadFail, options); } else { jQuery.ajax( { - url: "http://photek.local:3000/report/new/mobile", + url: CONFIG.FMS_URL + "report/new/mobile", type: 'POST', data: params, timeout: 30000, |