diff --git a/src/General/Settings.coffee b/src/General/Settings.coffee index f842925d4..eca1f1d18 100755 --- a/src/General/Settings.coffee +++ b/src/General/Settings.coffee @@ -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 diff --git a/src/General/lib/post.class b/src/General/lib/post.class index 2a9ab47de..6ca9229a1 100755 --- a/src/General/lib/post.class +++ b/src/General/lib/post.class @@ -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 diff --git a/src/Images/Gallery.coffee b/src/Images/Gallery.coffee index 49a591e0b..8260743b1 100644 --- a/src/Images/Gallery.coffee +++ b/src/Images/Gallery.coffee @@ -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 diff --git a/src/Images/ImageCommon.coffee b/src/Images/ImageCommon.coffee index 499808522..582428198 100644 --- a/src/Images/ImageCommon.coffee +++ b/src/Images/ImageCommon.coffee @@ -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. diff --git a/src/Images/ImageExpand.coffee b/src/Images/ImageExpand.coffee index a60914c96..a2698ab01 100755 --- a/src/Images/ImageExpand.coffee +++ b/src/Images/ImageExpand.coffee @@ -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 diff --git a/src/Images/ImageHover.coffee b/src/Images/ImageHover.coffee index bed03f2e4..ac551b369 100755 --- a/src/Images/ImageHover.coffee +++ b/src/Images/ImageHover.coffee @@ -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 diff --git a/src/Images/ImageLoader.coffee b/src/Images/ImageLoader.coffee index 96f243622..eff4718fd 100755 --- a/src/Images/ImageLoader.coffee +++ b/src/Images/ImageLoader.coffee @@ -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 diff --git a/src/Images/Metadata.coffee b/src/Images/Metadata.coffee index f5f89b180..68af80a63 100644 --- a/src/Images/Metadata.coffee +++ b/src/Images/Metadata.coffee @@ -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 diff --git a/src/Images/Sauce.coffee b/src/Images/Sauce.coffee index d68f9c8d5..df96fda89 100755 --- a/src/Images/Sauce.coffee +++ b/src/Images/Sauce.coffee @@ -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 diff --git a/src/Menu/DownloadLink.coffee b/src/Menu/DownloadLink.coffee index d7c3f9411..f5973ae78 100755 --- a/src/Menu/DownloadLink.coffee +++ b/src/Menu/DownloadLink.coffee @@ -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 diff --git a/src/Miscellaneous/FileInfo.coffee b/src/Miscellaneous/FileInfo.coffee index 74ea41f97..1b86d68c6 100755 --- a/src/Miscellaneous/FileInfo.coffee +++ b/src/Miscellaneous/FileInfo.coffee @@ -28,10 +28,10 @@ FileInfo = $.extend outputNode, <%= html('@{output}') %> formatters: - t: -> <%= html('${this.file.URL.match(/[^\/]*$/)[0]}') %> - T: -> <%= html('&{FileInfo.formatters.t.call(this)}') %> - l: -> <%= html('&{FileInfo.formatters.n.call(this)}') %> - L: -> <%= html('&{FileInfo.formatters.N.call(this)}') %> + t: -> <%= html('${this.file.url.match(/[^\/]*$/)[0]}') %> + T: -> <%= html('&{FileInfo.formatters.t.call(this)}') %> + l: -> <%= html('&{FileInfo.formatters.n.call(this)}') %> + L: -> <%= html('&{FileInfo.formatters.N.call(this)}') %> n: -> fullname = @file.name shortname = Build.shortFilename @file.name, @isReply