stuff
This commit is contained in:
parent
380e48bd42
commit
5f57e78ea0
|
@ -3,7 +3,7 @@
|
||||||
class ReadAllNotificationsButton {
|
class ReadAllNotificationsButton {
|
||||||
getName () {return "ReadAllNotificationsButton";}
|
getName () {return "ReadAllNotificationsButton";}
|
||||||
|
|
||||||
getVersion () {return "1.4.6";}
|
getVersion () {return "1.4.7";}
|
||||||
|
|
||||||
getAuthor () {return "DevilBro";}
|
getAuthor () {return "DevilBro";}
|
||||||
|
|
||||||
|
@ -11,7 +11,7 @@ class ReadAllNotificationsButton {
|
||||||
|
|
||||||
initConstructor () {
|
initConstructor () {
|
||||||
this.changelog = {
|
this.changelog = {
|
||||||
"fixed":[["New Classes","Fixed the plugin for the new class update"]]
|
"fixed":[["Button above home button","Fixed the issue where the read all button would sometimes appear above the home button"]]
|
||||||
};
|
};
|
||||||
|
|
||||||
this.patchModules = {
|
this.patchModules = {
|
||||||
|
@ -149,10 +149,10 @@ class ReadAllNotificationsButton {
|
||||||
|
|
||||||
processGuilds (instance, wrapper) {
|
processGuilds (instance, wrapper) {
|
||||||
BDFDB.removeEles(".RANbutton-frame");
|
BDFDB.removeEles(".RANbutton-frame");
|
||||||
let guildseparator = wrapper.querySelector(BDFDB.dotCN.guildseparator);
|
let insertnode = this.getInsertNode();
|
||||||
if (guildseparator) {
|
if (insertnode) {
|
||||||
let ranbutton = BDFDB.htmlToElement(this.RANbuttonMarkup);
|
let ranbutton = BDFDB.htmlToElement(this.RANbuttonMarkup);
|
||||||
guildseparator.parentElement.parentElement.insertBefore(ranbutton, guildseparator.parentElement);
|
insertnode.parentElement.insertBefore(ranbutton, insertnode);
|
||||||
ranbutton.addEventListener("click", () => {
|
ranbutton.addEventListener("click", () => {
|
||||||
let settings = BDFDB.getAllData(this, "settings");
|
let settings = BDFDB.getAllData(this, "settings");
|
||||||
if (settings.includeGuilds) BDFDB.markGuildAsRead(settings.includeMuted ? BDFDB.readServerList() : BDFDB.readUnreadServerList());
|
if (settings.includeGuilds) BDFDB.markGuildAsRead(settings.includeMuted ? BDFDB.readServerList() : BDFDB.readUnreadServerList());
|
||||||
|
@ -180,8 +180,8 @@ class ReadAllNotificationsButton {
|
||||||
|
|
||||||
processDirectMessage (instance, wrapper, methodnames) {
|
processDirectMessage (instance, wrapper, methodnames) {
|
||||||
let ranbutton = document.querySelector(".RANbutton-frame");
|
let ranbutton = document.querySelector(".RANbutton-frame");
|
||||||
let guildseparator = wrapper.parentElement.parentElement.querySelector(BDFDB.dotCN.guildseparator);
|
let insertnode = this.getInsertNode();
|
||||||
if (ranbutton && guildseparator) guildseparator.parentElement.parentElement.insertBefore(ranbutton, guildseparator.parentElement);
|
if (ranbutton && insertnode) insertnode.parentElement.insertBefore(ranbutton, insertnode);
|
||||||
}
|
}
|
||||||
|
|
||||||
processRecentMentions (instance, wrapper) {
|
processRecentMentions (instance, wrapper) {
|
||||||
|
@ -206,6 +206,16 @@ class ReadAllNotificationsButton {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
getInsertNode () {
|
||||||
|
let homebutton = BDFDB.getParentEle(BDFDB.dotCN.guildouter, document.querySelector(BDFDB.dotCN.homebuttonicon));
|
||||||
|
let nextsibling = homebutton.nextElementSibling, insertnode = null;
|
||||||
|
while (nextsibling && insertnode == null) {
|
||||||
|
if (nextsibling.querySelector(`${BDFDB.dotCN.guildseparator}:not(.folderseparator)`)) insertnode = nextsibling;
|
||||||
|
nextsibling = nextsibling.nextElementSibling
|
||||||
|
}
|
||||||
|
return insertnode;
|
||||||
|
}
|
||||||
|
|
||||||
setLabelsByLanguage () {
|
setLabelsByLanguage () {
|
||||||
switch (BDFDB.getDiscordLanguage().id) {
|
switch (BDFDB.getDiscordLanguage().id) {
|
||||||
case "hr": //croatian
|
case "hr": //croatian
|
||||||
|
|
|
@ -740,7 +740,7 @@ img[src="/assets/bfffd518c76d3f6bc5e96eb52e4ae2cf.svg"],
|
||||||
.searchFilter-2ESiM3,
|
.searchFilter-2ESiM3,
|
||||||
.searchAnswer-3Dz2-q,
|
.searchAnswer-3Dz2-q,
|
||||||
.progressBar-3u8FBM,
|
.progressBar-3u8FBM,
|
||||||
.aka-1mqp34,
|
.akaBadge-1M-1Gw,
|
||||||
.item-26Dhrx[style*="background-color: rgb(114, 137, 218)"],
|
.item-26Dhrx[style*="background-color: rgb(114, 137, 218)"],
|
||||||
.valueChecked-m-4IJZ:not([style*="background-color: rgba(255, 255, 255, 0.3)"]),
|
.valueChecked-m-4IJZ:not([style*="background-color: rgba(255, 255, 255, 0.3)"]),
|
||||||
.channel-2QD9_O.selected-1HYmZZ a,
|
.channel-2QD9_O.selected-1HYmZZ a,
|
||||||
|
|
Loading…
Reference in New Issue