This commit is contained in:
Mirco Wittrien 2020-08-15 09:37:12 +02:00
parent c779038f6a
commit 594564cf4b
7 changed files with 1244 additions and 1231 deletions

View File

@ -206,7 +206,12 @@
if (updateNoticeList && !updateNoticeList.querySelector(`#${pluginName}-notice`)) {
if (updateNoticeList.querySelector("span")) updateNoticeList.appendChild(BDFDB.DOMUtils.create(`<span class="separator">, </span>`));
let updateEntry = BDFDB.DOMUtils.create(`<span id="${pluginName}-notice">${pluginName}</span>`);
updateEntry.addEventListener("click", _ => {BDFDB.PluginUtils.downloadUpdate(pluginName, url);});
updateEntry.addEventListener("click", _ => {
if (!updateEntry.wasClicked) {
updateEntry.wasClicked = true;
BDFDB.PluginUtils.downloadUpdate(pluginName, url);
}
});
updateNoticeList.appendChild(updateEntry);
if (!updateNoticeList.hasTooltip) {
updateNoticeList.hasTooltip = true;
@ -245,33 +250,39 @@
};
BDFDB.PluginUtils.downloadUpdate = function (pluginName, url) {
if (pluginName && url) LibraryRequires.request(url, (error, response, body) => {
if (error) return BDFDB.LogUtils.warn("Unable to get update for " + pluginName);
BDFDB.InternalData.creationTime = 0;
let wasEnabled = BDFDB.BDUtils.isPluginEnabled(pluginName);
let newName = (body.match(/"name"\s*:\s*"([^"]+)"/) || [])[1] || pluginName;
let newVersion = body.match(/['"][0-9]+\.[0-9]+\.[0-9]+['"]/i).toString().replace(/['"]/g, "");
let oldVersion = window.PluginUpdates.plugins[url].version;
LibraryRequires.fs.writeFile(LibraryRequires.path.join(BDFDB.BDUtils.getPluginsFolder(), newName + ".plugin.js"), body, _ => {
if (pluginName != newName) {
url = url.replace(new RegExp(pluginName, "g"), newName);
LibraryRequires.fs.unlink(LibraryRequires.path.join(BDFDB.BDUtils.getPluginsFolder(), pluginName + ".plugin.js"), _ => {});
let configPath = LibraryRequires.path.join(BDFDB.BDUtils.getPluginsFolder(), pluginName + ".config.json");
LibraryRequires.fs.exists(configPath, exists => {
if (exists) LibraryRequires.fs.rename(configPath, LibraryRequires.path.join(BDFDB.BDUtils.getPluginsFolder(), newName + ".config.json"), _ => {});
});
BDFDB.TimeUtils.timeout(_ => {if (wasEnabled && !BDFDB.BDUtils.isPluginEnabled(newName)) BDFDB.BDUtils.enablePlugin(newName);}, 3000);
}
BDFDB.NotificationUtils.toast(BDFDB.LanguageUtils.LibraryStringsFormat("toast_plugin_updated", pluginName, "v" + oldVersion, newName, "v" + newVersion), {nopointer:true, selector:"plugin-updated-toast"});
if (error) {
let updateNotice = document.querySelector("#pluginNotice");
if (updateNotice) {
if (updateNotice.querySelector(BDFDB.dotCN.noticebutton)) {
window.PluginUpdates.plugins[url].version = newVersion;
if (!window.PluginUpdates.downloaded) window.PluginUpdates.downloaded = [];
if (!window.PluginUpdates.downloaded.includes(pluginName)) window.PluginUpdates.downloaded.push(pluginName);
if (updateNotice) BDFDB.PluginUtils.removeUpdateNotice(pluginName, updateNotice);
BDFDB.LogUtils.warn("Unable to get update for " + pluginName);
}
else {
BDFDB.InternalData.creationTime = 0;
let wasEnabled = BDFDB.BDUtils.isPluginEnabled(pluginName);
let newName = (body.match(/"name"\s*:\s*"([^"]+)"/) || [])[1] || pluginName;
let newVersion = body.match(/['"][0-9]+\.[0-9]+\.[0-9]+['"]/i).toString().replace(/['"]/g, "");
let oldVersion = window.PluginUpdates.plugins[url].version;
LibraryRequires.fs.writeFile(LibraryRequires.path.join(BDFDB.BDUtils.getPluginsFolder(), newName + ".plugin.js"), body, _ => {
if (pluginName != newName) {
url = url.replace(new RegExp(pluginName, "g"), newName);
LibraryRequires.fs.unlink(LibraryRequires.path.join(BDFDB.BDUtils.getPluginsFolder(), pluginName + ".plugin.js"), _ => {});
let configPath = LibraryRequires.path.join(BDFDB.BDUtils.getPluginsFolder(), pluginName + ".config.json");
LibraryRequires.fs.exists(configPath, exists => {
if (exists) LibraryRequires.fs.rename(configPath, LibraryRequires.path.join(BDFDB.BDUtils.getPluginsFolder(), newName + ".config.json"), _ => {});
});
BDFDB.TimeUtils.timeout(_ => {if (wasEnabled && !BDFDB.BDUtils.isPluginEnabled(newName)) BDFDB.BDUtils.enablePlugin(newName);}, 3000);
}
BDFDB.PluginUtils.removeUpdateNotice(pluginName, updateNotice);
}
});
BDFDB.NotificationUtils.toast(BDFDB.LanguageUtils.LibraryStringsFormat("toast_plugin_updated", pluginName, "v" + oldVersion, newName, "v" + newVersion), {nopointer:true, selector:"plugin-updated-toast"});
let updateNotice = document.querySelector("#pluginNotice");
if (updateNotice) {
if (updateNotice.querySelector(BDFDB.dotCN.noticebutton)) {
window.PluginUpdates.plugins[url].version = newVersion;
if (!window.PluginUpdates.downloaded) window.PluginUpdates.downloaded = [];
if (!window.PluginUpdates.downloaded.includes(pluginName)) window.PluginUpdates.downloaded.push(pluginName);
}
BDFDB.PluginUtils.removeUpdateNotice(pluginName, updateNotice);
}
});
}
});
};
BDFDB.PluginUtils.checkChangeLog = function (plugin) {
@ -5539,8 +5550,6 @@
memberpremiumicon: ["Member", "premiumIcon"],
members: ["MembersWrap", "members"],
membersgroup: ["MembersWrap", "membersGroup"],
memberstabbar: ["MembersThreads", "tabBar"],
membersthread: ["MembersThreads", "thread"],
memberswrap: ["MembersWrap", "membersWrap"],
memberusername: ["Member", "roleColor"],
mention: ["NotFound", "mention"],
@ -5688,6 +5697,7 @@
messagespopoutvisible: ["MessagesPopout", "visible"],
messagespopoutwrap: ["MessagesPopout", "messagesPopoutWrap"],
messagesscroller: ["MessagesWrap", "scroller"],
messagesscrollercontent: ["MessagesWrap", "scrollerContent"],
messagesscrollerinner: ["MessagesWrap", "scrollerInner"],
messagesscrollerwrapper: ["MessagesWrap", "scrollerWrap"],
messageswelcome: ["MessagesWelcome", "container"],
@ -5696,7 +5706,7 @@
messageswelcomeemptychannelicon: ["MessagesWelcome", "emptyChannelIcon"],
messageswelcomehasdivider: ["MessagesWelcome", "hasDivider"],
messageswelcomeheader: ["MessagesWelcome", "header"],
messageswelcomelocked: ["MessagesWelcome", "lcoked"],
messageswelcomelocked: ["MessagesWelcome", "locked"],
messageswrapper: ["MessagesWrap", "messagesWrapper"],
messagesystem: ["Message", "systemMessage"],
messagesystemaccessories: ["MessageBody", "systemMessageAccessories"],
@ -5865,13 +5875,14 @@
scrollbardefault: ["Scrollbar", "scrollbarDefault"],
scrollbarghost: ["Scrollbar", "scrollbarGhost"],
scrollbarghosthairline: ["Scrollbar", "scrollbarGhostHairline"],
scrollerbase: ["Scroller", "scrollerBase"],
scrollerbaseauto: ["Scroller", "auto"],
scrollerbasefade: ["Scroller", "fade"],
scrollerbaselistcontent: ["Scroller", "listContent"],
scrollerbasenone: ["Scroller", "none"],
scrollerbasescrolling: ["Scroller", "scrolling"],
scrollerbasethin: ["Scroller", "thin"],
scroller: ["Scroller", "scrollerBase"],
scrollerauto: ["Scroller", "auto"],
scrollercontent: ["Scroller", "content"],
scrollerdisablescrollanchor: ["Scroller", "disableScrollAnchor"],
scrollerfade: ["Scroller", "fade"],
scrollernone: ["Scroller", "none"],
scrollerscrolling: ["Scroller", "scrolling"],
scrollerthin: ["Scroller", "thin"],
searchbar: ["SearchBar", "container"],
searchbarclear: ["SearchBar", "clear"],
searchbarclose: ["SearchBar", "close"],

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

View File

@ -79,7 +79,7 @@
<span class="REPLACE_CLASS_unreadbartext"></span>
</div>
</div>
<div class="REPLACE_CLASS_guildsscroller REPLACE_CLASS_scrollerbasenone" dir="ltr" style="overflow: hidden scroll; padding-right: 0px;">
<div class="REPLACE_CLASS_guildsscroller REPLACE_CLASS_scrollernone" dir="ltr" style="overflow: hidden scroll; padding-right: 0px;">
<div class="REPLACE_CLASS_guildtutorialcontainer">
<div class="REPLACE_CLASS_guildouter">
<div class="REPLACE_CLASS_homebuttonpill REPLACE_CLASS_guildpillwrapper"></div>
@ -486,8 +486,8 @@
</div>
</div>
</div>
<div class="REPLACE_CLASS_channelsscroller REPLACE_CLASS_scrollerbasethin REPLACE_CLASS_scrollerbasefade" role="list" tabindex="0" id="channels" style="overflow: hidden scroll; padding-right: 0px;">
<div class="REPLACE_CLASS_scrollerbaselistcontent">
<div class="REPLACE_CLASS_channelsscroller REPLACE_CLASS_scrollerthin REPLACE_CLASS_scrollerfade" role="list" tabindex="0" id="channels" style="overflow: hidden scroll; padding-right: 0px;">
<div class="REPLACE_CLASS_scrollercontent">
<div style="height: 84px;"></div>
<div class="REPLACE_CLASS_channelcontainerdefault" draggable="true">
<div tabindex="0" class="REPLACE_CLASS_channeliconvisibility REPLACE_CLASS_channelwrapper" role="button">
@ -1343,8 +1343,8 @@
</svg>
</button>
</div>
<div class="REPLACE_CLASS_scrollerwrap REPLACE_CLASS_messagesscrollerwrapper REPLACE_CLASS_scrollerthemed REPLACE_CLASS_scrollerthemedwithtrack">
<div class="REPLACE_CLASS_scroller REPLACE_CLASS_messages REPLACE_CLASS_messagesscroller">
<div class="REPLACE_CLASS_messagesscroller REPLACE_CLASS_scrollerauto REPLACE_CLASS_scrollerdisablescrollanchor">
<div class="REPLACE_CLASS_messagesscrollercontent REPLACE_CLASS_scrollercontent">
<div class="REPLACE_CLASS_messagesscrollerinner">
<div class="REPLACE_CLASS_messageswelcome REPLACE_CLASS_messageswelcomehasdivider">
<div class="REPLACE_CLASS_messageswelcomeemptychannelicon"></div>
@ -2114,8 +2114,8 @@
<div class="REPLACE_CLASS_itemlayercontainer"></div>
</main>
<div class="REPLACE_CLASS_memberswrap">
<div class="REPLACE_CLASS_members REPLACE_CLASS_scrollerbasenone REPLACE_CLASS_scrollerbasefade" role="list" tabindex="0" style="overflow: hidden scroll; padding-right: 0px;">
<div class="REPLACE_CLASS_scrollerbaselistcontent">
<div class="REPLACE_CLASS_members REPLACE_CLASS_scrollernone REPLACE_CLASS_scrollerfade" role="list" tabindex="0" style="overflow: hidden scroll; padding-right: 0px;">
<div class="REPLACE_CLASS_scrollercontent">
<div style="height: 0px;"></div>
<h2 class="REPLACE_CLASS_membersgroup REPLACE_CLASS_namecontainernamecontainer" aria-label="Developer, 1 member">
<span aria-hidden="true">Developer—1</span>
@ -2252,10 +2252,10 @@
</div>
</div>
</div>
<div class="REPLACE_CLASS_themelight REPLACE_CLASS_popouts"></div>
<div class="REPLACE_CLASS_popouts"></div>
<div></div>
<div></div>
<div class="REPLACE_CLASS_itemlayercontainer REPLACE_CLASS_themelight">
<div class="REPLACE_CLASS_itemlayercontainer">
<div class="REPLACE_CLASS_itemlayer" style="top: 140px; right: 260px;">
<div class="REPLACE_CLASS_animationcontainerleft REPLACE_CLASS_animationcontainertranslate REPLACE_CLASS_animationcontainerrender">
<div class="REPLACE_CLASS_userpopout">
@ -2293,8 +2293,8 @@
</div>
</div>
</div>
<div class="REPLACE_CLASS_scrollerwrap REPLACE_CLASS_userpopoutbody REPLACE_CLASS_scrollerthemed REPLACE_CLASS_scrollerthemeghosthairline REPLACE_CLASS_scrollerfade">
<div class="REPLACE_CLASS_scroller REPLACE_CLASS_scrollersystempad">
<div class="REPLACE_CLASS_userpopoutbody REPLACE_CLASS_scrollerthin REPLACE_CLASS_scrollerfade">
<div class="REPLACE_CLASS_userpopoutbodyinnerwrapper">
<div class="REPLACE_CLASS_userpopoutbodytitle">Role</div>
<ul class="REPLACE_CLASS_userpopoutroles REPLACE_CLASS_userpopoutrolelist REPLACE_CLASS_userpopoutendbodysection">
<li class="REPLACE_CLASS_userpopoutrole" style="border-color: rgba(255, 23, 189, 0.6);">

View File

@ -790,19 +790,19 @@ body:before {
text-align: center;
}
.hasMore-3e72_v { /* bar hasmore */
.hasMore-3POVhk { /* bar hasmore */
box-shadow: inset 0 0 0 1px rgba(var(--fontwhite1), 0.1);
}
.hasMore-3e72_v:hover {
.hasMore-3POVhk:hover {
background-color: rgba(var(--vtransparencycolor), 0.2);
}
.jumpToPresentBar-9P20AM { /* bar jumptopresent */
.jumpToPresentBar-G1R9s6 { /* bar jumptopresent */
overflow: hidden;
background: transparent;
opacity: 1;
}
.jumpToPresentBar-9P20AM:after,
.jumpToPresentBar-9P20AM:before {
.jumpToPresentBar-G1R9s6:after,
.jumpToPresentBar-G1R9s6:before {
content: "";
position: absolute;
top: 0;
@ -812,10 +812,10 @@ body:before {
pointer-events: none;
z-index: -1;
}
.jumpToPresentBar-9P20AM:after {
.jumpToPresentBar-G1R9s6:after {
background-color: rgba(var(--vtransparencycolor), calc(var(--vtransparencyalpha) + 0.2));
}
.jumpToPresentBar-9P20AM:before {
.jumpToPresentBar-G1R9s6:before {
background: var(--vbackground) center/var(--vbackgroundsize);
filter: blur(var(--vbackgroundblur));
background-attachment: fixed;

View File

@ -395,11 +395,11 @@
/* ---- 4.1. MESSAGES ---- */
.newMessagesBar-mujexs { /* newmessagesbar */
.newMessagesBar-265mhP { /* newmessagesbar */
background-color: rgb(var(--vaccentcolor));
}
.hasMore-3e72_v { /* hasmoremessagesbar */
.hasMore-3POVhk { /* hasmoremessagesbar */
color: rgb(var(--vaccentcolor));
}

View File

@ -70,10 +70,6 @@
#app-mount .regionSelectName-2-2FWh {
color: #FFF;
}
#app-mount .slide-2pHaq5 .scroller-2FKFPG::-webkit-scrollbar-thumb {
background-color: #2B2C31;
border: none;
}
#app-mount .modal-3HD5ck {
background-color: #36393F;
box-shadow: 0 0 0 1px rgba(32,34,37,.6), 0 2px 10px 0 rgba(0,0,0,.2);