Follow Zixaphir in adding space to label in UI.checkbox.

Change settings checkbox (where space was unwanted) to HTML template.
This commit is contained in:
ccd0 2015-02-02 22:59:06 -08:00
parent 845ebcfad4
commit e1b63d4a99
13 changed files with 28 additions and 31 deletions

View File

@ -39,9 +39,9 @@ PostHiding =
href: 'javascript:;'
$.on apply, 'click', PostHiding.menu.hide
thisPost = UI.checkbox 'thisPost', ' This post', true
replies = UI.checkbox 'replies', ' Hide replies', Conf['Recursive Hiding']
makeStub = UI.checkbox 'makeStub', ' Make stub', Conf['Stubs']
thisPost = UI.checkbox 'thisPost', 'This post', true
replies = UI.checkbox 'replies', 'Hide replies', Conf['Recursive Hiding']
makeStub = UI.checkbox 'makeStub', 'Make stub', Conf['Stubs']
Menu.menu.addEntry
el: div
@ -71,8 +71,8 @@ PostHiding =
href: 'javascript:;'
$.on apply, 'click', PostHiding.menu.show
thisPost = UI.checkbox 'thisPost', ' This post', false
replies = UI.checkbox 'replies', ' Show replies', false
thisPost = UI.checkbox 'thisPost', 'This post', false
replies = UI.checkbox 'replies', 'Show replies', false
hideStubLink = $.el 'a',
textContent: 'Hide stub'
href: 'javascript:;'

View File

@ -63,7 +63,7 @@ ThreadHiding =
href: 'javascript:;'
$.on apply, 'click', ThreadHiding.menu.hide
makeStub = UI.checkbox 'Stubs', ' Make stub'
makeStub = UI.checkbox 'Stubs', 'Make stub'
Menu.menu.addEntry
el: div

View File

@ -6,14 +6,14 @@ Header =
className: 'menu-button'
$.extend menuButton, <%= html('<i></i>') %>
barFixedToggler = UI.checkbox 'Fixed Header', ' Fixed Header'
headerToggler = UI.checkbox 'Header auto-hide', ' Auto-hide header'
scrollHeaderToggler = UI.checkbox 'Header auto-hide on scroll', ' Auto-hide header on scroll'
barPositionToggler = UI.checkbox 'Bottom Header', ' Bottom header'
linkJustifyToggler = UI.checkbox 'Centered links', ' Centered links'
customNavToggler = UI.checkbox 'Custom Board Navigation', ' Custom board navigation'
footerToggler = UI.checkbox 'Bottom Board List', ' Hide bottom board list'
shortcutToggler = UI.checkbox 'Shortcut Icons', ' Shortcut Icons'
barFixedToggler = UI.checkbox 'Fixed Header', 'Fixed Header'
headerToggler = UI.checkbox 'Header auto-hide', 'Auto-hide header'
scrollHeaderToggler = UI.checkbox 'Header auto-hide on scroll', 'Auto-hide header on scroll'
barPositionToggler = UI.checkbox 'Bottom Header', 'Bottom header'
linkJustifyToggler = UI.checkbox 'Centered links', 'Centered links'
customNavToggler = UI.checkbox 'Custom Board Navigation', 'Custom board navigation'
footerToggler = UI.checkbox 'Bottom Board List', 'Hide bottom board list'
shortcutToggler = UI.checkbox 'Shortcut Icons', 'Shortcut Icons'
editCustomNav = $.el 'a',
textContent: 'Edit custom board navigation'
href: 'javascript:;'

View File

