X-Git-Url: https://git.openstreetmap.org./osqa.git/blobdiff_plain/2017cbd3e796117e1fdf57181d7b7443f8696657..4b20a67ddb4ebea2c6e09d51ee48da5a856edef8:/forum/skins/default/templates/question.html
diff --git a/forum/skins/default/templates/question.html b/forum/skins/default/templates/question.html
index 37e5fe3..a9a1706 100644
--- a/forum/skins/default/templates/question.html
+++ b/forum/skins/default/templates/question.html
@@ -8,12 +8,13 @@
{% load humanize %}
{% load i18n %}
{% load cache %}
+{% block metadescription %}{{question.summary}}{% endblock %}
+{% block metakeywords %}{{question.tagname_meta_generator}}{% endblock %}
{% block title %}{% spaceless %}{{ question.headline }}{% endspaceless %}{% endblock %}
{% block forejs %}
-
-
- {% if not question.closed %}
+
+ {% if not question.nis.closed %}
@@ -29,7 +30,7 @@
}
$('#editor').TextAreaResizer();
-
+
//toggle preview of editor
var display = true;
var txt = "[{% trans "hide preview" %}]";
@@ -40,8 +41,32 @@
$('#previewer').toggle();
$('#pre-collapse').text(txt);
});
+
});
-
+
+ function beforeUnload(e) {
+ if($("textarea#editor")[0].value != "") {
+ yourWorkWillBeLost(e);
+ }
+
+ $("textarea.commentBox").each(function() {
+ if(this.value != "") {
+ yourWorkWillBeLost(e);
+ }
+ });
+
+ return false;
+ }
+ window.addEventListener('beforeunload', beforeUnload, true);
+
+ function submitClicked() {
+ window.removeEventListener('beforeunload', beforeUnload, true);
+ $("input.submit").each(function() {
+ this.disabled=true;
+ });
+ }
+
+