mirror of
https://github.com/FrankerFaceZ/FrankerFaceZ.git
synced 2025-06-28 05:15:54 +00:00
added feature for Issue 1090
This commit is contained in:
parent
032c8821df
commit
b4eebe6b87
3 changed files with 19 additions and 2 deletions
2
package-lock.json
generated
2
package-lock.json
generated
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "frankerfacez",
|
"name": "frankerfacez",
|
||||||
"version": "4.28.6",
|
"version": "4.29.2",
|
||||||
"lockfileVersion": 1,
|
"lockfileVersion": 1,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
|
|
@ -184,6 +184,15 @@ export default class Chat extends Module {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
this.settings.add('test', {
|
||||||
|
default: true,
|
||||||
|
ui: {
|
||||||
|
path: 'Chat > Appearance >> General',
|
||||||
|
title: 'Displays amount of written characters in your Chatinput',
|
||||||
|
component: 'setting-check-box'
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
this.settings.add('chat.name-format', {
|
this.settings.add('chat.name-format', {
|
||||||
default: 0,
|
default: 0,
|
||||||
ui: {
|
ui: {
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
// ============================================================================
|
// ============================================================================
|
||||||
|
|
||||||
import Module from 'utilities/module';
|
import Module from 'utilities/module';
|
||||||
import { findReactFragment } from 'utilities/dom';
|
import { findReactFragment, createElement } from 'utilities/dom';
|
||||||
import { TWITCH_POINTS_SETS, TWITCH_GLOBAL_SETS, TWITCH_PRIME_SETS, KNOWN_CODES, REPLACEMENTS, REPLACEMENT_BASE, KEYS } from 'utilities/constants';
|
import { TWITCH_POINTS_SETS, TWITCH_GLOBAL_SETS, TWITCH_PRIME_SETS, KNOWN_CODES, REPLACEMENTS, REPLACEMENT_BASE, KEYS } from 'utilities/constants';
|
||||||
|
|
||||||
import Twilight from 'site';
|
import Twilight from 'site';
|
||||||
|
@ -324,10 +324,18 @@ export default class Input extends Module {
|
||||||
inst.tempInput = '';
|
inst.tempInput = '';
|
||||||
inst.messageHistoryPos = -1;
|
inst.messageHistoryPos = -1;
|
||||||
|
|
||||||
|
let element = this.fine.getChildNode(inst);
|
||||||
|
let container = element && element.querySelector('div[class="Layout-sc-nxg1ff-0 chat-input__input-icons"]');
|
||||||
|
container.append(<div class="Layout-sc-nxg1ff-0 appendChildForWrittenChars"><p id="textForCharsWritten">( 0 / 500 )</p></div>);
|
||||||
|
let replacedDivP = element && element.querySelector('p[id="textForCharsWritten"]');
|
||||||
|
|
||||||
inst.onKeyDown = function(event) {
|
inst.onKeyDown = function(event) {
|
||||||
try {
|
try {
|
||||||
const code = event.charCode || event.keyCode;
|
const code = event.charCode || event.keyCode;
|
||||||
|
|
||||||
|
let charsWritten = '( ' + inst.chatInputRef.value.length.toString() + '/500 )';
|
||||||
|
replacedDivP.innerHTML = charsWritten;
|
||||||
|
|
||||||
if ( inst.onEmotePickerToggle && t.chat.context.get('chat.emote-menu.shortcut') && event.key === 'e' && event.ctrlKey && ! event.altKey && ! event.shiftKey ) {
|
if ( inst.onEmotePickerToggle && t.chat.context.get('chat.emote-menu.shortcut') && event.key === 'e' && event.ctrlKey && ! event.altKey && ! event.shiftKey ) {
|
||||||
inst.onEmotePickerToggle();
|
inst.onEmotePickerToggle();
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue