From: Tom Hughes Date: Tue, 24 Feb 2015 00:30:25 +0000 (+0000) Subject: Fix some more JSHint issues X-Git-Tag: live~4812 X-Git-Url: https://git.openstreetmap.org./rails.git/commitdiff_plain/6d124f801224ee441dbb7e67b912b8689cab6dfb?ds=sidebyside Fix some more JSHint issues --- diff --git a/app/assets/javascripts/index/directions/mapquest.js b/app/assets/javascripts/index/directions/mapquest.js index 0daeaa139..6b24fb3bc 100644 --- a/app/assets/javascripts/index/directions/mapquest.js +++ b/app/assets/javascripts/index/directions/mapquest.js @@ -48,9 +48,10 @@ function MapQuestEngine(id, vehicleParam) { if (data.info.statuscode !== 0) return callback(true); + var i; var line = []; var shape = data.route.shape.shapePoints; - for (var i = 0; i < shape.length; i += 2) { + for (i = 0; i < shape.length; i += 2) { line.push(L.latLng(shape[i], shape[i + 1])); } @@ -58,7 +59,7 @@ function MapQuestEngine(id, vehicleParam) { // data.route.legs[0].maneuvers is list of turns var steps = []; var mq = data.route.legs[0].maneuvers; - for (var i = 0; i < mq.length; i++) { + for (i = 0; i < mq.length; i++) { var s = mq[i]; var d; var linesegstart, linesegend, lineseg; diff --git a/app/assets/javascripts/index/note.js b/app/assets/javascripts/index/note.js index 6062f7003..5bf3f543a 100644 --- a/app/assets/javascripts/index/note.js +++ b/app/assets/javascripts/index/note.js @@ -1,6 +1,5 @@ OSM.Note = function (map) { - var noteLayer = map.noteLayer, - content = $('#sidebar_content'), + var content = $('#sidebar_content'), page = {}, halo, currentNote; diff --git a/app/assets/javascripts/index/query.js b/app/assets/javascripts/index/query.js index 117d12df3..9e82aa496 100644 --- a/app/assets/javascripts/index/query.js +++ b/app/assets/javascripts/index/query.js @@ -87,9 +87,10 @@ OSM.Query = function(map) { }); } else { var prefixes = I18n.t("geocoder.search_osm_nominatim.prefix"); + var key, value; - for (var key in tags) { - var value = tags[key]; + for (key in tags) { + value = tags[key]; if (prefixes[key]) { if (prefixes[key][value]) { @@ -98,8 +99,8 @@ OSM.Query = function(map) { } } - for (var key in tags) { - var value = tags[key]; + for (key in tags) { + value = tags[key]; if (prefixes[key]) { var first = value.substr(0, 1).toUpperCase(), diff --git a/app/assets/javascripts/leaflet.layers.js b/app/assets/javascripts/leaflet.layers.js index 49d19f123..d2928068d 100644 --- a/app/assets/javascripts/leaflet.layers.js +++ b/app/assets/javascripts/leaflet.layers.js @@ -34,12 +34,12 @@ L.OSM.layers = function(options) { .attr('class', 'section base-layers') .appendTo($ui); - list = $('