diff --git a/4chan_x.js b/4chan_x.js index da7041d1e..5bb9b0ef8 100644 --- a/4chan_x.js +++ b/4chan_x.js @@ -468,7 +468,7 @@ innerHTML: xhr.responseText }); if (threadID === replyID) { - bq = $('blockqoute', body); + bq = $('blockquote', body); } else { _ref = $$('td[id]', body); for (_i = 0, _len = _ref.length; _i < _len; _i++) { @@ -1999,10 +1999,11 @@ foo: function() { var crap, formWidth, left, table, td; formWidth = $('form[name=delform]').getBoundingClientRect().width; - td = $('td.reply'); - table = td.parentNode.parentNode.parentNode; - left = td.getBoundingClientRect().left - table.getBoundingClientRect().left; - crap = td.getBoundingClientRect().width - parseInt(getComputedStyle(td).width); + if (td = $('td.reply')) { + table = td.parentNode.parentNode.parentNode; + left = td.getBoundingClientRect().left - table.getBoundingClientRect().left; + crap = td.getBoundingClientRect().width - parseInt(getComputedStyle(td).width); + } imgExpand.maxWidthOP = formWidth; imgExpand.maxWidthReply = formWidth - left - crap; imgExpand.maxHeight = d.body.clientHeight; diff --git a/script.coffee b/script.coffee index b495c1536..1a2366686 100644 --- a/script.coffee +++ b/script.coffee @@ -309,7 +309,7 @@ expandComment = innerHTML: xhr.responseText if threadID is replyID - bq = $ 'blockqoute', body + bq = $ 'blockquote', body else #css selectors don't like ids starting with numbers, # getElementById only works for root document. @@ -1518,10 +1518,10 @@ imgExpand = foo: -> formWidth = $('form[name=delform]').getBoundingClientRect().width - td = $('td.reply') - table = td.parentNode.parentNode.parentNode - left = td.getBoundingClientRect().left - table.getBoundingClientRect().left - crap = td.getBoundingClientRect().width - parseInt(getComputedStyle(td).width) + if td = $('td.reply') + table = td.parentNode.parentNode.parentNode + left = td.getBoundingClientRect().left - table.getBoundingClientRect().left + crap = td.getBoundingClientRect().width - parseInt(getComputedStyle(td).width) imgExpand.maxWidthOP = formWidth imgExpand.maxWidthReply = formWidth - left - crap