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.)
This commit is contained in:
J3ermuda 2020-05-07 16:45:58 +03:00
parent 82232fa9c6
commit 68a9aa95ad
5 changed files with 128 additions and 21 deletions

View File

@ -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.

7
.vscode/launch.json vendored Normal file
View File

@ -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": []
}

10
.vscode/settings.json vendored Normal file
View File

@ -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
}

View File

@ -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 = $("<div/>", { id: "clockPluginClock" });
$("body").append(this.clock);
@ -92,4 +92,4 @@ clockPlugin.prototype.getVersion = function () {
clockPlugin.prototype.getAuthor = function () {
return "Jiiks";
};
};

View File

@ -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";