X-Git-Url: https://git.openstreetmap.org./osqa.git/blobdiff_plain/0ea3cdb937d3d53c38b2e1c4b3a3205560e537cb..ee7cd8daedc243f04e5f619b94239371c87e0fcc:/forum/skins/default/templates/question.html
diff --git a/forum/skins/default/templates/question.html b/forum/skins/default/templates/question.html
index 1f30f7c..6407978 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" %}]";
@@ -41,6 +42,28 @@
$('#pre-collapse').text(txt);
});
});
+
+ function submitClicked(e) {
+ if(!(browserTester('chrome') || browserTester('safari'))) {
+ $("input.submit")[0].disabled=true;
+ }
+ window.removeEventListener('beforeunload', beforeUnload, true);
+ }
+
+ 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);