Move Catalog Links into the Header Menu.

This commit is contained in:
Zixaphir 2013-04-21 21:31:52 -07:00
parent 29b1f20387
commit 4d25b6ff3a
7 changed files with 66 additions and 50 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -194,6 +194,10 @@ a[href="javascript:;"] {
.expand-all-shortcut {
opacity: .45;
}
#settings-container {
float: right;
}
#navbotright,
#navtopright {
display: none;
}

View File

@ -1,15 +1,19 @@
CatalogLinks =
init: ->
return unless Conf['Catalog Links']
el = $.el 'a',
el = $.el 'label',
id: 'toggleCatalog'
href: 'javascript:;'
className: if Conf['Header catalog links'] then 'disabled' else ''
textContent: 'Catalog'
innerHTML: "<input type=checkbox #{if Conf['Header catalog links'] then 'checked' else ''}>Catalog"
title: "Turn catalog links #{if Conf['Header catalog links'] then 'off' else 'on'}."
$.on el, 'click', @toggle
input = $ 'input', el
$.on input, 'change', @toggle
Header.addShortcut el
$.event 'AddMenuEntry',
type: 'header'
el: el
order: 95
$.asap (-> d.body), ->
return unless Main.isThisPageLegit()
@ -20,8 +24,7 @@ CatalogLinks =
CatalogLinks.toggle.call el
toggle: ->
$.set 'Header catalog links', useCatalog = @className is 'disabled'
$.toggleClass @, 'disabled'
$.set 'Header catalog links', useCatalog = @checked
for a in $$ 'a', $.id('boardNavDesktop')
board = a.pathname.split('/')[1]
continue if ['f', 'status', '4chan'].contains(board) or !board
@ -33,7 +36,7 @@ CatalogLinks =
else
a.pathname = "/#{board}/#{if useCatalog then 'catalog' else ''}"
a.title = if useCatalog then "#{a.title} - Catalog" else a.title.replace(/\ -\ Catalog$/, '')
@title = "Turn catalog links #{if useCatalog then 'off' else 'on'}."
@title = "Turn catalog links #{if useCatalog then 'off' else 'on'}."
external: (board) ->
return (

View File

@ -57,7 +57,7 @@ Header =
id: 'toggle-header-bar'
settings: $.el 'div',
id: 'settingsContainer'
id: 'settings-container'
createSubEntry: (setting)->
label = $.el 'label',
@ -88,6 +88,7 @@ Header =
fullBoardList.hidden = true
customBoardList = $.el 'span',
id: 'custom-board-list'
$.before fullBoardList, customBoardList
Header.generateBoardList Conf['boardnav']
$.sync 'boardnav', Header.generateBoardList
@ -98,7 +99,6 @@ Header =
$.on btn, 'click', Header.toggleBoardList
$.prepend fullBoardList, btn
$.before fullBoardList, customBoardList
else
fullBoardList.hidden = false

View File

@ -3,7 +3,7 @@ Settings =
# 4chan X settings link
link = $.el 'a',
className: 'settings-link'
textContent: '<%= meta.name %> Settings'
textContent: 'Settings'
href: 'javascript:;'
$.on link, 'click', Settings.open