Merge branch 'newnames'

Conflicts:
	src/General/lib/post.class
This commit is contained in:
ccd0 2014-04-19 16:57:17 -07:00
commit bf45917000
18 changed files with 30 additions and 30 deletions

View File

@ -42,14 +42,14 @@ Build =
name: data.filename + data.ext name: data.filename + data.ext
timestamp: "#{data.tim}#{data.ext}" timestamp: "#{data.tim}#{data.ext}"
url: if boardID is 'f' url: if boardID is 'f'
"//i.4cdn.org/#{boardID}/src/#{data.filename}#{data.ext}" "//i.4cdn.org/#{boardID}/#{data.filename}#{data.ext}"
else else
"//i.4cdn.org/#{boardID}/src/#{data.tim}#{data.ext}" "//i.4cdn.org/#{boardID}/#{data.tim}#{data.ext}"
height: data.h height: data.h
width: data.w width: data.w
MD5: data.md5 MD5: data.md5
size: data.fsize 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 theight: data.tn_h
twidth: data.tn_w twidth: data.tn_w
isSpoiler: !!data.spoiler isSpoiler: !!data.spoiler
@ -188,7 +188,7 @@ Build =
pageIcon = '' pageIcon = ''
if isOP and g.VIEW is 'index' if isOP and g.VIEW is 'index'
replyLink = " &nbsp; <span>[<a href='/#{boardID}/res/#{threadID}' class=replylink>Reply</a>]</span>" replyLink = " &nbsp; <span>[<a href='/#{boardID}/thread/#{threadID}' class=replylink>Reply</a>]</span>"
else else
replyLink = '' replyLink = ''
@ -200,7 +200,7 @@ Build =
for quote in $$ '.quotelink', container for quote in $$ '.quotelink', container
href = quote.getAttribute 'href' href = quote.getAttribute 'href'
continue if href[0] is '/' # Cross-board quote, or board link 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 container
@ -212,7 +212,7 @@ Build =
$.el 'a', $.el 'a',
className: 'summary' className: 'summary'
textContent: text.join ' ' textContent: text.join ' '
href: "/#{boardID}/res/#{threadID}" href: "/#{boardID}/thread/#{threadID}"
thread: (board, data, full) -> thread: (board, data, full) ->
Build.spoilerRange[board] = data.custom_spoiler Build.spoilerRange[board] = data.custom_spoiler

View File

@ -74,7 +74,7 @@ Get =
root.textContent = "Loading post No.#{postID}..." root.textContent = "Loading post No.#{postID}..."
if threadID 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 Get.fetchedPost @, boardID, threadID, postID, root, context
else if url = Redirect.to 'post', {boardID, postID} else if url = Redirect.to 'post', {boardID, postID}
$.cache url, $.cache url,
@ -203,7 +203,7 @@ Get =
width: data.media.media_w width: data.media.media_w
MD5: data.media.media_hash MD5: data.media.media_hash
size: data.media.media_size 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 theight: data.media.preview_h
twidth: data.media.preview_w twidth: data.media.preview_w
isSpoiler: data.media.spoiler is '1' isSpoiler: data.media.spoiler is '1'

View File

@ -222,7 +222,7 @@ Navigate =
else else
Navigate.updateSFW Favicon.SFW Navigate.updateSFW Favicon.SFW
{load} = Navigate {load} = Navigate
Navigate.req = $.ajax "//a.4cdn.org/#{boardID}/res/#{threadID}.json", Navigate.req = $.ajax "//a.4cdn.org/#{boardID}/thread/#{threadID}.json",
onabort: load onabort: load
onloadend: load onloadend: load

View File

@ -394,7 +394,7 @@ Settings =
data = data =
isReply: true isReply: true
file: file:
URL: '//i.4cdn.org/g/src/1334437723720.jpg' URL: '//i.4cdn.org/g/1334437723720.jpg'
name: 'd9bb2efc98dd0df141a94399ff5880b7.jpg' name: 'd9bb2efc98dd0df141a94399ff5880b7.jpg'
size: '276 KB' size: '276 KB'
sizeInBytes: 276 * 1024 sizeInBytes: 276 * 1024

