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 false
'Link to external catalog instead of the internal one.' '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': [ 'Custom Board Navigation': [
true true
'Show custom links instead of the full board list.' 'Show custom links instead of the full board list.'

View File

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

View File

@ -94,5 +94,8 @@ ExpandThread =
Main.callbackNodes Post, posts Main.callbackNodes Post, posts
$.after a, nodes $.after a, nodes
# 4chan features. # Enable 4chan features.
Fourchan.parseThread thread.ID, 1, nodes.length 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', toggle: $.el 'div',
id: 'toggle-header-bar' id: 'toggle-header-bar'
settings: $.el 'div',
id: 'settingsContainer'
createSubEntry: (setting)-> createSubEntry: (setting)->
label = $.el 'label', label = $.el 'label',
@ -71,10 +74,6 @@ Header =
fullBoardList = $.el 'span', fullBoardList = $.el 'span',
id: 'full-board-list' id: 'full-board-list'
hidden: true
customBoardList = $.el 'span',
id: 'custom-board-list'
Header.setBarPosition.call textContent: "#{Conf['Boards Navigation']}" Header.setBarPosition.call textContent: "#{Conf['Boards Navigation']}"
$.sync 'Boards Navigation', Header.changeBarPosition $.sync 'Boards Navigation', Header.changeBarPosition
@ -82,21 +81,26 @@ Header =
Header.setBarVisibility Conf['Header auto-hide'] Header.setBarVisibility Conf['Header auto-hide']
$.sync 'Header auto-hide', Header.setBarVisibility $.sync 'Header auto-hide', Header.setBarVisibility
settings = $.id 'navtopright'
$.add fullBoardList, [nav.childNodes...] $.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'] if Conf['Custom Board Navigation']
fullBoardList.hidden = true
customBoardList = $.el 'span',
id: 'custom-board-list'
Header.generateBoardList Conf['boardnav'] Header.generateBoardList Conf['boardnav']
$.sync 'boardnav', Header.generateBoardList $.sync 'boardnav', Header.generateBoardList
btn = $.el 'span', btn = $.el 'span',
className: 'hide-board-list-button' className: 'hide-board-list-button'
innerHTML: '[<a href=javascript:;> - </a>]\u00A0' innerHTML: '[<a href=javascript:;> - </a>]\u00A0'
$.on btn, 'click', Header.toggleBoardList $.on btn, 'click', Header.toggleBoardList
$.prepend fullBoardList, btn $.prepend fullBoardList, btn
$.before fullBoardList, customBoardList
else else
$.rm $ '#custom-board-list', nav
fullBoardList.hidden = false fullBoardList.hidden = false
generateBoardList: (text) -> generateBoardList: (text) ->

View File

@ -289,7 +289,10 @@ ThreadUpdater =
# Enable 4chan features. # Enable 4chan features.
threadID = ThreadUpdater.thread.ID threadID = ThreadUpdater.thread.ID
{length} = $$ '.thread > .postContainer', ThreadUpdater.root {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', $.event 'ThreadUpdate',
404: false 404: false

View File

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