diff options
-rw-r--r-- | hyperkitty/static/css/hyperkitty.css | 3 | ||||
-rw-r--r-- | hyperkitty/static/js/hyperkitty.js | 23 | ||||
-rw-r--r-- | hyperkitty/templates/messages/reply_form.html | 1 |
3 files changed, 25 insertions, 2 deletions
diff --git a/hyperkitty/static/css/hyperkitty.css b/hyperkitty/static/css/hyperkitty.css index ad73d02..447368a 100644 --- a/hyperkitty/static/css/hyperkitty.css +++ b/hyperkitty/static/css/hyperkitty.css @@ -865,6 +865,9 @@ a.reply { display: none; padding-top: 1em; } +.reply-form p.reply-tools { + font-size: 90%; +} .reply-form p { margin: 0; } diff --git a/hyperkitty/static/js/hyperkitty.js b/hyperkitty/static/js/hyperkitty.js index 36812cf..86db2bd 100644 --- a/hyperkitty/static/js/hyperkitty.js +++ b/hyperkitty/static/js/hyperkitty.js @@ -178,6 +178,25 @@ function setup_replies() { e.preventDefault(); $(this).parents(".reply-form").first().slideUp(); }); + $(".reply-form a.quote").click(function(e) { + e.preventDefault(); + var quoted = $(this).parents(".email").first() + .find(".email-body").clone() + .find(".quoted-switch").remove().end() + .find(".quoted-text").remove().end() + .text(); + var textarea = $(this).parents(".reply-form").find("textarea"); + // remove signature + var sig_index = quoted.search(/^-- $/m); + if (sig_index != -1) { + quoted = quoted.substr(0, sig_index); + } + // add quotation marks + quoted = $.trim(quoted).replace(/^/mg, "> "); + // insert before any previous text + textarea.val(quoted + "\n" + textarea.val()); + textarea.focus(); + }); } @@ -258,9 +277,9 @@ function setup_attachments() { function setup_quotes() { $('div.email-body .quoted-switch a') - .click(function() { + .click(function(e) { + e.preventDefault(); $(this).parent().next(".quoted-text").slideToggle('fast'); - return false; }); } diff --git a/hyperkitty/templates/messages/reply_form.html b/hyperkitty/templates/messages/reply_form.html index eca1dc6..e1138f2 100644 --- a/hyperkitty/templates/messages/reply_form.html +++ b/hyperkitty/templates/messages/reply_form.html @@ -1,5 +1,6 @@ <a class="reply icon-envelope" href="#">Reply</a> <div class="reply-form dropdown"> + <p class="reply-tools">[<a href="#" class="quote">Quote</a>]</p> <form method="post" action="{% url message_reply mlist_fqdn=mlist_fqdn, message_id_hash=message_id_hash %}"> {% csrf_token %} |