Always give integers for thread IDs.

This commit is contained in:
Mayhem 2013-06-25 20:50:11 +02:00
parent 51358e328a
commit 6213853f67
3 changed files with 3 additions and 4 deletions

View File

@ -185,7 +185,7 @@ Get =
# quotes # quotes
.replace /((&gt;){2}(&gt;\/[a-z\d]+\/)?\d+)/g, '<span class=deadlink>$1</span>' .replace /((&gt;){2}(&gt;\/[a-z\d]+\/)?\d+)/g, '<span class=deadlink>$1</span>'
threadID = data.thread_num threadID = +data.thread_num
o = o =
# id # id
postID: "#{postID}" postID: "#{postID}"

View File

@ -182,7 +182,7 @@ Main =
posts = [] posts = []
for threadRoot in $$ '.board > .thread', board for threadRoot in $$ '.board > .thread', board
thread = new Thread threadRoot.id[1..], g.BOARD thread = new Thread +threadRoot.id[1..], g.BOARD
threads.push thread threads.push thread
for postRoot in $$ '.thread > .postContainer', threadRoot for postRoot in $$ '.thread > .postContainer', threadRoot
try try

View File

@ -2,8 +2,7 @@ class Thread
callbacks: [] callbacks: []
toString: -> @ID toString: -> @ID
constructor: (ID, @board) -> constructor: (@ID, @board) ->
@ID = +ID
@fullID = "#{@board}.#{@ID}" @fullID = "#{@board}.#{@ID}"
@posts = {} @posts = {}