diff --git a/src/General/css/burichan.css b/src/General/css/burichan.css index 8f4350347..8514f84e2 100755 --- a/src/General/css/burichan.css +++ b/src/General/css/burichan.css @@ -66,6 +66,11 @@ background: rgba(255, 255, 255, .33); } +/* Thread Watcher */ +:root.burichan .unread-quoting-you > a { + color: #F00; +} + /* Watcher Favicon */ :root.burichan .watch-thread-link { diff --git a/src/General/css/futaba.css b/src/General/css/futaba.css index 845d948b2..be8f930d8 100755 --- a/src/General/css/futaba.css +++ b/src/General/css/futaba.css @@ -66,6 +66,11 @@ background: rgba(255, 255, 255, .33); } +/* Thread Watcher */ +:root.futaba .unread-quoting-you > a { + color: #F00; +} + /* Watcher Favicon */ :root.futaba .watch-thread-link { diff --git a/src/General/css/photon.css b/src/General/css/photon.css index 0feb8a3ec..4b7c0c04f 100755 --- a/src/General/css/photon.css +++ b/src/General/css/photon.css @@ -66,6 +66,11 @@ background: rgba(255, 255, 255, .33); } +/* Thread Watcher */ +:root.photon .unread-quoting-you > a { + color: #00F !important; +} + /* Watcher Favicon */ :root.photon .watch-thread-link { diff --git a/src/General/css/tomorrow.css b/src/General/css/tomorrow.css index 3485475f6..91cb1d711 100755 --- a/src/General/css/tomorrow.css +++ b/src/General/css/tomorrow.css @@ -72,6 +72,11 @@ background: rgba(0, 0, 0, .33); } +/* Thread Watcher */ +:root.tomorrow .unread-quoting-you > a { + color: #F00 !important; +} + /* Watcher Favicon */ :root.tomorrow .watch-thread-link { diff --git a/src/General/css/yotsuba-b.css b/src/General/css/yotsuba-b.css index c3cf4c8ee..d9ae70d33 100755 --- a/src/General/css/yotsuba-b.css +++ b/src/General/css/yotsuba-b.css @@ -67,6 +67,11 @@ background: rgba(255, 255, 255, .33); } +/* Thread Watcher */ +:root.yotsuba-b .unread-quoting-you > a { + color: #F00; +} + /* Watcher Favicon */ :root.yotsuba-b .watch-thread-link { diff --git a/src/General/css/yotsuba.css b/src/General/css/yotsuba.css index 0fd7b1c82..a49ab93d6 100755 --- a/src/General/css/yotsuba.css +++ b/src/General/css/yotsuba.css @@ -66,6 +66,11 @@ background: rgba(255, 255, 255, .33); } +/* Thread Watcher */ +:root.yotsuba .unread-quoting-you > a { + color: #F00; +} + /* Watcher Favicon */ :root.yotsuba .watch-thread-link { diff --git a/src/Monitoring/ThreadWatcher.coffee b/src/Monitoring/ThreadWatcher.coffee index 596e118dc..77802bf02 100755 --- a/src/Monitoring/ThreadWatcher.coffee +++ b/src/Monitoring/ThreadWatcher.coffee @@ -149,15 +149,27 @@ ThreadWatcher = threadID: threadID defaultValue: 0 - unread = 0 + unread = unreadQY = 0 for postObj in @response.posts[1..] - if postObj.no > lastReadPost and !QR.db?.get {boardID, threadID, postID: postObj.no} - unread++ + continue unless postObj.no > lastReadPost + continue if QR.db?.get {boardID, threadID, postID: postObj.no} + unread++ + continue unless QR.db and postObj.com + regexp = /]*\bhref="(?:\/([^\/]+)\/thread\/(\d+))?(?:#p(\d+))?"/g + while match = regexp.exec postObj.com + if QR.db.get { + boardID: match[1] or boardID + threadID: match[2] or threadID + postID: match[3] or match[2] or threadID + } + unreadQY++ + continue - if isDead isnt data.isDead or unread isnt data.unread - data.isDead = isDead - data.unread = unread + if isDead isnt data.isDead or unread isnt data.unread or unreadQY isnt data.unreadQY + data.isDead = isDead + data.unread = unread + data.unreadQY = unreadQY ThreadWatcher.db.set {boardID, threadID, val: data} ThreadWatcher.refresh() @@ -167,6 +179,7 @@ ThreadWatcher = else data.isDead = true delete data.unread + delete data.unreadQY ThreadWatcher.db.set {boardID, threadID, val: data} ThreadWatcher.refresh() @@ -202,8 +215,9 @@ ThreadWatcher = div = $.el 'div' fullID = "#{boardID}.#{threadID}" div.dataset.fullID = fullID - $.addClass div, 'current' if g.VIEW is 'thread' and fullID is "#{g.BOARD}.#{g.THREADID}" - $.addClass div, 'dead-thread' if data.isDead + $.addClass div, 'current' if g.VIEW is 'thread' and fullID is "#{g.BOARD}.#{g.THREADID}" + $.addClass div, 'unread-quoting-you' if data.unreadQY + $.addClass div, 'dead-thread' if data.isDead $.add div, [x, $.tn(' '), link] div refresh: ->