diff --git a/src/Filtering/Anonymize.coffee b/src/Filtering/Anonymize.coffee index 414c428e5..451365b8a 100755 --- a/src/Filtering/Anonymize.coffee +++ b/src/Filtering/Anonymize.coffee @@ -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' diff --git a/src/Filtering/Filter.coffee b/src/Filtering/Filter.coffee index d74b0b044..89d71afd0 100755 --- a/src/Filtering/Filter.coffee +++ b/src/Filtering/Filter.coffee @@ -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' diff --git a/src/Filtering/PostHiding.coffee b/src/Filtering/PostHiding.coffee index e495e67ef..a6607023c 100755 --- a/src/Filtering/PostHiding.coffee +++ b/src/Filtering/PostHiding.coffee @@ -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', diff --git a/src/Filtering/Recursive.coffee b/src/Filtering/Recursive.coffee index c271b091c..21d541b90 100755 --- a/src/Filtering/Recursive.coffee +++ b/src/Filtering/Recursive.coffee @@ -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' diff --git a/src/Filtering/ThreadHiding.coffee b/src/Filtering/ThreadHiding.coffee index 46ed71ccc..93c986a9e 100755 --- a/src/Filtering/ThreadHiding.coffee +++ b/src/Filtering/ThreadHiding.coffee @@ -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 diff --git a/src/General/BuildTest.coffee b/src/General/BuildTest.coffee index 8284a63d5..3638fdaa2 100644 --- a/src/General/BuildTest.coffee +++ b/src/General/BuildTest.coffee @@ -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' diff --git a/src/General/Main.coffee b/src/General/Main.coffee index 0d2b195bc..ba2df19dd 100755 --- a/src/General/Main.coffee +++ b/src/General/Main.coffee @@ -15,6 +15,8 @@ Main = 'thread' when 'catalog' 'catalog' + when 'archive' + 'archive' else 'index' if g.VIEW is 'thread' diff --git a/src/Images/FappeTyme.coffee b/src/Images/FappeTyme.coffee index a0262abd5..d1732bf33 100755 --- a/src/Images/FappeTyme.coffee +++ b/src/Images/FappeTyme.coffee @@ -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 = diff --git a/src/Images/Gallery.coffee b/src/Images/Gallery.coffee index 6f836b561..6b25855db 100644 --- a/src/Images/Gallery.coffee +++ b/src/Images/Gallery.coffee @@ -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' diff --git a/src/Images/ImageExpand.coffee b/src/Images/ImageExpand.coffee index c07a4bfb8..fe393f1ed 100755 --- a/src/Images/ImageExpand.coffee +++ b/src/Images/ImageExpand.coffee @@ -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' diff --git a/src/Images/ImageHover.coffee b/src/Images/ImageHover.coffee index 12b3e8ead..e3415fecd 100755 --- a/src/Images/ImageHover.coffee +++ b/src/Images/ImageHover.coffee @@ -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' diff --git a/src/Images/ImageLoader.coffee b/src/Images/ImageLoader.coffee index ec335766f..c4e2120c9 100755 --- a/src/Images/ImageLoader.coffee +++ b/src/Images/ImageLoader.coffee @@ -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 diff --git a/src/Images/RevealSpoilers.coffee b/src/Images/RevealSpoilers.coffee index ac40c0a7c..be93d4e2f 100755 --- a/src/Images/RevealSpoilers.coffee +++ b/src/Images/RevealSpoilers.coffee @@ -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 diff --git a/src/Images/Sauce.coffee b/src/Images/Sauce.coffee index 856ca9224..b7945dcc3 100755 --- a/src/Images/Sauce.coffee +++ b/src/Images/Sauce.coffee @@ -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' diff --git a/src/Linkification/Linkify.coffee b/src/Linkification/Linkify.coffee index 8ec78189f..4177483d2 100755 --- a/src/Linkification/Linkify.coffee +++ b/src/Linkification/Linkify.coffee @@ -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 diff --git a/src/Menu/ArchiveLink.coffee b/src/Menu/ArchiveLink.coffee index 9e344b138..051b855d5 100755 --- a/src/Menu/ArchiveLink.coffee +++ b/src/Menu/ArchiveLink.coffee @@ -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' diff --git a/src/Menu/DeleteLink.coffee b/src/Menu/DeleteLink.coffee index fdfecf1c8..dc90da6ce 100755 --- a/src/Menu/DeleteLink.coffee +++ b/src/Menu/DeleteLink.coffee @@ -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' diff --git a/src/Menu/DownloadLink.coffee b/src/Menu/DownloadLink.coffee index 3c33e7e84..f726fcc77 100755 --- a/src/Menu/DownloadLink.coffee +++ b/src/Menu/DownloadLink.coffee @@ -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' diff --git a/src/Menu/Menu.coffee b/src/Menu/Menu.coffee index d504e349d..e73258cbb 100755 --- a/src/Menu/Menu.coffee +++ b/src/Menu/Menu.coffee @@ -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' diff --git a/src/Menu/ReportLink.coffee b/src/Menu/ReportLink.coffee index 7cb21cb7e..429374566 100755 --- a/src/Menu/ReportLink.coffee +++ b/src/Menu/ReportLink.coffee @@ -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' diff --git a/src/Miscellaneous/CatalogLinks.coffee b/src/Miscellaneous/CatalogLinks.coffee index ae7f867ce..05efc40b3 100755 --- a/src/Miscellaneous/CatalogLinks.coffee +++ b/src/Miscellaneous/CatalogLinks.coffee @@ -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 -> diff --git a/src/Miscellaneous/FileInfo.coffee b/src/Miscellaneous/FileInfo.coffee index 27a01586b..1aa868c03 100755 --- a/src/Miscellaneous/FileInfo.coffee +++ b/src/Miscellaneous/FileInfo.coffee @@ -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' diff --git a/src/Miscellaneous/Fourchan.coffee b/src/Miscellaneous/Fourchan.coffee index 25c3178c5..8ddd170bd 100755 --- a/src/Miscellaneous/Fourchan.coffee +++ b/src/Miscellaneous/Fourchan.coffee @@ -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 ''' diff --git a/src/Miscellaneous/IDColor.coffee b/src/Miscellaneous/IDColor.coffee index acb1b9b6c..854f2e56e 100755 --- a/src/Miscellaneous/IDColor.coffee +++ b/src/Miscellaneous/IDColor.coffee @@ -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 diff --git a/src/Miscellaneous/IDHighlight.coffee b/src/Miscellaneous/IDHighlight.coffee index 697692e1d..ad0e29075 100644 --- a/src/Miscellaneous/IDHighlight.coffee +++ b/src/Miscellaneous/IDHighlight.coffee @@ -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' diff --git a/src/Miscellaneous/Keybinds.coffee b/src/Miscellaneous/Keybinds.coffee index 016c3bca5..8e3be5424 100755 --- a/src/Miscellaneous/Keybinds.coffee +++ b/src/Miscellaneous/Keybinds.coffee @@ -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'] diff --git a/src/Miscellaneous/Nav.coffee b/src/Miscellaneous/Nav.coffee index 82eeed469..c5f239cdb 100755 --- a/src/Miscellaneous/Nav.coffee +++ b/src/Miscellaneous/Nav.coffee @@ -5,7 +5,7 @@ Nav = return unless Conf['Index Navigation'] when 'thread' return unless Conf['Reply Navigation'] - else # catalog + else return span = $.el 'span', diff --git a/src/Miscellaneous/RelativeDates.coffee b/src/Miscellaneous/RelativeDates.coffee index c0e7d5d34..bad8478e3 100644 --- a/src/Miscellaneous/RelativeDates.coffee +++ b/src/Miscellaneous/RelativeDates.coffee @@ -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() diff --git a/src/Miscellaneous/Time.coffee b/src/Miscellaneous/Time.coffee index a79cb9e45..ddb048633 100755 --- a/src/Miscellaneous/Time.coffee +++ b/src/Miscellaneous/Time.coffee @@ -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' diff --git a/src/Quotelinks/QuoteBacklink.coffee b/src/Quotelinks/QuoteBacklink.coffee index 17134870c..028bb2694 100755 --- a/src/Quotelinks/QuoteBacklink.coffee +++ b/src/Quotelinks/QuoteBacklink.coffee @@ -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' diff --git a/src/Quotelinks/QuoteCT.coffee b/src/Quotelinks/QuoteCT.coffee index 953c7e20f..fd2de4796 100755 --- a/src/Quotelinks/QuoteCT.coffee +++ b/src/Quotelinks/QuoteCT.coffee @@ -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 diff --git a/src/Quotelinks/QuoteInline.coffee b/src/Quotelinks/QuoteInline.coffee index 3ae1634b3..978bac3ed 100755 --- a/src/Quotelinks/QuoteInline.coffee +++ b/src/Quotelinks/QuoteInline.coffee @@ -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) -> diff --git a/src/Quotelinks/QuoteOP.coffee b/src/Quotelinks/QuoteOP.coffee index 33b680112..e673c2f8d 100755 --- a/src/Quotelinks/QuoteOP.coffee +++ b/src/Quotelinks/QuoteOP.coffee @@ -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 diff --git a/src/Quotelinks/QuotePreview.coffee b/src/Quotelinks/QuotePreview.coffee index 17c9e1b0c..428d18a92 100755 --- a/src/Quotelinks/QuotePreview.coffee +++ b/src/Quotelinks/QuotePreview.coffee @@ -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 diff --git a/src/Quotelinks/QuoteStrikeThrough.coffee b/src/Quotelinks/QuoteStrikeThrough.coffee index c70604230..0444f326c 100755 --- a/src/Quotelinks/QuoteStrikeThrough.coffee +++ b/src/Quotelinks/QuoteStrikeThrough.coffee @@ -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' diff --git a/src/Quotelinks/QuoteYou.coffee b/src/Quotelinks/QuoteYou.coffee index c3cd85c4b..85da4b8b4 100755 --- a/src/Quotelinks/QuoteYou.coffee +++ b/src/Quotelinks/QuoteYou.coffee @@ -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' diff --git a/src/Quotelinks/Quotify.coffee b/src/Quotelinks/Quotify.coffee index feb35af40..6c24bed55 100755 --- a/src/Quotelinks/Quotify.coffee +++ b/src/Quotelinks/Quotify.coffee @@ -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