Separate icons and "stats" in the shortcuts element
This commit is contained in:
parent
fed5217b07
commit
e80797a0fb
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -53,7 +53,7 @@ Header =
|
|||||||
$.on d, 'CreateNotification', @createNotification
|
$.on d, 'CreateNotification', @createNotification
|
||||||
|
|
||||||
@enableDesktopNotifications()
|
@enableDesktopNotifications()
|
||||||
@addShortcut menuButton
|
@addShortcut menuButton, true
|
||||||
|
|
||||||
$.asap (-> d.body), =>
|
$.asap (-> d.body), =>
|
||||||
return unless Main.isThisPageLegit()
|
return unless Main.isThisPageLegit()
|
||||||
@ -70,8 +70,11 @@ Header =
|
|||||||
notify: $.el 'div',
|
notify: $.el 'div',
|
||||||
id: 'notifications'
|
id: 'notifications'
|
||||||
|
|
||||||
shortcuts: $.el 'span',
|
stats: $.el 'span',
|
||||||
id: 'shortcuts'
|
id: 'a-stats'
|
||||||
|
|
||||||
|
icons: $.el 'span',
|
||||||
|
id: 'a-icons'
|
||||||
|
|
||||||
hover: $.el 'div',
|
hover: $.el 'div',
|
||||||
id: 'hoverUI'
|
id: 'hoverUI'
|
||||||
@ -81,6 +84,7 @@ Header =
|
|||||||
|
|
||||||
setBoardList: ->
|
setBoardList: ->
|
||||||
fourchannav = $.id 'boardNavDesktop'
|
fourchannav = $.id 'boardNavDesktop'
|
||||||
|
|
||||||
if a = $ "a[href*='/#{g.BOARD}/']", fourchannav
|
if a = $ "a[href*='/#{g.BOARD}/']", fourchannav
|
||||||
a.className = 'current'
|
a.className = 'current'
|
||||||
boardList = $.el 'span',
|
boardList = $.el 'span',
|
||||||
@ -91,11 +95,16 @@ Header =
|
|||||||
$.on btn, 'click', Header.toggleBoardList
|
$.on btn, 'click', Header.toggleBoardList
|
||||||
|
|
||||||
$.rm $ '#navtopright', fullBoardList
|
$.rm $ '#navtopright', fullBoardList
|
||||||
|
|
||||||
$.prepend d.body, $.id 'navtopright'
|
shortcuts = $.el 'span',
|
||||||
|
id: 'shortcuts'
|
||||||
|
|
||||||
|
$.add shortcuts, [Header.stats, Header.icons]
|
||||||
|
|
||||||
|
$.prepend d.body, shortcuts
|
||||||
|
|
||||||
$.add boardList, fullBoardList
|
$.add boardList, fullBoardList
|
||||||
$.add Header.bar, [Header.shortcuts, boardList, Header.notify, Header.toggle]
|
$.add Header.bar, [boardList, Header.notify, Header.toggle]
|
||||||
|
|
||||||
Header.setCustomNav Conf['Custom Board Navigation']
|
Header.setCustomNav Conf['Custom Board Navigation']
|
||||||
Header.generateBoardList Conf['boardnav'].replace /(\r\n|\n|\r)/g, ' '
|
Header.generateBoardList Conf['boardnav'].replace /(\r\n|\n|\r)/g, ' '
|
||||||
@ -269,9 +278,10 @@ Header =
|
|||||||
top -= headRect.top + headRect.height
|
top -= headRect.top + headRect.height
|
||||||
window.scrollBy 0, top
|
window.scrollBy 0, top
|
||||||
|
|
||||||
addShortcut: (el) ->
|
addShortcut: (el, icon) ->
|
||||||
$.addClass el, 'shortcut'
|
$.addClass el, 'shortcut'
|
||||||
$.add Header.shortcuts, el
|
|
||||||
|
$.add Header[if icon then 'icons' else 'stats'], el
|
||||||
|
|
||||||
menuToggle: (e) ->
|
menuToggle: (e) ->
|
||||||
Header.menu.toggle e, @, g
|
Header.menu.toggle e, @, g
|
||||||
|
|||||||
@ -374,28 +374,49 @@ th {
|
|||||||
display: <%= flex %>;
|
display: <%= flex %>;
|
||||||
top: 0;
|
top: 0;
|
||||||
z-index: 16;
|
z-index: 16;
|
||||||
|
<%= flex %>-direction: row;
|
||||||
|
max-height: 1.3em;
|
||||||
|
overflow: visible;
|
||||||
}
|
}
|
||||||
.shortcut {
|
.shortcut {
|
||||||
margin: 0 1px;
|
margin: 0 1px;
|
||||||
}
|
}
|
||||||
.icon-orientation-vertical #shortcuts {
|
#a-icons,
|
||||||
<%= flex %>-direction: column;
|
#a-stats {
|
||||||
|
<%= order %>: 0;
|
||||||
|
display: <%= flex %>;
|
||||||
|
}
|
||||||
|
#a-icons {
|
||||||
|
<%= order %>: 10;
|
||||||
}
|
}
|
||||||
.sidebar-location-right #shortcuts {
|
.sidebar-location-right #shortcuts {
|
||||||
right: 0;
|
right: 0;
|
||||||
}
|
}
|
||||||
.sidebar-location-right .shortcut {
|
|
||||||
<%= align %>-self: flex-end;
|
|
||||||
}
|
|
||||||
.sidebar-location-left #shortcuts {
|
.sidebar-location-left #shortcuts {
|
||||||
left: 0;
|
left: 0;
|
||||||
}
|
}
|
||||||
.icon-orientation-horizontal #shortcuts {
|
.sidebar-location-right .shortcut {
|
||||||
|
<%= align %>-self: flex-end;
|
||||||
|
}
|
||||||
|
.icon-orientation-vertical #a-icons{
|
||||||
|
<%= flex %>-direction: column;
|
||||||
|
height: 200px;
|
||||||
|
}
|
||||||
|
.icon-orientation-horizontal #a-stats,
|
||||||
|
.icon-orientation-horizontal #a-icons,
|
||||||
|
.sidebar-location-left #shortcuts {
|
||||||
<%= flex %>-direction: row-reverse;
|
<%= flex %>-direction: row-reverse;
|
||||||
}
|
}
|
||||||
.icon-orientation-horizontal.sidebar-location-left #shortcuts {
|
.icon-orientation-horizontal.sidebar-location-left #a-stats,
|
||||||
|
.icon-orientation-horizontal.sidebar-location-left #a-icons {
|
||||||
<%= flex %>-direction: row;
|
<%= flex %>-direction: row;
|
||||||
}
|
}
|
||||||
|
#thread-stats {
|
||||||
|
<%= order %>: 0;
|
||||||
|
}
|
||||||
|
#updater {
|
||||||
|
<%= order %>: 10;
|
||||||
|
}
|
||||||
#main-menu {
|
#main-menu {
|
||||||
<%= order %>: 0;
|
<%= order %>: 0;
|
||||||
}
|
}
|
||||||
@ -435,12 +456,6 @@ th {
|
|||||||
#returnIcon {
|
#returnIcon {
|
||||||
<%= order %>: 100;
|
<%= order %>: 100;
|
||||||
}
|
}
|
||||||
#thread-stats {
|
|
||||||
<%= order %>: 110;
|
|
||||||
}
|
|
||||||
#updater {
|
|
||||||
<%= order %>: 120;
|
|
||||||
}
|
|
||||||
.icon-orientation-horizontal #so-psa #globalMessage,
|
.icon-orientation-horizontal #so-psa #globalMessage,
|
||||||
.icon-orientation-horizontal #so-watcher #thread-watcher,
|
.icon-orientation-horizontal #so-watcher #thread-watcher,
|
||||||
.icon-orientation-horizontal #so-nav #boardNavDesktopFoot {
|
.icon-orientation-horizontal #so-nav #boardNavDesktopFoot {
|
||||||
|
|||||||
@ -11,7 +11,7 @@ FappeTyme =
|
|||||||
|
|
||||||
$.on el, 'click', FappeTyme.cb.fappe
|
$.on el, 'click', FappeTyme.cb.fappe
|
||||||
|
|
||||||
Header.addShortcut el
|
Header.addShortcut el, true
|
||||||
|
|
||||||
if Conf['Werk Tyme']
|
if Conf['Werk Tyme']
|
||||||
el = $.el 'a',
|
el = $.el 'a',
|
||||||
@ -23,7 +23,7 @@ FappeTyme =
|
|||||||
|
|
||||||
$.on el, 'click', FappeTyme.cb.werk
|
$.on el, 'click', FappeTyme.cb.werk
|
||||||
|
|
||||||
Header.addShortcut el
|
Header.addShortcut el, true
|
||||||
|
|
||||||
|
|
||||||
Post::callbacks.push
|
Post::callbacks.push
|
||||||
|
|||||||
@ -11,7 +11,7 @@ Gallery =
|
|||||||
|
|
||||||
$.on el, 'click', @cb.toggle
|
$.on el, 'click', @cb.toggle
|
||||||
|
|
||||||
Header.addShortcut el
|
Header.addShortcut el, true
|
||||||
|
|
||||||
Post::callbacks.push
|
Post::callbacks.push
|
||||||
name: 'Gallery'
|
name: 'Gallery'
|
||||||
|
|||||||
@ -10,7 +10,7 @@ ImageExpand =
|
|||||||
|
|
||||||
$.on @EAI, 'click', ImageExpand.cb.toggleAll
|
$.on @EAI, 'click', ImageExpand.cb.toggleAll
|
||||||
|
|
||||||
Header.addShortcut @EAI
|
Header.addShortcut @EAI, true
|
||||||
|
|
||||||
Post::callbacks.push
|
Post::callbacks.push
|
||||||
name: 'Image Expansion'
|
name: 'Image Expansion'
|
||||||
|
|||||||
@ -57,5 +57,5 @@ CatalogLinks =
|
|||||||
if catalogLink = ($('.pages.cataloglink a', d.body) or $ '[href=".././catalog"]', d.body)
|
if catalogLink = ($('.pages.cataloglink a', d.body) or $ '[href=".././catalog"]', d.body)
|
||||||
catalogLink.textContent = ''
|
catalogLink.textContent = ''
|
||||||
catalogLink.className = 'a-icon'
|
catalogLink.className = 'a-icon'
|
||||||
Header.addShortcut catalogLink
|
Header.addShortcut catalogLink, true
|
||||||
catalogLink.id = 'catalog'
|
catalogLink.id = 'catalog'
|
||||||
|
|||||||
@ -15,8 +15,8 @@ Nav =
|
|||||||
href: 'javascript:;'
|
href: 'javascript:;'
|
||||||
id: 'navNext'
|
id: 'navNext'
|
||||||
|
|
||||||
Header.addShortcut prev
|
Header.addShortcut prev, true
|
||||||
Header.addShortcut next
|
Header.addShortcut next, true
|
||||||
|
|
||||||
$.on prev, 'click', @prev
|
$.on prev, 'click', @prev
|
||||||
$.on next, 'click', @next
|
$.on next, 'click', @next
|
||||||
|
|||||||
@ -46,7 +46,7 @@ ThreadWatcher =
|
|||||||
el = $.el 'div',
|
el = $.el 'div',
|
||||||
id: 'so-watcher'
|
id: 'so-watcher'
|
||||||
innerHTML: '<i class=a-icon></a>'
|
innerHTML: '<i class=a-icon></a>'
|
||||||
Header.addShortcut el
|
Header.addShortcut el, true
|
||||||
else
|
else
|
||||||
el = d.body
|
el = d.body
|
||||||
|
|
||||||
|
|||||||
@ -31,7 +31,7 @@ QR =
|
|||||||
QR.close()
|
QR.close()
|
||||||
$.toggleClass @, 'disabled'
|
$.toggleClass @, 'disabled'
|
||||||
|
|
||||||
return Header.addShortcut sc if Conf['Header Shortcut']
|
return Header.addShortcut sc, true if Conf['Header Shortcut']
|
||||||
|
|
||||||
$.addClass sc, 'on-page'
|
$.addClass sc, 'on-page'
|
||||||
$.rmClass sc, 'icon'
|
$.rmClass sc, 'icon'
|
||||||
|
|||||||
@ -172,7 +172,7 @@ Style =
|
|||||||
id: 'so-nav'
|
id: 'so-nav'
|
||||||
innerHTML: '<i class=a-icon></a>'
|
innerHTML: '<i class=a-icon></a>'
|
||||||
$.add slideNav, $.id('boardNavDesktopFoot')
|
$.add slideNav, $.id('boardNavDesktopFoot')
|
||||||
Header.addShortcut slideNav if Conf['Slideout Navigation'] isnt 'hide'
|
Header.addShortcut slideNav, true if Conf['Slideout Navigation'] isnt 'hide'
|
||||||
|
|
||||||
# Announcements
|
# Announcements
|
||||||
if Conf['Announcements'] is 'slideout'
|
if Conf['Announcements'] is 'slideout'
|
||||||
@ -181,14 +181,14 @@ Style =
|
|||||||
id: 'so-psa'
|
id: 'so-psa'
|
||||||
innerHTML: '<i class=a-icon></a>'
|
innerHTML: '<i class=a-icon></a>'
|
||||||
$.add psa, psaIcon
|
$.add psa, psaIcon
|
||||||
Header.addShortcut psaIcon
|
Header.addShortcut psaIcon, true
|
||||||
|
|
||||||
if g.VIEW is 'thread'
|
if g.VIEW is 'thread'
|
||||||
el = $('body > div.navLinks > a')
|
el = $('body > div.navLinks > a')
|
||||||
el.textContent = ''
|
el.textContent = ''
|
||||||
el.id = 'returnIcon'
|
el.id = 'returnIcon'
|
||||||
el.className = 'a-icon'
|
el.className = 'a-icon'
|
||||||
Header.addShortcut el
|
Header.addShortcut el, true
|
||||||
|
|
||||||
padding: ->
|
padding: ->
|
||||||
Style.padding.nav = Header.bar
|
Style.padding.nav = Header.bar
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user