stuff
This commit is contained in:
parent
f72d3c342e
commit
5d3d39f006
|
@ -4126,7 +4126,13 @@
|
||||||
};
|
};
|
||||||
DiscordClassModules.CharCounter = {
|
DiscordClassModules.CharCounter = {
|
||||||
charCounter: "charCounter-7fw40k",
|
charCounter: "charCounter-7fw40k",
|
||||||
counterAdded: "charCounterAdded-zz9O4t"
|
chatCounter: "chatCounter-XOMPsh",
|
||||||
|
counterAdded: "charCounterAdded-zz9O4t",
|
||||||
|
editCounter: "editCounter-pNT1Xe",
|
||||||
|
formCounter: "formCounter-iEGQQk",
|
||||||
|
nickCounter: "nickCounter-tJrO_4",
|
||||||
|
popoutNoteCounter: "popoutNoteCounter-62U4Rh",
|
||||||
|
profileNoteCounter: "profileNoteCounter-p0fWA_"
|
||||||
};
|
};
|
||||||
DiscordClassModules.DisplayLargeMessages = {
|
DiscordClassModules.DisplayLargeMessages = {
|
||||||
injectButton: "injectButton-8eKqGu"
|
injectButton: "injectButton-8eKqGu"
|
||||||
|
@ -4490,7 +4496,13 @@
|
||||||
_chatfiltercensored: ["ChatFilter", "censored"],
|
_chatfiltercensored: ["ChatFilter", "censored"],
|
||||||
_chatfiltercensoredstamp: ["ChatFilter", "censoredStamp"],
|
_chatfiltercensoredstamp: ["ChatFilter", "censoredStamp"],
|
||||||
_charcountercounter: ["CharCounter", "charCounter"],
|
_charcountercounter: ["CharCounter", "charCounter"],
|
||||||
|
_charcounterchatcounter: ["CharCounter", "chatCounter"],
|
||||||
_charcountercounteradded: ["CharCounter", "counterAdded"],
|
_charcountercounteradded: ["CharCounter", "counterAdded"],
|
||||||
|
_charcountereditcounter: ["CharCounter", "editCounter"],
|
||||||
|
_charcounterformcounter: ["CharCounter", "formCounter"],
|
||||||
|
_charcounternickcounter: ["CharCounter", "nickCounter"],
|
||||||
|
_charcounterpopoutnotecounter: ["CharCounter", "popoutNoteCounter"],
|
||||||
|
_charcounterprofilenotecounter: ["CharCounter", "profileNoteCounter"],
|
||||||
_displaylargemessagesinjectbutton: ["DisplayLargeMessages", "injectButton"],
|
_displaylargemessagesinjectbutton: ["DisplayLargeMessages", "injectButton"],
|
||||||
_displayserversaschannelsbadge: ["DisplayServersAsChannels", "badge"],
|
_displayserversaschannelsbadge: ["DisplayServersAsChannels", "badge"],
|
||||||
_displayserversaschannelsname: ["DisplayServersAsChannels", "name"],
|
_displayserversaschannelsname: ["DisplayServersAsChannels", "name"],
|
||||||
|
@ -9983,20 +9995,6 @@
|
||||||
BDFDB.LibraryComponents[component] = "div";
|
BDFDB.LibraryComponents[component] = "div";
|
||||||
}
|
}
|
||||||
|
|
||||||
// REMOVE ONCE BD IS FIXED
|
|
||||||
if (BDFDB.BDUtils.getSettings(BdApi.settings["Public Servers"].id)) {
|
|
||||||
let failed = false;
|
|
||||||
try {BDFDB.BDUtils.toggleSettings(BdApi.settings["Public Servers"].id, false);}
|
|
||||||
catch (err) {
|
|
||||||
failed = true;
|
|
||||||
if (BDFDB.BDUtils.getSettings(BdApi.settings["Automatic Loading"].id)) {
|
|
||||||
BDFDB.BDUtils.toggleSettings(BdApi.settings["Automatic Loading"].id, false);
|
|
||||||
BDFDB.TimeUtils.timeout(_ => {BDFDB.BDUtils.toggleSettings(BdApi.settings["Automatic Loading"].id, true)}, 3000);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (!failed) BDFDB.BDUtils.toggleSettings(BdApi.settings["Public Servers"].id, true);
|
|
||||||
}
|
|
||||||
|
|
||||||
BDFDB.loaded = true;
|
BDFDB.loaded = true;
|
||||||
window.BDFDB = BDFDB;
|
window.BDFDB = BDFDB;
|
||||||
InternalBDFDB.reloadLib = _ => {
|
InternalBDFDB.reloadLib = _ => {
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -2,12 +2,12 @@
|
||||||
|
|
||||||
var CharCounter = (_ => {
|
var CharCounter = (_ => {
|
||||||
const maxLenghts = {
|
const maxLenghts = {
|
||||||
normal: 2000,
|
chat: 2000,
|
||||||
edit: 2000,
|
edit: 2000,
|
||||||
form: 2000,
|
form: 2000,
|
||||||
nickname: 32,
|
nick: 32,
|
||||||
popout: 256,
|
popoutnote: 256,
|
||||||
profile: 256
|
profilenote: 256
|
||||||
};
|
};
|
||||||
|
|
||||||
return class CharCounter {
|
return class CharCounter {
|
||||||
|
@ -41,28 +41,28 @@ var CharCounter = (_ => {
|
||||||
pointer-events: none;
|
pointer-events: none;
|
||||||
font-size: 15px;
|
font-size: 15px;
|
||||||
}
|
}
|
||||||
${BDFDB.dotCN._charcountercounter}.normal {
|
${BDFDB.dotCN._charcounterchatcounter} {
|
||||||
right: 0;
|
right: 0;
|
||||||
bottom: -1.3em;
|
bottom: -1.3em;
|
||||||
}
|
}
|
||||||
${BDFDB.dotCN._charcountercounter}.edit {
|
${BDFDB.dotCN._charcountereditcounter} {
|
||||||
right: 0;
|
right: 0;
|
||||||
bottom: -1.3em;
|
bottom: -1.3em;
|
||||||
}
|
}
|
||||||
${BDFDB.dotCN._charcountercounter}.form {
|
${BDFDB.dotCN._charcounterformcounter} {
|
||||||
right: 0;
|
right: 0;
|
||||||
bottom: -1.0em;
|
bottom: -1.0em;
|
||||||
}
|
}
|
||||||
${BDFDB.dotCN._charcountercounter}.nickname {
|
${BDFDB.dotCN._charcounternickcounter} {
|
||||||
right: 0 !important;
|
right: 0 !important;
|
||||||
top: 0 !important;
|
top: 0 !important;
|
||||||
}
|
}
|
||||||
${BDFDB.dotCN._charcountercounter}.popout {
|
${BDFDB.dotCN._charcounterpopoutnotecounter} {
|
||||||
right: 3px !important;
|
right: 3px !important;
|
||||||
bottom: -8px !important;
|
bottom: -8px !important;
|
||||||
font-size: 10px !important;
|
font-size: 10px !important;
|
||||||
}
|
}
|
||||||
${BDFDB.dotCN._charcountercounter}.profile {
|
${BDFDB.dotCN._charcounterprofilenotecounter} {
|
||||||
right: 0 !important;
|
right: 0 !important;
|
||||||
bottom: -10px !important;
|
bottom: -10px !important;
|
||||||
font-size: 12px !important;
|
font-size: 12px !important;
|
||||||
|
@ -121,31 +121,32 @@ var CharCounter = (_ => {
|
||||||
// Begin of own functions
|
// Begin of own functions
|
||||||
|
|
||||||
processChannelTextAreaContainer (e) {
|
processChannelTextAreaContainer (e) {
|
||||||
let [children, index] = BDFDB.ReactUtils.findParent(e.returnvalue, {name: "ChannelEditorContainer"});
|
let editorContainer = BDFDB.ReactUtils.findChild(e.returnvalue, {name: "ChannelEditorContainer"});
|
||||||
if (index > -1 && children[index].props.type && maxLenghts[children[index].props.type] && !children[index].props.disabled) {
|
if (editorContainer && editorContainer.props.type && maxLenghts[editorContainer.props.type] && !editorContainer.props.disabled) {
|
||||||
if (!BDFDB.ArrayUtils.is(e.returnvalue.props.children)) e.returnvalue.props.children = [e.returnvalue.props.children];
|
if (!BDFDB.ArrayUtils.is(e.returnvalue.props.children)) e.returnvalue.props.children = [e.returnvalue.props.children];
|
||||||
this.injectCounter(e.returnvalue, e.returnvalue.props.children, children[index].props.type, BDFDB.dotCN.textarea, true);
|
this.injectCounter(e.returnvalue, e.returnvalue.props.children, editorContainer.props.type, BDFDB.dotCN.textarea, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
processNote (e) {
|
processNote (e) {
|
||||||
let [children, index] = BDFDB.ReactUtils.findParent(e.returnvalue, {name: ["TextAreaAutosize", "TextArea", "PlainTextArea"]});
|
let [children, index] = BDFDB.ReactUtils.findParent(e.returnvalue, {name: ["TextAreaAutosize", "TextArea", "PlainTextArea"]});
|
||||||
if (index > -1) this.injectCounter(e.returnvalue, children, e.instance.props.className && e.instance.props.className.indexOf(BDFDB.disCN.usernotepopout) > -1 ? "popout" : "profile", "textarea");
|
if (index > -1) this.injectCounter(e.returnvalue, children, e.instance.props.className && e.instance.props.className.indexOf(BDFDB.disCN.usernotepopout) > -1 ? "popoutnote" : "profilenote", "textarea");
|
||||||
}
|
}
|
||||||
|
|
||||||
processChangeNickname (e) {
|
processChangeNickname (e) {
|
||||||
let [children, index] = BDFDB.ReactUtils.findParent(e.returnvalue, {name: "FormItem"});
|
let formItem = BDFDB.ReactUtils.findChild(e.returnvalue, {name: "FormItem"});
|
||||||
if (index > -1) {
|
if (formItem) {
|
||||||
let [children2, index2] = BDFDB.ReactUtils.findParent(children[index], {name: "TextInput"});
|
let [children, index] = BDFDB.ReactUtils.findParent(formItem, {name: "TextInput"});
|
||||||
if (index2 > -1) this.injectCounter(children[index], children2, "nickname", BDFDB.dotCN.input);
|
if (index > -1) this.injectCounter(formItem, children, "nick", BDFDB.dotCN.input);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
injectCounter (parent, children, type, refClass, parsing) {
|
injectCounter (parent, children, type, refClass, parsing) {
|
||||||
if (!children) return;
|
if (!children) return;
|
||||||
|
if (type == "normal") type = "chat";
|
||||||
parent.props.className = BDFDB.DOMUtils.formatClassName(parent.props.className, BDFDB.disCN._charcountercounteradded);
|
parent.props.className = BDFDB.DOMUtils.formatClassName(parent.props.className, BDFDB.disCN._charcountercounteradded);
|
||||||
children.push(BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.CharCounter, {
|
children.push(BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.CharCounter, {
|
||||||
className: `${BDFDB.disCN._charcountercounter} ${type}`,
|
className: BDFDB.DOMUtils.formatClassName(BDFDB.disCN._charcountercounter, type && BDFDB.disCN[`_charcounter${type}counter`]),
|
||||||
refClass: refClass,
|
refClass: refClass,
|
||||||
parsing: parsing,
|
parsing: parsing,
|
||||||
max: maxLenghts[type],
|
max: maxLenghts[type],
|
||||||
|
|
Loading…
Reference in New Issue