Fix posts from original post form not being marked as yours.

This commit is contained in:
ccd0 2015-04-01 17:07:37 -07:00
parent ed0edd760a
commit 27ae66feea
2 changed files with 20 additions and 4 deletions

View File

@ -14,10 +14,8 @@ Main =
switch pathname[2]
when 'res', 'thread'
'thread'
when 'catalog'
'catalog'
when 'archive'
'archive'
when 'catalog', 'archive', 'post'
pathname[2]
else
'index'
return if g.VIEW is 'catalog' and g.BOARD.ID is 'f'
@ -56,6 +54,7 @@ Main =
when 'a.4cdn.org'
return
when 'sys.4chan.org'
PostSuccessful.init() if g.VIEW is 'post'
return
when 'i.4cdn.org'
$.asap (-> d.readyState isnt 'loading'), ->

View File

@ -0,0 +1,17 @@
PostSuccessful =
init: ->
$.ready @ready
ready: ->
return unless d.title is 'Post successful!'
[_, threadID, postID] = $('h1').nextSibling.textContent.match /thread:(\d+),no:(\d+)/
postID = +postID
threadID = +threadID or postID
db = new DataBoard 'yourPosts'
db.set
boardID: g.BOARD.ID
threadID: threadID
postID: postID
val: true