change res -> thread in JSON API URLs
This commit is contained in:
parent
c5b06f6988
commit
a452b732fd
@ -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,
|
||||||
|
|||||||
@ -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
|
||||||
|
|
||||||
|
|||||||
@ -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
|
||||||
|
|||||||
@ -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
|
||||||
|
|||||||
@ -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
|
||||||
|
|||||||
@ -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) ->
|
||||||
|
|||||||
@ -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
|
||||||
|
|
||||||
|
|||||||
@ -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
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user