This commit is contained in:
Mirco Wittrien 2021-01-12 19:09:01 +01:00
parent 89d13dc396
commit 9dfd7bbb00
6 changed files with 75 additions and 51 deletions

View File

@ -627,13 +627,16 @@ module.exports = (_ => {
updateNotice = BDFDB.NotificationUtils.notice(`${BDFDB.LanguageUtils.LibraryStrings.update_notice_update}&nbsp;&nbsp;&nbsp;&nbsp;<strong id="outdatedPlugins"></strong>`, {
id: "pluginNotice",
type: "info",
textClassName: BDFDB.disCN.noticeupdatetext,
html: true,
btn: !BDFDB.BDUtils.getSettings(BDFDB.BDUtils.settingsIds.automaticLoading) ? BDFDB.LanguageUtils.LanguageStrings.ERRORS_RELOAD : "",
customicon: `<svg height="100%" style="fill-rule: evenodd;clip-rule: evenodd;stroke-linecap: round;stroke-linejoin: round;" xmlns: xlink="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2000/svg" xml: space="preserve" width="100%" version="1.1" viewBox="0 0 2000 2000"><metadata /><defs><filter id="shadow1"><feDropShadow dx="20" dy="0" stdDeviation="20" flood-color="rgba(0,0,0,0.35)"/></filter><filter id="shadow2"><feDropShadow dx="15" dy="0" stdDeviation="20" flood-color="rgba(255,255,255,0.15)"/></filter><filter id="shadow3"><feDropShadow dx="10" dy="0" stdDeviation="20" flood-color="rgba(0,0,0,0.35)"/></filter></defs><g><path style="filter: url(#shadow3)" d="M1195.44+135.442L1195.44+135.442L997.6+136.442C1024.2+149.742+1170.34+163.542+1193.64+179.742C1264.34+228.842+1319.74+291.242+1358.24+365.042C1398.14+441.642+1419.74+530.642+1422.54+629.642L1422.54+630.842L1422.54+632.042C1422.54+773.142+1422.54+1228.14+1422.54+1369.14L1422.54+1370.34L1422.54+1371.54C1419.84+1470.54+1398.24+1559.54+1358.24+1636.14C1319.74+1709.94+1264.44+1772.34+1193.64+1821.44C1171.04+1837.14+1025.7+1850.54+1000+1863.54L1193.54+1864.54C1539.74+1866.44+1864.54+1693.34+1864.54+1296.64L1864.54+716.942C1866.44+312.442+1541.64+135.442+1195.44+135.442Z" fill="#171717" opacity="1"/><path style="filter: url(#shadow2)" d="M1695.54+631.442C1685.84+278.042+1409.34+135.442+1052.94+135.442L361.74+136.442L803.74+490.442L1060.74+490.442C1335.24+490.442+1335.24+835.342+1060.74+835.342L1060.74+1164.84C1150.22+1164.84+1210.53+1201.48+1241.68+1250.87C1306.07+1353+1245.76+1509.64+1060.74+1509.64L361.74+1863.54L1052.94+1864.54C1409.24+1864.54+1685.74+1721.94+1695.54+1368.54C1695.54+1205.94+1651.04+1084.44+1572.64+999.942C1651.04+915.542+1695.54+794.042+1695.54+631.442Z" fill="#3E82E5" opacity="1"/><path style="filter: url(#shadow1)" d="M1469.25+631.442C1459.55+278.042+1183.05+135.442+826.65+135.442L135.45+135.442L135.45+1004C135.45+1004+135.427+1255.21+355.626+1255.21C575.825+1255.21+575.848+1004+575.848+1004L577.45+490.442L834.45+490.442C1108.95+490.442+1108.95+835.342+834.45+835.342L664.65+835.342L664.65+1164.84L834.45+1164.84C923.932+1164.84+984.244+1201.48+1015.39+1250.87C1079.78+1353+1019.47+1509.64+834.45+1509.64L135.45+1509.64L135.45+1864.54L826.65+1864.54C1182.95+1864.54+1459.45+1721.94+1469.25+1368.54C1469.25+1205.94+1424.75+1084.44+1346.35+999.942C1424.75+915.542+1469.25+794.042+1469.25+631.442Z" fill="#FFFFFF" opacity="1"/></g></svg>`,
forceStyle: true,
customIcon: `<svg height="100%" style="fill-rule: evenodd;clip-rule: evenodd;stroke-linecap: round;stroke-linejoin: round;" xmlns: xlink="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2000/svg" xml: space="preserve" width="100%" version="1.1" viewBox="0 0 2000 2000"><metadata /><defs><filter id="shadow1"><feDropShadow dx="20" dy="0" stdDeviation="20" flood-color="rgba(0,0,0,0.35)"/></filter><filter id="shadow2"><feDropShadow dx="15" dy="0" stdDeviation="20" flood-color="rgba(255,255,255,0.15)"/></filter><filter id="shadow3"><feDropShadow dx="10" dy="0" stdDeviation="20" flood-color="rgba(0,0,0,0.35)"/></filter></defs><g><path fill="#171717" filter="url(#shadow3)" d="M 1195.44+135.442 L 1195.44+135.442 L 997.6+136.442 C 1024.2+149.742+1170.34+163.542+1193.64+179.742 C 1264.34+228.842+1319.74+291.242+1358.24+365.042 C 1398.14+441.642+1419.74+530.642+1422.54+629.642 L 1422.54+630.842 L 1422.54+632.042 C 1422.54+773.142+1422.54+1228.14+1422.54+1369.14 L 1422.54+1370.34 L 1422.54+1371.54 C 1419.84+1470.54+1398.24+1559.54+1358.24+1636.14 C 1319.74+1709.94+1264.44+1772.34+1193.64+1821.44 C 1171.04+1837.14+1025.7+1850.54+1000+1863.54 L 1193.54+1864.54 C 1539.74+1866.44+1864.54+1693.34+1864.54+1296.64 L 1864.54+716.942 C 1866.44+312.442+1541.64+135.442+1195.44+135.442 Z"/><path fill="#3E82E5" filter="url(#shadow2)" d="M 1695.54+631.442 C 1685.84+278.042+1409.34+135.442+1052.94+135.442 L 361.74+136.442 L 803.74+490.442 L 1060.74+490.442 C 1335.24+490.442+1335.24+835.342+1060.74+835.342 L 1060.74+1164.84 C 1150.22+1164.84+1210.53+1201.48+1241.68+1250.87 C 1306.07+1353+1245.76+1509.64+1060.74+1509.64 L 361.74+1863.54 L 1052.94+1864.54 C 1409.24+1864.54+1685.74+1721.94+1695.54+1368.54 C 1695.54+1205.94+1651.04+1084.44+1572.64+999.942 C 1651.04+915.542+1695.54+794.042+1695.54+631.442 Z"/><path fill="#FFFFFF" filter="url(#shadow1)" d="M 1469.25+631.442 C 1459.55+278.042+1183.05+135.442+826.65+135.442 L 135.45+135.442 L 135.45+1004 C 135.45+1004+135.427+1255.21+355.626+1255.21 C 575.825+1255.21+575.848+1004+575.848+1004 L 577.45+490.442 L 834.45+490.442 C 1108.95+490.442+1108.95+835.342+834.45+835.342 L 664.65+835.342 L 664.65+1164.84 L 834.45+1164.84 C 923.932+1164.84+984.244+1201.48+1015.39+1250.87 C 1079.78+1353+1019.47+1509.64+834.45+1509.64 L 135.45+1509.64 L 135.45+1864.54 L 826.65+1864.54 C 1182.95+1864.54+1459.45+1721.94+1469.25+1368.54 C 1469.25+1205.94+1424.75+1084.44+1346.35+999.942 C 1424.75+915.542+1469.25+794.042+1469.25+631.442 Z"/></g></svg>`,
onClose: _ => {vanishObserver.disconnect();}
});
updateNotice.style.setProperty("z-index", "100000", "important");
updateNotice.style.setProperty("display", "block", "important");
updateNotice.style.setProperty("position", "relative", "important");
updateNotice.style.setProperty("visibility", "visible", "important");
updateNotice.style.setProperty("opacity", "1", "important");
let reloadButton = updateNotice.querySelector(BDFDB.dotCN.noticebutton);
@ -643,7 +646,11 @@ module.exports = (_ => {
LibraryRequires.electron.remote.getCurrentWindow().reload();
});
reloadButton.addEventListener("mouseenter", _ => {
if (window.PluginUpdates.downloaded) BDFDB.TooltipUtils.create(reloadButton, window.PluginUpdates.downloaded.join(", "), {type: "bottom", selector: "update-notice-tooltip", style: "max-width: 420px"});
if (window.PluginUpdates.downloaded) BDFDB.TooltipUtils.create(reloadButton, window.PluginUpdates.downloaded.join(", "), {
type: "bottom",
className: "update-notice-tooltip",
style: "max-width: 420px"
});
});
}
}
@ -686,7 +693,7 @@ module.exports = (_ => {
if (!updateNoticeList.querySelector("span")) {
let reloadButton = updateNotice.querySelector(BDFDB.dotCN.noticebutton);
if (reloadButton) {
updateNotice.querySelector(".notice-message").innerText = BDFDB.LanguageUtils.LibraryStrings.update_notice_reload;
updateNotice.querySelector(BDFDB.dotCN.noticeupdatetext).innerText = BDFDB.LanguageUtils.LibraryStrings.update_notice_reload;
BDFDB.DOMUtils.toggle(reloadButton, false);
}
else updateNotice.querySelector(BDFDB.dotCN.noticedismiss).click();
@ -1098,7 +1105,7 @@ module.exports = (_ => {
toasts = BDFDB.DOMUtils.create(`<div class="${BDFDB.disCN.toasts} bd-toasts" style="width: ${width}px; left: ${left}px; bottom: ${bottom}px;"></div>`);
(document.querySelector(BDFDB.dotCN.app) || document.body).appendChild(toasts);
}
const {type = "", icon = true, timeout = 3000, html = false, selector = "", noPointer = false, color = ""} = options;
const {type = "", icon = true, timeout = 3000, html = false, className = "", noPointer = false, color = ""} = options;
let toast = BDFDB.DOMUtils.create(`<div class="${BDFDB.disCN.toast} bd-toast">${html === true ? text : BDFDB.StringUtils.htmlEscape(text)}</div>`);
if (type) {
BDFDB.DOMUtils.addClass(toast, "toast-" + type);
@ -1111,7 +1118,7 @@ module.exports = (_ => {
BDFDB.DOMUtils.addClass(toast, BDFDB.disCN.toastcustom);
}
}
BDFDB.DOMUtils.addClass(toast, selector);
BDFDB.DOMUtils.addClass(toast, className);
toasts.appendChild(toast);
toast.close = _ => {
if (document.contains(toast)) {
@ -1171,30 +1178,31 @@ module.exports = (_ => {
let layers = document.querySelector(BDFDB.dotCN.layers) || document.querySelector(BDFDB.dotCN.appmount);
if (!layers) return;
let id = BDFDB.NumberUtils.generateId(NotificationBars);
let notice = BDFDB.DOMUtils.create(`<div class="${BDFDB.disCNS.notice + BDFDB.disCN.noticewrapper}" notice-id="${id}"><div class="${BDFDB.disCN.noticedismiss}" style="width: 36px !important; height: 36px !important; position: absolute !important; top: 0 !important; right: 0 !important; left: unset !important;"></div><span class="notice-message"></span></div>`);
let notice = BDFDB.DOMUtils.create(`<div class="${BDFDB.disCNS.notice + BDFDB.disCN.noticewrapper}" notice-id="${id}"><div class="${BDFDB.disCN.noticedismiss}"${options.forceStyle ? ` style="width: 36px !important; height: 36px !important; position: absolute !important; top: 0 !important; right: 0 !important; left: unset !important;"` : ""}></div><span class="${BDFDB.disCN.noticetext}"></span></div>`);
layers.parentElement.insertBefore(notice, layers);
let noticeMessage = notice.querySelector(".notice-message");
let noticeText = notice.querySelector(BDFDB.dotCN.noticetext);
if (options.platform) for (let platform of options.platform.split(" ")) if (DiscordClasses["noticeicon" + platform]) {
let icon = BDFDB.DOMUtils.create(`<i class="${BDFDB.disCN["noticeicon" + platform]}"></i>`);
BDFDB.DOMUtils.addClass(icon, BDFDB.disCN.noticeplatformicon);
BDFDB.DOMUtils.removeClass(icon, BDFDB.disCN.noticeicon);
notice.insertBefore(icon, noticeMessage);
notice.insertBefore(icon, noticeText);
}
if (options.customicon) {
let iconinner = BDFDB.DOMUtils.create(options.customicon)
if (options.customIcon) {
let iconInner = BDFDB.DOMUtils.create(options.customIcon)
let icon = BDFDB.DOMUtils.create(`<i></i>`);
if (iconinner.tagName == "span" && !iconinner.firstElementChild) icon.style.setProperty("background", `url(${options.customicon}) center/cover no-repeat`);
else icon.appendChild(iconinner);
if (iconInner.tagName == "span" && !iconinner.firstElementChild) icon.style.setProperty("background", `url(${options.customIcon}) center/cover no-repeat`);
else icon.appendChild(iconInner);
BDFDB.DOMUtils.addClass(icon, BDFDB.disCN.noticeplatformicon);
BDFDB.DOMUtils.removeClass(icon, BDFDB.disCN.noticeicon);
notice.insertBefore(icon, noticeMessage);
notice.insertBefore(icon, noticeText);
}
if (options.btn || options.button) notice.appendChild(BDFDB.DOMUtils.create(`<button class="${BDFDB.disCN.noticebutton}">${options.btn || options.button}</button>`));
if (options.id) notice.id = options.id.split(" ").join("");
if (options.selector) BDFDB.DOMUtils.addClass(notice, options.selector);
if (options.className) BDFDB.DOMUtils.addClass(notice, options.className);
if (options.textClassName) BDFDB.DOMUtils.addClass(noticeText, options.textClassName);
if (options.css) BDFDB.DOMUtils.appendLocalStyle("BDFDBcustomNotificationBar" + id, options.css);
if (options.style) notice.style = options.style;
if (options.html === true) noticeMessage.innerHTML = text;
if (options.html === true) noticeText.innerHTML = text;
else {
let link = document.createElement("a");
let newText = [];
@ -1203,7 +1211,7 @@ module.exports = (_ => {
link.href = word;
newText.push(link.host && link.host !== window.location.host ? `<label class="${BDFDB.disCN.noticetextlink}">${encodedWord}</label>` : encodedWord);
}
noticeMessage.innerHTML = newText.join(" ");
noticeText.innerHTML = newText.join(" ");
}
let type = null;
if (options.type && !document.querySelector(BDFDB.dotCNS.chatbase + BDFDB.dotCN.noticestreamer)) {
@ -1211,31 +1219,34 @@ module.exports = (_ => {
if (options.type == "premium") {
let noticeButton = notice.querySelector(BDFDB.dotCN.noticebutton);
if (noticeButton) BDFDB.DOMUtils.addClass(noticeButton, BDFDB.disCN.noticepremiumaction);
BDFDB.DOMUtils.addClass(noticeMessage, BDFDB.disCN.noticepremiumtext);
notice.insertBefore(BDFDB.DOMUtils.create(`<i class="${BDFDB.disCN.noticepremiumlogo}"></i>`), noticeMessage);
BDFDB.DOMUtils.addClass(noticeText, BDFDB.disCN.noticepremiumtext);
notice.insertBefore(BDFDB.DOMUtils.create(`<i class="${BDFDB.disCN.noticepremiumlogo}"></i>`), noticeText);
}
}
if (!type) {
let comp = BDFDB.ColorUtils.convert(options.color, "RGBCOMP");
if (comp) {
let fontColor = comp[0] > 180 && comp[1] > 180 && comp[2] > 180 ? "#000" : "#FFF";
let backgroundcolor = BDFDB.ColorUtils.convert(comp, "HEX");
let backgroundColor = BDFDB.ColorUtils.convert(comp, "HEX");
let filter = comp[0] > 180 && comp[1] > 180 && comp[2] > 180 ? "brightness(0%)" : "brightness(100%)";
BDFDB.DOMUtils.appendLocalStyle("BDFDBcustomNotificationBarColorCorrection" + id, `${BDFDB.dotCN.noticewrapper}[notice-id="${id}"]{background-color: ${backgroundcolor} !important;}${BDFDB.dotCN.noticewrapper}[notice-id="${id}"] .notice-message {color: ${fontColor} !important;}${BDFDB.dotCN.noticewrapper}[notice-id="${id}"] ${BDFDB.dotCN.noticebutton} {color: ${fontColor} !important;border-color: ${BDFDB.ColorUtils.setAlpha(fontColor, 0.25, "RGBA")} !important;}${BDFDB.dotCN.noticewrapper}[notice-id="${id}"] ${BDFDB.dotCN.noticebutton}:hover {color: ${backgroundcolor} !important;background-color: ${fontColor} !important;}${BDFDB.dotCN.noticewrapper}[notice-id="${id}"] ${BDFDB.dotCN.noticedismiss} {filter: ${filter} !important;}`);
BDFDB.DOMUtils.appendLocalStyle("BDFDBcustomNotificationBarColorCorrection" + id, `${BDFDB.dotCN.noticewrapper}[notice-id="${id}"]{background-color: ${backgroundColor} !important;}${BDFDB.dotCN.noticewrapper}[notice-id="${id}"] ${BDFDB.dotCN.noticetext} {color: ${fontColor} !important;}${BDFDB.dotCN.noticewrapper}[notice-id="${id}"] ${BDFDB.dotCN.noticebutton} {color: ${fontColor} !important;border-color: ${BDFDB.ColorUtils.setAlpha(fontColor, 0.25, "RGBA")} !important;}${BDFDB.dotCN.noticewrapper}[notice-id="${id}"] ${BDFDB.dotCN.noticebutton}:hover {color: ${backgroundColor} !important;background-color: ${fontColor} !important;}${BDFDB.dotCN.noticewrapper}[notice-id="${id}"] ${BDFDB.dotCN.noticedismiss} {filter: ${filter} !important;}`);
BDFDB.DOMUtils.addClass(notice, BDFDB.disCN.noticecustom);
}
else BDFDB.DOMUtils.addClass(notice, BDFDB.disCN.noticedefault);
}
notice.style.setProperty("height", "36px", "important");
notice.style.setProperty("min-width", "70vw", "important");
notice.style.setProperty("left", "unset", "important");
notice.style.setProperty("right", "unset", "important");
let sideMargin = ((BDFDB.DOMUtils.getWidth(document.body.firstElementChild) - BDFDB.DOMUtils.getWidth(notice))/2);
notice.style.setProperty("left", `${sideMargin}px`, "important");
notice.style.setProperty("right", `${sideMargin}px`, "important");
notice.style.setProperty("min-width", "unset", "important");
notice.style.setProperty("width", "unset", "important");
notice.style.setProperty("max-width", `calc(100vw - ${sideMargin*2}px)`, "important");
if (options.forceStyle) {
notice.style.setProperty("display", "block", "important");
notice.style.setProperty("height", "36px", "important");
notice.style.setProperty("min-width", "70vw", "important");
notice.style.setProperty("left", "unset", "important");
notice.style.setProperty("right", "unset", "important");
let sideMargin = ((BDFDB.DOMUtils.getWidth(document.body.firstElementChild) - BDFDB.DOMUtils.getWidth(notice))/2);
notice.style.setProperty("left", `${sideMargin}px`, "important");
notice.style.setProperty("right", `${sideMargin}px`, "important");
notice.style.setProperty("min-width", "unset", "important");
notice.style.setProperty("width", "unset", "important");
notice.style.setProperty("max-width", `calc(100vw - ${sideMargin*2}px)`, "important");
}
notice.querySelector(BDFDB.dotCN.noticedismiss).addEventListener("click", _ => {
notice.style.setProperty("overflow", "hidden", "important");
notice.style.setProperty("height", "0px", "important");
@ -1280,7 +1291,7 @@ module.exports = (_ => {
if (typeof options.type != "string" || !BDFDB.disCN["tooltip" + options.type.toLowerCase()]) options.type = "top";
let type = options.type.toLowerCase();
BDFDB.DOMUtils.addClass(tooltip, BDFDB.disCN["tooltip" + type], options.className, options.selector);
BDFDB.DOMUtils.addClass(tooltip, BDFDB.disCN["tooltip" + type], options.className);
let fontColorIsGradient = false, customBackgroundColor = false, style = "";
if (options.style) style += options.style;

View File

@ -585,6 +585,8 @@
"multiInputFirst": "multiInputFirst-5rMj_O",
"multiInputLast": "multiInputLast-HWxgTr",
"multiInputWrapper": "multiInputWrapper-g6Srtv",
"noticeText": "text-kRs522",
"noticeUpdateText": "notice-message",
"noticeWrapper": "noticeWrapper-8z511t",
"searchBarWrapper": "searchBarWrapper-1GpKvB",
"selectWrapper": "selectWrapper-yPjeij",
@ -2327,7 +2329,9 @@
"noticespotify": ["Notice", "colorSpotify"],
"noticestreamer": ["Notice", "colorStreamerMode"],
"noticesuccess": ["Notice", "colorSuccess"],
"noticetext": ["BDFDB", "noticeText"],
"noticetextlink": ["NoticePlatform", "textLink"],
"noticeupdatetext": ["BDFDB", "noticeUpdateText"],
"noticewrapper": ["BDFDB", "noticeWrapper"],
"overflowellipsis": ["BDFDB", "overflowEllipsis"],
"pagination": ["BDFDB", "pagination"],

View File

@ -715,7 +715,13 @@ module.exports = (_ => {
BDFDB.NotificationUtils.desktop(desktopString, {icon: avatar, timeout: desktopTime, click: openChannel, silent: notificationsound.mute, sound: notificationsound.song});
}
else if (!document.querySelector(`.friendnotifications-${id}-toast`)) {
let toast = BDFDB.NotificationUtils.toast(`<div class="${BDFDB.disCN.toastinner}"><div class="${BDFDB.disCN.toastavatar}" style="background-image: url(${avatar});"></div><div>${toastString}</div></div>`, {html: true, timeout: toastTime, color: BDFDB.UserUtils.getStatusColor(status.statusName), icon: false, selector: `friendnotifications-${status.statusName}-toast friendnotifications-${id}-toast`});
let toast = BDFDB.NotificationUtils.toast(`<div class="${BDFDB.disCN.toastinner}"><div class="${BDFDB.disCN.toastavatar}" style="background-image: url(${avatar});"></div><div>${toastString}</div></div>`, {
className: `friendnotifications-${status.statusName}-toast friendnotifications-${id}-toast`,
html: true,
timeout: toastTime,
color: BDFDB.UserUtils.getStatusColor(status.statusName),
icon: false
});
toast.addEventListener("click", openChannel);
let notificationsound = notificationSounds["toast" + status.statusName] || {};
if (!notificationsound.mute && notificationsound.song) {

View File

@ -249,7 +249,10 @@ module.exports = (_ => {
let item = BDFDB.DOMUtils.getParent(BDFDB.dotCN.menuitem, event.target);
if (item) {
let createTooltip = _ => {
BDFDB.TooltipUtils.create(item, `From ${foundInput.name}:\n${text}\n\nTo ${foundOutput.name}:\n${foundTranslation}`, {type: "right", selector: "googletranslate-tooltip"});
BDFDB.TooltipUtils.create(item, `From ${foundInput.name}:\n${text}\n\nTo ${foundOutput.name}:\n${foundTranslation}`, {
type: "right",
className: "googletranslate-tooltip"
});
};
if (foundTranslation && foundInput && foundOutput) {
if (document.querySelector(".googletranslate-tooltip")) {

View File

@ -727,9 +727,9 @@ module.exports = (_ => {
loadingIcon.addEventListener("mouseenter", _ => {
BDFDB.TooltipUtils.create(loadingIcon, this.getLoadingTooltipText(), {
type: "left",
className: "pluginrepo-loadingtooltip",
delay: 500,
style: "max-width: unset;",
selector: "pluginrepo-loading-tooltip"
style: "max-width: unset;"
});
});
BDFDB.PluginUtils.addLoadingIcon(loadingIcon);
@ -757,9 +757,9 @@ module.exports = (_ => {
if (oldBarButton) oldBarButton.click();
let bar = BDFDB.NotificationUtils.notice(`${outdated} of your Plugins ${outdated == 1 ? "is" : "are"} outdated. Check: `, {
type: "danger",
className: "pluginrepo-notice pluginrepo-outdate-notice",
btn: "PluginRepo",
selector: "pluginrepo-notice pluginrepo-outdate-notice",
customicon: pluginRepoIcon.replace(/COLOR_1/gi, "#fff").replace(/COLOR_2/gi, "#b9bbbe")
customIcon: pluginRepoIcon.replace(/COLOR_1/gi, "#fff").replace(/COLOR_2/gi, "#b9bbbe")
});
bar.querySelector(BDFDB.dotCN.noticebutton).addEventListener("click", _ => {
showOnlyOutdated = true;
@ -774,9 +774,9 @@ module.exports = (_ => {
let single = newEntries == 1;
let bar = BDFDB.NotificationUtils.notice(`There ${single ? "is" : "are"} ${newEntries} new Plugin${single ? "" : "s"} in the Repo. Check: `, {
type: "success",
className: "pluginrepo-notice pluginrepo-newentries-notice",
btn: "PluginRepo",
selector: "pluginrepo-notice pluginrepo-newentries-notice",
customicon: pluginRepoIcon.replace(/COLOR_1/gi, "#fff").replace(/COLOR_2/gi, "#b9bbbe")
customIcon: pluginRepoIcon.replace(/COLOR_1/gi, "#fff").replace(/COLOR_2/gi, "#b9bbbe")
});
bar.querySelector(BDFDB.dotCN.noticebutton).addEventListener("click", _ => {
forcedSort = "NEW";
@ -792,9 +792,9 @@ module.exports = (_ => {
if (wrongUrls.length) {
let bar = BDFDB.NotificationUtils.notice(`PluginRepo: ${wrongUrls.length} Plugin${wrongUrls.length > 1 ? "s" : ""} could not be loaded.`, {
type: "danger",
className: "pluginrepo-notice pluginrepo-fail-notice",
btn: "List",
selector: "pluginrepo-notice pluginrepo-fail-notice",
customicon: pluginRepoIcon.replace(/COLOR_1/gi, "#fff").replace(/COLOR_2/gi, "#b9bbbe")
customIcon: pluginRepoIcon.replace(/COLOR_1/gi, "#fff").replace(/COLOR_2/gi, "#b9bbbe")
});
bar.querySelector(BDFDB.dotCN.noticebutton).addEventListener("click", e => {
let toast = BDFDB.NotificationUtils.toast(wrongUrls.join("\n"), {type: "error"});
@ -892,7 +892,7 @@ module.exports = (_ => {
}
i++;
let loadingTooltip = document.querySelector(".pluginrepo-loading-tooltip");
let loadingTooltip = document.querySelector(".pluginrepo-loadingtooltip");
if (loadingTooltip) loadingTooltip.update(this.getLoadingTooltipText());
getPluginInfo(callback);

View File

@ -1042,9 +1042,9 @@ module.exports = (_ => {
loadingIcon.addEventListener("mouseenter", _ => {
BDFDB.TooltipUtils.create(loadingIcon, this.getLoadingTooltipText(), {
type: "left",
className: "themerepo-loadingtooltip",
delay: 500,
style: "max-width: unset;",
selector: "themerepo-loading-tooltip"
style: "max-width: unset;"
});
});
BDFDB.PluginUtils.addLoadingIcon(loadingIcon);
@ -1066,9 +1066,9 @@ module.exports = (_ => {
if (oldBarButton) oldBarButton.click();
let bar = BDFDB.NotificationUtils.notice(`${outdated} of your Themes ${outdated == 1 ? "is" : "are"} outdated. Check: `, {
type: "danger",
className: "themerepo-notice themerepo-outdate-notice",
btn: "ThemeRepo",
selector: "themerepo-notice themerepo-outdate-notice",
customicon: themeRepoIcon.replace(/COLOR_1/gi, "#fff").replace(/COLOR_2/gi, "#b9bbbe")
customIcon: themeRepoIcon.replace(/COLOR_1/gi, "#fff").replace(/COLOR_2/gi, "#b9bbbe")
});
bar.querySelector(BDFDB.dotCN.noticebutton).addEventListener("click", _ => {
showOnlyOutdated = true;
@ -1083,9 +1083,9 @@ module.exports = (_ => {
let single = newEntries == 1;
let bar = BDFDB.NotificationUtils.notice(`There ${single ? "is" : "are"} ${newEntries} new Theme${single ? "" : "s"} in the Repo. Check: `, {
type: "success",
className: "themerepo-notice themerepo-newentries-notice",
btn: "ThemeRepo",
selector: "themerepo-notice themerepo-newentries-notice",
customicon: themeRepoIcon.replace(/COLOR_1/gi, "#fff").replace(/COLOR_2/gi, "#b9bbbe")
customIcon: themeRepoIcon.replace(/COLOR_1/gi, "#fff").replace(/COLOR_2/gi, "#b9bbbe")
});
bar.querySelector(BDFDB.dotCN.noticebutton).addEventListener("click", _ => {
forcedSort = "NEW";
@ -1101,9 +1101,9 @@ module.exports = (_ => {
if (wrongUrls.length) {
let bar = BDFDB.NotificationUtils.notice(`ThemeRepo: ${wrongUrls.length} Theme${wrongUrls.length > 1 ? "s" : ""} could not be loaded.`, {
type: "danger",
className: "themerepo-notice themerepo-fail-notice",
btn: "List",
selector: "themerepo-notice themerepo-fail-notice",
customicon: themeRepoIcon.replace(/COLOR_1/gi, "#fff").replace(/COLOR_2/gi, "#b9bbbe")
customIcon: themeRepoIcon.replace(/COLOR_1/gi, "#fff").replace(/COLOR_2/gi, "#b9bbbe")
});
bar.querySelector(BDFDB.dotCN.noticebutton).addEventListener("click", e => {
let toast = BDFDB.NotificationUtils.toast(wrongUrls.join("\n"), {type: "error"});
@ -1181,7 +1181,7 @@ module.exports = (_ => {
}
i++;
let loadingTooltip = document.querySelector(".themerepo-loading-tooltip");
let loadingTooltip = document.querySelector(".themerepo-loadingtooltip");
if (loadingTooltip) loadingTooltip.update(this.getLoadingTooltipText());
getThemeInfo(callback);