Fix errors due to <font> tag in file info on /s4s/

This commit is contained in:
ccd0 2014-06-16 11:20:10 -07:00
parent 04a0b95922
commit 79e9d06047
2 changed files with 6 additions and 4 deletions

View File

@ -1,3 +1,6 @@
**ccd0**
- Fix errors due to <font> tag in file info on /s4s/.
### v1.7.61
*2014-06-15*

View File

@ -132,11 +132,10 @@ class Post
"#{location.protocol}//t.4cdn.org/#{@board}/#{@file.URL.match(/(\d+)\./)[1]}s.jpg"
@file.isImage = /(jpg|png|gif)$/i.test @file.URL
@file.isVideo = /webm$/i.test @file.URL
nameNode = $ 'a', fileText
if @file.isImage or @file.isVideo
@file.dimensions = fileText.childNodes[2].textContent.match(/\d+x\d+/)?[0]
@file.name = fileText.title or do ->
nameNode = $('span', fileText) or $('a', fileText)
nameNode?.title or nameNode?.textContent
@file.dimensions = nameNode.nextSibling.textContent.match(/\d+x\d+/)[0]
@file.name = fileText.title or nameNode.title or nameNode.textContent
cleanup: (root) ->
for node in $$ '.mobile', root