aboutsummaryrefslogtreecommitdiffstats
path: root/web
diff options
context:
space:
mode:
Diffstat (limited to 'web')
-rw-r--r--web/cobrands/fixmystreet/fixmystreet.js2
-rw-r--r--web/cobrands/fixmystreet/offline.js32
-rw-r--r--web/cobrands/fixmystreet/staff.js2
-rw-r--r--web/cobrands/sass/_base.scss8
-rw-r--r--web/cobrands/sass/_layout.scss14
-rw-r--r--web/js/map-OpenLayers.js2
-rw-r--r--web/js/map-google-ol.js18
7 files changed, 54 insertions, 24 deletions
diff --git a/web/cobrands/fixmystreet/fixmystreet.js b/web/cobrands/fixmystreet/fixmystreet.js
index e92395661..a4bab095e 100644
--- a/web/cobrands/fixmystreet/fixmystreet.js
+++ b/web/cobrands/fixmystreet/fixmystreet.js
@@ -669,7 +669,7 @@ $.extend(fixmystreet.set_up, {
email_login_form: function() {
// Log in with email button
var email_form = $('#js-social-email-hide'),
- button = $('<button class="btn btn--social btn--social-email">Log in with email</button>'),
+ button = $('<button class="btn btn--social btn--social-email">'+translation_strings.login_with_email+'</button>'),
form_box = $('<div class="form-box"></div>');
button.click(function(e) {
e.preventDefault();
diff --git a/web/cobrands/fixmystreet/offline.js b/web/cobrands/fixmystreet/offline.js
index 0fdad1279..e6e50d3e8 100644
--- a/web/cobrands/fixmystreet/offline.js
+++ b/web/cobrands/fixmystreet/offline.js
@@ -2,17 +2,27 @@ fixmystreet.offlineBanner = (function() {
var toCache = 0;
var cachedSoFar = 0;
+ // Extremely noddy function
+ function sprintf(s, p) {
+ return s.replace('%s', p);
+ }
+
+ // Note this non-global way of handling plurals may need looking at in future
function formText() {
var num = fixmystreet.offlineData.getForms().length;
- return num + ' update' + (num===1 ? '' : 's');
+ if ( num === 1 ) {
+ return num + translation_strings.offline.update_single;
+ } else {
+ return num + translation_strings.offline.update_plural;
+ }
}
function onlineText() {
- return 'You have <a id="oFN" href=""><span>' + formText() + '</span> saved to submit</a>.';
+ return sprintf(translation_strings.offline.saved_to_submit, formText());
}
function offlineText() {
- return 'You are offline \u2013 <span>' + formText() + '</span> saved.';
+ return translation_strings.offline.you_are_offline + ' \u2013 ' + sprintf(translation_strings.offline.N_saved, formText());
}
function remove() {
@@ -87,12 +97,12 @@ fixmystreet.offlineBanner = (function() {
startProgress: function(l) {
$('.top_banner--offline').slideDown();
toCache = l;
- $('#offline_saving').html('Saving reports offline &ndash; <span>0</span>/' + toCache + '.');
+ $('#offline_saving').html(translation_strings.offline.saving_reports + ' &ndash; <span>0</span>/' + toCache + '.');
},
progress: function() {
cachedSoFar += 1;
if (cachedSoFar === toCache) {
- $('#offline_saving').text('Reports saved offline.');
+ $('#offline_saving').text(translation_strings.offline.reports_saved);
window.setTimeout(remove, 3000);
} else {
$('#offline_saving span').text(cachedSoFar);
@@ -367,10 +377,10 @@ if ($('#offline_list').length) {
if (!success) {
var html = localStorage.getItem('/my/planned');
if (html) {
- $('#offline_list').before('<h2>Your offline reports</h2>');
+ $('#offline_list').before('<h2>'+translation_strings.offline.your_reports+'</h2>');
$('#offline_list').html(html);
if (location.search.indexOf('saved=1') > 0) {
- $('#offline_list').before('<p class="form-success">Your update has been saved offline for submission when back online.</p>');
+ $('#offline_list').before('<p class="form-success">'+translation_strings.offline.update_saved+'</p>');
}
fixmystreet.offline.replaceImages('#offline_list img');
var offlineForms = fixmystreet.offlineData.getForms();
@@ -380,16 +390,16 @@ if ($('#offline_list').length) {
});
$('#offline_list a').each(function(i, a) {
if (savedForms[a.href]) {
- $(this).find('h3').prepend('<em>Offline update data saved</em> ');
+ $(this).find('h3').prepend('<em>'+translation_strings.offline.update_data_saved+'</em> ');
}
});
- $('#offline_clear').css('margin-top', '5em').html('<button id="js-clear-localStorage">Clear offline data</button>');
+ $('#offline_clear').css('margin-top', '5em').html('<button id="js-clear-localStorage">'+translation_strings.offline.clear_data+'</button>');
$('#js-clear-localStorage').click(function() {
- if (window.confirm("Are you sure?")) {
+ if (window.confirm(translation_strings.offline.are_you_sure)) {
fixmystreet.offline.removeReports(fixmystreet.offlineData.getCachedUrls());
fixmystreet.offlineData.clearForms();
localStorage.removeItem('/my/planned');
- alert('Offline data cleared');
+ alert(translation_strings.offline.data_cleared);
}
});
}
diff --git a/web/cobrands/fixmystreet/staff.js b/web/cobrands/fixmystreet/staff.js
index 9825a37ea..b92a70f9c 100644
--- a/web/cobrands/fixmystreet/staff.js
+++ b/web/cobrands/fixmystreet/staff.js
@@ -266,6 +266,8 @@ $.extend(fixmystreet.set_up, {
);
$("#problem_northing").text(bng.lat.toFixed(1));
$("#problem_easting").text(bng.lon.toFixed(1));
+ $("#problem_latitude").text(latlon.lat.toFixed(6));
+ $("#problem_longitude").text(latlon.lon.toFixed(6));
$("form#report_inspect_form input[name=latitude]").val(latlon.lat);
$("form#report_inspect_form input[name=longitude]").val(latlon.lon);
});
diff --git a/web/cobrands/sass/_base.scss b/web/cobrands/sass/_base.scss
index 25674aedd..54954023b 100644
--- a/web/cobrands/sass/_base.scss
+++ b/web/cobrands/sass/_base.scss
@@ -530,24 +530,24 @@ ul.error {
a, span {
display: block;
padding: 0.5em 1em;
- background: #f6f6f6;
+ background-color: #f6f6f6;
color: #333;
font-size: 1.25em;
border-bottom: 0.25em solid #333;
}
a:hover, span.hover {
- background: #333;
+ background-color: #333;
color: #fff;
text-decoration: none;
}
span {
- background: #ccc;
+ background-color: #ccc;
}
}
.nav-menu--mysoc {
a {
color: $primary_text;
- background: $primary;
+ background-color: $primary;
}
}
#mysoc-logo {
diff --git a/web/cobrands/sass/_layout.scss b/web/cobrands/sass/_layout.scss
index a390a4131..7e56d31bd 100644
--- a/web/cobrands/sass/_layout.scss
+++ b/web/cobrands/sass/_layout.scss
@@ -148,7 +148,7 @@ h1 {
a, span {
display: block;
color: $nav_fg;
- background: none;
+ background-color: transparent;
border-bottom: none;
}
}
@@ -158,16 +158,16 @@ h1 {
font-size: 0.9em;
}
a:hover {
- background: $nav_fg_hover;
+ background-color: $nav_fg_hover;
}
a.report-a-problem-btn {
color: $primary_text;
- background: $primary;
+ background-color: $primary;
padding:0.25em;
margin:0.5em;
@include border-radius(0.25em);
&:hover {
- background:$primary/1.1;
+ background-color:$primary/1.1;
}
}
span {
@@ -177,17 +177,17 @@ h1 {
.nav-menu--mysoc {
padding: 0em 0.5em;
margin-#{$left}: 0.25em;
- background: $primary;
+ background-color: $primary;
@include border-radius(0 0 0.375em 0.375em);
a {
- background:none;
+ background-color: transparent;
color: $primary_text;
text-transform: uppercase;
font-size: 0.6875em;
padding: 1.3em 0.7em 1em;
&:hover {
color: #fff;
- background: none;
+ background-color: transparent;
}
}
}
diff --git a/web/js/map-OpenLayers.js b/web/js/map-OpenLayers.js
index 2a5af940d..40539f385 100644
--- a/web/js/map-OpenLayers.js
+++ b/web/js/map-OpenLayers.js
@@ -331,6 +331,8 @@ var fixmystreet = fixmystreet || {};
);
$("#problem_northing").text(bng.y.toFixed(1));
$("#problem_easting").text(bng.x.toFixed(1));
+ $("#problem_latitude").text(lonlat.y.toFixed(6));
+ $("#problem_longitude").text(lonlat.x.toFixed(6));
$("form#report_inspect_form input[name=latitude]").val(lonlat.y);
$("form#report_inspect_form input[name=longitude]").val(lonlat.x);
},
diff --git a/web/js/map-google-ol.js b/web/js/map-google-ol.js
index 96ec6fe9b..7369a8e9f 100644
--- a/web/js/map-google-ol.js
+++ b/web/js/map-google-ol.js
@@ -33,8 +33,24 @@ fixmystreet.maps.config = function() {
zoomDuration: 10
};
+ var road_layer = {}; // Empty object defaults to standard road layer
+
+ function apply_map_styles() {
+ var styledMapType = new google.maps.StyledMapType(fixmystreet_google_maps_custom_style);
+ this.mapObject.mapTypes.set('styled', styledMapType);
+ this.mapObject.setMapTypeId('styled');
+ }
+ // If you want to apply a custom style to the road map (for example from
+ // a service such as snazzymaps.com) then define that style as a top-level
+ // variable called fixmystreet_google_maps_custom_style (you might have to
+ // override the maps/google-ol.html template to include your own JS file)
+ // and it'll automatically be applied.
+ if (typeof fixmystreet_google_maps_custom_style !== 'undefined') {
+ road_layer = { type: 'styled', eventListeners: { added: apply_map_styles } };
+ }
+
fixmystreet.layer_options = [
- {},
+ road_layer,
{ type: google.maps.MapTypeId.HYBRID }
];
};