X-Git-Url: https://git.openstreetmap.org./osqa.git/blobdiff_plain/2fcb4175c3ee2d8223798a973bcf1dbdcc1cfa49..f76d8997ce081a9f2dfca9b875405362ece3608e:/forum/skins/default/templates/question.html
diff --git a/forum/skins/default/templates/question.html b/forum/skins/default/templates/question.html
index 430a304..1173ce9 100644
--- a/forum/skins/default/templates/question.html
+++ b/forum/skins/default/templates/question.html
@@ -8,12 +8,14 @@
{% 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 %}
@@ -30,7 +32,7 @@
}
$('#editor').TextAreaResizer();
-
+
//toggle preview of editor
var display = true;
var txt = "[{% trans "hide preview" %}]";
@@ -42,6 +44,31 @@
$('#pre-collapse').text(txt);
});
});
+
+ 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($("textarea#editor")[0].value != "") {
+ return yourWorkWillBeLost(e);
+ }
+
+ var commentBoxes = $("textarea.commentBox");
+ for(var index = 0; index < commentBoxes.length; index++) {
+ if(commentBoxes[index].value != "") {
+ return yourWorkWillBeLost(e);
+ }
+ }
+ }
+ window.addEventListener('beforeunload', beforeUnload, true);