From: David ‘Bombe’ Roden Date: Wed, 19 Jan 2011 14:57:00 +0000 (+0100) Subject: Add “mark as read” buttons to new post, reply, and Sone notifications. X-Git-Tag: 0.4.2^2~27^2~6 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=36af6a6efdac06222844893180d39f611dd29a42;p=Sone.git Add “mark as read” buttons to new post, reply, and Sone notifications. --- diff --git a/src/main/resources/i18n/sone.en.properties b/src/main/resources/i18n/sone.en.properties index 7b8450f..e608358 100644 --- a/src/main/resources/i18n/sone.en.properties +++ b/src/main/resources/i18n/sone.en.properties @@ -233,6 +233,7 @@ Notification.NewSone.ShortText=New Sones have been discovered: Notification.NewSone.Text=New Sones have been discovered: Notification.NewPost.ShortText=New posts have been discovered. Notification.NewPost.Text=New posts have been discovered by the following Sones: +Notification.NewPost.Button.MarkRead=Mark as read Notification.NewReply.ShortText=New replies have been discovered. Notification.NewReply.Text=New replies have been discovered by the following Sones: Notification.SoneIsBeingRescued.Text=The following Sones are currently being rescued: diff --git a/src/main/resources/static/css/sone.css b/src/main/resources/static/css/sone.css index 323cb0e..a83d3a1 100644 --- a/src/main/resources/static/css/sone.css +++ b/src/main/resources/static/css/sone.css @@ -108,6 +108,10 @@ textarea { margin-left: 1ex; } +#sone #notification-area .notification .mark-as-read { + float: right; +} + #sone #plugin-warning { border: solid 0.5em red; padding: 0.5em; diff --git a/src/main/resources/static/javascript/sone.js b/src/main/resources/static/javascript/sone.js index 9d00c5a..b48dac3 100644 --- a/src/main/resources/static/javascript/sone.js +++ b/src/main/resources/static/javascript/sone.js @@ -680,6 +680,11 @@ function ajaxifyNotification(notification) { notification.find("form.dismiss").submit(function() { return false; }); + notification.find("input[name=returnPage]").val($.url.attr("relative")); + if (notification.find(".short-text").length > 0) { + notification.find(".short-text").removeClass("hidden"); + notification.find(".text").addClass("hidden"); + } notification.find("form.dismiss button").click(function() { $.getJSON("dismissNotification.ajax", { "formPassword" : getFormPassword(), "notification" : notification.attr("id") }, function(data, textStatus) { /* dismiss in case of error, too. */ diff --git a/src/main/resources/templates/include/head.html b/src/main/resources/templates/include/head.html index 4e43da4..aec46cf 100644 --- a/src/main/resources/templates/include/head.html +++ b/src/main/resources/templates/include/head.html @@ -27,7 +27,7 @@ <%/if> - <% notification> + <%include notification request=request> <%/foreach> diff --git a/src/main/resources/templates/notify/newPostNotification.html b/src/main/resources/templates/notify/newPostNotification.html index 94f7a1f..e5d7792 100644 --- a/src/main/resources/templates/notify/newPostNotification.html +++ b/src/main/resources/templates/notify/newPostNotification.html @@ -1,8 +1,15 @@ -
+ -