diff options
author | Struan Donald <struan@exo.org.uk> | 2013-07-23 13:15:44 +0100 |
---|---|---|
committer | Struan Donald <struan@exo.org.uk> | 2013-07-23 13:15:44 +0100 |
commit | 05ec13abf0c4f40e2fb89f6b78a2e11a732f3bbf (patch) | |
tree | 6d695194baa338a3703c6533a6733823d5cd6c2c | |
parent | 824d64b179b3c49370d571b71f498eef7ed990d5 (diff) |
change to use phonegap API alert call so we can use a title in
the alert box and then use own internal function to call this to ensure
consistency
-rw-r--r-- | src/js/config.js-example | 3 | ||||
-rw-r--r-- | src/js/views/around.js | 2 | ||||
-rw-r--r-- | src/js/views/details.js | 2 | ||||
-rw-r--r-- | src/js/views/fms.js | 4 | ||||
-rw-r--r-- | src/js/views/offline.js | 2 | ||||
-rw-r--r-- | src/js/views/photo.js | 2 | ||||
-rw-r--r-- | src/js/views/submit.js | 4 |
7 files changed, 11 insertions, 8 deletions
diff --git a/src/js/config.js-example b/src/js/config.js-example index 392c021..92ce308 100644 --- a/src/js/config.js-example +++ b/src/js/config.js-example @@ -1,4 +1,7 @@ var CONFIG = { + // Name of app to use in alert dialog titles amongst other things + APP_NAME: '', + // URL of the fixmystreet install to report to FMS_URL: '', diff --git a/src/js/views/around.js b/src/js/views/around.js index 3e549e2..71f5da6 100644 --- a/src/js/views/around.js +++ b/src/js/views/around.js @@ -349,7 +349,7 @@ }, locationCheckFailed: function() { - alert(FMS.strings.location_check_failed); + this.displayAlert(FMS.strings.location_check_failed); }, goSearch: function(e) { diff --git a/src/js/views/details.js b/src/js/views/details.js index 514b84f..9f03d58 100644 --- a/src/js/views/details.js +++ b/src/js/views/details.js @@ -94,7 +94,7 @@ } }, error: function() { - alert(FMS.strings.category_extra_check_error); + that.displayAlert(FMS.strings.category_extra_check_error); } } ); } diff --git a/src/js/views/fms.js b/src/js/views/fms.js index 53cdc66..f60bf77 100644 --- a/src/js/views/fms.js +++ b/src/js/views/fms.js @@ -75,8 +75,8 @@ this.navigate( this.next ); }, - displayError: function(msg) { - alert(msg); + displayAlert: function(msg) { + navigator.notification.alert(msg, null, CONFIG.APP_NAME); }, validationError: function( id, error ) { diff --git a/src/js/views/offline.js b/src/js/views/offline.js index a98b488..0b0f5f8 100644 --- a/src/js/views/offline.js +++ b/src/js/views/offline.js @@ -88,7 +88,7 @@ if ( message != 'no image selected' && message != 'Selection cancelled.' && message != 'Camera cancelled.' ) { - this.displayError(FMS.strings.photo_failed); + this.displayAlert(FMS.strings.photo_failed); } }, diff --git a/src/js/views/photo.js b/src/js/views/photo.js index e3bb489..7acef6c 100644 --- a/src/js/views/photo.js +++ b/src/js/views/photo.js @@ -74,7 +74,7 @@ if ( message != 'no image selected' && message != 'Selection cancelled.' && message != 'Camera cancelled.' ) { - this.displayError(FMS.strings.photo_failed); + this.displayAlert(FMS.strings.photo_failed); } }, diff --git a/src/js/views/submit.js b/src/js/views/submit.js index c98dbf3..2d122d9 100644 --- a/src/js/views/submit.js +++ b/src/js/views/submit.js @@ -100,9 +100,9 @@ onReportError: function(model, err, options) { if ( err.errors ) { - navigator.notification.alert( FMS.strings.sync_error + ': ' + err.errors, null, 'FixMyStreet' ); + this.displayAlert(FMS.strings.sync_error + ': ' + err.errors); } else { - navigator.notification.alert( FMS.strings.unknown_sync_error, null, 'FixMyStreet' ); + this.displayAlert(FMS.strings.unknown_sync_error); } }, |