Merge branch 'master' into html

This commit is contained in:
ccd0 2015-03-28 16:34:11 -07:00
commit 897bdac327
3 changed files with 6 additions and 3 deletions

View File

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

View File

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

View File

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