Fix 4chan X for markup change.
This commit is contained in:
parent
1e621a7fe4
commit
3efffe8a6e
@ -1,3 +1,5 @@
|
|||||||
|
- Fix 4chan X breaking in threads following a 4chan markup change.
|
||||||
|
|
||||||
### 3.14.1 - *2013-11-25*
|
### 3.14.1 - *2013-11-25*
|
||||||
|
|
||||||
- Minor cooldown fix:
|
- Minor cooldown fix:
|
||||||
|
|||||||
@ -55,6 +55,9 @@ a[href="javascript:;"] {
|
|||||||
.post {
|
.post {
|
||||||
overflow: visible !important;
|
overflow: visible !important;
|
||||||
}
|
}
|
||||||
|
.fileText {
|
||||||
|
margin: 0 20px;
|
||||||
|
}
|
||||||
[hidden] {
|
[hidden] {
|
||||||
display: none !important;
|
display: none !important;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -167,15 +167,15 @@ Build =
|
|||||||
filename = a.innerHTML.replace /'/g, '''
|
filename = a.innerHTML.replace /'/g, '''
|
||||||
|
|
||||||
fileDims = if ext is 'pdf' then 'PDF' else "#{file.width}x#{file.height}"
|
fileDims = if ext is 'pdf' then 'PDF' else "#{file.width}x#{file.height}"
|
||||||
fileInfo = "<span class=fileText id=fT#{postID}#{if file.isSpoiler then " title='#{filename}'" else ''}>File: <a href='#{file.url}' target=_blank>#{file.timestamp}</a>" +
|
fileInfo = "<div class=fileText id=fT#{postID}#{if file.isSpoiler then " title='#{filename}'" else ''}>File: <a href='#{file.url}' target=_blank>#{file.timestamp}</a>" +
|
||||||
"-(#{fileSize}, #{fileDims}#{
|
"-(#{fileSize}, #{fileDims}#{
|
||||||
if file.isSpoiler
|
if file.isSpoiler
|
||||||
''
|
''
|
||||||
else
|
else
|
||||||
", <span title='#{filename}'>#{shortFilename}</span>"
|
", <span#{if filename isnt shortFilename then " title='#{filename}'" else ''}>#{shortFilename}</span>"
|
||||||
}" + ")</span>"
|
}" + ")</div>"
|
||||||
|
|
||||||
fileHTML = "<div id=f#{postID} class=file><div class=fileInfo>#{fileInfo}</div>#{imgSrc}</div>"
|
fileHTML = "<div class=file id=f#{postID}>#{fileInfo}#{imgSrc}</div>"
|
||||||
else
|
else
|
||||||
fileHTML = ''
|
fileHTML = ''
|
||||||
|
|
||||||
|
|||||||
@ -52,8 +52,7 @@ class Clone extends Post
|
|||||||
for key, val of origin.file
|
for key, val of origin.file
|
||||||
@file[key] = val
|
@file[key] = val
|
||||||
file = $ '.file', post
|
file = $ '.file', post
|
||||||
@file.info = file.firstElementChild
|
@file.text = file.firstElementChild
|
||||||
@file.text = @file.info.firstElementChild
|
|
||||||
@file.thumb = $ 'img[data-md5]', file
|
@file.thumb = $ 'img[data-md5]', file
|
||||||
@file.fullImage = $ '.full-image', file
|
@file.fullImage = $ '.full-image', file
|
||||||
|
|
||||||
|
|||||||
@ -109,15 +109,13 @@ class Post
|
|||||||
return unless (fileEl = $ '.file', @nodes.post) and thumb = $ 'img[data-md5]', fileEl
|
return unless (fileEl = $ '.file', @nodes.post) and thumb = $ 'img[data-md5]', fileEl
|
||||||
# Supports JPG/PNG/GIF/PDF.
|
# Supports JPG/PNG/GIF/PDF.
|
||||||
# Flash files are not supported.
|
# Flash files are not supported.
|
||||||
alt = thumb.alt
|
|
||||||
anchor = thumb.parentNode
|
anchor = thumb.parentNode
|
||||||
fileInfo = fileEl.firstElementChild
|
fileText = fileEl.firstElementChild
|
||||||
@file =
|
@file =
|
||||||
info: fileInfo
|
text: fileText
|
||||||
text: fileInfo.firstElementChild
|
|
||||||
thumb: thumb
|
thumb: thumb
|
||||||
URL: anchor.href
|
URL: anchor.href
|
||||||
size: alt.match(/[\d.]+\s\w+/)[0]
|
size: thumb.alt.match(/[\d.]+\s\w+/)[0]
|
||||||
MD5: thumb.dataset.md5
|
MD5: thumb.dataset.md5
|
||||||
isSpoiler: $.hasClass anchor, 'imgspoiler'
|
isSpoiler: $.hasClass anchor, 'imgspoiler'
|
||||||
size = +@file.size.match(/[\d.]+/)[0]
|
size = +@file.size.match(/[\d.]+/)[0]
|
||||||
@ -128,7 +126,10 @@ class Post
|
|||||||
thumb.src
|
thumb.src
|
||||||
else
|
else
|
||||||
"#{location.protocol}//t.4cdn.org/#{@board}/thumb/#{@file.URL.match(/(\d+)\./)[1]}s.jpg"
|
"#{location.protocol}//t.4cdn.org/#{@board}/thumb/#{@file.URL.match(/(\d+)\./)[1]}s.jpg"
|
||||||
@file.name = $('span[title]', fileInfo).title
|
@file.name = if nameNode = $ 'span', fileText
|
||||||
|
nameNode.title or nameNode.textContent
|
||||||
|
else
|
||||||
|
fileText.title
|
||||||
<% if (type === 'crx') { %>
|
<% if (type === 'crx') { %>
|
||||||
# replace %22 with quotes, see:
|
# replace %22 with quotes, see:
|
||||||
# crbug.com/81193
|
# crbug.com/81193
|
||||||
@ -138,7 +139,7 @@ class Post
|
|||||||
@file.name = @file.name.replace /%22/g, '"'
|
@file.name = @file.name.replace /%22/g, '"'
|
||||||
<% } %>
|
<% } %>
|
||||||
if @file.isImage = /(jpg|png|gif)$/i.test @file.name
|
if @file.isImage = /(jpg|png|gif)$/i.test @file.name
|
||||||
@file.dimensions = @file.text.textContent.match(/\d+x\d+/)[0]
|
@file.dimensions = fileText.textContent.match(/\d+x\d+/)[0]
|
||||||
|
|
||||||
kill: (file, now) ->
|
kill: (file, now) ->
|
||||||
now or= new Date()
|
now or= new Date()
|
||||||
|
|||||||
@ -40,4 +40,4 @@ Sauce =
|
|||||||
for link in Sauce.links
|
for link in Sauce.links
|
||||||
# \u00A0 is nbsp
|
# \u00A0 is nbsp
|
||||||
nodes.push $.tn('\u00A0'), link @, Sauce.link.cloneNode true
|
nodes.push $.tn('\u00A0'), link @, Sauce.link.cloneNode true
|
||||||
$.add @file.info, nodes
|
$.add @file.text, nodes
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user