change res -> thread in JSON API URLs

This commit is contained in:
ccd0 2014-04-13 01:46:18 -07:00
parent c5b06f6988
commit a452b732fd
8 changed files with 8 additions and 8 deletions

View File

@ -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,

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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) ->

View File

@ -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

View File

@ -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