Remove deferred thumbnail loading; no longer needed.

This commit is contained in:
ccd0 2016-10-01 21:02:26 -07:00
parent 293fca67dd
commit 59bc4143db
6 changed files with 6 additions and 21 deletions

View File

@ -95,11 +95,11 @@ Build =
# Remove preceding and following new lines, trailing spaces.
Build.parseComment(html).trim().replace(/\s+$/gm, '')
postFromObject: (data, boardID, suppressThumb) ->
postFromObject: (data, boardID) ->
o = Build.parseJSON data, boardID
Build.post o, suppressThumb
Build.post o
post: (o, suppressThumb) ->
post: (o) ->
{ID, threadID, boardID, file} = o
{subject, email, name, tripcode, capcode, uniqueID, flagCode, flag, dateUTC, dateText, commentHTML} = o.info
{staticPath, gifIcon} = Build

View File

@ -15,8 +15,8 @@
(${file.size}, ${file.dimensions || "PDF"})
</div>
<a class="fileThumb?{file.isSpoiler}{ imgspoiler}{}" href="${fileURL}" target="_blank">
<img
?{suppressThumb}{ data-src="${fileThumb}"}{ src="${fileThumb}"}
<img
src="${fileThumb}"
alt="${file.size}"
data-md5="${file.MD5}"
style="height: ${file.isSpoiler ? 100 : file.theight}px; width: ${file.isSpoiler ? 100 : file.twidth}px;"

View File

@ -632,7 +632,7 @@ Index =
if not ((OP = thread.OP) and not OP.isFetchedQuote)
obj = Index.parsedThreads[ID]
OP = new Post Build.post(obj, true), thread, g.BOARD
OP = new Post Build.post(obj), thread, g.BOARD
OP.filterResults = obj.filterResults
newPosts.push OP
thread.setPage(Index.threadPosition[ID] // Index.threadsNumPerPage + 1)
@ -789,10 +789,6 @@ Index =
$.replace thread.nodes.placeholder, thread.OP.nodes.root
thread.nodes.placeholder = null
thread.OP.setCatalogOP false
if (file = thread.OP.file) and (thumb = thread.OP.file.thumb) and thumb.dataset.src
thumb.src = thumb.dataset.src
# XXX https://bugzilla.mozilla.org/show_bug.cgi?id=1021289
thumb.removeAttribute 'data-src'
nodes.push thread.nodes.root, $.el('hr')
$.add Index.root, nodes
if doc.contains Index.root

View File

@ -123,10 +123,6 @@ Gallery =
thumbImg = post.file.thumb.cloneNode false
thumbImg.style.cssText = ''
if thumbImg.dataset.src
thumbImg.src = thumbImg.dataset.src
# XXX https://bugzilla.mozilla.org/show_bug.cgi?id=1021289
thumbImg.removeAttribute 'data-src'
$.add thumb, thumbImg
$.on thumb, 'click', Gallery.cb.open

View File

@ -73,8 +73,6 @@ 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: ->

View File

@ -54,11 +54,6 @@ Post.Clone = class extends Post
@file.thumb.muted = true if @file.videoThumb
if @file.thumb?.dataset.src
@file.thumb.src = @file.thumb.dataset.src
# XXX https://bugzilla.mozilla.org/show_bug.cgi?id=1021289
@file.thumb.removeAttribute 'data-src'
# Contract thumbnails in quote preview
ImageExpand.contract @ if @file.thumb and contractThumb