aboutsummaryrefslogtreecommitdiffstats
path: root/web
diff options
context:
space:
mode:
authorMatthew Somerville <matthew-github@dracos.co.uk>2017-07-17 13:30:07 +0100
committerMatthew Somerville <matthew-github@dracos.co.uk>2017-08-03 10:36:50 +0100
commit82350c8df0cb088e5d1eaf26833f9880700b496d (patch)
tree93891e67ed5bfd8e6e46430462cc0133ded28370 /web
parent26b71d818cf023968e2ee9afd1c4934f57c9111f (diff)
Use standard JS translation for show/hide pins.
Diffstat (limited to 'web')
-rw-r--r--web/js/map-OpenLayers.js25
-rw-r--r--web/js/map-google.js27
2 files changed, 17 insertions, 35 deletions
diff --git a/web/js/map-OpenLayers.js b/web/js/map-OpenLayers.js
index 549da6ebe..97507ea4a 100644
--- a/web/js/map-OpenLayers.js
+++ b/web/js/map-OpenLayers.js
@@ -566,23 +566,14 @@ var fixmystreet = fixmystreet || {};
$('#hide_pins_link').click(function(e) {
e.preventDefault();
- var showhide = [
- 'Show pins', 'Hide pins',
- 'Dangos pinnau', 'Cuddio pinnau',
- "Vis nåler", "Skjul nåler",
- "Zeige Stecknadeln", "Stecknadeln ausblenden",
- 'Visa kartnålar', 'Göm kartnålar'
- ];
- for (var i=0; i<showhide.length; i+=2) {
- if (this.innerHTML == showhide[i]) {
- fixmystreet.markers.setVisibility(true);
- fixmystreet.select_feature.activate();
- this.innerHTML = showhide[i+1];
- } else if (this.innerHTML == showhide[i+1]) {
- fixmystreet.markers.setVisibility(false);
- fixmystreet.select_feature.deactivate();
- this.innerHTML = showhide[i];
- }
+ if (this.innerHTML == translation_strings.show_pins) {
+ fixmystreet.markers.setVisibility(true);
+ fixmystreet.select_feature.activate();
+ this.innerHTML = translation_strings.hide_pins;
+ } else if (this.innerHTML == translation_strings.hide_pins) {
+ fixmystreet.markers.setVisibility(false);
+ fixmystreet.select_feature.deactivate();
+ this.innerHTML = translation_strings.show_pins;
}
});
diff --git a/web/js/map-google.js b/web/js/map-google.js
index 7155a372e..8819697eb 100644
--- a/web/js/map-google.js
+++ b/web/js/map-google.js
@@ -214,25 +214,16 @@ fixmystreet.maps = {};
$('#hide_pins_link').click(function(e) {
var i, m;
e.preventDefault();
- var showhide = [
- 'Show pins', 'Hide pins',
- 'Dangos pinnau', 'Cuddio pinnau',
- "Vis nåler", "Gjem nåler",
- "Zeige Stecknadeln", "Stecknadeln ausblenden",
- 'Visa kartnålar', 'Göm kartnålar'
- ];
- for (i=0; i<showhide.length; i+=2) {
- if (this.innerHTML == showhide[i]) {
- for (m=0; m<fixmystreet.markers.length; m++) {
- fixmystreet.markers[m].setMap(fixmystreet.map);
- }
- this.innerHTML = showhide[i+1];
- } else if (this.innerHTML == showhide[i+1]) {
- for (m=0; m<fixmystreet.markers.length; m++) {
- fixmystreet.markers[m].setMap(null);
- }
- this.innerHTML = showhide[i];
+ if (this.innerHTML == translation_strings.show_pins) {
+ for (m=0; m<fixmystreet.markers.length; m++) {
+ fixmystreet.markers[m].setMap(fixmystreet.map);
+ }
+ this.innerHTML = translation_strings.hide_pins;
+ } else if (this.innerHTML == translation_strings.hide_pins) {
+ for (m=0; m<fixmystreet.markers.length; m++) {
+ fixmystreet.markers[m].setMap(null);
}
+ this.innerHTML = translation_strings.show_pins;
}
});