summaryrefslogtreecommitdiffstats
path: root/hyperkitty/static
diff options
context:
space:
mode:
authorAurélien Bompard <aurelien@bompard.org>2013-07-18 13:46:46 +0200
committerAurélien Bompard <aurelien@bompard.org>2013-07-18 13:50:08 +0200
commit63db25bb5e1a2605c7a2fdaabcba32422191f70b (patch)
treedf8d09107b5a8c06546ca99e991d6249d5e98960 /hyperkitty/static
parentfd5bdaf0bd47260e4a797ff2156036a80d3ac3ee (diff)
downloadhyperkitty-63db25bb5e1a2605c7a2fdaabcba32422191f70b.tar.gz
hyperkitty-63db25bb5e1a2605c7a2fdaabcba32422191f70b.tar.xz
hyperkitty-63db25bb5e1a2605c7a2fdaabcba32422191f70b.zip
Add a page to reattach a broken thread
Diffstat (limited to 'hyperkitty/static')
-rw-r--r--hyperkitty/static/hyperkitty/css/hyperkitty-message.css34
-rw-r--r--hyperkitty/static/hyperkitty/js/hyperkitty-thread.js30
2 files changed, 64 insertions, 0 deletions
diff --git a/hyperkitty/static/hyperkitty/css/hyperkitty-message.css b/hyperkitty/static/hyperkitty/css/hyperkitty-message.css
index 2668f3a..769dc02 100644
--- a/hyperkitty/static/hyperkitty/css/hyperkitty-message.css
+++ b/hyperkitty/static/hyperkitty/css/hyperkitty-message.css
@@ -317,3 +317,37 @@
border-bottom: none;
background-color: #eee;
}
+
+
+/*
+ * Re-attach threads
+ */
+.reattach-thread form {
+ margin-bottom: 0;
+}
+.reattach-thread form.search p {
+ line-height: 22px;
+}
+.reattach-thread form.search input {
+ margin-left: 3em;
+}
+.reattach-thread form.search input,
+.reattach-thread form.search button {
+ font-size: 12px;
+ padding: 2px 8px;
+}
+.reattach-thread form img.ajaxloader {
+ margin-left: 1em;
+}
+.reattach-thread li.manual label {
+ display: inline;
+}
+.reattach-thread li.manual input {
+ margin-bottom: 0;
+}
+.reattach-thread li.manual input[type='text'] {
+ width: 22em;
+}
+.reattach-thread p.buttons {
+ margin-top: 2em;
+}
diff --git a/hyperkitty/static/hyperkitty/js/hyperkitty-thread.js b/hyperkitty/static/hyperkitty/js/hyperkitty-thread.js
index 069c4e9..e6c726f 100644
--- a/hyperkitty/static/hyperkitty/js/hyperkitty-thread.js
+++ b/hyperkitty/static/hyperkitty/js/hyperkitty-thread.js
@@ -331,3 +331,33 @@ function update_thread_replies(url) {
}
load_more(url);
}
+
+
+/*
+ * Re-attach threads
+ */
+function setup_reattach() {
+ $(".reattach-thread li.manual input[type='text']").focus( function() {
+ $(this).parents("li").first()
+ .find("input[type='radio']")
+ .prop("checked", true);
+ });
+ $(".reattach-thread form.search").submit(function (e) {
+ e.preventDefault();
+ var results_elem = $(this).parent().find("ul.suggestions");
+ var url = $(this).attr("action") + "?" + $(this).serialize();
+ results_elem.find("img.ajaxloader").show();
+ $.ajax({
+ url: url,
+ success: function(data) {
+ results_elem.html(data);
+ },
+ error: function(jqXHR, textStatus, errorThrown) {
+ alert(jqXHR.responseText);
+ },
+ complete: function(jqXHR, textStatus) {
+ results_elem.find("img.ajaxloader").hide();
+ }
+ });
+ }).submit();
+}