From 01a4db0ab0287fc44c82be9d0abbe54e9ff38b74 Mon Sep 17 00:00:00 2001 From: Bartek Fabiszewski Date: Fri, 9 Nov 2018 20:39:28 +0100 Subject: [PATCH] Fix quotation marks consistency in js --- js/admin.js | 2 +- js/api_gmaps.js | 6 +++--- js/api_openlayers.js | 4 ++-- js/main.js | 14 +++++++------- js/pass.js | 4 ++-- js/track.js | 2 +- 6 files changed, 16 insertions(+), 16 deletions(-) diff --git a/js/admin.js b/js/admin.js index 80357c5..13c979a 100644 --- a/js/admin.js +++ b/js/admin.js @@ -83,7 +83,7 @@ function submitUser(action) { xhr.onreadystatechange = function() { if (xhr.readyState == 4) { var error = true; - var message = ""; + var message = ''; if (xhr.status == 200) { var xml = xhr.responseXML; if (xml) { diff --git a/js/api_gmaps.js b/js/api_gmaps.js index a546617..0974ac1 100755 --- a/js/api_gmaps.js +++ b/js/api_gmaps.js @@ -40,7 +40,7 @@ function init() { mapTypeId: google.maps.MapTypeId.ROADMAP, scaleControl: true }; - map = new google.maps.Map(document.getElementById("map-canvas"), mapOptions); + map = new google.maps.Map(document.getElementById('map-canvas'), mapOptions); } function cleanup() { map = undefined; @@ -50,7 +50,7 @@ function cleanup() { popup = undefined; polyOptions = undefined; mapOptions = undefined; - document.getElementById("map-canvas").innerHTML = ''; + document.getElementById('map-canvas').innerHTML = ''; } function displayTrack(xml, update) { @@ -188,7 +188,7 @@ function zoomToBounds(b) { function gm_authFailure() { gm_error = true; - message = sprintf(lang['apifailure'], "Google Maps"); + message = sprintf(lang['apifailure'], 'Google Maps'); message += '

' + lang['gmauthfailure']; message += '

' + lang['gmapilink']; showModal(message); diff --git a/js/api_openlayers.js b/js/api_openlayers.js index b4677bc..248c673 100755 --- a/js/api_openlayers.js +++ b/js/api_openlayers.js @@ -185,7 +185,7 @@ function init() { }); // change mouse cursor when over marker - map.on("pointermove", function(e) { + map.on('pointermove', function(e) { var hit = map.forEachFeatureAtPixel(e.pixel, function(feature, layer) { if (layer.get('name') == 'Markers') { return true; @@ -287,7 +287,7 @@ function cleanup() { olStyles = undefined; removeElementById('popup'); removeElementById('switcher'); - document.getElementById("map-canvas").innerHTML = ''; + document.getElementById('map-canvas').innerHTML = ''; } function displayTrack(xml, update) { diff --git a/js/main.js b/js/main.js index f21c27f..d377fb0 100755 --- a/js/main.js +++ b/js/main.js @@ -135,7 +135,7 @@ function getXHR() { } function loadTrack(userid, trackid, update) { - var title = document.getElementById("track").getElementsByClassName("menutitle")[0]; + var title = document.getElementById('track').getElementsByClassName('menutitle')[0]; if (trackid < 0) { return; } if (latest == 1) { trackid = 0; } var xhr = getXHR(); @@ -262,7 +262,7 @@ function exportFile(type, userid, trackid) { function importFile(input) { var form = input.parentElement; - var title = form.parentElement.getElementsByClassName("menutitle")[0]; + var title = form.parentElement.getElementsByClassName('menutitle')[0]; var sizeMax = form.elements['MAX_FILE_SIZE'].value; if (input.files && input.files.length == 1 && input.files[0].size > sizeMax) { alert(sprintf(lang['isizefailure'], sizeMax)); @@ -272,7 +272,7 @@ function importFile(input) { xhr.onreadystatechange = function() { if (xhr.readyState == 4) { var error = true; - var message = ""; + var message = ''; if (xhr.status == 200) { var xml = xhr.responseXML; if (xml) { @@ -298,9 +298,9 @@ function importFile(input) { xhr = null; } } - xhr.open("POST", "utils/import.php", true); + xhr.open('POST', 'utils/import.php', true); xhr.send(new FormData(form)); - input.value = ""; + input.value = ''; setLoader(title); } @@ -400,7 +400,7 @@ function selectUser(f) { } function getTracks(userid, trackid) { - var title = document.getElementById("track").getElementsByClassName("menutitle")[0]; + var title = document.getElementById('track').getElementsByClassName('menutitle')[0]; var xhr = getXHR(); xhr.onreadystatechange = function () { if (xhr.readyState == 4) { @@ -431,7 +431,7 @@ function fillOptions(xml, uid, tid) { for (var i = 0; i < trackLen; i++) { var trackid = getNode(tracks[i], 'trackid'); var trackname = getNode(tracks[i], 'trackname'); - var option = document.createElement("option"); + var option = document.createElement('option'); option.value = trackid; option.innerHTML = htmlEncode(trackname); trackSelect.appendChild(option); diff --git a/js/pass.js b/js/pass.js index 95723d7..651dafc 100644 --- a/js/pass.js +++ b/js/pass.js @@ -48,14 +48,14 @@ function submitPass() { xhr.onreadystatechange = function () { if (xhr.readyState == 4) { var error = true; - var message = ""; + var message = ''; if (xhr.status == 200) { var xml = xhr.responseXML; if (xml) { var root = xml.getElementsByTagName('root'); if (root.length && getNode(root[0], 'error') == 0) { removeModal(); - alert(lang["actionsuccess"]); + alert(lang['actionsuccess']); error = false; } else if (root.length) { errorMsg = getNode(root[0], 'message'); diff --git a/js/track.js b/js/track.js index c9c98a7..bbdb38c 100644 --- a/js/track.js +++ b/js/track.js @@ -67,7 +67,7 @@ function submitTrack(action) { xhr.onreadystatechange = function() { if (xhr.readyState == 4) { var error = true; - var message = ""; + var message = ''; if (xhr.status == 200) { var xml = xhr.responseXML; if (xml) {