Bring back index argument for Header.addShortcut.
This commit is contained in:
parent
015db35c85
commit
2909e88223
@ -55,7 +55,7 @@ Header =
|
|||||||
$.sync 'Centered links', @setLinkJustify
|
$.sync 'Centered links', @setLinkJustify
|
||||||
$.sync 'Bottom Board List', @setFooterVisibility
|
$.sync 'Bottom Board List', @setFooterVisibility
|
||||||
|
|
||||||
@addShortcut menuButton
|
@addShortcut menuButton, 900
|
||||||
|
|
||||||
@menu.addEntry
|
@menu.addEntry
|
||||||
el: $.el 'span',
|
el: $.el 'span',
|
||||||
@ -119,7 +119,7 @@ Header =
|
|||||||
cs.className = 'fa fa-leaf'
|
cs.className = 'fa fa-leaf'
|
||||||
$.on cs, 'click', () ->
|
$.on cs, 'click', () ->
|
||||||
$.id('settingsWindowLink').click()
|
$.id('settingsWindowLink').click()
|
||||||
@addShortcut cs
|
@addShortcut cs, 810
|
||||||
|
|
||||||
@enableDesktopNotifications()
|
@enableDesktopNotifications()
|
||||||
|
|
||||||
@ -495,11 +495,15 @@ Header =
|
|||||||
else
|
else
|
||||||
top < 0
|
top < 0
|
||||||
|
|
||||||
addShortcut: (el) ->
|
addShortcut: (el, index) ->
|
||||||
shortcut = $.el 'span',
|
shortcut = $.el 'span',
|
||||||
className: 'shortcut brackets-wrap'
|
className: 'shortcut brackets-wrap'
|
||||||
$.add shortcut, el
|
$.add shortcut, el
|
||||||
$.prepend Header.shortcuts, shortcut
|
shortcut.dataset.index = index
|
||||||
|
for item in $$('[data-index]', Header.shortcuts) when +item.dataset.index > +index
|
||||||
|
$.before item, shortcut
|
||||||
|
return
|
||||||
|
$.add Header.shortcuts, shortcut
|
||||||
|
|
||||||
rmShortcut: (el) ->
|
rmShortcut: (el) ->
|
||||||
$.rm el.parentElement
|
$.rm el.parentElement
|
||||||
|
|||||||
@ -32,7 +32,7 @@ Index =
|
|||||||
href: 'javascript:;'
|
href: 'javascript:;'
|
||||||
textContent: 'Refresh Index'
|
textContent: 'Refresh Index'
|
||||||
$.on @button, 'click', -> Index.update()
|
$.on @button, 'click', -> Index.update()
|
||||||
Header.addShortcut @button, 1
|
Header.addShortcut @button, 590
|
||||||
|
|
||||||
# Header "Index Navigation" submenu
|
# Header "Index Navigation" submenu
|
||||||
repliesEntry = el: UI.checkbox 'Show Replies', 'Show replies'
|
repliesEntry = el: UI.checkbox 'Show Replies', 'Show replies'
|
||||||
|
|||||||
@ -8,7 +8,7 @@ Settings =
|
|||||||
href: 'javascript:;'
|
href: 'javascript:;'
|
||||||
$.on link, 'click', Settings.open
|
$.on link, 'click', Settings.open
|
||||||
|
|
||||||
Header.addShortcut link
|
Header.addShortcut link, 820
|
||||||
|
|
||||||
add = @addSection
|
add = @addSection
|
||||||
|
|
||||||
|
|||||||
@ -13,7 +13,7 @@ Gallery =
|
|||||||
|
|
||||||
$.on el, 'click', @cb.toggle
|
$.on el, 'click', @cb.toggle
|
||||||
|
|
||||||
Header.addShortcut el
|
Header.addShortcut el, 530
|
||||||
|
|
||||||
Callbacks.Post.push
|
Callbacks.Post.push
|
||||||
name: 'Gallery'
|
name: 'Gallery'
|
||||||
|
|||||||
@ -9,7 +9,7 @@ ImageExpand =
|
|||||||
href: 'javascript:;'
|
href: 'javascript:;'
|
||||||
|
|
||||||
$.on @EAI, 'click', @cb.toggleAll
|
$.on @EAI, 'click', @cb.toggleAll
|
||||||
Header.addShortcut @EAI, 3
|
Header.addShortcut @EAI, 520
|
||||||
$.on d, 'scroll visibilitychange', @cb.playVideos
|
$.on d, 'scroll visibilitychange', @cb.playVideos
|
||||||
@videoControls = $.el 'span', className: 'video-controls'
|
@videoControls = $.el 'span', className: 'video-controls'
|
||||||
$.extend @videoControls, <%= html('\u00A0<a href="javascript:;" title="You can also contract the video by dragging it to the left.">contract</a>') %>
|
$.extend @videoControls, <%= html('\u00A0<a href="javascript:;" title="You can also contract the video by dragging it to the left.">contract</a>') %>
|
||||||
|
|||||||
@ -16,8 +16,7 @@ ThreadStats =
|
|||||||
id: 'thread-stats'
|
id: 'thread-stats'
|
||||||
title: statsTitle
|
title: statsTitle
|
||||||
$.extend sc, statsHTML
|
$.extend sc, statsHTML
|
||||||
$.ready ->
|
Header.addShortcut sc, 200
|
||||||
Header.addShortcut sc
|
|
||||||
|
|
||||||
else
|
else
|
||||||
@dialog = sc = UI.dialog 'thread-stats', 'bottom: 0px; right: 0px;',
|
@dialog = sc = UI.dialog 'thread-stats', 'bottom: 0px; right: 0px;',
|
||||||
|
|||||||
@ -8,8 +8,7 @@ ThreadUpdater =
|
|||||||
@dialog = sc = $.el 'span',
|
@dialog = sc = $.el 'span',
|
||||||
id: 'updater'
|
id: 'updater'
|
||||||
$.extend sc, <%= html('<span id="update-status" class="empty"></span><span id="update-timer" class="empty" title="Update now"></span>') %>
|
$.extend sc, <%= html('<span id="update-status" class="empty"></span><span id="update-timer" class="empty" title="Update now"></span>') %>
|
||||||
$.ready ->
|
Header.addShortcut sc, 100
|
||||||
Header.addShortcut sc
|
|
||||||
else
|
else
|
||||||
@dialog = sc = UI.dialog 'updater', 'bottom: 0px; left: 0px;',
|
@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>') %>
|
<%= 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'
|
$.addClass doc, 'fixed-watcher'
|
||||||
if Conf['Toggleable Thread Watcher']
|
if Conf['Toggleable Thread Watcher']
|
||||||
@dialog.hidden = true
|
@dialog.hidden = true
|
||||||
Header.addShortcut sc
|
Header.addShortcut sc, 510
|
||||||
$.addClass doc, 'toggleable-watcher'
|
$.addClass doc, 'toggleable-watcher'
|
||||||
|
|
||||||
ThreadWatcher.fetchAuto()
|
ThreadWatcher.fetchAuto()
|
||||||
|
|||||||
@ -51,7 +51,7 @@ QR =
|
|||||||
else
|
else
|
||||||
QR.close()
|
QR.close()
|
||||||
|
|
||||||
Header.addShortcut sc
|
Header.addShortcut sc, 540
|
||||||
|
|
||||||
initReady: ->
|
initReady: ->
|
||||||
$.off d, '4chanXInitFinished', @initReady
|
$.off d, '4chanXInitFinished', @initReady
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user