Remove all inline catalog-related code.
This commit is contained in:
parent
e95035a17f
commit
1aa467b051
@ -1,4 +1,3 @@
|
|||||||
[<a href="./catalog">Catalog</a>]
|
|
||||||
[<time id="index-last-refresh" title="Last index refresh">...</time>]
|
[<time id="index-last-refresh" title="Last index refresh">...</time>]
|
||||||
<input type="search" id="index-search" class="field" placeholder="Search">
|
<input type="search" id="index-search" class="field" placeholder="Search">
|
||||||
<a id="index-search-clear" class="fa fa-times-circle" href="javascript:;"></a>
|
<a id="index-search-clear" class="fa fa-times-circle" href="javascript:;"></a>
|
||||||
|
|||||||
@ -9,6 +9,3 @@
|
|||||||
<button disabled>Next</button>
|
<button disabled>Next</button>
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
<div class="pages cataloglink">
|
|
||||||
<a href="./catalog">Catalog</a>
|
|
||||||
</div>
|
|
||||||
|
|||||||
@ -7,9 +7,6 @@
|
|||||||
<div>Board link (Replace with title when on that board): <code>board-replace</code></div>
|
<div>Board link (Replace with title when on that board): <code>board-replace</code></div>
|
||||||
<div>Full text link: <code>board-full</code></div>
|
<div>Full text link: <code>board-full</code></div>
|
||||||
<div>Custom text link: <code>board-text:"VIP Board"</code></div>
|
<div>Custom text link: <code>board-text:"VIP Board"</code></div>
|
||||||
<div>Index-only link: <code>board-index</code></div>
|
|
||||||
<div>Catalog-only link: <code>board-catalog</code></div>
|
|
||||||
<div>Combinations are possible: <code>board-index-text:"VIP Index"</code></div>
|
|
||||||
<div>Full board list toggle: <code>toggle-all</code></div>
|
<div>Full board list toggle: <code>toggle-all</code></div>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
|
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
Filter =
|
Filter =
|
||||||
filters: {}
|
filters: {}
|
||||||
init: ->
|
init: ->
|
||||||
return if g.VIEW is 'catalog' or !Conf['Filter']
|
return if !Conf['Filter']
|
||||||
|
|
||||||
for key of Config.filter
|
for key of Config.filter
|
||||||
@filters[key] = []
|
@filters[key] = []
|
||||||
@ -166,7 +166,7 @@ Filter =
|
|||||||
|
|
||||||
menu:
|
menu:
|
||||||
init: ->
|
init: ->
|
||||||
return if g.VIEW is 'catalog' or !Conf['Menu'] or !Conf['Filter']
|
return if !Conf['Menu'] or !Conf['Filter']
|
||||||
|
|
||||||
div = $.el 'div',
|
div = $.el 'div',
|
||||||
textContent: 'Filter'
|
textContent: 'Filter'
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
PostHiding =
|
PostHiding =
|
||||||
init: ->
|
init: ->
|
||||||
return if g.VIEW is 'catalog' or !Conf['Reply Hiding'] and !Conf['Reply Hiding Link']
|
return if !Conf['Reply Hiding'] and !Conf['Reply Hiding Link']
|
||||||
|
|
||||||
@db = new DataBoard 'hiddenPosts'
|
@db = new DataBoard 'hiddenPosts'
|
||||||
Post.callbacks.push
|
Post.callbacks.push
|
||||||
@ -20,7 +20,7 @@ PostHiding =
|
|||||||
|
|
||||||
menu:
|
menu:
|
||||||
init: ->
|
init: ->
|
||||||
return if g.VIEW is 'catalog' or !Conf['Menu'] or !Conf['Reply Hiding Link']
|
return if !Conf['Menu'] or !Conf['Reply Hiding Link']
|
||||||
|
|
||||||
# Hide
|
# Hide
|
||||||
div = $.el 'div',
|
div = $.el 'div',
|
||||||
|
|||||||
@ -1,8 +1,6 @@
|
|||||||
Recursive =
|
Recursive =
|
||||||
recursives: {}
|
recursives: {}
|
||||||
init: ->
|
init: ->
|
||||||
return if g.VIEW is 'catalog'
|
|
||||||
|
|
||||||
Post.callbacks.push
|
Post.callbacks.push
|
||||||
name: 'Recursive'
|
name: 'Recursive'
|
||||||
cb: @node
|
cb: @node
|
||||||
|
|||||||
@ -3,7 +3,6 @@ ThreadHiding =
|
|||||||
return if g.VIEW isnt 'index'
|
return if g.VIEW isnt 'index'
|
||||||
|
|
||||||
@db = new DataBoard 'hiddenThreads'
|
@db = new DataBoard 'hiddenThreads'
|
||||||
@syncCatalog()
|
|
||||||
$.on d, 'IndexRefresh', @onIndexRefresh
|
$.on d, 'IndexRefresh', @onIndexRefresh
|
||||||
Thread.callbacks.push
|
Thread.callbacks.push
|
||||||
name: 'Thread Hiding'
|
name: 'Thread Hiding'
|
||||||
@ -26,50 +25,6 @@ ThreadHiding =
|
|||||||
ThreadHiding.makeStub thread, root
|
ThreadHiding.makeStub thread, root
|
||||||
return
|
return
|
||||||
|
|
||||||
syncCatalog: ->
|
|
||||||
# Sync hidden threads from the catalog into the index.
|
|
||||||
hiddenThreads = ThreadHiding.db.get
|
|
||||||
boardID: g.BOARD.ID
|
|
||||||
defaultValue: {}
|
|
||||||
hiddenThreadsOnCatalog = JSON.parse(localStorage.getItem "4chan-hide-t-#{g.BOARD}") or {}
|
|
||||||
|
|
||||||
# Add threads that were hidden in the catalog.
|
|
||||||
for threadID of hiddenThreadsOnCatalog
|
|
||||||
unless threadID of hiddenThreads
|
|
||||||
hiddenThreads[threadID] = {}
|
|
||||||
|
|
||||||
# Remove threads that were un-hidden in the catalog.
|
|
||||||
for threadID of hiddenThreads
|
|
||||||
unless threadID of hiddenThreadsOnCatalog
|
|
||||||
delete hiddenThreads[threadID]
|
|
||||||
|
|
||||||
if (ThreadHiding.db.data.lastChecked or 0) > Date.now() - $.MINUTE
|
|
||||||
# Was cleaned just now.
|
|
||||||
ThreadHiding.cleanCatalog hiddenThreadsOnCatalog
|
|
||||||
|
|
||||||
unless Object.keys(hiddenThreads).length
|
|
||||||
ThreadHiding.db.delete boardID: g.BOARD.ID
|
|
||||||
return
|
|
||||||
ThreadHiding.db.set
|
|
||||||
boardID: g.BOARD.ID
|
|
||||||
val: hiddenThreads
|
|
||||||
|
|
||||||
cleanCatalog: (hiddenThreadsOnCatalog) ->
|
|
||||||
# We need to clean hidden threads on the catalog ourselves,
|
|
||||||
# otherwise if we don't visit the catalog regularly
|
|
||||||
# it will pollute the localStorage and our data.
|
|
||||||
$.cache "//a.4cdn.org/#{g.BOARD}/threads.json", ->
|
|
||||||
return unless @status is 200
|
|
||||||
threads = {}
|
|
||||||
for page in @response
|
|
||||||
for thread in page.threads
|
|
||||||
if thread.no of hiddenThreadsOnCatalog
|
|
||||||
threads[thread.no] = hiddenThreadsOnCatalog[thread.no]
|
|
||||||
if Object.keys(threads).length
|
|
||||||
localStorage.setItem "4chan-hide-t-#{g.BOARD}", JSON.stringify threads
|
|
||||||
else
|
|
||||||
localStorage.removeItem "4chan-hide-t-#{g.BOARD}"
|
|
||||||
|
|
||||||
menu:
|
menu:
|
||||||
init: ->
|
init: ->
|
||||||
return if g.VIEW isnt 'index' or !Conf['Menu'] or !Conf['Thread Hiding Link']
|
return if g.VIEW isnt 'index' or !Conf['Menu'] or !Conf['Thread Hiding Link']
|
||||||
@ -130,19 +85,15 @@ ThreadHiding =
|
|||||||
$.prepend root, thread.stub
|
$.prepend root, thread.stub
|
||||||
|
|
||||||
saveHiddenState: (thread, makeStub) ->
|
saveHiddenState: (thread, makeStub) ->
|
||||||
hiddenThreadsOnCatalog = JSON.parse(localStorage.getItem "4chan-hide-t-#{g.BOARD}") or {}
|
|
||||||
if thread.isHidden
|
if thread.isHidden
|
||||||
ThreadHiding.db.set
|
ThreadHiding.db.set
|
||||||
boardID: thread.board.ID
|
boardID: thread.board.ID
|
||||||
threadID: thread.ID
|
threadID: thread.ID
|
||||||
val: {makeStub}
|
val: {makeStub}
|
||||||
hiddenThreadsOnCatalog[thread] = true
|
|
||||||
else
|
else
|
||||||
ThreadHiding.db.delete
|
ThreadHiding.db.delete
|
||||||
boardID: thread.board.ID
|
boardID: thread.board.ID
|
||||||
threadID: thread.ID
|
threadID: thread.ID
|
||||||
delete hiddenThreadsOnCatalog[thread]
|
|
||||||
localStorage.setItem "4chan-hide-t-#{g.BOARD}", JSON.stringify hiddenThreadsOnCatalog
|
|
||||||
|
|
||||||
toggle: (thread) ->
|
toggle: (thread) ->
|
||||||
unless thread instanceof Thread
|
unless thread instanceof Thread
|
||||||
|
|||||||
@ -149,7 +149,6 @@ Config =
|
|||||||
'Header auto-hide': false
|
'Header auto-hide': false
|
||||||
'Header auto-hide on scroll': false
|
'Header auto-hide on scroll': false
|
||||||
'Bottom header': false
|
'Bottom header': false
|
||||||
'Header catalog links': false
|
|
||||||
'Top Board List': false
|
'Top Board List': false
|
||||||
'Bottom Board List': false
|
'Bottom Board List': false
|
||||||
'Custom Board Navigation': true
|
'Custom Board Navigation': true
|
||||||
|
|||||||
@ -25,8 +25,6 @@ Header =
|
|||||||
innerHTML: '<input type=checkbox name="Header auto-hide on scroll"> Auto-hide header on scroll'
|
innerHTML: '<input type=checkbox name="Header auto-hide on scroll"> Auto-hide header on scroll'
|
||||||
barPositionToggler = $.el 'label',
|
barPositionToggler = $.el 'label',
|
||||||
innerHTML: '<input type=checkbox name="Bottom header"> Bottom header'
|
innerHTML: '<input type=checkbox name="Bottom header"> Bottom header'
|
||||||
catalogToggler = $.el 'label',
|
|
||||||
innerHTML: '<input type=checkbox name="Header catalog links"> Use catalog board links'
|
|
||||||
topBoardToggler = $.el 'label',
|
topBoardToggler = $.el 'label',
|
||||||
innerHTML: '<input type=checkbox name="Top Board List"> Top original board list'
|
innerHTML: '<input type=checkbox name="Top Board List"> Top original board list'
|
||||||
botBoardToggler = $.el 'label',
|
botBoardToggler = $.el 'label',
|
||||||
@ -40,7 +38,6 @@ Header =
|
|||||||
@headerToggler = headerToggler.firstElementChild
|
@headerToggler = headerToggler.firstElementChild
|
||||||
@scrollHeaderToggler = scrollHeaderToggler.firstElementChild
|
@scrollHeaderToggler = scrollHeaderToggler.firstElementChild
|
||||||
@barPositionToggler = barPositionToggler.firstElementChild
|
@barPositionToggler = barPositionToggler.firstElementChild
|
||||||
@catalogToggler = catalogToggler.firstElementChild
|
|
||||||
@topBoardToggler = topBoardToggler.firstElementChild
|
@topBoardToggler = topBoardToggler.firstElementChild
|
||||||
@botBoardToggler = botBoardToggler.firstElementChild
|
@botBoardToggler = botBoardToggler.firstElementChild
|
||||||
@customNavToggler = customNavToggler.firstElementChild
|
@customNavToggler = customNavToggler.firstElementChild
|
||||||
@ -48,7 +45,6 @@ Header =
|
|||||||
$.on @headerToggler, 'change', @toggleBarVisibility
|
$.on @headerToggler, 'change', @toggleBarVisibility
|
||||||
$.on @scrollHeaderToggler, 'change', @toggleHideBarOnScroll
|
$.on @scrollHeaderToggler, 'change', @toggleHideBarOnScroll
|
||||||
$.on @barPositionToggler, 'change', @toggleBarPosition
|
$.on @barPositionToggler, 'change', @toggleBarPosition
|
||||||
$.on @catalogToggler, 'change', @toggleCatalogLinks
|
|
||||||
$.on @topBoardToggler, 'change', @toggleOriginalBoardList
|
$.on @topBoardToggler, 'change', @toggleOriginalBoardList
|
||||||
$.on @botBoardToggler, 'change', @toggleOriginalBoardList
|
$.on @botBoardToggler, 'change', @toggleOriginalBoardList
|
||||||
$.on @customNavToggler, 'change', @toggleCustomNav
|
$.on @customNavToggler, 'change', @toggleCustomNav
|
||||||
@ -74,7 +70,6 @@ Header =
|
|||||||
{el: headerToggler}
|
{el: headerToggler}
|
||||||
{el: scrollHeaderToggler}
|
{el: scrollHeaderToggler}
|
||||||
{el: barPositionToggler}
|
{el: barPositionToggler}
|
||||||
{el: catalogToggler}
|
|
||||||
{el: topBoardToggler}
|
{el: topBoardToggler}
|
||||||
{el: botBoardToggler}
|
{el: botBoardToggler}
|
||||||
{el: customNavToggler}
|
{el: customNavToggler}
|
||||||
@ -92,9 +87,6 @@ Header =
|
|||||||
if a = $ "a[href*='/#{g.BOARD}/']", $.id 'boardNavDesktopFoot'
|
if a = $ "a[href*='/#{g.BOARD}/']", $.id 'boardNavDesktopFoot'
|
||||||
a.className = 'current'
|
a.className = 'current'
|
||||||
|
|
||||||
Header.setCatalogLinks Conf['Header catalog links']
|
|
||||||
$.sync 'Header catalog links', Header.setCatalogLinks
|
|
||||||
|
|
||||||
@enableDesktopNotifications()
|
@enableDesktopNotifications()
|
||||||
|
|
||||||
setBoardList: ->
|
setBoardList: ->
|
||||||
@ -121,7 +113,7 @@ Header =
|
|||||||
$.rmAll list
|
$.rmAll list
|
||||||
return unless text
|
return unless text
|
||||||
as = $$ '#full-board-list a[title]', Header.bar
|
as = $$ '#full-board-list a[title]', Header.bar
|
||||||
nodes = text.match(/[\w@]+(-(all|title|replace|full|index|catalog|text:"[^"]+"))*|[^\w@]+/g).map (t) ->
|
nodes = text.match(/[\w@]+(-(all|title|replace|full|text:"[^"]+"))*|[^\w@]+/g).map (t) ->
|
||||||
if /^[^\w@]/.test t
|
if /^[^\w@]/.test t
|
||||||
return $.tn t
|
return $.tn t
|
||||||
if /^toggle-all/.test t
|
if /^toggle-all/.test t
|
||||||
@ -148,11 +140,6 @@ Header =
|
|||||||
else
|
else
|
||||||
a.textContent
|
a.textContent
|
||||||
|
|
||||||
if m = t.match /-(index|catalog)/
|
|
||||||
a.dataset.only = m[1]
|
|
||||||
a.href = "//boards.4chan.org/#{board}/"
|
|
||||||
a.href += 'catalog' if m[1] is 'catalog'
|
|
||||||
|
|
||||||
$.addClass a, 'navSmall' if board is '@'
|
$.addClass a, 'navSmall' if board is '@'
|
||||||
return a
|
return a
|
||||||
$.tn t
|
$.tn t
|
||||||
@ -219,21 +206,6 @@ Header =
|
|||||||
$.cb.checked.call @
|
$.cb.checked.call @
|
||||||
Header.setBarPosition @checked
|
Header.setBarPosition @checked
|
||||||
|
|
||||||
setCatalogLinks: (useCatalog) ->
|
|
||||||
Header.catalogToggler.checked = useCatalog
|
|
||||||
as = $$ [
|
|
||||||
'#board-list a'
|
|
||||||
'#boardNavDesktop a'
|
|
||||||
'#boardNavDesktopFoot a'
|
|
||||||
].join ', '
|
|
||||||
path = if useCatalog then 'catalog' else ''
|
|
||||||
for a in as when a.hostname is 'boards.4chan.org' and not a.dataset.only
|
|
||||||
a.pathname = "/#{a.pathname.split('/')[1]}/#{path}"
|
|
||||||
return
|
|
||||||
toggleCatalogLinks: ->
|
|
||||||
$.cb.checked.call @
|
|
||||||
Header.setCatalogLinks @checked
|
|
||||||
|
|
||||||
setTopBoardList: (show) ->
|
setTopBoardList: (show) ->
|
||||||
Header.topBoardToggler.checked = show
|
Header.topBoardToggler.checked = show
|
||||||
if show
|
if show
|
||||||
|
|||||||
@ -1,15 +1,5 @@
|
|||||||
Index =
|
Index =
|
||||||
init: ->
|
init: ->
|
||||||
if g.VIEW is 'catalog'
|
|
||||||
$.ready ->
|
|
||||||
span = $.el 'a',
|
|
||||||
href: '<%= meta.repo %>blob/<%= meta.mainBranch %>/CHANGELOG.md'
|
|
||||||
textContent: 'Support for the official catalog to be removed'
|
|
||||||
title: '<%= meta.name %> now has a "catalog" Index mode.'
|
|
||||||
className: 'btn-wrap warning'
|
|
||||||
target: '_blank'
|
|
||||||
$.add $.id('info'), span
|
|
||||||
|
|
||||||
return if g.VIEW isnt 'index' or g.BOARD.ID is 'f'
|
return if g.VIEW isnt 'index' or g.BOARD.ID is 'f'
|
||||||
|
|
||||||
@db = new DataBoard 'pinnedThreads'
|
@db = new DataBoard 'pinnedThreads'
|
||||||
@ -179,7 +169,6 @@ Index =
|
|||||||
a = e.target
|
a = e.target
|
||||||
else
|
else
|
||||||
return
|
return
|
||||||
return if a.textContent is 'Catalog'
|
|
||||||
e.preventDefault()
|
e.preventDefault()
|
||||||
Index.userPageNav +a.pathname.split('/')[2]
|
Index.userPageNav +a.pathname.split('/')[2]
|
||||||
|
|
||||||
|
|||||||
@ -11,6 +11,8 @@ Main =
|
|||||||
'catalog'
|
'catalog'
|
||||||
else
|
else
|
||||||
'index'
|
'index'
|
||||||
|
if g.VIEW is 'catalog'
|
||||||
|
return
|
||||||
if g.VIEW is 'thread'
|
if g.VIEW is 'thread'
|
||||||
g.THREADID = +pathname[3]
|
g.THREADID = +pathname[3]
|
||||||
|
|
||||||
@ -131,10 +133,6 @@ Main =
|
|||||||
$.addClass doc, 'fourchan-x', '<% if (type === 'crx') { %>blink<% } else { %>gecko<% } %>'
|
$.addClass doc, 'fourchan-x', '<% if (type === 'crx') { %>blink<% } else { %>gecko<% } %>'
|
||||||
$.addStyle Main.css
|
$.addStyle Main.css
|
||||||
|
|
||||||
if g.VIEW is 'catalog'
|
|
||||||
$.addClass doc, $.id('base-css').href.match(/catalog_(\w+)/)[1].replace('_new', '').replace /_+/g, '-'
|
|
||||||
return
|
|
||||||
|
|
||||||
style = 'yotsuba-b'
|
style = 'yotsuba-b'
|
||||||
mainStyleSheet = $ 'link[title=switch]', d.head
|
mainStyleSheet = $ 'link[title=switch]', d.head
|
||||||
styleSheets = $$ 'link[rel="alternate stylesheet"]', d.head
|
styleSheets = $$ 'link[rel="alternate stylesheet"]', d.head
|
||||||
|
|||||||
@ -133,10 +133,7 @@ Settings =
|
|||||||
button.textContent = "Hidden: #{hiddenNum}"
|
button.textContent = "Hidden: #{hiddenNum}"
|
||||||
$.on button, 'click', ->
|
$.on button, 'click', ->
|
||||||
@textContent = 'Hidden: 0'
|
@textContent = 'Hidden: 0'
|
||||||
$.get 'hiddenThreads', {}, ({hiddenThreads}) ->
|
$.delete ['hiddenThreads', 'hiddenPosts']
|
||||||
for boardID of hiddenThreads.boards
|
|
||||||
localStorage.removeItem "4chan-hide-t-#{boardID}"
|
|
||||||
$.delete ['hiddenThreads', 'hiddenPosts']
|
|
||||||
$.after $('input[name="Stubs"]', section).parentNode.parentNode, div
|
$.after $('input[name="Stubs"]', section).parentNode.parentNode, div
|
||||||
export: ->
|
export: ->
|
||||||
# Make sure to export the most recent data.
|
# Make sure to export the most recent data.
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
AutoGIF =
|
AutoGIF =
|
||||||
init: ->
|
init: ->
|
||||||
return if g.VIEW is 'catalog' or !Conf['Auto-GIF'] or g.BOARD.ID in ['gif', 'wsg']
|
return if !Conf['Auto-GIF'] or g.BOARD.ID in ['gif', 'wsg']
|
||||||
|
|
||||||
Post.callbacks.push
|
Post.callbacks.push
|
||||||
name: 'Auto-GIF'
|
name: 'Auto-GIF'
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
ImageExpand =
|
ImageExpand =
|
||||||
init: ->
|
init: ->
|
||||||
return if g.VIEW is 'catalog' or !Conf['Image Expansion']
|
return if !Conf['Image Expansion']
|
||||||
|
|
||||||
@EAI = $.el 'a',
|
@EAI = $.el 'a',
|
||||||
className: 'expand-all-shortcut fa fa-expand'
|
className: 'expand-all-shortcut fa fa-expand'
|
||||||
@ -156,7 +156,7 @@ ImageExpand =
|
|||||||
|
|
||||||
menu:
|
menu:
|
||||||
init: ->
|
init: ->
|
||||||
return if g.VIEW is 'catalog' or !Conf['Image Expansion']
|
return if !Conf['Image Expansion']
|
||||||
|
|
||||||
el = $.el 'span',
|
el = $.el 'span',
|
||||||
textContent: 'Image Expansion'
|
textContent: 'Image Expansion'
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
ImageHover =
|
ImageHover =
|
||||||
init: ->
|
init: ->
|
||||||
return if g.VIEW is 'catalog' or !Conf['Image Hover']
|
return if !Conf['Image Hover']
|
||||||
|
|
||||||
Post.callbacks.push
|
Post.callbacks.push
|
||||||
name: 'Image Hover'
|
name: 'Image Hover'
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
RevealSpoilers =
|
RevealSpoilers =
|
||||||
init: ->
|
init: ->
|
||||||
return if g.VIEW is 'catalog' or !Conf['Reveal Spoilers']
|
return if !Conf['Reveal Spoilers']
|
||||||
|
|
||||||
Post.callbacks.push
|
Post.callbacks.push
|
||||||
name: 'Reveal Spoilers'
|
name: 'Reveal Spoilers'
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
Sauce =
|
Sauce =
|
||||||
init: ->
|
init: ->
|
||||||
return if g.VIEW is 'catalog' or !Conf['Sauce']
|
return if !Conf['Sauce']
|
||||||
|
|
||||||
links = []
|
links = []
|
||||||
for link in Conf['sauces'].split '\n'
|
for link in Conf['sauces'].split '\n'
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
Linkify =
|
Linkify =
|
||||||
init: ->
|
init: ->
|
||||||
return if g.VIEW is 'catalog' or !Conf['Linkify']
|
return if !Conf['Linkify']
|
||||||
|
|
||||||
# gruber revised + magnet support
|
# gruber revised + magnet support
|
||||||
# http://df4.us/fv9
|
# http://df4.us/fv9
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
ArchiveLink =
|
ArchiveLink =
|
||||||
init: ->
|
init: ->
|
||||||
return if g.VIEW is 'catalog' or !Conf['Menu'] or !Conf['Archive Link']
|
return if !Conf['Menu'] or !Conf['Archive Link']
|
||||||
|
|
||||||
div = $.el 'div',
|
div = $.el 'div',
|
||||||
textContent: 'Archive'
|
textContent: 'Archive'
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
DeleteLink =
|
DeleteLink =
|
||||||
init: ->
|
init: ->
|
||||||
return if g.VIEW is 'catalog' or !Conf['Menu'] or !Conf['Delete Link']
|
return if !Conf['Menu'] or !Conf['Delete Link']
|
||||||
|
|
||||||
div = $.el 'div',
|
div = $.el 'div',
|
||||||
className: 'delete-link'
|
className: 'delete-link'
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
DownloadLink =
|
DownloadLink =
|
||||||
init: ->
|
init: ->
|
||||||
return if g.VIEW is 'catalog' or !Conf['Menu'] or !Conf['Download Link']
|
return if !Conf['Menu'] or !Conf['Download Link']
|
||||||
|
|
||||||
a = $.el 'a',
|
a = $.el 'a',
|
||||||
className: 'download-link'
|
className: 'download-link'
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
Menu =
|
Menu =
|
||||||
init: ->
|
init: ->
|
||||||
return if g.VIEW is 'catalog' or !Conf['Menu']
|
return if !Conf['Menu']
|
||||||
|
|
||||||
@menu = new UI.Menu 'post'
|
@menu = new UI.Menu 'post'
|
||||||
Post.callbacks.push
|
Post.callbacks.push
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
ReportLink =
|
ReportLink =
|
||||||
init: ->
|
init: ->
|
||||||
return if g.VIEW is 'catalog' or !Conf['Menu'] or !Conf['Report Link']
|
return if !Conf['Menu'] or !Conf['Report Link']
|
||||||
|
|
||||||
a = $.el 'a',
|
a = $.el 'a',
|
||||||
className: 'report-link'
|
className: 'report-link'
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
Anonymize =
|
Anonymize =
|
||||||
init: ->
|
init: ->
|
||||||
return if g.VIEW is 'catalog' or !Conf['Anonymize']
|
return if !Conf['Anonymize']
|
||||||
|
|
||||||
Post.callbacks.push
|
Post.callbacks.push
|
||||||
name: 'Anonymize'
|
name: 'Anonymize'
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
Dice =
|
Dice =
|
||||||
init: ->
|
init: ->
|
||||||
return if g.BOARD.ID isnt 'tg' or g.VIEW is 'catalog' or !Conf['Show Dice Roll']
|
return if g.BOARD.ID isnt 'tg' or !Conf['Show Dice Roll']
|
||||||
Post.callbacks.push
|
Post.callbacks.push
|
||||||
name: 'Show Dice Roll'
|
name: 'Show Dice Roll'
|
||||||
cb: @node
|
cb: @node
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
FileInfo =
|
FileInfo =
|
||||||
init: ->
|
init: ->
|
||||||
return if g.VIEW is 'catalog' or !Conf['File Info Formatting']
|
return if !Conf['File Info Formatting']
|
||||||
|
|
||||||
@funk = @createFunc Conf['fileInfo']
|
@funk = @createFunc Conf['fileInfo']
|
||||||
Post.callbacks.push
|
Post.callbacks.push
|
||||||
|
|||||||
@ -1,7 +1,5 @@
|
|||||||
Fourchan =
|
Fourchan =
|
||||||
init: ->
|
init: ->
|
||||||
return if g.VIEW is 'catalog'
|
|
||||||
|
|
||||||
board = g.BOARD.ID
|
board = g.BOARD.ID
|
||||||
if board is 'g'
|
if board is 'g'
|
||||||
$.globalEval """
|
$.globalEval """
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
IDColor =
|
IDColor =
|
||||||
init: ->
|
init: ->
|
||||||
return if g.VIEW is 'catalog' or !Conf['Color User IDs']
|
return if !Conf['Color User IDs']
|
||||||
@ids = {}
|
@ids = {}
|
||||||
|
|
||||||
Post.callbacks.push
|
Post.callbacks.push
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
Keybinds =
|
Keybinds =
|
||||||
init: ->
|
init: ->
|
||||||
return if g.VIEW is 'catalog' or !Conf['Keybinds']
|
return if !Conf['Keybinds']
|
||||||
|
|
||||||
for hotkey of Conf.hotkeys
|
for hotkey of Conf.hotkeys
|
||||||
$.sync hotkey, Keybinds.sync
|
$.sync hotkey, Keybinds.sync
|
||||||
|
|||||||
@ -5,8 +5,6 @@ Nav =
|
|||||||
return unless Conf['Index Navigation']
|
return unless Conf['Index Navigation']
|
||||||
when 'thread'
|
when 'thread'
|
||||||
return unless Conf['Reply Navigation']
|
return unless Conf['Reply Navigation']
|
||||||
else # catalog
|
|
||||||
return
|
|
||||||
|
|
||||||
span = $.el 'span',
|
span = $.el 'span',
|
||||||
id: 'navlinks'
|
id: 'navlinks'
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
Time =
|
Time =
|
||||||
init: ->
|
init: ->
|
||||||
return if g.VIEW is 'catalog' or !Conf['Time Formatting']
|
return if !Conf['Time Formatting']
|
||||||
|
|
||||||
@funk = @createFunc Conf['time']
|
@funk = @createFunc Conf['time']
|
||||||
Post.callbacks.push
|
Post.callbacks.push
|
||||||
|
|||||||
@ -57,7 +57,7 @@ QR =
|
|||||||
|
|
||||||
persist: ->
|
persist: ->
|
||||||
QR.open()
|
QR.open()
|
||||||
QR.hide() if Conf['Auto-Hide QR'] or g.VIEW is 'catalog'
|
QR.hide() if Conf['Auto-Hide QR']
|
||||||
open: ->
|
open: ->
|
||||||
if QR.nodes
|
if QR.nodes
|
||||||
QR.nodes.el.hidden = false
|
QR.nodes.el.hidden = false
|
||||||
|
|||||||
@ -11,7 +11,7 @@ QuoteBacklink =
|
|||||||
# This is is so that fetched posts can get their backlinks,
|
# This is is so that fetched posts can get their backlinks,
|
||||||
# and that as much backlinks are appended in the background as possible.
|
# and that as much backlinks are appended in the background as possible.
|
||||||
init: ->
|
init: ->
|
||||||
return if g.VIEW is 'catalog' or !Conf['Quote Backlinks']
|
return if !Conf['Quote Backlinks']
|
||||||
|
|
||||||
format = Conf['backlink'].replace /%id/g, "' + id + '"
|
format = Conf['backlink'].replace /%id/g, "' + id + '"
|
||||||
@funk = Function 'id', "return '#{format}'"
|
@funk = Function 'id', "return '#{format}'"
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
QuoteCT =
|
QuoteCT =
|
||||||
init: ->
|
init: ->
|
||||||
return if g.VIEW is 'catalog' or !Conf['Mark Cross-thread Quotes']
|
return if !Conf['Mark Cross-thread Quotes']
|
||||||
|
|
||||||
# \u00A0 is nbsp
|
# \u00A0 is nbsp
|
||||||
@text = '\u00A0(Cross-thread)'
|
@text = '\u00A0(Cross-thread)'
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
QuoteInline =
|
QuoteInline =
|
||||||
init: ->
|
init: ->
|
||||||
return if g.VIEW is 'catalog' or !Conf['Quote Inlining']
|
return if !Conf['Quote Inlining']
|
||||||
|
|
||||||
Post.callbacks.push
|
Post.callbacks.push
|
||||||
name: 'Quote Inlining'
|
name: 'Quote Inlining'
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
QuoteOP =
|
QuoteOP =
|
||||||
init: ->
|
init: ->
|
||||||
return if g.VIEW is 'catalog' or !Conf['Mark OP Quotes']
|
return if !Conf['Mark OP Quotes']
|
||||||
|
|
||||||
# \u00A0 is nbsp
|
# \u00A0 is nbsp
|
||||||
@text = '\u00A0(OP)'
|
@text = '\u00A0(OP)'
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
QuotePreview =
|
QuotePreview =
|
||||||
init: ->
|
init: ->
|
||||||
return if g.VIEW is 'catalog' or !Conf['Quote Previewing']
|
return if !Conf['Quote Previewing']
|
||||||
|
|
||||||
Post.callbacks.push
|
Post.callbacks.push
|
||||||
name: 'Quote Previewing'
|
name: 'Quote Previewing'
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
QuoteStrikeThrough =
|
QuoteStrikeThrough =
|
||||||
init: ->
|
init: ->
|
||||||
return if g.VIEW is 'catalog' or !Conf['Reply Hiding'] and !Conf['Reply Hiding Link'] and !Conf['Filter']
|
return if !Conf['Reply Hiding'] and !Conf['Reply Hiding Link'] and !Conf['Filter']
|
||||||
|
|
||||||
Post.callbacks.push
|
Post.callbacks.push
|
||||||
name: 'Strike-through Quotes'
|
name: 'Strike-through Quotes'
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
QuoteYou =
|
QuoteYou =
|
||||||
init: ->
|
init: ->
|
||||||
return if g.VIEW is 'catalog' or !Conf['Mark Quotes of You'] or !Conf['Quick Reply']
|
return if !Conf['Mark Quotes of You'] or !Conf['Quick Reply']
|
||||||
|
|
||||||
# \u00A0 is nbsp
|
# \u00A0 is nbsp
|
||||||
@text = '\u00A0(You)'
|
@text = '\u00A0(You)'
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
Quotify =
|
Quotify =
|
||||||
init: ->
|
init: ->
|
||||||
return if g.VIEW is 'catalog' or !Conf['Resurrect Quotes']
|
return if !Conf['Resurrect Quotes']
|
||||||
|
|
||||||
Post.callbacks.push
|
Post.callbacks.push
|
||||||
name: 'Resurrect Quotes'
|
name: 'Resurrect Quotes'
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user