Mark the “click to show” area if a hidden post is new.
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Thu, 11 Nov 2010 20:43:19 +0000 (21:43 +0100)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Thu, 11 Nov 2010 20:43:19 +0000 (21:43 +0100)
src/main/resources/static/css/sone.css
src/main/resources/templates/include/head.html

index 9e33575..3358399 100644 (file)
@@ -216,6 +216,10 @@ textarea {
        cursor: pointer;
 }
 
+#sone .post .replies .click-to-show.new {
+       background-color: #ffffa0;
+}
+
 #sone .post .reply > .avatar {
        position: absolute;
 }
index 8f7aa48..723f333 100644 (file)
                        $("#sone .post .replies").each(function() {
                                allReplies = $(this).find(".reply");
                                if (allReplies.length > 2) {
+                                       newHidden = false;
                                        for (replyIndex = 0; replyIndex < (allReplies.length - 2); ++replyIndex) {
                                                $(allReplies[replyIndex]).addClass("hidden");
+                                               newHidden |= $(allReplies[replyIndex]).hasClass("new");
                                        }
                                        clickToShowElement = $("<div></div>").addClass("click-to-show");
+                                       if (newHidden) {
+                                               clickToShowElement.addClass("new");
+                                       }
                                        (function(clickToShowElement, allReplies) {
                                                getTranslation("WebInterface.ClickToShow.Replies", function(text) {
                                                        clickToShowElement.text(text);