From e5663953b534f8098acff8f2942fdb81c2942acf Mon Sep 17 00:00:00 2001 From: czaks Date: Mon, 22 Jul 2013 10:14:08 -0400 Subject: [PATCH] Remove our post-hider script in favour of STI's one, leave symlink for compatibility --- js/post-hider.js | 54 +----------------------------------------------------- 1 file changed, 1 insertion(+), 53 deletions(-) mode change 100644 => 120000 js/post-hider.js diff --git a/js/post-hider.js b/js/post-hider.js deleted file mode 100644 index f4cde66a..00000000 --- a/js/post-hider.js +++ /dev/null @@ -1,53 +0,0 @@ -function phGetCookieName(board, id) { - return "ph_hide_" + board + "_" + id; -} -function phPostHidden(board, id) { - return (localStorage.getItem(phGetCookieName(board, id)) != null); -} -function phPostToggle(board, id) { - if(phPostHidden(board, id)) { localStorage.removeItem(phGetCookieName(board, id)); } - else { localStorage.setItem(phGetCookieName(board, id),"yes"); } -} -function phGetInnerText(board, id) { - if(phPostHidden(board, id)) { return "[+]"; } - else { return "[–]"; } -} -function phGetOpID(element) { - return Number(element.children("div.post.op").children("p.intro").children("a.post_no:eq(1)").text()); -} -function phGetOpBoard(element) { - return element.data("board"); -} -function phPostHandle(element) { - var id = phGetOpID(element); - var board = phGetOpBoard(element); - var preplies = element.children("div.post.reply"); - var pbody = element.children("div.post.op").children("div.body"); - var pimage = element.children("a:first").children("img"); - var pbutton = element.children("div.post.op").children("p.intro").children("a.posthider"); - var pomitted = element.children("div.post.op").children("span.omitted"); - if(phPostHidden(board, id)) { element.addClass("thread-hidden"); pomitted.hide(); preplies.hide(); pbody.hide(); pimage.hide(); pbutton.text("[+]"); } - else { element.removeClass("thread-hidden"); pomitted.show(); preplies.show(); pbody.show(); pimage.show(); pbutton.text("[–]"); } -} - -function phHandleThread(index, element) { - // Get thread ID. - var pin = $(this).children("div.post.op").children("p.intro"); - var tid = phGetOpID($(this)); - if(tid != NaN) { - $("[?]").insertAfter(pin.children('a:last')).click(function(e) { - var eO = $(e.target); - var par = eO.parent().parent().parent(); - phPostToggle(phGetOpBoard(par), phGetOpID(par)); - phPostHandle(par); - return false; - }); - phPostHandle($(this)); - } -} - -$(document).ready(function(){ - if (active_page != "thread") { - $('form[name="postcontrols"] > div[id^="thread"]').each(phHandleThread); - } -}); diff --git a/js/post-hider.js b/js/post-hider.js new file mode 120000 index 00000000..693c14d6 --- /dev/null +++ b/js/post-hider.js @@ -0,0 +1 @@ +hide-threads.js \ No newline at end of file