file.URL -> file.url
This commit is contained in:
parent
3f22852412
commit
c2080e8629
@ -454,7 +454,7 @@ Settings =
|
||||
data =
|
||||
isReply: true
|
||||
file:
|
||||
URL: '//i.4cdn.org/g/1334437723720.jpg'
|
||||
url: '//i.4cdn.org/g/1334437723720.jpg'
|
||||
name: 'd9bb2efc98dd0df141a94399ff5880b7.jpg'
|
||||
size: '276 KB'
|
||||
sizeInBytes: 276 * 1024
|
||||
|
||||
@ -170,7 +170,7 @@ class Post
|
||||
@file =
|
||||
text: fileText
|
||||
link: link
|
||||
URL: link.href
|
||||
url: link.href
|
||||
name: fileText.title or link.title or link.textContent
|
||||
size: info[1]
|
||||
isImage: /(jpg|png|gif)$/i.test link.href
|
||||
|
||||
@ -112,7 +112,7 @@ Gallery =
|
||||
|
||||
thumb = $.el 'a',
|
||||
className: 'gal-thumb'
|
||||
href: post.file.URL
|
||||
href: post.file.url
|
||||
target: '_blank'
|
||||
title: post.file.name
|
||||
|
||||
|
||||
@ -34,7 +34,7 @@ ImageCommon =
|
||||
return true
|
||||
|
||||
error: (file, post, delay, cb) ->
|
||||
src = post.file.URL.split '/'
|
||||
src = post.file.url.split '/'
|
||||
URL = Redirect.to 'file',
|
||||
boardID: post.board.ID
|
||||
filename: src[src.length - 1]
|
||||
@ -51,10 +51,10 @@ ImageCommon =
|
||||
cb URL
|
||||
|
||||
<% if (type === 'crx') { %>
|
||||
$.ajax post.file.URL,
|
||||
$.ajax post.file.url,
|
||||
onloadend: ->
|
||||
if @status is 200
|
||||
URL = post.file.URL
|
||||
URL = post.file.url
|
||||
else
|
||||
post.kill true if @status is 404
|
||||
redirect()
|
||||
@ -74,7 +74,7 @@ ImageCommon =
|
||||
post.kill true
|
||||
redirect()
|
||||
else
|
||||
URL = post.file.URL
|
||||
URL = post.file.url
|
||||
<% } %>
|
||||
|
||||
# Add controls, but not until the mouse is moved over the video.
|
||||
|
||||
@ -122,7 +122,7 @@ ImageExpand =
|
||||
$.rmClass post.nodes.root, 'expanded-image'
|
||||
$.rmClass file.thumb, 'expanding'
|
||||
$.rm file.videoControls if file.videoControls
|
||||
file.thumb.parentNode.href = file.URL
|
||||
file.thumb.parentNode.href = file.url
|
||||
file.thumb.parentNode.target = '_blank'
|
||||
for x in ['isExpanding', 'isExpanded', 'videoControls', 'wasPlaying', 'scrollIntoView']
|
||||
delete file[x]
|
||||
@ -175,7 +175,7 @@ ImageExpand =
|
||||
el = file.fullImage = $.el (if isVideo then 'video' else 'img')
|
||||
el.dataset.fullID = post.fullID
|
||||
$.on el, 'error', ImageExpand.error
|
||||
el.src = src or file.URL
|
||||
el.src = src or file.url
|
||||
|
||||
el.className = 'full-image'
|
||||
$.after thumb, el
|
||||
|
||||
@ -32,7 +32,7 @@ ImageHover =
|
||||
el = $.el (if isVideo then 'video' else 'img')
|
||||
el.dataset.fullID = post.fullID
|
||||
$.on el, 'error', error
|
||||
el.src = file.URL
|
||||
el.src = file.url
|
||||
|
||||
if Conf['Restart when Opened']
|
||||
ImageCommon.rewind el
|
||||
|
||||
@ -44,7 +44,7 @@ ImageLoader =
|
||||
video.setAttribute 'muted', 'muted'
|
||||
video.dataset.md5 = thumb.dataset.md5
|
||||
video.style[attr] = thumb.style[attr] for attr in ['height', 'width', 'maxHeight', 'maxWidth']
|
||||
video.src = file.URL
|
||||
video.src = file.url
|
||||
$.replace thumb, video
|
||||
file.thumb = video
|
||||
file.videoThumb = true
|
||||
@ -52,9 +52,9 @@ ImageLoader =
|
||||
prefetch: (post) ->
|
||||
{file} = post
|
||||
return unless file
|
||||
{isImage, isVideo, thumb, URL} = file
|
||||
{isImage, isVideo, thumb, url} = file
|
||||
return if file.isPrefetched or !(isImage or isVideo) or post.isHidden or post.thread.isHidden
|
||||
type = if (match = URL.match(/\.([^.]+)$/)[1].toUpperCase()) is 'JPEG' then 'JPG' else match
|
||||
type = if (match = url.match(/\.([^.]+)$/)[1].toUpperCase()) is 'JPEG' then 'JPG' else match
|
||||
replace = Conf["Replace #{type}"] and !/spoiler/.test(thumb.src or thumb.dataset.src)
|
||||
return unless replace or Conf['prefetch']
|
||||
return unless [post, post.clones...].some (clone) -> doc.contains clone.nodes.root
|
||||
@ -70,11 +70,11 @@ ImageLoader =
|
||||
el = $.el if isImage then 'img' else 'video'
|
||||
if replace and isImage
|
||||
$.on el, 'load', ->
|
||||
clone.file.thumb.src = URL for clone in post.clones
|
||||
thumb.src = URL
|
||||
clone.file.thumb.src = url for clone in post.clones
|
||||
thumb.src = url
|
||||
# XXX https://bugzilla.mozilla.org/show_bug.cgi?id=1021289
|
||||
thumb.removeAttribute 'data-src'
|
||||
el.src = URL
|
||||
el.src = url
|
||||
|
||||
toggle: ->
|
||||
if Conf['prefetch'] = @checked
|
||||
|
||||
@ -7,7 +7,7 @@ Metadata =
|
||||
cb: @node
|
||||
|
||||
node: ->
|
||||
return unless @file and /webm$/i.test @file.URL
|
||||
return unless @file and /webm$/i.test @file.url
|
||||
if @isClone
|
||||
el = $ '.webm-title', @file.text
|
||||
else
|
||||
@ -21,7 +21,7 @@ Metadata =
|
||||
load: ->
|
||||
$.rmClass @parentNode, 'error'
|
||||
$.addClass @parentNode, 'loading'
|
||||
CrossOrigin.binary Get.postFromNode(@).file.URL, (data) =>
|
||||
CrossOrigin.binary Get.postFromNode(@).file.url, (data) =>
|
||||
$.rmClass @parentNode, 'loading'
|
||||
if data?
|
||||
title = Metadata.parse data
|
||||
|
||||
@ -27,15 +27,15 @@ Sauce =
|
||||
m = part.match /^(\w*):(.*)$/
|
||||
parts[m[1]] = m[2]
|
||||
parts['text'] or= parts['url'].match(/(\w+)\.\w+\//)?[1] or '?'
|
||||
ext = post.file.URL.match(/[^.]*$/)[0]
|
||||
ext = post.file.url.match(/[^.]*$/)[0]
|
||||
|
||||
skip = false
|
||||
for key of parts
|
||||
parts[key] = parts[key].replace /%(T?URL|IMG|MD5|board|name|%|semi)/g, (parameter) ->
|
||||
type = {
|
||||
'%TURL': post.file.thumbURL
|
||||
'%URL': post.file.URL
|
||||
'%IMG': if ext in ['gif', 'jpg', 'png'] then post.file.URL else post.file.thumbURL
|
||||
'%URL': post.file.url
|
||||
'%IMG': if ext in ['gif', 'jpg', 'png'] then post.file.url else post.file.thumbURL
|
||||
'%MD5': post.file.MD5
|
||||
'%board': post.board.ID
|
||||
'%name': post.file.name
|
||||
|
||||
@ -14,6 +14,6 @@ DownloadLink =
|
||||
order: 100
|
||||
open: ({file}) ->
|
||||
return false unless file
|
||||
a.href = file.URL
|
||||
a.href = file.url
|
||||
a.download = file.name
|
||||
true
|
||||
|
||||
@ -28,10 +28,10 @@ FileInfo =
|
||||
$.extend outputNode, <%= html('@{output}') %>
|
||||
|
||||
formatters:
|
||||
t: -> <%= html('${this.file.URL.match(/[^\/]*$/)[0]}') %>
|
||||
T: -> <%= html('<a href="${this.file.URL}" target="_blank">&{FileInfo.formatters.t.call(this)}</a>') %>
|
||||
l: -> <%= html('<a href="${this.file.URL}" target="_blank">&{FileInfo.formatters.n.call(this)}</a>') %>
|
||||
L: -> <%= html('<a href="${this.file.URL}" target="_blank">&{FileInfo.formatters.N.call(this)}</a>') %>
|
||||
t: -> <%= html('${this.file.url.match(/[^\/]*$/)[0]}') %>
|
||||
T: -> <%= html('<a href="${this.file.url}" target="_blank">&{FileInfo.formatters.t.call(this)}</a>') %>
|
||||
l: -> <%= html('<a href="${this.file.url}" target="_blank">&{FileInfo.formatters.n.call(this)}</a>') %>
|
||||
L: -> <%= html('<a href="${this.file.url}" target="_blank">&{FileInfo.formatters.N.call(this)}</a>') %>
|
||||
n: ->
|
||||
fullname = @file.name
|
||||
shortname = Build.shortFilename @file.name, @isReply
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user