summaryrefslogtreecommitdiffstats
path: root/hyperkitty/static
diff options
context:
space:
mode:
Diffstat (limited to 'hyperkitty/static')
-rw-r--r--hyperkitty/static/css/hyperkitty-common.css12
-rw-r--r--hyperkitty/static/js/hyperkitty.js18
2 files changed, 28 insertions, 2 deletions
diff --git a/hyperkitty/static/css/hyperkitty-common.css b/hyperkitty/static/css/hyperkitty-common.css
index b385f1d..26b1153 100644
--- a/hyperkitty/static/css/hyperkitty-common.css
+++ b/hyperkitty/static/css/hyperkitty-common.css
@@ -47,7 +47,7 @@
/* Forms (replies, registration, ...) */
form .buttons .submit {
/* leave some space before the cancel button/link */
- margin-right: 2em;
+ margin-right: 1em;
}
@@ -210,11 +210,21 @@ a.reply.disabled {
padding-top: 1em;
}
.reply-form p.reply-tools {
+ margin-bottom: 0.7em;
+}
+.reply-form p.reply-tools label {
+ display: inline;
font-size: 90%;
+ margin-left: 1.5em;
+}
+.reply-form p.reply-tools input {
+ margin-top: 0;
+ margin-right: 0.1em;
}
.reply-form p {
margin: 0;
}
+.reply-form #id_subject,
.reply-form textarea {
width: 95%;
}
diff --git a/hyperkitty/static/js/hyperkitty.js b/hyperkitty/static/js/hyperkitty.js
index 6aa318d..05be5bc 100644
--- a/hyperkitty/static/js/hyperkitty.js
+++ b/hyperkitty/static/js/hyperkitty.js
@@ -161,6 +161,8 @@ function setup_replies() {
$(".reply-form button[type='submit']").click(function(e) {
e.preventDefault();
var form = $(this).parents("form").first();
+ // remove previous error messages
+ form.find("div.reply-result").remove();
var data = form_to_json(form);
$.ajax({
type: "POST",
@@ -180,7 +182,7 @@ function setup_replies() {
$('<div class="reply-result"><div class="alert alert-error">'
+ '<button type="button" class="close" data-dismiss="alert">&times;</button> '
+ jqXHR.responseText + '</div></div>')
- .css("display", "none").insertBefore(form).slideDown();
+ .css("display", "none").prependTo(form).slideDown();
}
});
});
@@ -207,6 +209,20 @@ function setup_replies() {
textarea.val(quoted + "\n" + textarea.val());
textarea.focus();
});
+ function set_new_thread(checkbox) {
+ var this_form = checkbox.parents("form").first();
+ var subj = this_form.find("input[name='subject']").parents("p").first();
+ if (checkbox.is(":checked")) {
+ subj.slideDown("fast");
+ subj.find("input").focus();
+ } else {
+ subj.slideUp("fast");
+ this_form.find("textarea").focus();
+ }
+ }
+ $(".reply-form input[name='newthread']").change(function() {
+ set_new_thread($(this));
+ }).change();
}