Activate appropriate features on previews shown in archive. #1256

This commit is contained in:
ccd0 2017-01-28 03:48:07 -08:00
parent edd7e14cf3
commit fc8684282f
12 changed files with 18 additions and 14 deletions

View File

@ -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'

View File

@ -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 =

View File

@ -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']

View File

@ -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'

View File

@ -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

View File

@ -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

View File

@ -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'

View File

@ -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) ->

View File

@ -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()

View File

@ -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'

View File

@ -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

View File

@ -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'