diff options
author | Struan Donald <struan@exo.org.uk> | 2014-10-03 15:07:08 +0100 |
---|---|---|
committer | Dave Arter <davea@mysociety.org> | 2015-08-28 14:27:15 +0100 |
commit | a69d425c0e5c004145ac1ab70e2f7f9fc329b54c (patch) | |
tree | 8eb7ff0ff7aaa0fce8bc7214ec6e15b694fddbdc /src/js/views/locator.js | |
parent | 8fd15b58733c51d7f001f9eac66b7d03830ec0b4 (diff) |
update Android to Cordova 3.6
Required due to security issue
Remove Android directory as no longer required, move src -> www to match
standard layout, update .gitignore to avoid including the standard
platform files, update README based on Steve's zurich one
Diffstat (limited to 'src/js/views/locator.js')
-rw-r--r-- | src/js/views/locator.js | 69 |
1 files changed, 0 insertions, 69 deletions
diff --git a/src/js/views/locator.js b/src/js/views/locator.js deleted file mode 100644 index 8e067a9..0000000 --- a/src/js/views/locator.js +++ /dev/null @@ -1,69 +0,0 @@ -(function (FMS, Backbone, _, $) { - _.extend( FMS, { - LocatorView: FMS.FMSView.extend({ - skipLocationCheck: false, - - locate: function() { - $(document).delegate('.ui-content', 'touchmove', false); - $('#locating').show(); - this.listenTo(FMS.locator, 'gps_located', this.gotLocation); - this.listenTo(FMS.locator, 'gps_failed', this.failedLocation); - this.listenTo(FMS.locator, 'gps_locating', this.locationUpdate); - - FMS.locator.geolocate(CONFIG.ACCURACY, this.skipLocationCheck); - this.startLocateProgress(); - }, - - startLocateProgress: function() { - this.located = false; - this.locateCount = 1; - var that = this; - window.setTimeout( function() {that.showLocateProgress();}, 1000); - }, - - locationUpdate: function( accuracy ) { - if ( accuracy && accuracy < 500 ) { - $('#progress-bar').css( 'background-color', 'orange' ); - } else if ( accuracy && accuracy < 250 ) { - $('#progress-bar').css( 'background-color', 'yellow' ); - } else { - $('#progress-bar').css( 'background-color', 'grey' ); - } - - $('#accuracy').text(parseInt(accuracy, 10) + 'm'); - }, - - showLocateProgress: function() { - if ( $('#locating').css('display') == 'none' ) { - return; - } - if ( !this.located && this.locateCount > 20 ) { - var details = { msg: FMS.strings.geolocation_failed }; - this.failedLocation(details); - return; - } - var percent = ( this.locateCount / 20 ) * 100; - $('#progress-bar').css( 'width', percent + '%' ); - this.locateCount++; - var that = this; - window.setTimeout( function() {that.showLocateProgress();}, 1000); - }, - - finishedLocating: function() { - this.stopListening(FMS.locator, 'gps_locating'); - this.stopListening(FMS.locator, 'gps_located'); - this.stopListening(FMS.locator, 'gps_failed'); - $(document).undelegate('.ui-content', 'touchmove', false); - $('#locating').hide(); - }, - - failedLocation: function(details) { - this.finishedLocating(); - }, - - gotLocation: function(info) { - this.finishedLocating(); - } - }) - }); -})(FMS, Backbone, _, $); |