Make sure all shortcuts have IDs. #904
This commit is contained in:
parent
ca5deed798
commit
6a2b05a629
@ -55,7 +55,7 @@ Header =
|
||||
$.sync 'Centered links', @setLinkJustify
|
||||
$.sync 'Bottom Board List', @setFooterVisibility
|
||||
|
||||
@addShortcut menuButton, 900
|
||||
@addShortcut 'menu', menuButton, 900
|
||||
|
||||
@menu.addEntry
|
||||
el: $.el 'span',
|
||||
@ -119,7 +119,7 @@ Header =
|
||||
cs.className = 'native-settings'
|
||||
$.on cs, 'click', () ->
|
||||
$.id('settingsWindowLink').click()
|
||||
@addShortcut cs, 810
|
||||
@addShortcut 'native', cs, 810
|
||||
|
||||
@enableDesktopNotifications()
|
||||
|
||||
@ -495,8 +495,9 @@ Header =
|
||||
else
|
||||
top < 0
|
||||
|
||||
addShortcut: (el, index) ->
|
||||
addShortcut: (id, el, index) ->
|
||||
shortcut = $.el 'span',
|
||||
id: "shortcut-#{id}"
|
||||
className: 'shortcut brackets-wrap'
|
||||
$.add shortcut, el
|
||||
shortcut.dataset.index = index
|
||||
|
||||
@ -27,12 +27,12 @@ Index =
|
||||
|
||||
# Header refresh button
|
||||
@button = $.el 'a',
|
||||
className: 'index-refresh-shortcut fa fa-refresh'
|
||||
className: 'fa fa-refresh'
|
||||
title: 'Refresh'
|
||||
href: 'javascript:;'
|
||||
textContent: 'Refresh Index'
|
||||
$.on @button, 'click', -> Index.update()
|
||||
Header.addShortcut @button, 590
|
||||
Header.addShortcut 'index-refresh', @button, 590
|
||||
|
||||
# Header "Index Navigation" submenu
|
||||
repliesEntry = el: UI.checkbox 'Show Replies', 'Show replies'
|
||||
|
||||
@ -8,7 +8,7 @@ Settings =
|
||||
href: 'javascript:;'
|
||||
$.on link, 'click', Settings.open
|
||||
|
||||
Header.addShortcut link, 820
|
||||
Header.addShortcut 'settings', link, 820
|
||||
|
||||
add = @addSection
|
||||
|
||||
|
||||
@ -25,11 +25,10 @@ FappeTyme =
|
||||
textContent: type[0]
|
||||
title: "#{type} Tyme active"
|
||||
$.on indicator, 'click', ->
|
||||
check = FappeTyme.nodes[@parentNode.id.split('-')[0]]
|
||||
check = FappeTyme.nodes[@parentNode.id.replace('shortcut-', '')]
|
||||
check.checked = !check.checked
|
||||
$.event 'change', null, check
|
||||
Header.addShortcut indicator, 410
|
||||
indicator.parentNode.id = "#{lc}-indicator"
|
||||
Header.addShortcut lc, indicator, 410
|
||||
|
||||
if Conf['Werk Tyme']
|
||||
$.sync 'werk', @set.bind(@, 'werk')
|
||||
|
||||
@ -6,14 +6,13 @@ Gallery =
|
||||
|
||||
el = $.el 'a',
|
||||
href: 'javascript:;'
|
||||
id: 'appchan-gal'
|
||||
title: 'Gallery'
|
||||
className: 'fa fa-picture-o'
|
||||
textContent: 'Gallery'
|
||||
|
||||
$.on el, 'click', @cb.toggle
|
||||
|
||||
Header.addShortcut el, 530
|
||||
Header.addShortcut 'gallery', el, 530
|
||||
|
||||
Callbacks.Post.push
|
||||
name: 'Gallery'
|
||||
|
||||
@ -9,7 +9,7 @@ ImageExpand =
|
||||
href: 'javascript:;'
|
||||
|
||||
$.on @EAI, 'click', @cb.toggleAll
|
||||
Header.addShortcut @EAI, 520
|
||||
Header.addShortcut 'expand-all', @EAI, 520
|
||||
$.on d, 'scroll visibilitychange', @cb.playVideos
|
||||
@videoControls = $.el 'span', className: 'video-controls'
|
||||
$.extend @videoControls, <%= html(' <a href="javascript:;" title="You can also contract the video by dragging it to the left.">contract</a>') %>
|
||||
|
||||
@ -16,7 +16,7 @@ ThreadStats =
|
||||
id: 'thread-stats'
|
||||
title: statsTitle
|
||||
$.extend sc, statsHTML
|
||||
Header.addShortcut sc, 200
|
||||
Header.addShortcut 'stats', sc, 200
|
||||
|
||||
else
|
||||
@dialog = sc = UI.dialog 'thread-stats', 'bottom: 0px; right: 0px;',
|
||||
|
||||
@ -12,7 +12,7 @@ ThreadUpdater =
|
||||
@dialog = sc = $.el 'span',
|
||||
id: 'updater'
|
||||
$.extend sc, <%= html('<span id="update-status" class="empty"></span><span id="update-timer" class="empty" title="Update now"></span>') %>
|
||||
Header.addShortcut sc, 100
|
||||
Header.addShortcut 'updater', sc, 100
|
||||
else
|
||||
@dialog = sc = UI.dialog 'updater', 'bottom: 0px; left: 0px;',
|
||||
<%= html('<div class="move"></div><span id="update-status"></span><span id="update-timer" title="Update now"></span>') %>
|
||||
|
||||
@ -36,7 +36,7 @@ ThreadWatcher =
|
||||
$.addClass doc, 'fixed-watcher'
|
||||
if Conf['Toggleable Thread Watcher']
|
||||
@dialog.hidden = true
|
||||
Header.addShortcut sc, 510
|
||||
Header.addShortcut 'watcher', sc, 510
|
||||
$.addClass doc, 'toggleable-watcher'
|
||||
|
||||
ThreadWatcher.fetchAuto()
|
||||
|
||||
@ -39,7 +39,7 @@ QR =
|
||||
|
||||
if Conf['QR Shortcut']
|
||||
@shortcut = sc = $.el 'a',
|
||||
className: 'qr-shortcut fa fa-comment-o disabled'
|
||||
className: 'fa fa-comment-o disabled'
|
||||
textContent: 'QR'
|
||||
title: 'Quick Reply'
|
||||
href: 'javascript:;'
|
||||
@ -51,7 +51,7 @@ QR =
|
||||
else
|
||||
QR.close()
|
||||
|
||||
Header.addShortcut sc, 540
|
||||
Header.addShortcut 'qr', sc, 540
|
||||
|
||||
initReady: ->
|
||||
$.off d, '4chanXInitFinished', @initReady
|
||||
|
||||
@ -1139,8 +1139,8 @@ input[name="Default Volume"] {
|
||||
border-radius: 2px;
|
||||
cursor: pointer;
|
||||
}
|
||||
:root:not(.fappeTyme) #fappe-indicator,
|
||||
:root:not(.werkTyme) #werk-indicator {
|
||||
:root:not(.fappeTyme) #shortcut-fappe,
|
||||
:root:not(.werkTyme) #shortcut-werk {
|
||||
display: none;
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user