From f38f0125d71ad635f2b0c6de0a3db6f3faf24561 Mon Sep 17 00:00:00 2001 From: C-xC-c Date: Wed, 18 Dec 2019 22:35:31 +0000 Subject: [PATCH] Remake the flag select form whenever you enter a thread. --- bantflags.meta.js | 2 +- bantflags.user.js | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/bantflags.meta.js b/bantflags.meta.js index 4e0c3c5..a5dc8d2 100644 --- a/bantflags.meta.js +++ b/bantflags.meta.js @@ -10,7 +10,7 @@ // @exclude http*://archive.nyafuu.org/bant/statistics/ // @exclude http*://archived.moe/bant/statistics/ // @exclude http*://thebarchive.com/bant/statistics/ -// @version 1.1.1 +// @version 1.1.2 // @grant GM_xmlhttpRequest // @grant GM_getValue // @grant GM_setValue diff --git a/bantflags.user.js b/bantflags.user.js index 9d4e1b8..b5adc81 100644 --- a/bantflags.user.js +++ b/bantflags.user.js @@ -11,7 +11,7 @@ // @exclude http*://archive.nyafuu.org/bant/statistics/ // @exclude http*://archived.moe/bant/statistics/ // @exclude http*://thebarchive.com/bant/statistics/ -// @version 1.1.1 +// @version 1.1.2 // @grant GM_xmlhttpRequest // @grant GM_getValue // @grant GM_setValue @@ -412,6 +412,7 @@ if (site.fourchan) { if (site.nineball) { nsetup.init(); + new MutationObserver(function (mutations) { mutations.forEach(function (mutation) { @@ -419,6 +420,7 @@ if (site.nineball) { if (mutation.target.nodeName === 'THREADS') { setTimeout(getposts('section[id], article[id]'), 2000); resolveRefFlags(); + nsetup.init(); } if (mutation.addedNodes[0].nodeName === 'HEADER') { // When you make a post let data = 'post_nr=' + encodeURIComponent(mutation.target.id) + '&board=' + encodeURIComponent(board_id) + '®ions=' + encodeURIComponent(regions) + '&version=' + encodeURIComponent(version); @@ -428,7 +430,7 @@ if (site.nineball) { data, function (resp) { postNrs.push(mutation.target.id); - setTimeout(resolveRefFlags, 0); + resolveRefFlags(); }); } if (mutation.addedNodes[0].nodeName === 'ARTICLE') { // When someone else makes a post