@ -26,10 +26,10 @@ Index =
$.on @button, 'click', -> Index.update()
Header.addShortcut @button, 1
repliesEntry = el: UI.checkbox 'Show Replies', ' Show replies'
pinEntry = el: UI.checkbox 'Pin Watched Threads', ' Pin watched threads'
anchorEntry = el: UI.checkbox 'Anchor Hidden Threads', ' Anchor hidden threads'
refNavEntry = el: UI.checkbox 'Refreshed Navigation', ' Refreshed navigation'
repliesEntry = el: UI.checkbox 'Show Replies', 'Show replies'
pinEntry = el: UI.checkbox 'Pin Watched Threads', 'Pin watched threads'
anchorEntry = el: UI.checkbox 'Anchor Hidden Threads', 'Anchor hidden threads'
refNavEntry = el: UI.checkbox 'Refreshed Navigation', 'Refreshed navigation'
pinEntry.el.title = 'Move watched threads to the start of the index.'
anchorEntry.el.title = 'Move hidden threads to the end of the index.'
refNavEntry.el.title = 'Refresh index when navigating through pages.'

View File

@ -100,11 +100,8 @@ Settings =
containers = [fs]
for key, arr of obj
description = arr[1]
div = $.el 'div'
$.add div, [
UI.checkbox key, key, false
$.el 'span', class: 'description', textContent: ": #{description}"
]
div = $.el 'div',
<%= html('<label><input type="checkbox" name="${key}">${key}</label><span class="description">: ${description}</span>') %>
input = $ 'input', div
$.on input, 'change', $.cb.checked
$.on input, 'change', -> @parentNode.parentNode.dataset.checked = @checked

View File

@ -373,7 +373,7 @@ UI = do ->
checked = Conf[name] unless checked?
label = $.el 'label'
input = $.el 'input', {type: 'checkbox', name, checked}
$.add label, [input, $.tn text]
$.add label, [input, $.tn " #{text}"]
label

View File

@ -9,7 +9,7 @@ FappeTyme =
for type in ["Fappe", "Werk"] when Conf["#{type} Tyme"]
lc = type.toLowerCase()
el = UI.checkbox lc, " #{type} Tyme", false
el = UI.checkbox lc, "#{type} Tyme", false
el.title = "#{type} Tyme"
@nodes[lc] = el.firstElementChild

View File

@ -315,7 +315,7 @@ Gallery =
subEntries: Gallery.menu.createSubEntries()
createSubEntry: (name) ->
label = UI.checkbox name, " #{name}"
label = UI.checkbox name, name
input = label.firstElementChild
if name in ['Fit Width', 'Fit Height', 'Hide Thumbnails']
$.on input, 'change', Gallery.cb.setFitness

View File

@ -295,7 +295,7 @@ ImageExpand =
subEntries: subEntries
createSubEntry: (name, desc) ->
label = UI.checkbox name, " #{name}"
label = UI.checkbox name, name
label.title = desc
input = label.firstElementChild
if name in ['Fit width', 'Fit height']

View File

@ -13,7 +13,7 @@ Volume =
return unless g.BOARD.ID in ['gif', 'wsg']
unmuteEntry = UI.checkbox 'Allow Sound', ' Allow Sound'
unmuteEntry = UI.checkbox 'Allow Sound', 'Allow Sound'
unmuteEntry.title = Config.main['Images and Videos']['Allow Sound'][1]
volumeEntry = $.el 'label',

View File

@ -26,7 +26,7 @@ CatalogLinks =
cb: @node
if Conf['Catalog Links']
CatalogLinks.el = el = UI.checkbox 'Header catalog links', ' Catalog Links'
CatalogLinks.el = el = UI.checkbox 'Header catalog links', 'Catalog Links'
el.id = 'toggleCatalog'
input = $ 'input', el
$.on input, 'change', @toggle

View File

@ -33,7 +33,7 @@ ThreadUpdater =
subEntries = []
for name, conf of Config.updater.checkbox
el = UI.checkbox name, " #{name}"
el = UI.checkbox name, name
el.title = conf[1]
input = el.firstElementChild
$.on input, 'change', $.cb.checked

View File

@ -435,7 +435,7 @@ ThreadWatcher =
createSubEntry: (name, desc) ->
entry =
type: 'thread watcher'
el: UI.checkbox name, " #{name.replace ' Thread Watcher', ''}"
el: UI.checkbox name, name.replace(' Thread Watcher', '')
entry.el.title = desc
input = entry.el.firstElementChild
$.on input, 'change', $.cb.checked