From 99a653f7f2f495c756580efe1bcf6a39477207e3 Mon Sep 17 00:00:00 2001 From: ccd0 Date: Thu, 6 Dec 2018 21:16:37 -0800 Subject: [PATCH] Record replies made via AJAX on Tinyboard as yours. --- src/Miscellaneous/Tinyboard.coffee | 14 ++++++++++++++ src/main/Main.coffee | 1 + 2 files changed, 15 insertions(+) create mode 100644 src/Miscellaneous/Tinyboard.coffee diff --git a/src/Miscellaneous/Tinyboard.coffee b/src/Miscellaneous/Tinyboard.coffee new file mode 100644 index 000000000..89969822a --- /dev/null +++ b/src/Miscellaneous/Tinyboard.coffee @@ -0,0 +1,14 @@ +Tinyboard = + init: -> + return unless Site.software is 'tinyboard' + if g.VIEW is 'thread' + Main.ready -> + $.global -> + {boardID, threadID} = document.currentScript.dataset + threadID = +threadID + window.$(document).on 'new_post', (e, post) -> + postID = +post.id.match(/\d*$/)[0] + detail = {boardID, threadID, postID} + event = new CustomEvent 'QRPostSuccessful', {bubbles: true, detail: detail} + document.dispatchEvent event + , {boardID: g.BOARD.ID, threadID: g.THREADID} diff --git a/src/main/Main.coffee b/src/main/Main.coffee index bf44197eb..47eda1404 100644 --- a/src/main/Main.coffee +++ b/src/main/Main.coffee @@ -478,6 +478,7 @@ Main = ['Disable Autoplay', AntiAutoplay] ['Announcement Hiding', PSAHiding] ['Fourchan thingies', Fourchan] + ['Tinyboard Glue', Tinyboard] ['Color User IDs', IDColor] ['Highlight by User ID', IDHighlight] ['Count Posts by ID', IDPostCount]