stuff
This commit is contained in:
parent
dab4ef7eb4
commit
12f0382339
File diff suppressed because one or more lines are too long
|
@ -475,8 +475,14 @@ var BDFDB = {myPlugins: BDFDB && BDFDB.myPlugins ? BDFDB.myPlugins : {}, BDv2Api
|
||||||
|
|
||||||
BDFDB.createTooltip = function (text, anker, options = {}) {
|
BDFDB.createTooltip = function (text, anker, options = {}) {
|
||||||
if (!text || !anker || !Node.prototype.isPrototypeOf(anker) || !document.contains(anker)) return null;
|
if (!text || !anker || !Node.prototype.isPrototypeOf(anker) || !document.contains(anker)) return null;
|
||||||
var tooltips = document.querySelector(BDFDB.dotCN.tooltips);
|
var tooltipsnative = document.querySelector(BDFDB.dotCN.tooltips);
|
||||||
if (!tooltips) return null;
|
if (!tooltipsnative) return null;
|
||||||
|
var tooltips = document.querySelector(".BDFDB-tooltips");
|
||||||
|
if (!tooltips) {
|
||||||
|
tooltips = tooltipsnative.cloneNode();
|
||||||
|
BDFDB.addClass(tooltips, "BDFDB-tooltips");
|
||||||
|
tooltipsnative.parentElement.insertBefore(tooltips, tooltipsnative.nextSibling);
|
||||||
|
}
|
||||||
var id = Math.round(Math.random() * 10000000000000000);
|
var id = Math.round(Math.random() * 10000000000000000);
|
||||||
var tooltip = BDFDB.htmlToElement(`<div class="${BDFDB.disCN.tooltip} BDFDB-tooltip tooltip-${id}"><div class="${BDFDB.disCN.tooltipinner}"></div></div>`);
|
var tooltip = BDFDB.htmlToElement(`<div class="${BDFDB.disCN.tooltip} BDFDB-tooltip tooltip-${id}"><div class="${BDFDB.disCN.tooltipinner}"></div></div>`);
|
||||||
tooltip.anker = anker;
|
tooltip.anker = anker;
|
||||||
|
@ -501,7 +507,10 @@ var BDFDB = {myPlugins: BDFDB && BDFDB.myPlugins ? BDFDB.myPlugins : {}, BDv2Api
|
||||||
|
|
||||||
BDFDB.updateTooltipPosition(tooltip);
|
BDFDB.updateTooltipPosition(tooltip);
|
||||||
|
|
||||||
var remove = () => {tooltip.remove();};
|
var remove = () => {
|
||||||
|
tooltip.remove();
|
||||||
|
if (!tooltips.firstElementChild) BDFDB.removeEles(tooltips);
|
||||||
|
};
|
||||||
var observer = new MutationObserver(changes => {
|
var observer = new MutationObserver(changes => {
|
||||||
changes.forEach(change => {
|
changes.forEach(change => {
|
||||||
var nodes = Array.from(change.removedNodes);
|
var nodes = Array.from(change.removedNodes);
|
||||||
|
@ -510,7 +519,7 @@ var BDFDB = {myPlugins: BDFDB && BDFDB.myPlugins ? BDFDB.myPlugins : {}, BDv2Api
|
||||||
var parentmatch = nodes.some(n => n.contains(anker));
|
var parentmatch = nodes.some(n => n.contains(anker));
|
||||||
if (tooltipmath || ownmatch || parentmatch) {
|
if (tooltipmath || ownmatch || parentmatch) {
|
||||||
observer.disconnect();
|
observer.disconnect();
|
||||||
tooltip.remove();
|
remove();
|
||||||
anker.removeEventListener('mouseleave', remove);
|
anker.removeEventListener('mouseleave', remove);
|
||||||
BDFDB.removeLocalStyle('BDFDBcustomTooltip' + id, tooltips);
|
BDFDB.removeLocalStyle('BDFDBcustomTooltip' + id, tooltips);
|
||||||
}
|
}
|
||||||
|
@ -4987,8 +4996,8 @@ var BDFDB = {myPlugins: BDFDB && BDFDB.myPlugins ? BDFDB.myPlugins : {}, BDv2Api
|
||||||
#pluginNotice #outdatedPlugins span:hover {
|
#pluginNotice #outdatedPlugins span:hover {
|
||||||
text-decoration: underline;
|
text-decoration: underline;
|
||||||
}
|
}
|
||||||
${BDFDB.dotCN.tooltipinner} {
|
.BDFDB-tooltips, .BDFDB-tooltip {
|
||||||
z-index: 100000000;
|
z-index: 3002;
|
||||||
}
|
}
|
||||||
${BDFDB.dotCN.tooltipinner}.tooltip-customcolor ${BDFDB.dotCN.tooltippointer} {
|
${BDFDB.dotCN.tooltipinner}.tooltip-customcolor ${BDFDB.dotCN.tooltippointer} {
|
||||||
border-top-color: inherit !important;
|
border-top-color: inherit !important;
|
||||||
|
|
|
@ -5,7 +5,7 @@ https://raw.githubusercontent.com/AltenGD/Altens-betterdiscord-Themes-Plugins/ma
|
||||||
https://raw.githubusercontent.com/AltenGD/Altens-betterdiscord-Themes-Plugins/master/Themes/MiniTheme.theme.css
|
https://raw.githubusercontent.com/AltenGD/Altens-betterdiscord-Themes-Plugins/master/Themes/MiniTheme.theme.css
|
||||||
https://raw.githubusercontent.com/archnemeziz/Discord/master/ElegantBlue.theme.css
|
https://raw.githubusercontent.com/archnemeziz/Discord/master/ElegantBlue.theme.css
|
||||||
https://raw.githubusercontent.com/Asteria5675/asteria5675.github.io/master/src/themes/Dusk_to_Dawn.theme.css
|
https://raw.githubusercontent.com/Asteria5675/asteria5675.github.io/master/src/themes/Dusk_to_Dawn.theme.css
|
||||||
https://raw.githubusercontent.com/Azagwen/Rainbow_kittens_theme/master/Rainbow_kittens_Vdev.theme.css
|
https://raw.githubusercontent.com/Azagwen/Rainbow_kittens_theme/master/Rainbow_kittens_2.0_online.theme.css
|
||||||
https://raw.githubusercontent.com/BeardDesign1/Ios-switches/themes/IOS_Switches.theme.css
|
https://raw.githubusercontent.com/BeardDesign1/Ios-switches/themes/IOS_Switches.theme.css
|
||||||
https://raw.githubusercontent.com/CapnKitten/Material-Discord/master/Material-Discord.theme.css
|
https://raw.githubusercontent.com/CapnKitten/Material-Discord/master/Material-Discord.theme.css
|
||||||
https://raw.githubusercontent.com/CAtOSe/Neon-Space-BetterDiscord-Theme/master/neon-space.theme.css
|
https://raw.githubusercontent.com/CAtOSe/Neon-Space-BetterDiscord-Theme/master/neon-space.theme.css
|
||||||
|
|
Loading…
Reference in New Issue