Various fixes.

This commit is contained in:
Nicolas Stepien 2012-06-15 21:58:50 +02:00
parent 9372c1dc32
commit 38623937be
2 changed files with 19 additions and 22 deletions

View File

@ -2809,7 +2809,7 @@
node: function(post) {
var img, link, nodes, _i, _len, _ref;
img = post.img;
if (post.isInlined && !post.isCrosspost || !img) {
if (post.isInlined && !post.isCrosspost || post.isArchived || !img) {
return;
}
img = img.parentNode;
@ -3099,7 +3099,7 @@
}
},
parseArchivedPost: function(req, board, postID, root, cb) {
var bq, br, capcode, data, email, file, filesize, isOP, name, nameBlock, pc, pi, piM, span, subject, threadID, trip;
var bq, br, capcode, data, email, file, filesize, isOP, name, nameBlock, pc, pi, piM, span, subject, threadID, timestamp, trip;
data = JSON.parse(req.response);
$.addClass(root, 'archivedPost');
if (data.error) {
@ -3108,7 +3108,7 @@
}
threadID = data.thread_num;
isOP = postID === threadID;
name = data.name, trip = data.trip;
name = data.name, trip = data.trip, timestamp = data.timestamp;
subject = data.title;
piM = $.el('div', {
id: "pim" + postID,
@ -3144,7 +3144,7 @@
pi = $.el('div', {
id: "pi" + postID,
className: 'postInfo desktop',
innerHTML: "<input type=checkbox name=" + postID + " value=delete> <span class=userInfo><span class=subject></span> <span class=nameBlock></span></span> <span class=dateTime data-utc=" + data.timestamp + ">data.fourchan_date</span> <span class='postNum desktop'><a href='/" + board + "/res/" + threadID + "#p" + postID + "' title='Highlight this post'>No.</a><a href='/" + board + "/res/" + threadID + "#q" + postID + "' title='Quote this post'>" + postID + "</a>" + (isOP ? ' &nbsp; ' : '') + "</span> "
innerHTML: "<input type=checkbox name=" + postID + " value=delete> <span class=userInfo><span class=subject></span> <span class=nameBlock></span></span> <span class=dateTime data-utc=" + timestamp + ">data.fourchan_date</span> <span class='postNum desktop'><a href='/" + board + "/res/" + threadID + "#p" + postID + "' title='Highlight this post'>No.</a><a href='/" + board + "/res/" + threadID + "#q" + postID + "' title='Quote this post'>" + postID + "</a>" + (isOP ? ' &nbsp; ' : '') + "</span> "
});
$('.subject', pi).textContent = subject;
nameBlock = $('.nameBlock', pi);
@ -3221,7 +3221,7 @@
pc = $.el('div', {
id: "pc" + postID,
className: "postContainer " + (isOP ? 'op' : 'reply') + "Container",
innerHTML: "<div id=p" + postID + " class='postContainer " + (isOP ? 'op' : 'reply') + "'></div>"
innerHTML: "<div id=p" + postID + " class='post " + (isOP ? 'op' : 'reply') + "'></div>"
});
$.add(pc.firstChild, [piM, pi, bq]);
if (data.media_filename) {
@ -3490,19 +3490,17 @@
UI.hover(e);
$.add(d.body, qp);
Get.post(board, threadID, postID, qp, function() {
var bq, fileInfo, img, post;
var bq, img, post;
bq = $('blockquote', qp);
Main.prettify(bq);
post = {
el: qp,
blockquote: bq
blockquote: bq,
isArchived: /\barchivedPost\b/.test(qp.className)
};
if (fileInfo = $('.fileInfo', qp)) {
img = fileInfo.nextElementSibling.firstElementChild;
if (img.alt !== 'File deleted.') {
post.fileInfo = fileInfo;
post.img = img;
}
if (img = $('img[data-md5]', qp)) {
post.fileInfo = img.parentNode.previousElementSibling;
post.img = img;
}
if (Conf['Reveal Spoilers']) {
RevealSpoilers.node(post);

View File

@ -2193,7 +2193,7 @@ Sauce =
node: (post) ->
{img} = post
return if post.isInlined and not post.isCrosspost or not img
return if post.isInlined and not post.isCrosspost or post.isArchived or not img
img = img.parentNode
nodes = []
for link in Sauce.links
@ -2385,7 +2385,7 @@ Get =
threadID = data.thread_num
isOP = postID is threadID
{name, trip} = data
{name, trip, timestamp} = data
subject = data.title
# post info (mobile)
@ -2424,7 +2424,7 @@ Get =
pi = $.el 'div',
id: "pi#{postID}"
className: 'postInfo desktop'
innerHTML: "<input type=checkbox name=#{postID} value=delete> <span class=userInfo><span class=subject></span> <span class=nameBlock></span></span> <span class=dateTime data-utc=#{data.timestamp}>data.fourchan_date</span> <span class='postNum desktop'><a href='/#{board}/res/#{threadID}#p#{postID}' title='Highlight this post'>No.</a><a href='/#{board}/res/#{threadID}#q#{postID}' title='Quote this post'>#{postID}</a>#{if isOP then ' &nbsp; ' else ''}</span> "
innerHTML: "<input type=checkbox name=#{postID} value=delete> <span class=userInfo><span class=subject></span> <span class=nameBlock></span></span> <span class=dateTime data-utc=#{timestamp}>data.fourchan_date</span> <span class='postNum desktop'><a href='/#{board}/res/#{threadID}#p#{postID}' title='Highlight this post'>No.</a><a href='/#{board}/res/#{threadID}#q#{postID}' title='Quote this post'>#{postID}</a>#{if isOP then ' &nbsp; ' else ''}</span> "
# subject
$('.subject', pi).textContent = subject
nameBlock = $ '.nameBlock', pi
@ -2504,7 +2504,7 @@ Get =
pc = $.el 'div',
id: "pc#{postID}"
className: "postContainer #{if isOP then 'op' else 'reply'}Container"
innerHTML: "<div id=p#{postID} class='postContainer #{if isOP then 'op' else 'reply'}'></div>"
innerHTML: "<div id=p#{postID} class='post #{if isOP then 'op' else 'reply'}'></div>"
$.add pc.firstChild, [piM, pi, bq]
# file
@ -2710,11 +2710,10 @@ QuotePreview =
post =
el: qp
blockquote: bq
if fileInfo = $ '.fileInfo', qp
img = fileInfo.nextElementSibling.firstElementChild
if img.alt isnt 'File deleted.'
post.fileInfo = fileInfo
post.img = img
isArchived: /\barchivedPost\b/.test qp.className
if img = $ 'img[data-md5]', qp
post.fileInfo = img.parentNode.previousElementSibling
post.img = img
if Conf['Reveal Spoilers']
RevealSpoilers.node post
if Conf['Image Auto-Gif']