This commit is contained in:
Mirco Wittrien 2019-05-24 11:46:22 +02:00
parent a3a4a35957
commit 2f2dec9a01
2 changed files with 9 additions and 7 deletions

View File

@ -3,7 +3,7 @@
class CharCounter {
getName () {return "CharCounter";}
getVersion () {return "1.3.3";}
getVersion () {return "1.3.4";}
getAuthor () {return "DevilBro";}
@ -11,7 +11,7 @@ class CharCounter {
initConstructor () {
this.changelog = {
"fixed":[["Parsed Length","The character counter show the parsed length (which determines if a message is over 2000 chars) again like it used to, instead of the literal length"]]
"fixed":[["Context Menu","Fixed the issue where the plugin would break the copy/paste actions via the textarea contextmenu"]]
};
this.patchModules = {
@ -163,9 +163,13 @@ class CharCounter {
BDFDB.addEventListener(this, document, "mouseup", () => {
BDFDB.removeEventListener(this, document);
if (input.selectionEnd - input.selectionStart) setImmediate(() => {BDFDB.addEventListener(this, document, "click", () => {
input.selectionStart = 0;
input.selectionEnd = 0;
updateCounter();
var contexttype = BDFDB.getReactValue(document.querySelector(BDFDB.dotCN.contextmenu), "return.stateNode.props.type");
if (!contexttype || !contexttype.startsWith("CHANNEL_TEXT_AREA")) {
input.selectionStart = 0;
input.selectionEnd = 0;
updateCounter();
}
else setTimeout(() => {updateCounter();},100);
BDFDB.removeEventListener(this, document);
});});
});

View File

@ -184,8 +184,6 @@ https://raw.githubusercontent.com/satoru8/Izanami/master/Izanami.theme.css
https://raw.githubusercontent.com/satoru8/NovaFork/master/Nova.theme.css
https://raw.githubusercontent.com/satoru8/Nyx/master/Nyx.theme.css
https://raw.githubusercontent.com/TakosThings/Metro-for-Discord/master/dist/Metro_for_Discord.theme.css
https://raw.githubusercontent.com/tehbasshunter/theme-fixes/master/Overwatch.theme.css
https://raw.githubusercontent.com/tehbasshunter/theme-fixes/master/Space_Nova.theme.css
https://raw.githubusercontent.com/TheBaconSpace/TMEMETheme/master/tmeme.theme.css
https://raw.githubusercontent.com/TheWrestlingDiscordia/MiniTheme/master/MiniTheme.theme.css
https://raw.githubusercontent.com/Tropix126/BetterDiscordStuff/master/aurora/Aurora.theme.css