From 8f2182fc2721b285a0317d7d03c8f2f17d492050 Mon Sep 17 00:00:00 2001 From: Mirco Wittrien Date: Mon, 14 Jan 2019 20:12:36 +0100 Subject: [PATCH] DiscordPreview --- Plugins/ThemeRepo/ThemeRepo.plugin.js | 11 ++++----- Plugins/ThemeRepo/res/DiscordPreview.html | 28 +++++++++++------------ Plugins/ThemeRepo/res/DiscordPreview.js | 2 +- 3 files changed, 19 insertions(+), 22 deletions(-) diff --git a/Plugins/ThemeRepo/ThemeRepo.plugin.js b/Plugins/ThemeRepo/ThemeRepo.plugin.js index 40ff4da65c..13e94fc04b 100644 --- a/Plugins/ThemeRepo/ThemeRepo.plugin.js +++ b/Plugins/ThemeRepo/ThemeRepo.plugin.js @@ -445,6 +445,7 @@ class ThemeRepo { }; var messageReceived = e => { + console.log(e); if (typeof e.data === "object" && e.data.origin == "DiscordPreview") { switch (e.data.reason) { case "OnLoad": @@ -460,7 +461,7 @@ class ThemeRepo { frame.contentWindow.postMessage({origin:"ThemeRepo",reason:"DarkLight",checked:lightTheme},"*"); break; case "KeyUp": - keyPressed(e.data.key); + keyPressed(e.data); break; } } @@ -835,12 +836,8 @@ class ThemeRepo { filename = filename[filename.length - 1]; var file = path.join(BDFDB.getThemesFolder(), filename); fileSystem.unlink(file, (error) => { - if (error) { - BDFDB.showToast(`Unable to delete Theme "${filename}".`, {type:"danger"}); - } - else { - BDFDB.showToast(`Successfully deleted Theme "${filename}".`, {type:"success"}); - } + if (error) BDFDB.showToast(`Unable to delete Theme "${filename}".`, {type:"danger"}); + else BDFDB.showToast(`Successfully deleted Theme "${filename}".`, {type:"success"}); }); } diff --git a/Plugins/ThemeRepo/res/DiscordPreview.html b/Plugins/ThemeRepo/res/DiscordPreview.html index 8a6a578516..1fb9904232 100644 --- a/Plugins/ThemeRepo/res/DiscordPreview.html +++ b/Plugins/ThemeRepo/res/DiscordPreview.html @@ -690,20 +690,20 @@ -
-