Use FontAwesome to replace the thread watcher toggle icon.

This commit is contained in:
Mayhem 2013-08-20 17:06:23 +02:00
parent f4433ccf4c
commit 7cd4b7cee0
3 changed files with 10 additions and 8 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 94 B

View File

@ -45,6 +45,5 @@ Favicon =
Favicon.unread = Favicon.unreadNSFW
Favicon.unreadY = Favicon.unreadNSFWY
empty: 'data:image/gif;base64,<%= grunt.file.read("img/favicons/empty.gif", {encoding: "base64"}) %>'
dead: 'data:image/gif;base64,<%= grunt.file.read("img/favicons/dead.gif", {encoding: "base64"}) %>'
logo: 'data:image/png;base64,<%= grunt.file.read("img/icon128.png", {encoding: "base64"}) %>'

View File

@ -31,10 +31,11 @@ ThreadWatcher =
name: 'Thread Watcher'
cb: @node
node: ->
toggler = $.el 'img',
toggler = $.el 'a',
className: 'watcher-toggler'
href: 'javascript:;'
$.on toggler, 'click', ThreadWatcher.cb.toggle
$.before $('input', @OP.nodes.post), toggler
$.after $('input', @OP.nodes.post), [toggler, $.tn ' ']
ready: ->
$.off d, '4chanXInitFinished', ThreadWatcher.ready
return unless Main.isThisPageLegit()
@ -154,11 +155,13 @@ ThreadWatcher =
$.add list, nodes
for threadID, thread of g.BOARD.threads
toggler = $ '.watcher-toggler', thread.OP.nodes.post
toggler.src = if ThreadWatcher.db.get {boardID: thread.board.ID, threadID}
Favicon.default
else
Favicon.empty
$.extend $('.watcher-toggler', thread.OP.nodes.post),
if ThreadWatcher.db.get {boardID: thread.board.ID, threadID}
className: 'watcher-toggler icon-bookmark'
title: 'Unwatch thread'
else
className: 'watcher-toggler icon-bookmark-empty'
title: 'Watch thread'
for refresher in ThreadWatcher.menu.refreshers
refresher()