View File

@ -18,12 +18,12 @@
</span>#{" "} </span>#{" "}
<span class=dateTime data-utc=#{dateUTC}>#{date}</span>#{' '} <span class=dateTime data-utc=#{dateUTC}>#{date}</span>#{' '}
<span class='postNum'> <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='#{ <a href='#{
if g.VIEW is 'thread' and g.THREADID is +threadID then if g.VIEW is 'thread' and g.THREADID is +threadID then
"javascript:quote(#{postID})" "javascript:quote(#{postID})"
else else
"/#{boardID}/res/#{threadID}#q#{postID}" "/#{boardID}/thread/#{threadID}#q#{postID}"
}' title='Quote this post'>#{postID}</a> }' title='Quote this post'>#{postID}</a>
#{pageIcon + sticky + closed + replyLink} #{pageIcon + sticky + closed + replyLink}
</span> </span>

View File

@ -129,7 +129,7 @@ class Post
@file.thumbURL = if that.isArchived @file.thumbURL = if that.isArchived
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}/#{@file.URL.match(/(\d+)\./)[1]}s.jpg"
@file.isImage = /(jpg|png|gif)$/i.test @file.URL @file.isImage = /(jpg|png|gif)$/i.test @file.URL
@file.isVideo = /webm$/i.test @file.URL @file.isVideo = /webm$/i.test @file.URL
if @file.isImage or @file.isVideo if @file.isImage or @file.isVideo

View File

@ -207,7 +207,7 @@ Gallery =
return return
# XXX CORS for i.4cdn.org WHEN? # 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 return if @status isnt 200
i = 0 i = 0
{posts} = @response {posts} = @response

View File

