Add keybind, default state option to toggleable watcher

Addresses #956 by adding a keybind to toggle visibility of thread
watcher rather than simply the header bar icon. Also adds an option in
config for the watcher to default to visible or not.
This commit is contained in:
dzamie 2016-06-28 22:42:42 -04:00
parent 102ae79506
commit 96f1497fb8
3 changed files with 14 additions and 1 deletions

View File

@ -97,6 +97,9 @@ Keybinds =
when Conf['Update thread watcher'] when Conf['Update thread watcher']
return unless ThreadWatcher.enabled return unless ThreadWatcher.enabled
ThreadWatcher.buttonFetchAll() ThreadWatcher.buttonFetchAll()
when Conf['Toggle thread watcher']
return unless ThreadWatcher.enabled and Conf['Toggleable Thread Watcher']
ThreadWatcher.toggleWatcher()
# Images # Images
when Conf['Expand image'] when Conf['Expand image']
return unless ImageExpand.enabled and threadRoot return unless ImageExpand.enabled and threadRoot

View File

@ -35,7 +35,8 @@ ThreadWatcher =
if Conf['Fixed Thread Watcher'] if Conf['Fixed Thread Watcher']
$.addClass doc, 'fixed-watcher' $.addClass doc, 'fixed-watcher'
if Conf['Toggleable Thread Watcher'] if Conf['Toggleable Thread Watcher']
@dialog.hidden = true if !Conf['Watcher Defaults to Visible']
@dialog.hidden = true
Header.addShortcut 'watcher', sc, 510 Header.addShortcut 'watcher', sc, 510
$.addClass doc, 'toggleable-watcher' $.addClass doc, 'toggleable-watcher'

View File

@ -389,6 +389,11 @@ Config =
'Adds a shortcut for the thread watcher and hides the watcher by default.' 'Adds a shortcut for the thread watcher and hides the watcher by default.'
1 1
] ]
'Watcher Defaults to Visible': [
false
'Displays the thread watcher by default, rather than hiding it.'
2
]
'Mark New IPs': [ 'Mark New IPs': [
false false
'Label each post from a new IP with the thread\'s current IP count.' 'Label each post from a new IP with the thread\'s current IP count.'
@ -857,6 +862,10 @@ Config =
'Shift+r' 'Shift+r'
'Manually refresh thread watcher.' 'Manually refresh thread watcher.'
] ]
'Toggle thread watcher': [
't'
'Toggle visibility of thread watcher when toggle is enabled'
]
# Images # Images
'Expand image': [ 'Expand image': [
'Shift+e' 'Shift+e'