Actually, I don't need to remove it to not support it.

This commit is contained in:
Zixaphir 2013-04-21 20:20:24 -07:00
parent 17d7967551
commit 29b1f20387
9 changed files with 113 additions and 94 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

@ -9,6 +9,10 @@ Config =
false
'Link to external catalog instead of the internal one.'
]
'Enable 4chan\'s Extension': [
false
'Compatibility between <%= meta.name %> and 4chan\'s inline extension is NOT guaranteed.'
]
'Custom Board Navigation': [
true
'Show custom links instead of the full board list.'

View File

@ -194,8 +194,8 @@ a[href="javascript:;"] {
.expand-all-shortcut {
opacity: .45;
}
#navtopright a {
text-decoration: none;
#navtopright {
display: none;
}
/* Notifications */

View File

@ -94,5 +94,8 @@ ExpandThread =
Main.callbackNodes Post, posts
$.after a, nodes
# 4chan features.
Fourchan.parseThread thread.ID, 1, nodes.length
# Enable 4chan features.
if Conf['Enable 4chan\'s Extension']
$.globalEval "Parser.parseThread(#{thread.ID}, 1, #{nodes.length})"
else
Fourchan.parseThread thread.ID, 1, nodes.length

View File

@ -55,6 +55,9 @@ Header =
toggle: $.el 'div',
id: 'toggle-header-bar'
settings: $.el 'div',
id: 'settingsContainer'
createSubEntry: (setting)->
label = $.el 'label',
@ -71,10 +74,6 @@ Header =
fullBoardList = $.el 'span',
id: 'full-board-list'
hidden: true
customBoardList = $.el 'span',
id: 'custom-board-list'
Header.setBarPosition.call textContent: "#{Conf['Boards Navigation']}"
$.sync 'Boards Navigation', Header.changeBarPosition
@ -82,21 +81,26 @@ Header =
Header.setBarVisibility Conf['Header auto-hide']
$.sync 'Header auto-hide', Header.setBarVisibility
settings = $.id 'navtopright'
$.add fullBoardList, [nav.childNodes...]
$.add nav, [Header.menuButton, customBoardList, fullBoardList, Header.shortcuts, Header.bar, Header.toggle, settings]
$.add nav, [Header.menuButton, fullBoardList, Header.shortcuts, Header.bar, Header.toggle, Header.settings]
if Conf['Custom Board Navigation']
fullBoardList.hidden = true
customBoardList = $.el 'span',
id: 'custom-board-list'
Header.generateBoardList Conf['boardnav']
$.sync 'boardnav', Header.generateBoardList
btn = $.el 'span',
className: 'hide-board-list-button'
innerHTML: '[<a href=javascript:;> - </a>]\u00A0'
$.on btn, 'click', Header.toggleBoardList
$.prepend fullBoardList, btn
$.before fullBoardList, customBoardList
else
$.rm $ '#custom-board-list', nav
fullBoardList.hidden = false
generateBoardList: (text) ->

View File

@ -289,7 +289,10 @@ ThreadUpdater =
# Enable 4chan features.
threadID = ThreadUpdater.thread.ID
{length} = $$ '.thread > .postContainer', ThreadUpdater.root
Fourchan.parseThread threadID, length - count, length
if Conf['Enable 4chan\'s Extension']
$.globalEval "Parser.parseThread(#{threadID}, #{-count})"
else
Fourchan.parseThread threadID, length - count, length
$.event 'ThreadUpdate',
404: false

View File

@ -7,12 +7,7 @@ Settings =
href: 'javascript:;'
$.on link, 'click', Settings.open
$.asap (-> d.body), ->
return unless Main.isThisPageLegit()
# Wait for #boardNavMobile instead of #boardNavDesktop,
# it might be incomplete otherwise.
$.asap (-> $.id 'boardNavMobile'), ->
$.replace $.id('settingsWindowLink'), link
$.add Header.settings, [$.tn(' ['), link, $.tn('] ')]
$.get 'previousversion', null, (item) ->
if previous = item['previousversion']
@ -40,6 +35,7 @@ Settings =
$.on d, 'AddSettingsSection', Settings.addSection
$.on d, 'OpenSettings', (e) -> Settings.open e.detail
return if Conf['Enable 4chan\'s Extension']
settings = JSON.parse(localStorage.getItem '4chan-settings') or {}
return if settings.disableAll
settings.disableAll = true