From 68a9aa95ad7519956fc97368dfa2b33fd78617fa Mon Sep 17 00:00:00 2001 From: J3ermuda <47281106+J3ermuda@users.noreply.github.com> Date: Thu, 7 May 2020 16:45:58 +0300 Subject: [PATCH 1/2] Update clock.plugin.js Makes it more compatible with V2 of Discord. (Moves the clock a bit to the right, and removes the background light color.) --- .github/ISSUE_TEMPLATE/issue-template.md | 92 ++++++++++++++++++++++++ .vscode/launch.json | 7 ++ .vscode/settings.json | 10 +++ Plugins/clock.plugin.js | 4 +- Plugins/dblClickEdit.plugin.js | 36 +++++----- 5 files changed, 128 insertions(+), 21 deletions(-) create mode 100644 .github/ISSUE_TEMPLATE/issue-template.md create mode 100644 .vscode/launch.json create mode 100644 .vscode/settings.json diff --git a/.github/ISSUE_TEMPLATE/issue-template.md b/.github/ISSUE_TEMPLATE/issue-template.md new file mode 100644 index 000000000..f6d564a50 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/issue-template.md @@ -0,0 +1,92 @@ +--- +name: Issue template +about: Template for all future issues + +--- + +*Before* you create an issue, make sure you have: + +1. Checked that that issue hasn't already been submitted. You can search open issues [here](https://github.com/Jiiks/BetterDiscordApp/issues). +2. Checked that there isn't an answer in either of the Discord servers (if you can access them - don't complain if you can't). +3. Checked that it isn't in the following list of frequently asked questions. + +If none of that helps you, delete the prefilled contents of this issue and ask whatever question you may have *in English so we can understand it*. + +### FAQ + +> *BetterDiscord doesn't work.* +> *BetterDiscord won't install.* +> *BetterDiscord doesn't support macOS.* + +This branch isn't being updated anymore. Until BetterDiscord v2 is released you can use [Zach Rauen's fork](https://github.com/rauenzi/BetterDiscordApp). + +> *BetterDiscord doesn't support Linux.* + +There's an installer script for BetterDiscord on Linux available [here](https://github.com/bb010g/betterdiscordctl). + +> *BetterDiscord doesn't work in my browser.* + +The browser version doesn't exist anymore. Use the desktop client. + +> *BetterDiscord doesn't work on my phone.* + +... and never will. BetterDiscord is a client modification for Discord's desktop Electron client. (Electron is a framework for making cross platform apps using web technologies. Basically the desktop client is just the web client in a specialised web browser.) + +> *Is there any security risks involved with installing BetterDiscord?* +> *My friend was hacked after he/she installed BetterDiscord.* + +*Not by itself.* However, BetterDiscord allows loading plugins. Discord, BetterDiscord, and any plugins you install (even without enabling) have full access to your system as your local user account. (Including full access to your Discord account.) So, make sure you only download plugins from sources you trust. + +Also, please note that [BetterDocs](https://betterdocs.net) and other third-party sources by definition *are not* affiliated with BetterDiscord or it's developers. + +> *How do I install plugin [x]?* +> *Is there a plugin to [x]?* +> *Does [x] theme exist?* + +https://imgur.com/lczPQxW + +> *Minimal mode broke everything.* + +You can get back into Discord's settings to disable it by pressing `Control + ,` on Windows and Linux or `Command + ,` on macOS. + +> *How do I completely hide messages from people I've blocked?* + +Add this to your custom CSS: + +```css +.message-group-blocked { + display: none !important; +} +``` + +> *How do I remove BetterDiscord?* + +BetterDiscord is installed to the following locations: + +Platform | Discord path +-------------|--------------- +Windows | `%APPDATA%`\discord\0.0.`*`\modules\discord_desktop_core +macOS | ~/Library/Application Support/discord/0.0.`*`/modules/discord_desktop_core +Linux | ~/.config/discord/0.0.`*`/modules/discord_desktop_core + +To remove BetterDiscord, open the file `index.js` in that directory and make sure only this line exists: + +```js +module.exports = require('./core'); +``` + +Then, delete the `core` directory. + +BetterDiscord's data is stored in the following locations: + +Platform | BetterDiscord data path +-------------|--------------- +Windows | `%APPDATA%`\BetterDiscord +macOS | ~/Library/Preferences/BetterDiscord +Linux | ~/.config/BetterDiscord + +To remove all of BetterDiscord's data, just delete that directory. + +> *BetterDiscord v2?* + +[BetterDiscord v2 is the new version of BetterDiscord currently in development.](https://github.com/JsSucks/BetterDiscordApp) If you'd like to help out with BetterDiscord v2, join the JsSucks Discord server. (Invite code `KYKwv4R`.) The only requirement is JavaScript/ES6 knowledge. diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 000000000..5c7247b40 --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,7 @@ +{ + // Use IntelliSense to learn about possible attributes. + // Hover to view descriptions of existing attributes. + // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "configurations": [] +} \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 000000000..91d2f4881 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,10 @@ +{ + "window.autoDetectColorScheme": true, + "window.closeWhenEmpty": true, + "cleartool.actionCommentOptionDialog": true, + "cleartool.actionPreserveFileModificationTime": true, + "problems.showCurrentInStatus": true, + "remote.downloadExtensionsLocally": true, + "comments.openPanel": "openOnSessionStart", + "remote.restoreForwardedPorts": true +} \ No newline at end of file diff --git a/Plugins/clock.plugin.js b/Plugins/clock.plugin.js index e07cb8cdc..1142f6e8f 100644 --- a/Plugins/clock.plugin.js +++ b/Plugins/clock.plugin.js @@ -6,7 +6,7 @@ var clockPlugin = function () {}; clockPlugin.prototype.start = function () { BdApi.clearCSS("clockPluginCss"); - BdApi.injectCSS("clockPluginCss", '#clockPluginClock { position:absolute; color:#FFF; background:#333333; padding:0 12px 0 13px; min-width:55px; max-width:55px; z-index:100; }'); + BdApi.injectCSS("clockPluginCss", '#clockPluginClock { position:absolute; color:#FFF; padding:0 10px 0 80px; min-width:50px; max-width:50px; z-index:100; }'); var self = this; this.clock = $("
", { id: "clockPluginClock" }); $("body").append(this.clock); @@ -92,4 +92,4 @@ clockPlugin.prototype.getVersion = function () { clockPlugin.prototype.getAuthor = function () { return "Jiiks"; -}; \ No newline at end of file +}; diff --git a/Plugins/dblClickEdit.plugin.js b/Plugins/dblClickEdit.plugin.js index d04d1dc57..5503d64ed 100644 --- a/Plugins/dblClickEdit.plugin.js +++ b/Plugins/dblClickEdit.plugin.js @@ -2,35 +2,33 @@ var dblClickEdit = function () {}; +dblClickEdit.prototype.handler = function(e) { + const message = e.target.closest('[class^=messageCozy]') || e.target.closest('[class^=messageCompact]'); + if (!message) return; + const btn = message.querySelector('[class^=buttonContainer] [class^=button-]'); + if (!btn) return; + btn.click(); + const popup = document.querySelector('[class^=container][role=menu]'); + if (!popup) return; + const rii = popup[Object.keys(popup).find(k => k.startsWith('__reactInternal'))]; + if (!rii || !rii.memoizedProps || !rii.memoizedProps.children || !rii.memoizedProps.children[1] || !rii.memoizedProps.children[1].props || !rii.memoizedProps.children[1].props.onClick) return; + rii.memoizedProps.children[1].props.onClick(); +}; + dblClickEdit.prototype.onMessage = function () { }; dblClickEdit.prototype.onSwitch = function () { }; dblClickEdit.prototype.start = function () { - $(document).on("dblclick.dce", function(e) { - var target = $(e.target); - if(target.parents(".message").length > 0) { - var msg = target.parents(".message").first(); - var opt = msg.find(".btn-option"); - opt.click(); - - $.each($(".option-popout .btn-item"), (index, value) => { - var option = $(value); - if(option.text() === "Edit") { - option.click(); - } - }); - - } - }); + document.addEventListener('dblclick', this.handler); }; dblClickEdit.prototype.load = function () {}; dblClickEdit.prototype.unload = function () { - $(document).off("dblclick.dce"); + document.removeEventListener('dblclick', this.handler); }; dblClickEdit.prototype.stop = function () { - $(document).off("dblclick.dce"); + document.removeEventListener('dblclick', this.handler); }; dblClickEdit.prototype.getSettingsPanel = function () { return ""; @@ -43,7 +41,7 @@ dblClickEdit.prototype.getDescription = function () { return "Double click messages to edit them"; }; dblClickEdit.prototype.getVersion = function () { - return "0.1.1"; + return "0.2.1"; }; dblClickEdit.prototype.getAuthor = function () { return "Jiiks"; From b0eb51f320cffd29c942d4a481e9f98cd36bf23b Mon Sep 17 00:00:00 2001 From: Sefaakahramann <47281106+J3ermuda@users.noreply.github.com> Date: Thu, 7 May 2020 17:25:26 +0300 Subject: [PATCH 2/2] Rename Plugins/clock.plugin.js to Eklentiler/clock.plugin.js --- {Plugins => Eklentiler}/clock.plugin.js | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {Plugins => Eklentiler}/clock.plugin.js (100%) diff --git a/Plugins/clock.plugin.js b/Eklentiler/clock.plugin.js similarity index 100% rename from Plugins/clock.plugin.js rename to Eklentiler/clock.plugin.js