Update 0BDFDB.plugin.js

This commit is contained in:
Mirco Wittrien 2022-10-14 13:55:44 +02:00
parent 9dc704ae5e
commit e66cbfd5df
1 changed files with 1 additions and 30 deletions

View File

@ -714,19 +714,7 @@ module.exports = (_ => {
type: "info",
className: BDFDB.disCN.noticeupdate,
html: true,
forceStyle: true,
customIcon: `<svg width="24" height="24" viewBox="0 0 24 24"><path fill="currentColor" d="M 15.46875 0.859375 C 15.772992 1.030675 16.059675 1.2229406 16.326172 1.4316406 C 17.134815 2.0640406 17.768634 2.8677594 18.208984 3.8183594 C 18.665347 4.8050594 18.913286 5.9512625 18.945312 7.2265625 L 18.945312 7.2421875 L 18.945312 7.2597656 L 18.945312 16.753906 L 18.945312 16.769531 L 18.945312 16.785156 C 18.914433 18.060356 18.666491 19.206759 18.208984 20.193359 C 17.768634 21.144059 17.135961 21.947578 16.326172 22.580078 C 16.06768 22.782278 15.790044 22.967366 15.496094 23.134766 L 16.326172 23.134766 C 20.285895 23.158766 24 20.930212 24 15.820312 L 24 8.3535156 C 24.021728 3.1431156 20.305428 0.86132812 16.345703 0.86132812 L 15.46875 0.859375 z M 0 0.8671875 L 0 10.064453 L 4.4492188 15.191406 L 4.4492188 5.4394531 L 8.4394531 5.4394531 C 11.753741 5.4394531 11.753741 9.8828125 8.4394531 9.8828125 L 7.0234375 9.8828125 L 7.0234375 14.126953 L 8.4394531 14.126953 C 11.753741 14.126953 11.753741 18.568359 8.4394531 18.568359 L 0 18.568359 L 0 23.138672 L 8.3457031 23.138672 C 12.647637 23.138672 15.987145 21.3021 16.105469 16.75 C 16.105469 14.6555 15.567688 13.090453 14.621094 12.001953 C 15.567688 10.914853 16.105469 9.3502594 16.105469 7.2558594 C 15.988351 2.7036594 12.648845 0.8671875 8.3457031 0.8671875 L 0 0.8671875 z"/></svg>`,
buttons: !BDFDB.BDUtils.getSettings(BDFDB.BDUtils.settingsIds.automaticLoading) && [{
className: BDFDB.disCN.noticeupdatebuttonreload,
contents: BDFDB.LanguageUtils.LanguageStrings.ERRORS_RELOAD,
onClick: _ => location.reload(),
onMouseEnter: _ => {
if (PluginStores.updateData.downloaded) BDFDB.TooltipUtils.create(reloadButton, PluginStores.updateData.downloaded.join(", "), {
type: "bottom",
style: "max-width: 420px"
});
}
}],
buttons: [{
className: BDFDB.disCN.noticeupdatebuttonall,
contents: BDFDB.LanguageUtils.LanguageStrings.FORM_LABEL_ALL,
@ -1813,7 +1801,7 @@ 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}"${config.forceStyle ? ` style="width: 36px !important; height: 36px !important; position: absolute !important; top: 0 !important; right: 0 !important; left: unset !important;"` : ""}><svg class="${BDFDB.disCN.noticedismissicon}" aria-hidden="false" width="18" height="18" viewBox="0 0 24 24"><path fill="currentColor" d="M18.4 4L12 10.4L5.6 4L4 5.6L10.4 12L4 18.4L5.6 20L12 13.6L18.4 20L20 18.4L13.6 12L20 5.6L18.4 4Z"></path></svg></div><div class="${BDFDB.disCN.noticetext}"></div></div>`);
let notice = BDFDB.DOMUtils.create(`<div class="${BDFDB.disCNS.notice + BDFDB.disCN.noticewrapper}" notice-id="${id}"><div class="${BDFDB.disCN.noticedismiss}"><svg class="${BDFDB.disCN.noticedismissicon}" aria-hidden="false" width="18" height="18" viewBox="0 0 24 24"><path fill="currentColor" d="M18.4 4L12 10.4L5.6 4L4 5.6L10.4 12L4 18.4L5.6 20L12 13.6L18.4 20L20 18.4L13.6 12L20 5.6L18.4 4Z"></path></svg></div><div class="${BDFDB.disCN.noticetext}"></div></div>`);
layers.parentElement.insertBefore(notice, layers);
let noticeText = notice.querySelector(BDFDB.dotCN.noticetext);
if (config.platform) for (let platform of config.platform.split(" ")) if (DiscordClasses["noticeicon" + platform]) {
@ -1885,25 +1873,8 @@ module.exports = (_ => {
}
else BDFDB.DOMUtils.addClass(notice, BDFDB.disCN.noticedefault);
}
if (config.forceStyle) {
notice.style.setProperty("display", "flex", "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.close = _ => {
BDFDB.DOMUtils.addClass(notice, BDFDB.disCN.noticeclosing);
if (config.forceStyle) {
notice.style.setProperty("overflow", "hidden", "important");
notice.style.setProperty("height", "0px", "important");
}
if (notice.tooltip && typeof notice.tooltip.removeTooltip == "function") notice.tooltip.removeTooltip();
BDFDB.TimeUtils.timeout(_ => {
if (typeof config.onClose == "function") config.onClose();