X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fmain%2Fresources%2Ftemplates%2Finclude%2Fhead.html;h=723f333a5a9db76606caffa83298649b785c13e2;hb=c86c161825115605e870e3b9fa8380080a8e0293;hp=f4eddf857501a7077788bac3a2cc51391537c013;hpb=b3eb759b6a367abdcd85b7ea11392c9e22e5e169;p=Sone.git diff --git a/src/main/resources/templates/include/head.html b/src/main/resources/templates/include/head.html index f4eddf8..723f333 100644 --- a/src/main/resources/templates/include/head.html +++ b/src/main/resources/templates/include/head.html @@ -55,10 +55,15 @@ $("#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 = $("
").addClass("click-to-show"); + if (newHidden) { + clickToShowElement.addClass("new"); + } (function(clickToShowElement, allReplies) { getTranslation("WebInterface.ClickToShow.Replies", function(text) { clickToShowElement.text(text); @@ -93,36 +98,6 @@ }); return false; }); - $("#sone .block").submit(function() { - var blockElement = this; - $.getJSON("ajax/blockSone.ajax", { "sone": getSoneId(this), "formPassword": getFormPassword() }, function() { - $(blockElement).addClass("hidden"); - $(blockElement).parent().find(".unblock").removeClass("hidden"); - }); - return false; - }); - $("#sone .unblock").submit(function() { - var unblockElement = this; - $.getJSON("ajax/unblockSone.ajax", { "sone": getSoneId(this), "formPassword": getFormPassword() }, function() { - $(unblockElement).addClass("hidden"); - $(unblockElement).parent().find(".block").removeClass("hidden"); - }); - return false; - }); - $("#sone .blacklist").submit(function() { - var blacklistElement = this; - $.getJSON("ajax/blacklistSone.ajax", { "sone" : getSoneId(this), "formPassword" : getFormPassword() }, function() { - $(getSoneElement(blacklistElement)).slideUp(); - }); - return false; - }); - $("#sone .unblacklist").submit(function() { - var unblacklistElement = this; - $.getJSON("ajax/unblacklistSone.ajax", { "sone" : getSoneId(this), "formPassword" : getFormPassword() }, function() { - $(getSoneElement(unblacklistElement)).slideUp(); - }); - return false; - }); });