Support archived thread list page.

This commit is contained in:
ccd0 2015-01-04 09:47:03 -08:00
parent db1362afb1
commit 4fb30a4d8f
37 changed files with 45 additions and 43 deletions

View File

@ -1,6 +1,6 @@
Anonymize =
init: ->
return if g.VIEW is 'catalog' or !Conf['Anonymize']
return if g.VIEW not in ['index', 'thread'] or !Conf['Anonymize']
Post.callbacks.push
name: 'Anonymize'

View File

@ -1,7 +1,7 @@
Filter =
filters: {}
init: ->
return if g.VIEW is 'catalog' or !Conf['Filter']
return if g.VIEW not in ['index', 'thread'] or !Conf['Filter']
unless Conf['Filtered Backlinks']
$.addClass doc, 'hide-backlinks'
@ -172,7 +172,7 @@ Filter =
menu:
init: ->
return if g.VIEW is 'catalog' or !Conf['Menu'] or !Conf['Filter']
return if g.VIEW not in ['index', 'thread'] or !Conf['Menu'] or !Conf['Filter']
div = $.el 'div',
textContent: 'Filter'

View File

@ -1,6 +1,6 @@
PostHiding =
init: ->
return if g.VIEW is 'catalog' or !Conf['Reply Hiding Buttons'] and !(Conf['Menu'] and Conf['Reply Hiding Link'])
return if g.VIEW not in ['index', 'thread'] or !Conf['Reply Hiding Buttons'] and !(Conf['Menu'] and Conf['Reply Hiding Link'])
if Conf['Reply Hiding Buttons']
$.addClass doc, "reply-hide"
@ -23,7 +23,7 @@ PostHiding =
menu:
init: ->
return if g.VIEW is 'catalog' or !Conf['Menu'] or !Conf['Reply Hiding Link']
return if g.VIEW not in ['index', 'thread'] or !Conf['Menu'] or !Conf['Reply Hiding Link']
# Hide
div = $.el 'div',

View File

@ -1,7 +1,7 @@
Recursive =
recursives: {}
init: ->
return if g.VIEW is 'catalog'
return if g.VIEW not in ['index', 'thread']
Post.callbacks.push
name: 'Recursive'

View File

@ -1,6 +1,6 @@
ThreadHiding =
init: ->
return if g.VIEW is 'thread' or !Conf['Thread Hiding Buttons'] and !(Conf['Menu'] and Conf['Thread Hiding Link']) and !Conf['JSON Navigation']
return if g.VIEW not in ['index', 'catalog'] or !Conf['Thread Hiding Buttons'] and !(Conf['Menu'] and Conf['Thread Hiding Link']) and !Conf['JSON Navigation']
@db = new DataBoard 'hiddenThreads'
return @catalogWatch() if g.VIEW is 'catalog'
@catalogSet g.BOARD

View File

