stuff
This commit is contained in:
parent
fb1f0b6ae3
commit
5ca704cc20
|
@ -627,7 +627,7 @@ class PluginRepo {
|
||||||
result = result.replace(/[\r\t]/g, "");
|
result = result.replace(/[\r\t]/g, "");
|
||||||
BDFDB.saveData("urlbase64", btoa(result), this, "newentriesdata");
|
BDFDB.saveData("urlbase64", btoa(result), this, "newentriesdata");
|
||||||
this.loadedPlugins = {};
|
this.loadedPlugins = {};
|
||||||
this.grabbedPlugins = result.split("\n");
|
this.grabbedPlugins = result.split("\n").filter(n => n);
|
||||||
this.foundPlugins = this.grabbedPlugins.concat(ownlist);
|
this.foundPlugins = this.grabbedPlugins.concat(ownlist);
|
||||||
this.loading = {is:true, timeout:setTimeout(() => {
|
this.loading = {is:true, timeout:setTimeout(() => {
|
||||||
clearTimeout(this.loading.timeout);
|
clearTimeout(this.loading.timeout);
|
||||||
|
@ -781,7 +781,10 @@ class PluginRepo {
|
||||||
callback();
|
callback();
|
||||||
},600000);
|
},600000);
|
||||||
frame.messageReceived = e => {
|
frame.messageReceived = e => {
|
||||||
if (typeof e.data === "object" && e.data.origin == "DiscordPreview") {
|
if (!document.contains(frame)) {
|
||||||
|
window.removeEventListener("message", frame.messageReceived);
|
||||||
|
}
|
||||||
|
else if (typeof e.data === "object" && e.data.origin == "DiscordPreview") {
|
||||||
switch (e.data.reason) {
|
switch (e.data.reason) {
|
||||||
case "OnLoad":
|
case "OnLoad":
|
||||||
frame.contentWindow.postMessage({origin:"PluginRepo",reason:"OnLoad"},"*");
|
frame.contentWindow.postMessage({origin:"PluginRepo",reason:"OnLoad"},"*");
|
||||||
|
@ -897,7 +900,7 @@ class PluginRepo {
|
||||||
let filename = data.url.split("/").pop();
|
let filename = data.url.split("/").pop();
|
||||||
require("fs").unlink(require("path").join(BDFDB.getPluginsFolder(), filename), (error) => {
|
require("fs").unlink(require("path").join(BDFDB.getPluginsFolder(), filename), (error) => {
|
||||||
if (error) BDFDB.showToast(`Unable to delete Plugin "${filename}".`, {type:"danger"});
|
if (error) BDFDB.showToast(`Unable to delete Plugin "${filename}".`, {type:"danger"});
|
||||||
else BDFDB.showToast(`Successfully deleted Plugin "${filename}".`, {type:"success"});
|
else BDFDB.showToast(`Successfully deleted Plugin "${filename}".`);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -266,7 +266,7 @@ class ThemeRepo {
|
||||||
top: 0 !important;
|
top: 0 !important;
|
||||||
}
|
}
|
||||||
iframe.discordPreview ~ ${BDFDB.dotCNS.appmount + BDFDB.dotCN.titlebar},
|
iframe.discordPreview ~ ${BDFDB.dotCNS.appmount + BDFDB.dotCN.titlebar},
|
||||||
iframe.discordPreview ~ ${BDFDB.dotCNS.appmount + BDFDB.dotCN.app} {
|
iframe.discordPreview ~ ${BDFDB.dotCNS.appmount + BDFDB.dotCN.app} > *:not(.toasts):not(.bd-toasts) {
|
||||||
opacity: 0 !important;
|
opacity: 0 !important;
|
||||||
visibility: hidden !important;
|
visibility: hidden !important;
|
||||||
}
|
}
|
||||||
|
@ -482,7 +482,11 @@ class ThemeRepo {
|
||||||
};
|
};
|
||||||
|
|
||||||
var messageReceived = e => {
|
var messageReceived = e => {
|
||||||
if (typeof e.data === "object" && e.data.origin == "DiscordPreview") {
|
if (!document.contains(frame)) {
|
||||||
|
document.removeEventListener("keyup", keyPressed);
|
||||||
|
window.removeEventListener("message", messageReceived);
|
||||||
|
}
|
||||||
|
else if (typeof e.data === "object" && e.data.origin == "DiscordPreview") {
|
||||||
switch (e.data.reason) {
|
switch (e.data.reason) {
|
||||||
case "OnLoad":
|
case "OnLoad":
|
||||||
var username = BDFDB.myData.username;
|
var username = BDFDB.myData.username;
|
||||||
|
@ -752,7 +756,7 @@ class ThemeRepo {
|
||||||
body = body.replace(/[\r\t]/g, "");
|
body = body.replace(/[\r\t]/g, "");
|
||||||
BDFDB.saveData("urlbase64", btoa(body), this, "newentriesdata");
|
BDFDB.saveData("urlbase64", btoa(body), this, "newentriesdata");
|
||||||
this.loadedThemes = {};
|
this.loadedThemes = {};
|
||||||
this.grabbedThemes = body.split("\n");
|
this.grabbedThemes = body.split("\n").filter(n => n);
|
||||||
request("https://github.com/NFLD99/Better-Discord", (error2, response2, body2) => {
|
request("https://github.com/NFLD99/Better-Discord", (error2, response2, body2) => {
|
||||||
if (!error2 && body2) {
|
if (!error2 && body2) {
|
||||||
NFLDreplace = /\/NFLD99\/Better-Discord\/tree\/master\/Themes_[^"]+">([^<]+)/i.exec(body2);
|
NFLDreplace = /\/NFLD99\/Better-Discord\/tree\/master\/Themes_[^"]+">([^<]+)/i.exec(body2);
|
||||||
|
@ -911,7 +915,7 @@ class ThemeRepo {
|
||||||
let filename = data.requesturl.split("/").pop();
|
let filename = data.requesturl.split("/").pop();
|
||||||
require("fs").unlink(require("path").join(BDFDB.getThemesFolder(), filename), (error) => {
|
require("fs").unlink(require("path").join(BDFDB.getThemesFolder(), filename), (error) => {
|
||||||
if (error) BDFDB.showToast(`Unable to delete Theme "${filename}".`, {type:"danger"});
|
if (error) BDFDB.showToast(`Unable to delete Theme "${filename}".`, {type:"danger"});
|
||||||
else BDFDB.showToast(`Successfully deleted Theme "${filename}".`, {type:"success"});
|
else BDFDB.showToast(`Successfully deleted Theme "${filename}".`);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue