update mod tracker
This commit is contained in:
parent
d5b1e7cd94
commit
83743d0b15
|
@ -192,7 +192,7 @@ PleromaModTracker = function () {
|
|||
function handlePost (postElement) {
|
||||
if (
|
||||
postElement.querySelectorAll &&
|
||||
postElement.querySelectorAll(".attachments").length > 0
|
||||
postElement.querySelectorAll(".attachments .non-gallery").length > 0
|
||||
) {
|
||||
const attachments = this.getModuleAttachments(postElement);
|
||||
for (const attachment of attachments) {
|
||||
|
@ -226,6 +226,21 @@ PleromaModTracker = function () {
|
|||
this.toUpdate = [];
|
||||
},
|
||||
|
||||
function onDestroy () {
|
||||
const scripts = document.querySelectorAll("script");
|
||||
for (const script of scripts) {
|
||||
if (script.src && script.src.includes("pleroma-mod-tracker") && !script.src.endsWith("mod.js")) {
|
||||
script.remove();
|
||||
}
|
||||
}
|
||||
const stylesheets = document.querySelectorAll("link[rel=\"stylesheet\"]");
|
||||
for (const style of stylesheets) {
|
||||
if (style.href.endsWith("pleroma-mod-tracker/" + this.config.stylesheet)) {
|
||||
style.remove();
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
function run () {
|
||||
PleromaModLoader.includeModCss("pleroma-mod-tracker/" + this.config.stylesheet);
|
||||
PleromaModTracker.chars = {
|
||||
|
|
Loading…
Reference in New Issue