diff --git a/src/General/Main.coffee b/src/General/Main.coffee index 923e37469..e3244468c 100755 --- a/src/General/Main.coffee +++ b/src/General/Main.coffee @@ -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'), -> diff --git a/src/Posting/PostSuccessful.coffee b/src/Posting/PostSuccessful.coffee new file mode 100644 index 000000000..83f269061 --- /dev/null +++ b/src/Posting/PostSuccessful.coffee @@ -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