@ -224,7 +224,7 @@ ImageExpand =
type: 'head' type: 'head'
<% } else { %> <% } else { %>
# XXX CORS for i.4cdn.org WHEN? # 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 return if @status isnt 200
for postObj in @response.posts for postObj in @response.posts
break if postObj.no is post.ID break if postObj.no is post.ID

View File

@ -70,7 +70,7 @@ ImageHover =
type: 'head' type: 'head'
<% } else { %> <% } else { %>
# XXX CORS for i.4cdn.org WHEN? # 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 return if @status isnt 200
for postObj in @response.posts for postObj in @response.posts
break if postObj.no is post.ID break if postObj.no is post.ID

View File

@ -52,7 +52,7 @@ ExpandComment =
for quote in $$ '.quotelink', clone for quote in $$ '.quotelink', clone
href = quote.getAttribute 'href' href = quote.getAttribute 'href'
continue if href[0] is '/' # Cross-board quote, or board link 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 post.nodes.shortComment = comment
$.replace comment, clone $.replace comment, clone
post.nodes.comment = post.nodes.longComment = clone post.nodes.comment = post.nodes.longComment = clone

View File

@ -48,7 +48,7 @@ ExpandThread =
expand: (thread, a, threadRoot) -> expand: (thread, a, threadRoot) ->
ExpandThread.statuses[thread] = status = {} ExpandThread.statuses[thread] = status = {}
a.textContent = ExpandThread.text '...', a.textContent.match(/\d+/g)... 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 delete status.req
ExpandThread.parse @, thread, a ExpandThread.parse @, thread, a
contract: (thread, a, threadRoot) -> contract: (thread, a, threadRoot) ->

View File

@ -48,19 +48,19 @@ InfiniScroll =
posts.push op posts.push op
replylink = $.el 'a', replylink = $.el 'a',
href: "res/#{threadID}" href: "thread/#{threadID}"
className: 'replylink' className: 'replylink'
textContent: 'Reply' textContent: 'Reply'
postlink = $.el 'div', postlink = $.el 'div',
className: "postLink mobile" 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 if omitted_posts
posts.push $.el 'span', posts.push $.el 'span',
className: 'summary desktop' className: 'summary desktop'
innerHTML: """ 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', $.prepend postlink, $.el 'span',

View File

@ -217,7 +217,7 @@ Keybinds =
open: (thread, tab) -> open: (thread, tab) ->
return if g.VIEW isnt 'index' return if g.VIEW isnt 'index'
url = "/#{thread.board}/res/#{thread}" url = "/#{thread.board}/thread/#{thread}"
if tab if tab
$.open url $.open url
else else

View File

@ -243,7 +243,7 @@ ThreadUpdater =
else else
ThreadUpdater.set 'timer', 'Update' ThreadUpdater.set 'timer', 'Update'
ThreadUpdater.req?.abort() 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, ThreadUpdater.req = $.ajax url, onloadend: ThreadUpdater.cb.load,
whenModified: true whenModified: true

View File

@ -123,7 +123,7 @@ ThreadWatcher =
return if data.isDead return if data.isDead
{fetchCount} = ThreadWatcher {fetchCount} = ThreadWatcher
fetchCount.fetching++ fetchCount.fetching++
$.ajax "//a.4cdn.org/#{boardID}/res/#{threadID}.json", $.ajax "//a.4cdn.org/#{boardID}/thread/#{threadID}.json",
onloadend: -> onloadend: ->
fetchCount.fetched++ fetchCount.fetched++
if fetchCount.fetched is fetchCount.fetching if fetchCount.fetched is fetchCount.fetching
@ -161,7 +161,7 @@ ThreadWatcher =
if data.isDead if data.isDead
href = Redirect.to 'thread', {boardID, threadID} href = Redirect.to 'thread', {boardID, threadID}
link = $.el 'a', link = $.el 'a',
href: href or "/#{boardID}/res/#{threadID}" href: href or "/#{boardID}/thread/#{threadID}"
textContent: data.excerpt textContent: data.excerpt
title: data.excerpt title: data.excerpt

View File

@ -795,9 +795,9 @@ QR =
QR.cooldown.set {req, post, isReply, threadID} QR.cooldown.set {req, post, isReply, threadID}
URL = if threadID is postID # new thread 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 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 URL
if Conf['Open Post in New Tab'] if Conf['Open Post in New Tab']
$.open URL $.open URL

View File

@ -26,7 +26,7 @@ QuoteBacklink =
return if @isClone or !@quotes.length 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} 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', a = $.el 'a',
href: "/#{@board}/res/#{@thread}#p#{@}" href: "/#{@board}/thread/#{@thread}#p#{@}"
className: if @isHidden then 'filtered backlink' else 'backlink' className: if @isHidden then 'filtered backlink' else 'backlink'
textContent: (QuoteBacklink.funk @ID) + (if markYours then '\u00A0(You)' else '') textContent: (QuoteBacklink.funk @ID) + (if markYours then '\u00A0(You)' else '')
for quote in @quotes for quote in @quotes

View File

@ -45,13 +45,13 @@ Quotify =
# Don't (Dead) when quotifying in an archived post, # Don't (Dead) when quotifying in an archived post,
# and we know the post still exists. # and we know the post still exists.
a = $.el 'a', a = $.el 'a',
href: "/#{boardID}/res/#{post.thread}#p#{postID}" href: "/#{boardID}/thread/#{post.thread}#p#{postID}"
className: 'quotelink' className: 'quotelink'
textContent: quote textContent: quote
else else
# Replace the .deadlink span if we can redirect. # Replace the .deadlink span if we can redirect.
a = $.el 'a', a = $.el 'a',
href: "/#{boardID}/res/#{post.thread}#p#{postID}" href: "/#{boardID}/thread/#{post.thread}#p#{postID}"
className: 'quotelink deadlink' className: 'quotelink deadlink'
target: '_blank' target: '_blank'
textContent: "#{quote}\u00A0(Dead)" textContent: "#{quote}\u00A0(Dead)"