@ -1,7 +1,7 @@
<% if (tests_enabled) { %>
BuildTest =
init: ->
return if !Conf['Menu'] or g.VIEW is 'catalog'
return if !Conf['Menu'] or g.VIEW not in ['index', 'thread']
a = $.el 'a',
textContent: 'Test HTML building'

View File

@ -15,6 +15,8 @@ Main =
'thread'
when 'catalog'
'catalog'
when 'archive'
'archive'
else
'index'
if g.VIEW is 'thread'

View File

@ -1,6 +1,6 @@
FappeTyme =
init: ->
return if !(Conf['Fappe Tyme'] or Conf['Werk Tyme']) or g.VIEW is 'catalog' or g.BOARD is 'f'
return if !(Conf['Fappe Tyme'] or Conf['Werk Tyme']) or g.VIEW not in ['index', 'thread'] or g.BOARD is 'f'
@nodes = {}
@enabled =

View File

@ -1,6 +1,6 @@
Gallery =
init: ->
return if g.VIEW is 'catalog' or g.BOARD is 'f' or !Conf['Gallery']
return if g.VIEW not in ['index', 'thread'] or g.BOARD is 'f' or !Conf['Gallery']
@delay = Conf['Slide Delay']
@ -286,7 +286,7 @@ Gallery =
menu:
init: ->
return if g.VIEW is 'catalog' or !Conf['Gallery']
return if g.VIEW not in ['index', 'thread'] or !Conf['Gallery']
el = $.el 'span',
textContent: 'Gallery'

View File

@ -1,6 +1,6 @@
ImageExpand =
init: ->
return if g.VIEW is 'catalog' or !Conf['Image Expansion']
return if g.VIEW not in ['index', 'thread'] or !Conf['Image Expansion']
@EAI = $.el 'a',
className: 'expand-all-shortcut fa fa-expand'
@ -269,7 +269,7 @@ ImageExpand =
menu:
init: ->
return if g.VIEW is 'catalog' or !Conf['Image Expansion']
return if g.VIEW not in ['index', 'thread'] or !Conf['Image Expansion']
el = $.el 'span',
textContent: 'Image Expansion'

View File

@ -1,6 +1,6 @@
ImageHover =
init: ->
return if g.VIEW is 'catalog'
return if g.VIEW not in ['index', 'thread']
if Conf['Image Hover']
Post.callbacks.push
name: 'Image Hover'

View File

@ -1,6 +1,6 @@
ImageLoader =
init: ->
return if g.VIEW is 'catalog'
return if g.VIEW not in ['index', 'thread']
return unless Conf['Image Prefetching'] or Conf['Replace JPG'] or Conf['Replace PNG'] or Conf['Replace GIF'] or Conf['Replace WEBM']
Post.callbacks.push

View File

@ -1,6 +1,6 @@
RevealSpoilers =
init: ->
return if g.VIEW is 'catalog' or !Conf['Reveal Spoiler Thumbnails']
return if g.VIEW not in ['index', 'thread'] or !Conf['Reveal Spoiler Thumbnails']
Post.callbacks.push
cb: @node

View File

@ -1,6 +1,6 @@
Sauce =
init: ->
return if g.VIEW is 'catalog' or !Conf['Sauce']
return if g.VIEW not in ['index', 'thread'] or !Conf['Sauce']
links = []
for link in Conf['sauces'].split '\n'

View File

@ -1,6 +1,6 @@
Linkify =
init: ->
return if g.VIEW is 'catalog' or not Conf['Linkify']
return if g.VIEW not in ['index', 'thread'] or not Conf['Linkify']
if Conf['Comment Expansion']
ExpandComment.callbacks.push @node

View File

@ -1,6 +1,6 @@
ArchiveLink =
init: ->
return if g.VIEW is 'catalog' or !Conf['Menu'] or !Conf['Archive Link']
return if g.VIEW not in ['index', 'thread'] or !Conf['Menu'] or !Conf['Archive Link']
div = $.el 'div',
textContent: 'Archive'

View File

@ -1,6 +1,6 @@
DeleteLink =
init: ->
return if g.VIEW is 'catalog' or !Conf['Menu'] or !Conf['Delete Link']
return if g.VIEW not in ['index', 'thread'] or !Conf['Menu'] or !Conf['Delete Link']
div = $.el 'div',
className: 'delete-link'

View File

@ -1,6 +1,6 @@
DownloadLink =
init: ->
return if g.VIEW is 'catalog' or !Conf['Menu'] or !Conf['Download Link']
return if g.VIEW not in ['index', 'thread'] or !Conf['Menu'] or !Conf['Download Link']
a = $.el 'a',
className: 'download-link'

View File

@ -1,6 +1,6 @@
Menu =
init: ->
return if g.VIEW is 'catalog' or !Conf['Menu']
return if g.VIEW not in ['index', 'thread'] or !Conf['Menu']
@button = $.el 'a',
className: 'menu-button'

View File

@ -1,6 +1,6 @@
ReportLink =
init: ->
return if g.VIEW is 'catalog' or !Conf['Menu'] or !Conf['Report Link']
return if g.VIEW not in ['index', 'thread'] or !Conf['Menu'] or !Conf['Report Link']
a = $.el 'a',
className: 'report-link'

View File

@ -2,7 +2,7 @@ CatalogLinks =
init: ->
if (Conf['External Catalog'] or Conf['JSON Navigation']) and !(Conf['JSON Navigation'] and g.VIEW is 'index')
selector = switch g.VIEW
when 'thread' then '.navLinks.desktop > a'
when 'thread', 'archive' then '.navLinks.desktop > a'
when 'catalog' then '.navLinks > :first-child > a'
when 'index' then '.middlead + .desktop > a, .cataloglink > a'
$.ready ->

View File

@ -1,6 +1,6 @@
FileInfo =
init: ->
return if g.VIEW is 'catalog' or !Conf['File Info Formatting']
return if g.VIEW not in ['index', 'thread'] or !Conf['File Info Formatting']
Post.callbacks.push
name: 'File Info Formatting'

View File

@ -1,6 +1,6 @@
Fourchan =
init: ->
return if g.VIEW is 'catalog'
return if g.VIEW not in ['index', 'thread']
if g.BOARD.ID is 'g'
$.globalEval '''

View File

@ -1,6 +1,6 @@
IDColor =
init: ->
return if g.VIEW is 'catalog' or not Conf['Color User IDs']
return if g.VIEW not in ['index', 'thread'] or not Conf['Color User IDs']
@ids = {}
Post.callbacks.push

View File

@ -1,6 +1,6 @@
IDHighlight =
init: ->
return if g.VIEW is 'catalog'
return if g.VIEW not in ['index', 'thread']
Post.callbacks.push
name: 'Highlight by User ID'

View File

@ -21,7 +21,7 @@ Keybinds =
{target} = e
if target.nodeName in ['INPUT', 'TEXTAREA']
return unless /(Esc|Alt|Ctrl|Meta|Shift\+\w{2,})/.test key
unless g.VIEW is 'catalog' or g.VIEW is 'index' and Conf['JSON Navigation'] and Conf['Index Mode'] is 'catalog'
unless g.VIEW not in ['index', 'thread'] or g.VIEW is 'index' and Conf['JSON Navigation'] and Conf['Index Mode'] is 'catalog'
threadRoot = Nav.getThread()
if op = $ '.op', threadRoot
thread = Get.postFromNode(op).thread
@ -94,13 +94,13 @@ Keybinds =
return unless threadRoot
Keybinds.img threadRoot, true
when Conf['Open Gallery']
return if g.VIEW is 'catalog'
return if g.VIEW not in ['index', 'thread']
Gallery.cb.toggle()
when Conf['fappeTyme']
return if !Conf['Fappe Tyme'] or g.VIEW is 'catalog' or g.BOARD is 'f'
return if !Conf['Fappe Tyme'] or g.VIEW not in ['index', 'thread'] or g.BOARD is 'f'
FappeTyme.toggle 'fappe'
when Conf['werkTyme']
return if !Conf['Werk Tyme'] or g.VIEW is 'catalog' or g.BOARD is 'f'
return if !Conf['Werk Tyme'] or g.VIEW not in ['index', 'thread'] or g.BOARD is 'f'
FappeTyme.toggle 'werk'
# Board Navigation
when Conf['Front page']

View File

@ -5,7 +5,7 @@ Nav =
return unless Conf['Index Navigation']
when 'thread'
return unless Conf['Reply Navigation']
else # catalog
else
return
span = $.el 'span',

View File

@ -2,7 +2,7 @@ RelativeDates =
INTERVAL: $.MINUTE / 2
init: ->
if (
g.VIEW isnt 'catalog' and Conf['Relative Post Dates'] and !Conf['Relative Date Title'] or
g.VIEW in ['index', 'thread'] and Conf['Relative Post Dates'] and !Conf['Relative Date Title'] or
g.VIEW is 'index' and Conf['JSON Navigation'] and g.BOARD.ID isnt 'f'
)
@flush()

View File

@ -1,6 +1,6 @@
Time =
init: ->
return if g.VIEW is 'catalog' or !Conf['Time Formatting']
return if g.VIEW not in ['index', 'thread'] or !Conf['Time Formatting']
Post.callbacks.push
name: 'Time Formatting'

View File

@ -12,7 +12,7 @@ QuoteBacklink =
# and that as much backlinks are appended in the background as possible.
containers: {}
init: ->
return if g.VIEW is 'catalog' or !Conf['Quote Backlinks']
return if g.VIEW not in ['index', 'thread'] or !Conf['Quote Backlinks']
Post.callbacks.push
name: 'Quote Backlinking Part 1'

View File

@ -1,6 +1,6 @@
QuoteCT =
init: ->
return if g.VIEW is 'catalog' or !Conf['Mark Cross-thread Quotes']
return if g.VIEW not in ['index', 'thread'] or !Conf['Mark Cross-thread Quotes']
if Conf['Comment Expansion']
ExpandComment.callbacks.push @node

View File

@ -1,6 +1,6 @@
QuoteInline =
init: ->
return if g.VIEW is 'catalog' or !Conf['Quote Inlining']
return if g.VIEW not in ['index', 'thread'] or !Conf['Quote Inlining']
@process = if Conf['Quote Hash Navigation']
(link, clone) ->

View File

@ -1,6 +1,6 @@
QuoteOP =
init: ->
return if g.VIEW is 'catalog' or !Conf['Mark OP Quotes']
return if g.VIEW not in ['index', 'thread'] or !Conf['Mark OP Quotes']
if Conf['Comment Expansion']
ExpandComment.callbacks.push @node

View File

@ -1,6 +1,6 @@
QuotePreview =
init: ->
return if g.VIEW is 'catalog' or !Conf['Quote Previewing']
return if g.VIEW not in ['index', 'thread'] or !Conf['Quote Previewing']
if Conf['Comment Expansion']
ExpandComment.callbacks.push @node

View File

@ -1,6 +1,6 @@
QuoteStrikeThrough =
init: ->
return if g.VIEW is 'catalog' or !Conf['Reply Hiding Buttons'] and !(Conf['Menu'] and Conf['Reply Hiding Link']) and !Conf['Filter']
return if g.VIEW not in ['index', 'thread'] or !Conf['Reply Hiding Buttons'] and !(Conf['Menu'] and Conf['Reply Hiding Link']) and !Conf['Filter']
Post.callbacks.push
name: 'Strike-through Quotes'

View File

@ -1,6 +1,6 @@
QuoteYou =
init: ->
return unless g.VIEW isnt 'catalog' and Conf['Mark Quotes of You'] and Conf['Quick Reply']
return unless g.VIEW in ['index', 'thread'] and Conf['Mark Quotes of You'] and Conf['Quick Reply']
if Conf['Highlight Own Posts']
$.addClass doc, 'highlight-own'

View File

@ -1,6 +1,6 @@
Quotify =
init: ->
return if g.VIEW is 'catalog' or !Conf['Resurrect Quotes']
return if g.VIEW not in ['index', 'thread'] or !Conf['Resurrect Quotes']
if Conf['Comment Expansion']
ExpandComment.callbacks.push @node