X-Git-Url: https://git.openstreetmap.org./osqa.git/blobdiff_plain/c1a4dfda807ca08de7d3370fc421abc39d411264..cb4f846ea59604ea425b6726ce27ac7cd6d383d5:/forum/skins/default/templates/answer_edit.html diff --git a/forum/skins/default/templates/answer_edit.html b/forum/skins/default/templates/answer_edit.html index fbea230..c9d8466 100644 --- a/forum/skins/default/templates/answer_edit.html +++ b/forum/skins/default/templates/answer_edit.html @@ -35,22 +35,20 @@ }); - function submitClicked(e) { - if(!is_chrome) { + function submitClicked(e, f) { + if(!(browserTester('chrome') || browserTester('safari'))) { $("input.submit")[0].disabled=true; $("input.submit")[1].disabled=true; } window.removeEventListener('beforeunload', beforeUnload, true); + if (f) { + f.submit(); + } } function beforeUnload(e) { - var is_chrome = navigator.userAgent.toLowerCase().indexOf('chrome') > -1; if($("textarea#editor")[0].value != answer) { - if(is_chrome) { - return "Are you sure you want to leave? Your work will be lost."; - } else { - yourWorkWillBeLost(e); - } + return yourWorkWillBeLost(e); } } window.addEventListener('beforeunload', beforeUnload, true); @@ -77,6 +75,7 @@
{% trans "toggle preview" %} + {% if settings.WIKI_ON %}
{{ form.wiki }} {{ form.wiki.label_tag }} @@ -91,8 +90,8 @@
{{ form.summary.help_text }}
- - + +