X-Git-Url: https://git.openstreetmap.org./osqa.git/blobdiff_plain/3d2eba570bc4586884cc112b1920a4273b4d11c1..6278f4396ce969cb7fae8a275047c9d96203db08:/forum/skins/default/templates/question.html diff --git a/forum/skins/default/templates/question.html b/forum/skins/default/templates/question.html index 7afcf40..efb797b 100644 --- a/forum/skins/default/templates/question.html +++ b/forum/skins/default/templates/question.html @@ -8,13 +8,16 @@ {% load humanize %} {% load i18n %} {% load cache %} -{% block metadescription %}{{question.summary}}{% endblock %} +{% block metadescription %}{{ question.meta_description }}{% endblock %} {% block metakeywords %}{{question.tagname_meta_generator}}{% endblock %} -{% block title %}{% spaceless %}{{ question.headline }}{% endspaceless %}{% endblock %} -{% block forejs %} +{% block meta %} +{% endblock %} +{% block title %}{% spaceless %}{{ question.headline }}{% endspaceless %}{% endblock %} +{% block forejs %} {% if not question.nis.closed %} + @@ -43,38 +46,30 @@ }); }); - 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) { - var is_chrome = navigator.userAgent.toLowerCase().indexOf('chrome') > -1; if($("textarea#editor")[0].value != "") { - if(is_chrome) { - return "You sure you want to leave? Your work will be lost."; - } else { - yourWorkWillBeLost(e); - } - return false; + return yourWorkWillBeLost(e); } var commentBoxes = $("textarea.commentBox"); for(var index = 0; index < commentBoxes.length; index++) { if(commentBoxes[index].value != "") { - if(is_chrome) { - return "You sure you want to leave? Your work will be lost."; - } else { - yourWorkWillBeLost(e); - } - return false; + return yourWorkWillBeLost(e); } } } window.addEventListener('beforeunload', beforeUnload, true); - - var is_chrome = navigator.userAgent.toLowerCase().indexOf('chrome') > -1;