better filename parsing; should fix conflict with Exlinks
This commit is contained in:
parent
23de0c18bd
commit
a54957689a
@ -1,3 +1,6 @@
|
||||
**ccd0**
|
||||
- Fix conflict of previous version with Exlinks.
|
||||
|
||||
### v1.7.11
|
||||
*2014-04-19*
|
||||
|
||||
|
||||
@ -130,7 +130,9 @@ class Post
|
||||
thumb.src
|
||||
else
|
||||
"#{location.protocol}//t.4cdn.org/#{@board}/thumb/#{@file.URL.match(/(\d+)\./)[1]}s.jpg"
|
||||
@file.name = fileText.title or fileText.lastElementChild.title or fileText.lastElementChild.textContent
|
||||
@file.name = fileText.title or do ->
|
||||
nameNode = $('span', fileText) or $('a', fileText)
|
||||
nameNode.title or nameNode.textContent
|
||||
<% if (type === 'crx') { %>
|
||||
# replace %22 with quotes, see:
|
||||
# crbug.com/81193
|
||||
@ -139,8 +141,8 @@ class Post
|
||||
# http://www.whatwg.org/specs/web-apps/current-work/#multipart-form-data
|
||||
@file.name = @file.name.replace /%22/g, '"'
|
||||
<% } %>
|
||||
@file.isImage = /(jpg|png|gif)$/i.test @file.name
|
||||
@file.isVideo = /webm$/i.test @file.name
|
||||
@file.isImage = /(jpg|png|gif)$/i.test @file.URL
|
||||
@file.isVideo = /webm$/i.test @file.URL
|
||||
if @file.isImage or @file.isVideo
|
||||
@file.dimensions = fileText.textContent.match(/\d+x\d+/)[0]
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user