diff options
Diffstat (limited to 'web/cobrands/bathnes/js.js')
-rw-r--r-- | web/cobrands/bathnes/js.js | 36 |
1 files changed, 5 insertions, 31 deletions
diff --git a/web/cobrands/bathnes/js.js b/web/cobrands/bathnes/js.js index 0ed4c3d96..418e0650c 100644 --- a/web/cobrands/bathnes/js.js +++ b/web/cobrands/bathnes/js.js @@ -4,37 +4,11 @@ if (!fixmystreet.maps) { return; } -fixmystreet.roadworks.display_message = function(feature) { - var attr = feature.attributes, - start = new Date(attr.start.replace(/{ts '([^ ]*).*/, '$1')).toDateString(), - end = new Date(attr.end.replace(/{ts '([^ ]*).*/, '$1')).toDateString(), - tooltip = attr.tooltip.replace(/\\n/g, '\n'), - desc = attr.works_desc.replace(/\\n/g, '\n'); - - var $msg = $('<div class="js-roadworks-message box-warning"><h3>Roadworks are scheduled near this location, so you may not need to report your issue.</h3></div>'); - var $dl = $("<dl></dl>").appendTo($msg); - $dl.append("<dt>Dates:</dt>"); - $dl.append($("<dd></dd>").text(start + " until " + end)); - $dl.append("<dt>Summary:</dt>"); - var $summary = $("<dd></dd>").appendTo($dl); - tooltip.split("\n").forEach(function(para) { - if (para.match(/^(\d{2}\s+\w{3}\s+(\d{2}:\d{2}\s+)?\d{4}( - )?){2}/)) { - // skip showing the date again - return; - } - if (para.match(/^delays/)) { - // skip showing traffic delay information - return; - } - $summary.append(para).append("<br />"); - }); - if (desc) { - $dl.append("<dt>Description:</dt>"); - $dl.append($("<dd></dd>").text(desc)); - } - $dl.append($("<p>If you think this issue needs immediate attention you can continue your report below</p>")); - - $('.change_location').after($msg); +fixmystreet.roadworks.config = { + tag_top: 'h3', + colon: true, + skip_delays: true, + text_after: "<p>If you think this issue needs immediate attention you can continue your report below</p>" }; fixmystreet.roadworks.filter = function(feature) { |