From fc8684282f33970e37c048670093ea76a001a42d Mon Sep 17 00:00:00 2001 From: ccd0 Date: Sat, 28 Jan 2017 03:48:07 -0800 Subject: [PATCH] Activate appropriate features on previews shown in archive. #1256 --- src/Filtering/Anonymize.coffee | 3 ++- src/Images/FappeTyme.coffee | 2 +- src/Images/ImageLoader.coffee | 2 +- src/Images/RevealSpoilers.coffee | 2 +- src/Linkification/Embedding.coffee | 9 +++++---- src/Linkification/Linkify.coffee | 2 +- src/Miscellaneous/FileInfo.coffee | 2 +- src/Miscellaneous/Fourchan.coffee | 2 +- src/Miscellaneous/RelativeDates.coffee | 2 +- src/Miscellaneous/Time.coffee | 2 +- src/Monitoring/ThreadWatcher.coffee | 2 ++ src/Quotelinks/QuoteYou.coffee | 2 +- 12 files changed, 18 insertions(+), 14 deletions(-) diff --git a/src/Filtering/Anonymize.coffee b/src/Filtering/Anonymize.coffee index dd2d34413..699553842 100644 --- a/src/Filtering/Anonymize.coffee +++ b/src/Filtering/Anonymize.coffee @@ -1,7 +1,8 @@ Anonymize = init: -> return unless g.VIEW in ['index', 'thread', 'archive'] and Conf['Anonymize'] - return @archive() if g.VIEW is 'archive' + + @archive() if g.VIEW is 'archive' Callbacks.Post.push name: 'Anonymize' diff --git a/src/Images/FappeTyme.coffee b/src/Images/FappeTyme.coffee index 028d4befd..c9094eb0e 100644 --- a/src/Images/FappeTyme.coffee +++ b/src/Images/FappeTyme.coffee @@ -1,6 +1,6 @@ FappeTyme = init: -> - return unless (Conf['Fappe Tyme'] or Conf['Werk Tyme']) and g.VIEW in ['index', 'thread'] + return unless (Conf['Fappe Tyme'] or Conf['Werk Tyme']) and g.VIEW in ['index', 'thread', 'archive'] @nodes = {} @enabled = diff --git a/src/Images/ImageLoader.coffee b/src/Images/ImageLoader.coffee index 22b6ae598..824213301 100644 --- a/src/Images/ImageLoader.coffee +++ b/src/Images/ImageLoader.coffee @@ -1,6 +1,6 @@ ImageLoader = init: -> - return unless g.VIEW in ['index', 'thread'] and g.BOARD.ID isnt 'f' + return unless g.VIEW in ['index', 'thread', 'archive'] and g.BOARD.ID isnt 'f' return unless Conf['Image Prefetching'] or Conf['Replace JPG'] or Conf['Replace PNG'] or Conf['Replace GIF'] or Conf['Replace WEBM'] diff --git a/src/Images/RevealSpoilers.coffee b/src/Images/RevealSpoilers.coffee index e0687ed27..1dc0fa1a1 100644 --- a/src/Images/RevealSpoilers.coffee +++ b/src/Images/RevealSpoilers.coffee @@ -1,6 +1,6 @@ RevealSpoilers = init: -> - return unless g.VIEW in ['index', 'thread'] and Conf['Reveal Spoiler Thumbnails'] + return unless g.VIEW in ['index', 'thread', 'archive'] and Conf['Reveal Spoiler Thumbnails'] Callbacks.Post.push name: 'Reveal Spoiler Thumbnails' diff --git a/src/Linkification/Embedding.coffee b/src/Linkification/Embedding.coffee index 055ae1767..0df813c96 100644 --- a/src/Linkification/Embedding.coffee +++ b/src/Linkification/Embedding.coffee @@ -1,10 +1,10 @@ Embedding = init: -> - return unless g.VIEW in ['index', 'thread'] and Conf['Linkify'] and (Conf['Embedding'] or Conf['Link Title'] or Conf['Cover Preview']) + return unless g.VIEW in ['index', 'thread', 'archive'] and Conf['Linkify'] and (Conf['Embedding'] or Conf['Link Title'] or Conf['Cover Preview']) @types = {} @types[type.key] = type for type in @ordered_types - if Conf['Embedding'] + if Conf['Embedding'] and g.VIEW isnt 'archive' @dialog = UI.dialog 'embedding', <%= readHTML('Embed.html') %> @media = $ '#media-embed', @dialog @@ -22,6 +22,7 @@ Embedding = return events: (post) -> + return if g.VIEW is 'archive' if Conf['Embedding'] i = 0 items = post.nodes.embedlinks = $$ '.embedder', post.nodes.comment @@ -41,9 +42,9 @@ Embedding = return if $.x 'ancestor::pre', link if data = Embedding.services link data.post = post - Embedding.embed data if Conf['Embedding'] + Embedding.embed data if Conf['Embedding'] and g.VIEW isnt 'archive' Embedding.title data if Conf['Link Title'] - Embedding.preview data if Conf['Cover Preview'] + Embedding.preview data if Conf['Cover Preview'] and g.VIEW isnt 'archive' services: (link) -> {href} = link diff --git a/src/Linkification/Linkify.coffee b/src/Linkification/Linkify.coffee index ba93fd902..b0213eed1 100644 --- a/src/Linkification/Linkify.coffee +++ b/src/Linkification/Linkify.coffee @@ -1,6 +1,6 @@ Linkify = init: -> - return if g.VIEW not in ['index', 'thread'] or not Conf['Linkify'] + return if g.VIEW not in ['index', 'thread', 'archive'] or not Conf['Linkify'] if Conf['Comment Expansion'] ExpandComment.callbacks.push @node diff --git a/src/Miscellaneous/FileInfo.coffee b/src/Miscellaneous/FileInfo.coffee index 4f3a9b36a..23d957108 100644 --- a/src/Miscellaneous/FileInfo.coffee +++ b/src/Miscellaneous/FileInfo.coffee @@ -1,6 +1,6 @@ FileInfo = init: -> - return if g.VIEW not in ['index', 'thread'] or !Conf['File Info Formatting'] + return if g.VIEW not in ['index', 'thread', 'archive'] or !Conf['File Info Formatting'] Callbacks.Post.push name: 'File Info Formatting' diff --git a/src/Miscellaneous/Fourchan.coffee b/src/Miscellaneous/Fourchan.coffee index 5365c6f1a..581e0559e 100644 --- a/src/Miscellaneous/Fourchan.coffee +++ b/src/Miscellaneous/Fourchan.coffee @@ -1,6 +1,6 @@ Fourchan = init: -> - return unless g.VIEW in ['index', 'thread'] + return unless g.VIEW in ['index', 'thread', 'archive'] if g.BOARD.ID is 'g' $.on window, 'prettyprint:cb', (e) -> diff --git a/src/Miscellaneous/RelativeDates.coffee b/src/Miscellaneous/RelativeDates.coffee index 476622f88..4945fe7bd 100644 --- a/src/Miscellaneous/RelativeDates.coffee +++ b/src/Miscellaneous/RelativeDates.coffee @@ -3,7 +3,7 @@ RelativeDates = init: -> if ( - g.VIEW in ['index', 'thread'] and Conf['Relative Post Dates'] and !Conf['Relative Date Title'] or + g.VIEW in ['index', 'thread', 'archive'] and Conf['Relative Post Dates'] and !Conf['Relative Date Title'] or g.VIEW is 'index' and Conf['JSON Index'] and g.BOARD.ID isnt 'f' ) @flush() diff --git a/src/Miscellaneous/Time.coffee b/src/Miscellaneous/Time.coffee index 8e9128ea6..f1ff39693 100644 --- a/src/Miscellaneous/Time.coffee +++ b/src/Miscellaneous/Time.coffee @@ -1,6 +1,6 @@ Time = init: -> - return unless g.VIEW in ['index', 'thread'] and Conf['Time Formatting'] + return unless g.VIEW in ['index', 'thread', 'archive'] and Conf['Time Formatting'] Callbacks.Post.push name: 'Time Formatting' diff --git a/src/Monitoring/ThreadWatcher.coffee b/src/Monitoring/ThreadWatcher.coffee index f417090a7..c031a35d2 100644 --- a/src/Monitoring/ThreadWatcher.coffee +++ b/src/Monitoring/ThreadWatcher.coffee @@ -63,6 +63,8 @@ ThreadWatcher = $.on @el, 'click', @cb true + return unless g.VIEW in ['index', 'thread'] + Callbacks.Post.push name: 'Thread Watcher' cb: @node diff --git a/src/Quotelinks/QuoteYou.coffee b/src/Quotelinks/QuoteYou.coffee index 1c085758c..cf694d157 100644 --- a/src/Quotelinks/QuoteYou.coffee +++ b/src/Quotelinks/QuoteYou.coffee @@ -10,7 +10,7 @@ QuoteYou = {boardID, threadID, postID} = e.detail (QuoteYou.db.set {boardID, threadID, postID, val: true}) - return unless g.VIEW in ['index', 'thread'] + return unless g.VIEW in ['index', 'thread', 'archive'] if Conf['Highlight Own Posts'] $.addClass doc, 'highlight-own'