post.hasPdf

This commit is contained in:
James Campos 2013-01-15 23:27:21 -08:00
parent e5355e450b
commit cc04f1b9e9
2 changed files with 13 additions and 9 deletions

View File

@ -4630,7 +4630,7 @@
return;
}
$.id('postcount').textContent = ++ThreadStats.posts;
if (!post.img) {
if (!post.img || post.hasPdf) {
return;
}
imgcount = $.id('imagecount');
@ -4920,7 +4920,7 @@
return Main.callbacks.push(this.node);
},
node: function(post) {
if (!post.img) {
if (!post.img || post.hasPdf) {
return;
}
return $.on(post.img, 'mouseover', ImageHover.mouseover);
@ -5025,7 +5025,7 @@
},
node: function(post) {
var a;
if (!post.img) {
if (!post.img || post.hasPdf) {
return;
}
a = post.img.parentNode;
@ -5544,7 +5544,7 @@
}
},
preParse: function(node) {
var el, img, parentClass, post;
var el, img, imgParent, parentClass, post;
parentClass = node.parentNode.className;
el = $('.post', node);
post = {
@ -5563,8 +5563,10 @@
img: false
};
if (img = $('img[data-md5]', el)) {
post.fileInfo = img.parentNode.previousElementSibling;
imgParent = img.parentNode;
post.img = img;
post.fileInfo = imgParent.previousElementSibling;
post.hasPdf = /\.pdf$/.test(imgParent.href);
}
Main.prettify(post.blockquote);
return post;

View File

@ -3796,7 +3796,7 @@ ThreadStats =
node: (post) ->
return if post.isInlined
$.id('postcount').textContent = ++ThreadStats.posts
return unless post.img
return if (!post.img or post.hasPdf)
imgcount = $.id 'imagecount'
imgcount.textContent = ++ThreadStats.images
if ThreadStats.images > ThreadStats.imgLimit
@ -4012,7 +4012,7 @@ ImageHover =
init: ->
Main.callbacks.push @node
node: (post) ->
return unless post.img
return if (!post.img or post.hasPdf)
$.on post.img, 'mouseover', ImageHover.mouseover
mouseover: ->
# Make sure to remove the previous image hover
@ -4078,7 +4078,7 @@ ImageExpand =
@dialog()
node: (post) ->
return unless post.img
return if (!post.img or post.hasPdf)
a = post.img.parentNode
$.on a, 'click', ImageExpand.cb.toggle
if ImageExpand.on and !post.el.hidden
@ -4506,8 +4506,10 @@ Main =
if img = $ 'img[data-md5]', el
# Make sure to not add deleted images,
# those do not have a data-md5 attribute.
post.fileInfo = img.parentNode.previousElementSibling
imgParent = img.parentNode
post.img = img
post.fileInfo = imgParent.previousElementSibling
post.hasPdf = /\.pdf$/.test imgParent.href
Main.prettify post.blockquote
post
node: (nodes, notify) ->