From d7ad4b8619c1cfd1b64950113d91181dc665a363 Mon Sep 17 00:00:00 2001 From: Nicolas Stepien Date: Fri, 31 Aug 2012 02:49:16 +0200 Subject: [PATCH] Parse threads. --- 4chan_x.user.js | 4 ++++ script.coffee | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/4chan_x.user.js b/4chan_x.user.js index 9245d6801..2c270c3f9 100644 --- a/4chan_x.user.js +++ b/4chan_x.user.js @@ -627,11 +627,15 @@ }; function Thread(root, board) { + var postInfo; this.root = root; this.board = board; this.ID = +root.id.slice(1); this.hr = root.nextElementSibling; this.posts = {}; + postInfo = $('.postInfo', root.firstElementChild); + this.isClosed = !!$('img[title=Closed]', postInfo); + this.isSticky = !!$('img[title=Sticky]', postInfo); g.threads["" + board + "." + this] = board.threads[this] = this; } diff --git a/script.coffee b/script.coffee index 9464d237b..8dd55ea0f 100644 --- a/script.coffee +++ b/script.coffee @@ -491,6 +491,10 @@ class Thread @hr = root.nextElementSibling @posts = {} + postInfo = $ '.postInfo', root.firstElementChild + @isClosed = !!$ 'img[title=Closed]', postInfo + @isSticky = !!$ 'img[title=Sticky]', postInfo + g.threads["#{board}.#{@}"] = board.threads[@] = @ class Post