Some shortcut icon tweaks

This commit is contained in:
seaweedchan 2013-08-18 03:42:25 -07:00
parent 5689ba0012
commit 1fb2897baa
9 changed files with 110 additions and 9 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -488,6 +488,7 @@ http://iqdb.org/?url=%TURL
'Centered links': false
'Header catalog links': false
'Bottom Board List': true
'Shortcut Icons': false
'Custom Board Navigation': true
boardnav: """

View File

@ -18,6 +18,8 @@ Header =
innerHTML: '<input type=checkbox name="Custom Board Navigation"> Custom board navigation'
footerToggler = $.el 'label',
innerHTML: "<input type=checkbox #{unless Conf['Bottom Board List'] then 'checked' else ''}> Hide bottom board list"
shortcutToggler = $.el 'label',
innerHTML: "<input type=checkbox #{unless Conf['Shortcut Icons'] then 'checked' else ''}> Shortcut Icons"
editCustomNav = $.el 'a',
textContent: 'Edit custom board navigation'
href: 'javascript:;'
@ -27,6 +29,7 @@ Header =
@linkJustifyToggler = linkJustifyToggler.firstElementChild
@headerToggler = headerToggler.firstElementChild
@footerToggler = footerToggler.firstElementChild
@shortcutToggler = shortcutToggler.firstElementChild
@customNavToggler = customNavToggler.firstElementChild
$.on menuButton, 'click', @menuToggle
@ -35,15 +38,18 @@ Header =
$.on @linkJustifyToggler, 'change', @toggleLinkJustify
$.on @headerToggler, 'change', @toggleBarVisibility
$.on @footerToggler, 'change', @toggleFooterVisibility
$.on @shortcutToggler, 'change', @toggleShortcutIcons
$.on @customNavToggler, 'change', @toggleCustomNav
$.on editCustomNav, 'click', @editCustomNav
@setBarFixed Conf['Fixed Header']
@setBarVisibility Conf['Header auto-hide']
@setLinkJustify Conf['Centered links']
@setShortcutIcons Conf['Shortcut Icons']
$.sync 'Fixed Header', Header.setBarFixed
$.sync 'Bottom Header', Header.setBarPosition
$.sync 'Shortcut Icons', Header.setShortcutIcons
$.sync 'Header auto-hide', Header.setBarVisibility
$.sync 'Centered links', Header.setLinkJustify
@ -60,6 +66,7 @@ Header =
{el: barPositionToggler}
{el: linkJustifyToggler}
{el: footerToggler}
{el: shortcutToggler}
{el: customNavToggler}
{el: editCustomNav}
]
@ -75,6 +82,7 @@ Header =
$.prepend d.body, @bar
$.add d.body, Header.hover
@setBarPosition Conf['Bottom Header']
@
$.ready =>
@footer = $.id 'boardNavDesktopFoot'
@ -240,6 +248,21 @@ Header =
Conf['Fixed Header'] = @checked
$.set 'Fixed Header', @checked
setShortcutIcons: (show) ->
Header.shortcutToggler.checked = show
if show
$.addClass doc, 'shortcut-icons'
else
$.rmClass doc, 'shortcut-icons'
toggleShortcutIcons: ->
$.event 'CloseMenu'
Header.setShortcutIcons @checked
Conf['Shortcut Icons'] = @checked
$.set 'Shortcut Icons', @checked
setBarVisibility: (hide) ->
Header.headerToggler.checked = hide
$.event 'CloseMenu'

View File

@ -3,6 +3,7 @@ Settings =
# 4chan X settings link
link = $.el 'a',
className: 'settings-link icon-wrench'
textContent: 'Settings'
href: 'javascript:;'
$.on link, 'click', Settings.open

View File

@ -1039,6 +1039,21 @@ a:only-of-type > .remove {
cursor: text !important;
}
/* Shortcut Icons */
:root:not(.shortcut-icons) [class*=" icon-"]::before {
display: none !important;
}
:root:not(.shortcut-icons) [class*=" icon-"] {
font-family: '' !important;
}
:root.shortcut-icons [class*=" icon-"] {
font-size: 0px;
}
:root.shortcut-icons [class*=" icon-"]::before {
font-size: 13px !important;
}
/* Link Title Favicons */
.linkify.YouTube {
background: transparent url('data:image/png;base64,<%= grunt.file.read("src/General/img/links/youtube.png", {encoding: "base64"}) %>') center left no-repeat!important;

View File

@ -4,6 +4,7 @@ ImageExpand =
@EAI = $.el 'a',
className: 'expand-all-shortcut icon-resize-full'
textContent: 'EAI'
title: 'Expand All Images'
href: 'javascript:;'
$.on @EAI, 'click', ImageExpand.cb.toggleAll

View File

@ -4,6 +4,7 @@ ThreadWatcher =
@shortcut = sc = $.el 'a',
id: 'watcher-link'
textContent: 'Watcher'
href: 'javascript:;'
className: 'disabled icon-bookmark'

View File

@ -7,6 +7,7 @@ QR =
if Conf['QR Shortcut']
sc = $.el 'a',
className: "qr-shortcut icon-comment-alt #{unless Conf['Persistent QR'] then 'disabled' else ''}"
textContent: 'QR'
title: 'Quick Reply'
href: 'javascript:;'
$.on sc, 'click', ->
@ -720,7 +721,7 @@ QR =
URL.revokeObjectURL @URL
updateFilename: ->
long = "#{@filename} (#{@filesize}) - Ctrl+click to edit filename"
long = "#{@filename} (#{@filesize})\nCtrl+click to edit filename. Shift+click to clear."
@nodes.el.title = long
return unless @ is QR.selected
QR.nodes.fileContainer.title = long