diff --git a/src/General/lib/clone.class b/src/General/lib/clone.class index f0c42ecbf..710e35de3 100755 --- a/src/General/lib/clone.class +++ b/src/General/lib/clone.class @@ -58,6 +58,7 @@ class Clone extends Post @file[key] = val file = $ '.file', post @file.text = file.firstElementChild + @file.link = $ '.fileText > a, .fileText-original', file @file.thumb = $ '.fileThumb > [data-md5]', file @file.fullImage = $ '.full-image', file @file.videoControls = $ '.video-controls', @file.text diff --git a/src/General/lib/post.class b/src/General/lib/post.class index 5932cc30e..f62e65377 100755 --- a/src/General/lib/post.class +++ b/src/General/lib/post.class @@ -164,7 +164,7 @@ class Post parseFile: -> return unless fileEl = $ '.file', @nodes.post - return unless link = $ '.fileText > a', fileEl + return unless link = $ '.fileText > a, .fileText-original > a', fileEl return unless info = link.nextSibling?.textContent.match /\(([\d.]+ [KMG]?B).*\)/ fileText = fileEl.firstElementChild @file = @@ -180,7 +180,7 @@ class Post unit = ['B', 'KB', 'MB', 'GB'].indexOf @file.size.match(/\w+$/)[0] size *= 1024 while unit-- > 0 @file.sizeInBytes = size - if (thumb = $ 'img[data-md5]', fileEl) + if (thumb = $ '.fileThumb > [data-md5]', fileEl) $.extend @file, thumb: thumb thumbURL: "#{location.protocol}//i.4cdn.org/#{@board}/#{link.href.match(/(\d+)\./)[1]}s.jpg" diff --git a/src/Posting/QR.coffee b/src/Posting/QR.coffee index e016e2057..35020c4ca 100644 --- a/src/Posting/QR.coffee +++ b/src/Posting/QR.coffee @@ -748,6 +748,8 @@ QR = postsCount = QR.posts.length - 1 QR.cooldown.auto = postsCount and isReply + lastPostToThread = not (do -> return true for p in QR.posts[1..] when p.thread is post.thread) + unless Conf['Persistent QR'] or postsCount QR.close() else @@ -758,7 +760,7 @@ QR = URL = if threadID is postID # new thread "#{window.location.origin}/#{g.BOARD}/thread/#{threadID}" - else if g.VIEW is 'index' and !QR.cooldown.auto and Conf['Open Post in New Tab'] # replying from the index + else if g.VIEW is 'index' and lastPostToThread and Conf['Open Post in New Tab'] # replying from the index "#{window.location.origin}/#{g.BOARD}/thread/#{threadID}#p#{postID}" if URL