Merge branch 'newnames'
Conflicts: src/General/lib/post.class
This commit is contained in:
commit
bf45917000
@ -42,14 +42,14 @@ Build =
|
||||
name: data.filename + data.ext
|
||||
timestamp: "#{data.tim}#{data.ext}"
|
||||
url: if boardID is 'f'
|
||||
"//i.4cdn.org/#{boardID}/src/#{data.filename}#{data.ext}"
|
||||
"//i.4cdn.org/#{boardID}/#{data.filename}#{data.ext}"
|
||||
else
|
||||
"//i.4cdn.org/#{boardID}/src/#{data.tim}#{data.ext}"
|
||||
"//i.4cdn.org/#{boardID}/#{data.tim}#{data.ext}"
|
||||
height: data.h
|
||||
width: data.w
|
||||
MD5: data.md5
|
||||
size: data.fsize
|
||||
turl: "//#{Build.thumbRotate()}.t.4cdn.org/#{boardID}/thumb/#{data.tim}s.jpg"
|
||||
turl: "//#{Build.thumbRotate()}.t.4cdn.org/#{boardID}/#{data.tim}s.jpg"
|
||||
theight: data.tn_h
|
||||
twidth: data.tn_w
|
||||
isSpoiler: !!data.spoiler
|
||||
@ -188,7 +188,7 @@ Build =
|
||||
pageIcon = ''
|
||||
|
||||
if isOP and g.VIEW is 'index'
|
||||
replyLink = " <span>[<a href='/#{boardID}/res/#{threadID}' class=replylink>Reply</a>]</span>"
|
||||
replyLink = " <span>[<a href='/#{boardID}/thread/#{threadID}' class=replylink>Reply</a>]</span>"
|
||||
else
|
||||
replyLink = ''
|
||||
|
||||
@ -200,7 +200,7 @@ Build =
|
||||
for quote in $$ '.quotelink', container
|
||||
href = quote.getAttribute 'href'
|
||||
continue if href[0] is '/' # Cross-board quote, or board link
|
||||
quote.href = "/#{boardID}/res/#{href}" # Fix pathnames
|
||||
quote.href = "/#{boardID}/thread/#{href}" # Fix pathnames
|
||||
|
||||
container
|
||||
|
||||
@ -212,7 +212,7 @@ Build =
|
||||
$.el 'a',
|
||||
className: 'summary'
|
||||
textContent: text.join ' '
|
||||
href: "/#{boardID}/res/#{threadID}"
|
||||
href: "/#{boardID}/thread/#{threadID}"
|
||||
|
||||
thread: (board, data, full) ->
|
||||
Build.spoilerRange[board] = data.custom_spoiler
|
||||
|
||||
@ -74,7 +74,7 @@ Get =
|
||||
|
||||
root.textContent = "Loading post No.#{postID}..."
|
||||
if threadID
|
||||
$.cache "//a.4cdn.org/#{boardID}/res/#{threadID}.json", ->
|
||||
$.cache "//a.4cdn.org/#{boardID}/thread/#{threadID}.json", ->
|
||||
Get.fetchedPost @, boardID, threadID, postID, root, context
|
||||
else if url = Redirect.to 'post', {boardID, postID}
|
||||
$.cache url,
|
||||
@ -203,7 +203,7 @@ Get =
|
||||
width: data.media.media_w
|
||||
MD5: data.media.media_hash
|
||||
size: data.media.media_size
|
||||
turl: data.media.thumb_link or "//t.4cdn.org/#{boardID}/thumb/#{data.media.preview_orig}"
|
||||
turl: data.media.thumb_link or "//t.4cdn.org/#{boardID}/#{data.media.preview_orig}"
|
||||
theight: data.media.preview_h
|
||||
twidth: data.media.preview_w
|
||||
isSpoiler: data.media.spoiler is '1'
|
||||
|
||||
@ -222,7 +222,7 @@ Navigate =
|
||||
else
|
||||
Navigate.updateSFW Favicon.SFW
|
||||
{load} = Navigate
|
||||
Navigate.req = $.ajax "//a.4cdn.org/#{boardID}/res/#{threadID}.json",
|
||||
Navigate.req = $.ajax "//a.4cdn.org/#{boardID}/thread/#{threadID}.json",
|
||||
onabort: load
|
||||
onloadend: load
|
||||
|
||||
|
||||
@ -394,7 +394,7 @@ Settings =
|
||||
data =
|
||||
isReply: true
|
||||
file:
|
||||
URL: '//i.4cdn.org/g/src/1334437723720.jpg'
|
||||
URL: '//i.4cdn.org/g/1334437723720.jpg'
|
||||
name: 'd9bb2efc98dd0df141a94399ff5880b7.jpg'
|
||||
size: '276 KB'
|
||||
sizeInBytes: 276 * 1024
|
||||
|
||||
@ -18,12 +18,12 @@
|
||||
</span>#{" "}
|
||||
<span class=dateTime data-utc=#{dateUTC}>#{date}</span>#{' '}
|
||||
<span class='postNum'>
|
||||
<a href=#{"/#{boardID}/res/#{threadID}#p#{postID}"} title='Highlight this post'>No.</a>
|
||||
<a href=#{"/#{boardID}/thread/#{threadID}#p#{postID}"} title='Highlight this post'>No.</a>
|
||||
<a href='#{
|
||||
if g.VIEW is 'thread' and g.THREADID is +threadID then
|
||||
"javascript:quote(#{postID})"
|
||||
else
|
||||
"/#{boardID}/res/#{threadID}#q#{postID}"
|
||||
"/#{boardID}/thread/#{threadID}#q#{postID}"
|
||||
}' title='Quote this post'>#{postID}</a>
|
||||
#{pageIcon + sticky + closed + replyLink}
|
||||
</span>
|
||||
|
||||
@ -129,7 +129,7 @@ class Post
|
||||
@file.thumbURL = if that.isArchived
|
||||
thumb.src
|
||||
else
|
||||
"#{location.protocol}//t.4cdn.org/#{@board}/thumb/#{@file.URL.match(/(\d+)\./)[1]}s.jpg"
|
||||
"#{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
|
||||
if @file.isImage or @file.isVideo
|
||||
|
||||
@ -207,7 +207,7 @@ Gallery =
|
||||
return
|
||||
|
||||
# XXX CORS for i.4cdn.org WHEN?
|
||||
$.ajax "//a.4cdn.org/#{post.board}/res/#{post.thread}.json", onload: ->
|
||||
$.ajax "//a.4cdn.org/#{post.board}/thread/#{post.thread}.json", onload: ->
|
||||
return if @status isnt 200
|
||||
i = 0
|
||||
{posts} = @response
|
||||
|
||||
@ -224,7 +224,7 @@ ImageExpand =
|
||||
type: 'head'
|
||||
<% } else { %>
|
||||
# XXX CORS for i.4cdn.org WHEN?
|
||||
$.ajax "//a.4cdn.org/#{post.board}/res/#{post.thread}.json", onload: ->
|
||||
$.ajax "//a.4cdn.org/#{post.board}/thread/#{post.thread}.json", onload: ->
|
||||
return if @status isnt 200
|
||||
for postObj in @response.posts
|
||||
break if postObj.no is post.ID
|
||||
|
||||
@ -70,7 +70,7 @@ ImageHover =
|
||||
type: 'head'
|
||||
<% } else { %>
|
||||
# XXX CORS for i.4cdn.org WHEN?
|
||||
$.ajax "//a.4cdn.org/#{post.board}/res/#{post.thread}.json", onload: ->
|
||||
$.ajax "//a.4cdn.org/#{post.board}/thread/#{post.thread}.json", onload: ->
|
||||
return if @status isnt 200
|
||||
for postObj in @response.posts
|
||||
break if postObj.no is post.ID
|
||||
|
||||
@ -52,7 +52,7 @@ ExpandComment =
|
||||
for quote in $$ '.quotelink', clone
|
||||
href = quote.getAttribute 'href'
|
||||
continue if href[0] is '/' # Cross-board quote, or board link
|
||||
quote.href = "/#{post.board}/res/#{href}" # Fix pathnames
|
||||
quote.href = "/#{post.board}/thread/#{href}" # Fix pathnames
|
||||
post.nodes.shortComment = comment
|
||||
$.replace comment, clone
|
||||
post.nodes.comment = post.nodes.longComment = clone
|
||||
|
||||
@ -48,7 +48,7 @@ ExpandThread =
|
||||
expand: (thread, a, threadRoot) ->
|
||||
ExpandThread.statuses[thread] = status = {}
|
||||
a.textContent = ExpandThread.text '...', a.textContent.match(/\d+/g)...
|
||||
status.req = $.cache "//a.4cdn.org/#{thread.board}/res/#{thread}.json", ->
|
||||
status.req = $.cache "//a.4cdn.org/#{thread.board}/thread/#{thread}.json", ->
|
||||
delete status.req
|
||||
ExpandThread.parse @, thread, a
|
||||
contract: (thread, a, threadRoot) ->
|
||||
|
||||
@ -48,19 +48,19 @@ InfiniScroll =
|
||||
posts.push op
|
||||
|
||||
replylink = $.el 'a',
|
||||
href: "res/#{threadID}"
|
||||
href: "thread/#{threadID}"
|
||||
className: 'replylink'
|
||||
textContent: 'Reply'
|
||||
|
||||
postlink = $.el 'div',
|
||||
className: "postLink mobile"
|
||||
innerHTML: """<a href="res/#{threadID}" class="button">View Thread</a>"""
|
||||
innerHTML: """<a href="thread/#{threadID}" class="button">View Thread</a>"""
|
||||
|
||||
if omitted_posts
|
||||
posts.push $.el 'span',
|
||||
className: 'summary desktop'
|
||||
innerHTML: """
|
||||
#{omitted_posts} posts #{if omitted_images then "and " + omitted_images + " image replies"} omitted. Click <a class="replylink" href="res/#{threadID}">here</a> to view.
|
||||
#{omitted_posts} posts #{if omitted_images then "and " + omitted_images + " image replies"} omitted. Click <a class="replylink" href="thread/#{threadID}">here</a> to view.
|
||||
"""
|
||||
|
||||
$.prepend postlink, $.el 'span',
|
||||
|
||||
@ -217,7 +217,7 @@ Keybinds =
|
||||
|
||||
open: (thread, tab) ->
|
||||
return if g.VIEW isnt 'index'
|
||||
url = "/#{thread.board}/res/#{thread}"
|
||||
url = "/#{thread.board}/thread/#{thread}"
|
||||
if tab
|
||||
$.open url
|
||||
else
|
||||
|
||||
@ -243,7 +243,7 @@ ThreadUpdater =
|
||||
else
|
||||
ThreadUpdater.set 'timer', 'Update'
|
||||
ThreadUpdater.req?.abort()
|
||||
url = "//a.4cdn.org/#{ThreadUpdater.thread.board}/res/#{ThreadUpdater.thread}.json"
|
||||
url = "//a.4cdn.org/#{ThreadUpdater.thread.board}/thread/#{ThreadUpdater.thread}.json"
|
||||
ThreadUpdater.req = $.ajax url, onloadend: ThreadUpdater.cb.load,
|
||||
whenModified: true
|
||||
|
||||
|
||||
@ -123,7 +123,7 @@ ThreadWatcher =
|
||||
return if data.isDead
|
||||
{fetchCount} = ThreadWatcher
|
||||
fetchCount.fetching++
|
||||
$.ajax "//a.4cdn.org/#{boardID}/res/#{threadID}.json",
|
||||
$.ajax "//a.4cdn.org/#{boardID}/thread/#{threadID}.json",
|
||||
onloadend: ->
|
||||
fetchCount.fetched++
|
||||
if fetchCount.fetched is fetchCount.fetching
|
||||
@ -161,7 +161,7 @@ ThreadWatcher =
|
||||
if data.isDead
|
||||
href = Redirect.to 'thread', {boardID, threadID}
|
||||
link = $.el 'a',
|
||||
href: href or "/#{boardID}/res/#{threadID}"
|
||||
href: href or "/#{boardID}/thread/#{threadID}"
|
||||
textContent: data.excerpt
|
||||
title: data.excerpt
|
||||
|
||||
|
||||
@ -795,9 +795,9 @@ QR =
|
||||
QR.cooldown.set {req, post, isReply, threadID}
|
||||
|
||||
URL = if threadID is postID # new thread
|
||||
"/#{g.BOARD}/res/#{threadID}"
|
||||
"/#{g.BOARD}/thread/#{threadID}"
|
||||
else if g.VIEW is 'index' and !QR.cooldown.auto and Conf['Open Post in New Tab'] # replying from the index
|
||||
"/#{g.BOARD}/res/#{threadID}#p#{postID}"
|
||||
"/#{g.BOARD}/thread/#{threadID}#p#{postID}"
|
||||
if URL
|
||||
if Conf['Open Post in New Tab']
|
||||
$.open URL
|
||||
|
||||
@ -26,7 +26,7 @@ QuoteBacklink =
|
||||
return if @isClone or !@quotes.length
|
||||
markYours = Conf['Quick Reply'] and Conf['Mark Quotes of You'] and QR.db.get {boardID: @board.ID, threadID: @thread.ID, postID: @ID}
|
||||
a = $.el 'a',
|
||||
href: "/#{@board}/res/#{@thread}#p#{@}"
|
||||
href: "/#{@board}/thread/#{@thread}#p#{@}"
|
||||
className: if @isHidden then 'filtered backlink' else 'backlink'
|
||||
textContent: (QuoteBacklink.funk @ID) + (if markYours then '\u00A0(You)' else '')
|
||||
for quote in @quotes
|
||||
|
||||
@ -45,13 +45,13 @@ Quotify =
|
||||
# Don't (Dead) when quotifying in an archived post,
|
||||
# and we know the post still exists.
|
||||
a = $.el 'a',
|
||||
href: "/#{boardID}/res/#{post.thread}#p#{postID}"
|
||||
href: "/#{boardID}/thread/#{post.thread}#p#{postID}"
|
||||
className: 'quotelink'
|
||||
textContent: quote
|
||||
else
|
||||
# Replace the .deadlink span if we can redirect.
|
||||
a = $.el 'a',
|
||||
href: "/#{boardID}/res/#{post.thread}#p#{postID}"
|
||||
href: "/#{boardID}/thread/#{post.thread}#p#{postID}"
|
||||
className: 'quotelink deadlink'
|
||||
target: '_blank'
|
||||
textContent: "#{quote}\u00A0(Dead)"
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user