diff --git a/Plugins/BadgesEverywhere/BadgesEverywhere.plugin.js b/Plugins/BadgesEverywhere/BadgesEverywhere.plugin.js index 96477200ca..7dc975c460 100644 --- a/Plugins/BadgesEverywhere/BadgesEverywhere.plugin.js +++ b/Plugins/BadgesEverywhere/BadgesEverywhere.plugin.js @@ -15,9 +15,9 @@ class BadgesEverywhere { }; this.patchModules = { - "MemberListItem":"render", - "MessageUsername":"render", - "UserPopout":"render" + MemberListItem: "render", + MessageUsername: "render", + UserPopout: "render" }; } @@ -129,23 +129,26 @@ class BadgesEverywhere { let indicators = BDFDB.DataUtils.get(this, "indicators"); let settingsitems = [], inneritems = []; - for (let key in settings) settingsitems.push(BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.SettingsSwitch, { + for (let key in settings) settingsitems.push(BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.SettingsSaveItem, { className: BDFDB.disCN.marginbottom8, + type: "Switch", plugin: this, keys: ["settings", key], label: this.defaults.settings[key].description, value: settings[key] })); - for (let flag in badges) inneritems.push(BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.SettingsSwitch, { + for (let flag in badges) inneritems.push(BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.SettingsSaveItem, { className: BDFDB.disCN.marginbottom8, + type: "Switch", plugin: this, keys: ["badges", flag], label: this.defaults.badges[flag].name, value: badges[flag], labelchildren: this.createSettingsBadges(flag) })); - for (let flag in indicators) inneritems.push(BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.SettingsSwitch, { + for (let flag in indicators) inneritems.push(BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.SettingsSaveItem, { className: BDFDB.disCN.marginbottom8, + type: "Switch", plugin: this, keys: ["indicators", flag], label: this.defaults.indicators[flag].name, @@ -217,55 +220,56 @@ class BadgesEverywhere { } processMemberListItem (e) { - if (!BDFDB.DataUtils.get(this, "settings", "showInMemberList")) return; - if (e.instance.props.user) this.injectBadges(e.instance, BDFDB.ReactUtils.getValue(e.returnvalue, "props.decorators.props.children"), e.instance.props.user, "list"); + if (e.instance.props.user && BDFDB.DataUtils.get(this, "settings", "showInMemberList")) { + this.injectBadges(e.instance, BDFDB.ReactUtils.getValue(e.returnvalue, "props.decorators.props.children"), e.instance.props.user, "list"); + } } processMessageUsername (e) { - if (!BDFDB.DataUtils.get(this, "settings", "showInChat")) return; let user = BDFDB.ReactUtils.getValue(e.instance, "props.message.author"); - if (user) this.injectBadges(e.instance, BDFDB.ReactUtils.getValue(e.returnvalue, "props.children.props.children"), user, "chat"); + if (user && BDFDB.DataUtils.get(this, "settings", "showInChat")) { + this.injectBadges(e.instance, BDFDB.ReactUtils.getValue(e.returnvalue, "props.children.props.children"), user, "chat"); + } } processUserPopout (e) { - if (!BDFDB.DataUtils.get(this, "settings", "showInPopout")) return; - if (e.instance.props.user) { + if (e.instance.props.user && BDFDB.DataUtils.get(this, "settings", "showInPopout")) { let [children, index] = BDFDB.ReactUtils.findChildren(e.returnvalue, {name: "CustomStatus"}); if (index > -1) this.injectBadges(e.instance, children, e.instance.props.user, "popout", e.instance.props.activity && e.instance.props.activity.type != BDFDB.DiscordConstants.ActivityTypes.CUSTOM_STATUS); } } - injectBadges (instance, children, info, type, colored) { - if (!BDFDB.ArrayUtils.is(children) || !info || info.bot) return; - if (!BDFDB.ArrayUtils.is(this.requestedusers[info.id])) { - this.requestedusers[info.id] = [instance]; - BDFDB.LibraryModules.APIUtils.get(BDFDB.DiscordConstants.Endpoints.USER_PROFILE(info.id)).then(result => { + injectBadges (instance, children, user, type, colored) { + if (!BDFDB.ArrayUtils.is(children) || !user || user.bot) return; + if (!BDFDB.ArrayUtils.is(this.requestedusers[user.id])) { + this.requestedusers[user.id] = [instance]; + BDFDB.LibraryModules.APIUtils.get(BDFDB.DiscordConstants.Endpoints.USER_PROFILE(user.id)).then(result => { let usercopy = Object.assign({}, result.body.user); if (result.body.premium_since) usercopy.flags += this.nitroflag; usercopy.premium_since = result.body.premium_since; if (result.body.premium_guild_since) usercopy.flags += this.boostflag; usercopy.premium_guild_since = result.body.premium_guild_since; - this.loadedusers[info.id] = usercopy; - for (let queredinstance of this.requestedusers[info.id]) BDFDB.ReactUtils.forceUpdate(queredinstance); + this.loadedusers[user.id] = usercopy; + for (let queredinstance of this.requestedusers[user.id]) BDFDB.ReactUtils.forceUpdate(queredinstance); }); } - else if (!this.loadedusers[info.id]) this.requestedusers[info.id].push(instance); - else children.push(this.createBadges(info, type, colored)); + else if (!this.loadedusers[user.id]) this.requestedusers[user.id].push(instance); + else children.push(this.createBadges(user, type, colored)); } - createBadges (info, type, uncolored) { + createBadges (user, type, uncolored) { let badges = BDFDB.DataUtils.get(this, "badges"); let indicators = BDFDB.DataUtils.get(this, "indicators"); let settings = BDFDB.DataUtils.get(this, "settings"); if (uncolored == undefined) uncolored = !settings.useColoredVersion; let badgewrapper = BDFDB.ReactUtils.elementToReact(BDFDB.DOMUtils.create(``)); badgewrapper.props.children = []; - for (let flag in badges) if ((this.loadedusers[info.id].flags | flag) == this.loadedusers[info.id].flags && badges[flag]) { - badgewrapper.props.children.push(this.createBadge(settings.showNitroDate ? this.getTimeString(info.id, flag) : null, type, flag, flag == this.boostflag ? BDFDB.LibraryModules.GuildBoostUtils.getUserLevel(this.loadedusers[info.id].premium_guild_since) : null)); + for (let flag in badges) if ((this.loadedusers[user.id].flags | flag) == this.loadedusers[user.id].flags && badges[flag]) { + badgewrapper.props.children.push(this.createBadge(settings.showNitroDate ? this.getTimeString(user.id, flag) : null, type, flag, flag == this.boostflag ? BDFDB.LibraryModules.GuildBoostUtils.getUserLevel(this.loadedusers[user.id].premium_guild_since) : null)); } - let member = BDFDB.LibraryModules.MemberStore.getMember(BDFDB.LibraryModules.LastGuildStore.getGuildId(), info.id); + let member = BDFDB.LibraryModules.MemberStore.getMember(BDFDB.LibraryModules.LastGuildStore.getGuildId(), user.id); if (indicators.CURRENT_GUILD_BOOST && member && member.premiumSince) { - badgewrapper.props.children.push(this.createBadge(settings.showNitroDate ? this.getTimeString(info.id, "CURRENT_GUILD_BOOST") : null, type, "CURRENT_GUILD_BOOST")); + badgewrapper.props.children.push(this.createBadge(settings.showNitroDate ? this.getTimeString(user.id, "CURRENT_GUILD_BOOST") : null, type, "CURRENT_GUILD_BOOST")); } return badgewrapper.props.children.length ? badgewrapper : null; } diff --git a/Plugins/EditServers/EditServers.plugin.js b/Plugins/EditServers/EditServers.plugin.js index 27e12f2c24..94a6688300 100644 --- a/Plugins/EditServers/EditServers.plugin.js +++ b/Plugins/EditServers/EditServers.plugin.js @@ -622,7 +622,7 @@ class EditServers { updateGuildSidebar() { if (document.querySelector(BDFDB.dotCN.guildheader)) { var ins = BDFDB.ReactUtils.findOwner(document.querySelector(BDFDB.dotCN.app), {name: ["GuildSidebar", "GuildHeader"], all: true, noCopies: true, depth: 99999999, time: 99999999}); - if (ins) for (let i in ins) ins[i].updater.enqueueForceUpdate(ins[i]); + if (ins) for (let i in ins) ins[i].updater.enqueueForceUpdate(ins[i]) } } diff --git a/Plugins/GoogleTranslateOption/GoogleTranslateOption.plugin.js b/Plugins/GoogleTranslateOption/GoogleTranslateOption.plugin.js index e564bd0e8e..89a751a22c 100644 --- a/Plugins/GoogleTranslateOption/GoogleTranslateOption.plugin.js +++ b/Plugins/GoogleTranslateOption/GoogleTranslateOption.plugin.js @@ -94,8 +94,9 @@ class GoogleTranslateOption { settingsitems = settingsitems.concat(this.createSelects(false)); - for (let key in settings) settingsitems.push(BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.SettingsSwitch, { + for (let key in settings) settingsitems.push(BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.SettingsSaveItem, { className: BDFDB.disCN.marginbottom8, + type: "Switch", plugin: this, keys: ["settings", key], label: this.defaults.settings[key].description, @@ -297,7 +298,7 @@ class GoogleTranslateOption { className: BDFDB.disCN.textareapickerbuttoncontainer, children: BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.ChannelTextAreaButton, { className: ["translate-button", this.translating ? "translating-active" : null, BDFDB.disCN.textareapickerbutton].filter(n => n).join(" "), - iconSVG: `` + iconSVG: `` }), width: 400, padding: 10, diff --git a/Plugins/OldTitleBar/OldTitleBar.plugin.js b/Plugins/OldTitleBar/OldTitleBar.plugin.js index 10de260761..857719b0d9 100644 --- a/Plugins/OldTitleBar/OldTitleBar.plugin.js +++ b/Plugins/OldTitleBar/OldTitleBar.plugin.js @@ -3,7 +3,7 @@ class OldTitleBar { getName () {return "OldTitleBar";} - getVersion () {return "1.5.9";} + getVersion () {return "1.6.0";} getAuthor () {return "DevilBro";} @@ -11,14 +11,14 @@ class OldTitleBar { constructor () { this.changelog = { - "fixed":[["Activity Page","Fixed the issue where no icosn woud be added on the activity page"]] + "improved":[["New Library Structure & React","Restructured my Library and switched to React rendering instead of DOM manipulation"]] }; this.patchModules = { - "HeaderBar":["componentDidMount","componentDidUpdate"], - "HeaderBarContainer":["componentDidMount","componentDidUpdate"], - "StandardSidebarView":["componentDidMount","componentWillUnmount"], - "AuthWrapper":["componentDidMount","componentWillUnmount"] + App: "render", + HeaderBarContainer: "render", + StandardSidebarView: "render", + AuthWrapper: "render" }; } @@ -26,65 +26,45 @@ class OldTitleBar { this.patched = false; this.css = ` - .hidden-by-OTB ${BDFDB.dotCN.titlebar}, - .hidden-by-OTB ${BDFDB.dotCN.titlebar} + ${BDFDB.dotCNS.app + BDFDB.dotCN.splashbackground}:before { + .OTB-enabled ${BDFDB.dotCN.splashbackground}:before { display: none !important; } - - .hidden-by-OTB .platform-osx ${BDFDB.dotCN.guildswrapper} { + .platform-osx.OTB-enabled ${BDFDB.dotCN.guildswrapper} { margin-top: 0; } - .hidden-by-OTB .platform-osx ${BDFDB.dotCN.guildsscroller} { + .platform-osx.OTB-enabled ${BDFDB.dotCN.guildsscroller} { padding-top: 10px; } + + .OTB-toolbar { + flex: 1 1 auto; + justify-content: flex-end; + } - body:not(.settingsTitlebarOTB-added) ${BDFDB.dotCN.channelheaderheaderbar} { + .OTB-settingsToolbar { + position: absolute; + top: 0; + right: 0; + padding: 10px; + z-index: 2; + -webkit-app-region: drag !important; + } + + .OTB-enabled ${BDFDB.dotCN.splashbackground} .OTB-settingsToolbar { + background: rgba(0, 0, 0, 0.3); + border-radius: 0 0 0 5px; + } + + ${BDFDB.dotCN.channelheaderheaderbar} { -webkit-app-region: drag !important; } ${BDFDB.dotCN.channelheaderheaderbar} *, ${BDFDB.dotCN.contextmenu} * { -webkit-app-region: no-drag !important; - } - - .settingsTitlebarOTB { - position: relative; - z-index: 1000; - padding: 10px; - -webkit-app-region: drag; }`; - this.dividerMarkup = `
`; - - this.reloadButtonMarkup = - `
- - - -
`; - - this.minButtonMarkup = - `
- - - -
`; - - this.maxButtonMarkup = - `
- -
`; - this.maxButtonInnerMin = ``; - this.maxButtonInnerMax = ``; - - this.closeButtonMarkup = - `
- - - -
`; - this.defaults = { settings: { displayNative: {value:!!document.querySelector(".platform-linux"), description:"Displays the native Title Bar."}, @@ -98,32 +78,32 @@ class OldTitleBar { getSettingsPanel () { if (!global.BDFDB || typeof BDFDB != "object" || !BDFDB.loaded || !this.started) return; let settings = BDFDB.DataUtils.get(this, "settings"); - var settingshtml = `
${this.name}
`; - for (let key in settings) { - settingshtml += `

${this.defaults.settings[key].description}

`; - } - settingshtml += `
`; - - let settingspanel = BDFDB.DOMUtils.create(settingshtml); - - BDFDB.initElements(settingspanel, this); - - BDFDB.ListenerUtils.add(this, settingspanel, "click", ".nativetitlebar-switch", e => { - if (this.patchMainScreen(e.currentTarget.checked)) { - this.patched = !this.patched; - let notifybar = document.querySelector("#OldTitleBarNotifyBar"); - if (notifybar) notifybar.querySelector(BDFDB.dotCN.noticedismiss).click(); - if (this.patched) { - notifybar = BDFDB.NotificationUtils.notice("Changed nativebar settings, relaunch to see changes:", {type:"danger",btn:"Relaunch",id:"OldTitleBarNotifyBar"}); - notifybar.querySelector(BDFDB.dotCN.noticebutton).addEventListener("click", () => { - BDFDB.LibraryRequires.electron.remote.app.relaunch(); - BDFDB.LibraryRequires.electron.remote.app.quit(); - }); + let settingsitems = []; + + for (let key in settings) settingsitems.push(BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.SettingsSaveItem, { + className: BDFDB.disCN.marginbottom8, + type: "Switch", + plugin: this, + keys: ["settings", key], + label: this.defaults.settings[key].description, + value: settings[key], + onChange: key == "displayNative" ? value => { + if (this.patchMainScreen(value)) { + this.patched = !this.patched; + let notifybar = document.querySelector("#OldTitleBarNotifyBar"); + if (notifybar) notifybar.querySelector(BDFDB.dotCN.noticedismiss).click(); + if (this.patched) { + notifybar = BDFDB.NotificationUtils.notice("Changed nativebar settings, relaunch to see changes:", {type:"danger",btn:"Relaunch",id:"OldTitleBarNotifyBar"}); + notifybar.querySelector(BDFDB.dotCN.noticebutton).addEventListener("click", () => { + BDFDB.LibraryRequires.electron.remote.app.relaunch(); + BDFDB.LibraryRequires.electron.remote.app.quit(); + }); + } } - } - }); - - return settingspanel; + } : null + })); + + return BDFDB.PluginUtils.createSettingsPanel(this, settingsitems); } //legacy @@ -156,14 +136,14 @@ class OldTitleBar { BDFDB.PluginUtils.init(this); BDFDB.ListenerUtils.add(this, window, "resize", e => { - this.changeMaximizeButtons(); + BDFDB.ModuleUtils.forceAllUpdates(this, ["HeaderBarContainer", "StandardSidebarView"]); }); this.window = BDFDB.LibraryRequires.electron.remote.getCurrentWindow(); this.patchMainScreen(BDFDB.DataUtils.get(this, "settings", "displayNative")); - BDFDB.DOMUtils.addClass([document.body,document.querySelector(BDFDB.dotCN.titlebar)], "hidden-by-OTB"); + BDFDB.DOMUtils.addClass(document.documentElement, "OTB-enabled"); BDFDB.ModuleUtils.forceAllUpdates(this); } @@ -175,9 +155,9 @@ class OldTitleBar { if (global.BDFDB && typeof BDFDB === "object" && BDFDB.loaded) { this.stopping = true; - BDFDB.DOMUtils.remove(".headerbarOTB", ".settingsTitlebarOTB"); + BDFDB.ModuleUtils.forceAllUpdates(this); - BDFDB.DOMUtils.removeClassFromDOM("hidden-by-OTB", "settingsTitlebarOTB-added"); + BDFDB.DOMUtils.removeClassFromDOM("OTB-enabled"); BDFDB.PluginUtils.clear(this); } @@ -186,82 +166,99 @@ class OldTitleBar { // begin of own functions - processHeaderBar (instance, wrapper, returnvalue) { - this.addTitleBar(); - } - - processHeaderBarContainer (instance, wrapper, returnvalue) { - this.addTitleBar(); - } - - processStandardSidebarView (instance, wrapper, returnvalue, methodnames) { - this.processAuthWrapper(instance, wrapper, returnvalue, methodnames); - } - - processAuthWrapper (instance, wrapper, returnvalue, methodnames) { - if (methodnames.includes("componentDidMount")) { - this.addSettingsTitleBar(wrapper); - } - else if (methodnames.includes("componentWillUnmount")) { - BDFDB.DOMUtils.remove(".settingsTitlebarOTB"); - BDFDB.DOMUtils.removeClass(document.body, "settingsTitlebarOTB-added"); - this.addTitleBar(); + onSettingsClosed () { + if (this.SettingsUpdated) { + delete this.SettingsUpdated; + BDFDB.ModuleUtils.forceAllUpdates(this, ["HeaderBarContainer", "StandardSidebarView"]); } } - addTitleBar () { - BDFDB.DOMUtils.remove(".headerbarOTB"); - let settings = BDFDB.DataUtils.get(this, "settings"); - if (BDFDB.DataUtils.get(this, "settings", "addOldBar")) { - var headerbar = BDFDB.DOMUtils.create(``); - this.createButtons(headerbar); - let headerbaricon = document.querySelector(BDFDB.dotCN.channelheaderchildren); - if (headerbaricon) headerbaricon.parentElement.appendChild(headerbar); - this.changeMaximizeButtons(); - } + processApp (e) { + let [children, index] = BDFDB.ReactUtils.findChildren(e.returnvalue, {props:[["type",["WINDOWS", "MACOS"]]]}); + if (index > -1) children[index] = null; } - addSettingsTitleBar (settingspane) { - BDFDB.DOMUtils.remove(".settingsTitlebarOTB"); - if (BDFDB.DataUtils.get(this, "settings", "addToSettings")) { - BDFDB.DOMUtils.addClass(document.body, "settingsTitlebarOTB-added"); - var settingsbar = BDFDB.DOMUtils.create(`
`); - this.createButtons(settingsbar); - settingspane.parentElement.appendChild(settingsbar); - this.changeMaximizeButtons(); - } - } - - createButtons (bar) { - if (BDFDB.DataUtils.get(this, "settings", "reloadButton")) { - bar.appendChild(BDFDB.DOMUtils.create(this.dividerMarkup)); - var reloadbutton = BDFDB.DOMUtils.create(this.reloadButtonMarkup); - bar.appendChild(reloadbutton); - var reloadbuttonicon = reloadbutton.querySelector(BDFDB.dotCN.channelheadericon); - reloadbuttonicon.addEventListener("click", () => {this.window.reload();}); - reloadbuttonicon.addEventListener("mouseenter", e => { - BDFDB.TooltipUtils.create(reloadbuttonicon, "Reload", {type:"bottom",selector:"reload-button-tooltip"}); + processHeaderBarContainer (e) { + if (!BDFDB.DataUtils.get(this, "settings", "addOldBar")) return; + let children = BDFDB.ReactUtils.getValue(e.returnvalue, "props.toolbar.props.children"); + if (!children) { + let [oldToolbarParent, oldToolbarIndex] = BDFDB.ReactUtils.findChildren(e.returnvalue, {props:[["className", "OTB-toolbar"]]}); + if (oldToolbarIndex > -1) oldToolbarParent.splice(oldToolbarIndex, 1); + let toolbar = BDFDB.ReactUtils.createElement("div", { + className: BDFDB.disCNS.channelheadertoolbar + "OTB-toolbar", + children: [] }); + e.returnvalue.props.children.push(toolbar); + children = toolbar.props.children; } - bar.appendChild(BDFDB.DOMUtils.create(this.dividerMarkup)); - var minbutton = BDFDB.DOMUtils.create(this.minButtonMarkup); - bar.appendChild(minbutton); - minbutton.querySelector(BDFDB.dotCN.channelheadericon).addEventListener("click", () => {this.window.minimize();}); - var maxbutton = BDFDB.DOMUtils.create(this.maxButtonMarkup); - bar.appendChild(maxbutton); - maxbutton.querySelector(BDFDB.dotCN.channelheadericon).addEventListener("click", () => { - if (this.isMaximized()) this.window.unmaximize(); - else this.window.maximize(); - }); - var closebutton = BDFDB.DOMUtils.create(this.closeButtonMarkup); - bar.appendChild(closebutton); - closebutton.querySelector(BDFDB.dotCN.channelheadericon).addEventListener("click", () => {this.window.close();}); - if (BDFDB.DOMUtils.containsClass(bar, "settingsTitlebarOTB")) BDFDB.DOMUtils.remove(bar.querySelector(".dividerOTB")); + this.injectButtons(children, true); } - changeMaximizeButtons () { - var innerHTML = this.isMaximized() ? this.maxButtonInnerMax : this.maxButtonInnerMin; - document.querySelectorAll(".maxButtonOTB g").forEach(g => {g.innerHTML = innerHTML;}); + processStandardSidebarView (e) { + if (!BDFDB.ArrayUtils.is(e.returnvalue.props.children)) e.returnvalue.props.children = [e.returnvalue.props.children]; + this.injectSettingsToolbar(e.returnvalue.props.children); + } + + processAuthWrapper (e) { + if (!BDFDB.ArrayUtils.is(e.returnvalue.props.children)) e.returnvalue.props.children = [e.returnvalue.props.children]; + this.injectSettingsToolbar(e.returnvalue.props.children, true); + } + + injectSettingsToolbar (children, fixed) { + if (!BDFDB.DataUtils.get(this, "settings", "addToSettings")) return; + let toolbar = BDFDB.ReactUtils.createElement("div", { + className: BDFDB.disCNS.channelheadertoolbar + "OTB-settingsToolbar", + children: [], + style: fixed ? {position: "fixed"} : null + }); + this.injectButtons(toolbar.props.children); + children.push(toolbar); + } + + injectButtons (children, addFirstDivider) { + if (addFirstDivider) children.push(BDFDB.ReactUtils.createElement("div", {className: BDFDB.disCN.channelheaderdivider})) + if (BDFDB.DataUtils.get(this, "settings", "reloadButton")) { + children.push(BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.TooltipContainer, { + text: BDFDB.LanguageUtils.LanguageStrings.ERRORS_RELOAD, + tooltipConfig: {type: "bottom"}, + children: BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.Clickable, { + className: BDFDB.disCNS.channelheadericonwrapper + BDFDB.disCN.channelheadericonclickable, + onClick: _ => {this.window.reload();}, + children: BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.SvgIcon, { + className: BDFDB.disCNS.channelheadericon + "OTB-reloadButton", + iconSVG: `` + }) + }) + })); + children.push(BDFDB.ReactUtils.createElement("div", {className: BDFDB.disCN.channelheaderdivider})); + }; + children.push(BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.Clickable, { + className: BDFDB.disCNS.channelheadericonwrapper + BDFDB.disCN.channelheadericonclickable, + onClick: _ => {this.window.minimize();}, + children: BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.SvgIcon, { + className: BDFDB.disCNS.channelheadericon + "OTB-minButton", + iconSVG: `` + }) + })); + children.push(BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.Clickable, { + className: BDFDB.disCNS.channelheadericonwrapper + BDFDB.disCN.channelheadericonclickable, + onClick: _ => { + if (this.isMaximized()) this.window.unmaximize(); + else this.window.maximize(); + }, + children: BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.SvgIcon, { + className: BDFDB.disCNS.channelheadericon + "OTB-maxButton", + iconSVG: this.isMaximized() ? `` : `` + }) + })); + children.push(BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.Clickable, { + className: BDFDB.disCNS.channelheadericonwrapper + BDFDB.disCN.channelheadericonclickable, + onClick: _ => {this.window.close();}, + children: BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.SvgIcon, { + className: BDFDB.disCNS.channelheadericon + "OTB-closeButton", + iconSVG: `` + }) + })); } isMaximized () { diff --git a/Plugins/OwnerTag/OwnerTag.plugin.js b/Plugins/OwnerTag/OwnerTag.plugin.js index 59547b5942..709ea40ea9 100644 --- a/Plugins/OwnerTag/OwnerTag.plugin.js +++ b/Plugins/OwnerTag/OwnerTag.plugin.js @@ -65,8 +65,9 @@ class OwnerTag { settingsitems.push(BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.FormComponents.FormDivider, { className: BDFDB.disCN.marginbottom8 })); - for (let key in settings) (!this.defaults.settings[key].inner ? settingsitems : inneritems).push(BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.SettingsSwitch, { + for (let key in settings) (!this.defaults.settings[key].inner ? settingsitems : inneritems).push(BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.SettingsSaveItem, { className: BDFDB.disCN.marginbottom8, + type: "Switch", plugin: this, keys: ["settings", key], label: this.defaults.settings[key].description,