diff --git a/src/General/Build.coffee b/src/General/Build.coffee index 0d56e4e97..7bbe30d0e 100755 --- a/src/General/Build.coffee +++ b/src/General/Build.coffee @@ -26,7 +26,7 @@ Build = "#p#{postID}" else "/#{boardID}/thread/#{threadID}#p#{postID}" - postFromObject: (data, boardID) -> + postFromObject: (data, boardID, suppressThumb) -> o = # id postID: data.no @@ -70,8 +70,8 @@ Build = isSpoiler: !!data.spoiler isDeleted: false tag: data.tag - Build.post o - post: (o) -> + Build.post o, suppressThumb + post: (o, suppressThumb) -> ### This function contains code from 4chan-JS (https://github.com/4chan/4chan-JS). @license: https://github.com/4chan/4chan-JS/blob/master/LICENSE @@ -115,6 +115,7 @@ Build = shortFilename = Build.shortFilename file.name fileSize = $.bytesToString file.size fileDims = if file.url[-4..] is '.pdf' then 'PDF' else "#{file.width}x#{file.height}" + fileThumb = if file.isSpoiler then Build.spoilerThumb boardID else file.turl fileBlock = <%= importHTML('Build/File') %> @@ -166,7 +167,7 @@ Build = root excerptThread: (board, data, OP) -> - nodes = [if OP then OP.nodes.root else Build.postFromObject data, board.ID] + nodes = [if OP then OP.nodes.root else Build.postFromObject data, board.ID, true] if data.omitted_posts or !Conf['Show Replies'] and data.replies [posts, files] = if Conf['Show Replies'] # XXX data.omitted_images is not accurate. diff --git a/src/General/Index.coffee b/src/General/Index.coffee index d1a8f5073..8302c289c 100644 --- a/src/General/Index.coffee +++ b/src/General/Index.coffee @@ -647,6 +647,10 @@ Index = buildStructure: (nodes) -> for node in nodes + if thumb = $ 'img[data-src]', node + thumb.src = thumb.dataset.src + # XXX https://bugzilla.mozilla.org/show_bug.cgi?id=1021289 + thumb.removeAttribute 'data-src' $.add Index.root, [node, $.el 'hr'] $.event 'PostsInserted' if doc.contains Index.root ThreadHiding.onIndexBuild nodes @@ -661,7 +665,7 @@ Index = if Index.search Index.searchInput.dataset.searching = 1 else - # XXX https://github.com/greasemonkey/greasemonkey/issues/1571 + # XXX https://bugzilla.mozilla.org/show_bug.cgi?id=1021289 Index.searchInput.removeAttribute 'data-searching' onSearchInput: -> diff --git a/src/General/html/Build/File.html b/src/General/html/Build/File.html index f167e6114..2b1e0fed4 100644 --- a/src/General/html/Build/File.html +++ b/src/General/html/Build/File.html @@ -18,8 +18,8 @@ (${fileSize}, ${fileDims}) - ${fileSize} doc.contains clone.nodes.root file.isPrefetched = true @@ -72,6 +72,8 @@ ImageLoader = $.on el, 'load', -> clone.file.thumb.src = URL for clone in post.clones thumb.src = URL + # XXX https://bugzilla.mozilla.org/show_bug.cgi?id=1021289 + thumb.removeAttribute 'data-src' el.src = URL toggle: -> diff --git a/src/Images/RevealSpoilers.coffee b/src/Images/RevealSpoilers.coffee index 4c3e65709..ed159a4ca 100755 --- a/src/Images/RevealSpoilers.coffee +++ b/src/Images/RevealSpoilers.coffee @@ -13,4 +13,7 @@ RevealSpoilers = thumb.removeAttribute 'style' # Enforce thumbnail size if thumbnail is replaced. thumb.style.maxHeight = thumb.style.maxWidth = if @isReply then '125px' else '250px' - thumb.src = @file.thumbURL + if thumb.src + thumb.src = @file.thumbURL + else + thumb.dataset.src = @file.thumbURL