X-Git-Url: https://git.openstreetmap.org./osqa.git/blobdiff_plain/3d2eba570bc4586884cc112b1920a4273b4d11c1..cb4f846ea59604ea425b6726ce27ac7cd6d383d5:/forum/skins/default/templates/ask.html diff --git a/forum/skins/default/templates/ask.html b/forum/skins/default/templates/ask.html index c65bf9f..b027ce4 100644 --- a/forum/skins/default/templates/ask.html +++ b/forum/skins/default/templates/ask.html @@ -61,24 +61,23 @@ }); - function submitClicked(e) { - if(!is_chrome)$("input.submit")[0].disabled=true; + function submitClicked(e, f) { + if(!(browserTester('chrome') || browserTester('safari'))) { + $("input.submit")[0].disabled=true; + } window.removeEventListener('beforeunload', beforeUnload, true); + if (f) { + f.submit(); + } } function beforeUnload(e) { if($("input#id_title")[0].value != "" || $("textarea#editor")[0].value != "" || $("input#id_tags")[0].value != "") { - if(is_chrome) { - return "You sure you want to leave? Your work will be lost."; - } else { - yourWorkWillBeLost(e); - } + return yourWorkWillBeLost(e); } - return false; } window.addEventListener('beforeunload', beforeUnload, true); - var is_chrome = navigator.userAgent.toLowerCase().indexOf('chrome') > -1; var related_questions_url = "{% url related_questions %}"; @@ -125,6 +124,7 @@ {% trans "toggle preview" %} + {% if settings.WIKI_ON %} {{ form.wiki }} {{ form.wiki.label_tag }} @@ -145,9 +145,9 @@ {{ form.tags.help_text }}

{% if not request.user.is_authenticated %} - + {% else %} - + {% endif %}