mirror of
https://github.com/MathMan05/Fermi.git
synced 2026-10-22 19:41:18 +00:00
add dev menu and reduce logging
This commit is contained in:
1 parent
6e777d86fa
commit
266ede71d8
6 files changed
+46
-33
No files matched your search
@@ -195,7 +195,6 @@ class Contextmenu<x, y> {
|
||||
div.style.left = x + "px";
|
||||
document.body.appendChild(div);
|
||||
Contextmenu.keepOnScreen(div);
|
||||
console.log(div);
|
||||
|
||||
return this.div;
|
||||
}
|
||||
|
||||
@@ -42,12 +42,10 @@ class Hover {
|
||||
elm.addEventListener("mouseover", () => {
|
||||
clearTimeout(timeOut);
|
||||
timeOut = setTimeout(async () => {
|
||||
console.log(this.elm2);
|
||||
RM();
|
||||
this.elm2 = await this.makeHover(elm);
|
||||
Hover.bound = elm;
|
||||
Hover.watchForGone();
|
||||
console.error(this.elm2, tempy, document.contains(elm), elm);
|
||||
}, 300);
|
||||
});
|
||||
elm.addEventListener("mouseout", () => {
|
||||
@@ -56,7 +54,6 @@ class Hover {
|
||||
});
|
||||
new MutationObserver((e) => {
|
||||
if (e[0].removedNodes.length) {
|
||||
console.error("Hi :3", this.elm2, tempy, document.contains(elm), e[0]);
|
||||
clearTimeout(timeOut);
|
||||
RM();
|
||||
}
|
||||
|
||||
+39
-22
@@ -622,7 +622,7 @@ class Localuser {
|
||||
}
|
||||
async handleEvent(temp: wsjson) {
|
||||
if (temp.d._trace) this.handleTrace(temp.d._trace);
|
||||
console.debug(temp);
|
||||
if (localStorage.getItem("logGateway")) console.debug(temp);
|
||||
if (temp.s) this.lastSequence = temp.s;
|
||||
if (temp.op === 9 && this.ws) {
|
||||
this.errorBackoff = 0;
|
||||
@@ -1214,8 +1214,6 @@ class Localuser {
|
||||
category.append(membershtml);
|
||||
div.append(category);
|
||||
}
|
||||
|
||||
console.log(elms);
|
||||
}
|
||||
emojiPicker(x: number, y: number, guildEmojis = true) {
|
||||
return Emoji.emojiPicker(x, y, guildEmojis ? this : undefined);
|
||||
@@ -2477,25 +2475,8 @@ class Localuser {
|
||||
localStorage.removeItem("Voice enabled");
|
||||
}
|
||||
};
|
||||
const box2 = security.addCheckboxInput("Enable logging of bad stuff", () => {}, {
|
||||
initState: Boolean(localStorage.getItem("logbad")),
|
||||
});
|
||||
box2.onchange = (e) => {
|
||||
if (e) {
|
||||
if (confirm("this is meant for spacebar devs")) {
|
||||
localStorage.setItem("logbad", "true");
|
||||
} else {
|
||||
box2.value = false;
|
||||
const checkbox = box2.input.deref();
|
||||
if (checkbox) {
|
||||
checkbox.checked = false;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
localStorage.removeItem("logbad");
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
{
|
||||
security.addButtonInput("", I18n.logout.logout(), async () => {
|
||||
if (await this.userinfo.logout()) {
|
||||
@@ -2883,7 +2864,43 @@ class Localuser {
|
||||
}
|
||||
})();
|
||||
}
|
||||
if (this.trace.length) {
|
||||
{
|
||||
const devSettings = settings.addButton(I18n.devSettings.name());
|
||||
devSettings.addText(I18n.devSettings.description());
|
||||
devSettings.addHR();
|
||||
const box1 = devSettings.addCheckboxInput(I18n.devSettings.logGateway(), () => {}, {
|
||||
initState: Boolean(localStorage.getItem("logGateway")),
|
||||
});
|
||||
box1.onchange = (e) => {
|
||||
if (e) {
|
||||
localStorage.setItem("logGateway", "true");
|
||||
} else {
|
||||
localStorage.removeItem("logGateway");
|
||||
}
|
||||
};
|
||||
const box2 = devSettings.addCheckboxInput(I18n.devSettings.badUser(), () => {}, {
|
||||
initState: Boolean(localStorage.getItem("logbad")),
|
||||
});
|
||||
box2.onchange = (e) => {
|
||||
if (e) {
|
||||
localStorage.setItem("logbad", "true");
|
||||
} else {
|
||||
localStorage.removeItem("logbad");
|
||||
}
|
||||
};
|
||||
|
||||
const box3 = devSettings.addCheckboxInput(I18n.devSettings.traces(), () => {}, {
|
||||
initState: Boolean(localStorage.getItem("traces")),
|
||||
});
|
||||
box3.onchange = (e) => {
|
||||
if (e) {
|
||||
localStorage.setItem("traces", "true");
|
||||
} else {
|
||||
localStorage.removeItem("traces");
|
||||
}
|
||||
};
|
||||
}
|
||||
if (this.trace.length && localStorage.getItem("traces")) {
|
||||
const traces = settings.addButton(I18n.localuser.trace());
|
||||
const traceArr = this.trace;
|
||||
|
||||
|
||||
@@ -926,7 +926,6 @@ class MarkDown {
|
||||
(last.contentEditable === "false" || last instanceof HTMLBRElement)
|
||||
) {
|
||||
span.append(current);
|
||||
console.log(current);
|
||||
}
|
||||
return span;
|
||||
}
|
||||
|
||||
@@ -379,9 +379,6 @@ class Message extends SnowFlake {
|
||||
this.member = _;
|
||||
});
|
||||
}
|
||||
if (this.mentionsuser(this.localuser.user)) {
|
||||
console.log(this);
|
||||
}
|
||||
if (this.div) {
|
||||
this.generateMessage();
|
||||
return;
|
||||
@@ -621,7 +618,6 @@ class Message extends SnowFlake {
|
||||
thisTime.getMonth() !== prevTime.getMonth() ||
|
||||
thisTime.getFullYear() !== prevTime.getFullYear();
|
||||
} else {
|
||||
console.warn(div);
|
||||
datelineNeeded = true;
|
||||
}
|
||||
if (datelineNeeded) {
|
||||
@@ -926,7 +922,6 @@ class Message extends SnowFlake {
|
||||
text.appendChild(messagedwrap);
|
||||
build.appendChild(text);
|
||||
if (this.attachments.length) {
|
||||
console.log(this.attachments);
|
||||
const attach = document.createElement("div");
|
||||
attach.classList.add("flexltr", "attachments");
|
||||
for (const thing of this.attachments) {
|
||||
@@ -1202,7 +1197,6 @@ class Message extends SnowFlake {
|
||||
} else {
|
||||
}
|
||||
build += "\nReacted with " + thing.emoji.name;
|
||||
console.log(build);
|
||||
return build;
|
||||
});
|
||||
h.addEvent(reaction);
|
||||
|
||||
@@ -280,6 +280,13 @@
|
||||
"warnOffiline": "Instance is offline, can't connect",
|
||||
"icon": "$1's instance icon"
|
||||
},
|
||||
"devSettings":{
|
||||
"name":"Developer Settings",
|
||||
"description":"These are for developers of Spacebar/Fermi, if you don't know what you're doing, please don't mess with these settings.",
|
||||
"badUser":"Enabled logging of bad user objects that send too much information:",
|
||||
"logGateway":"Log received gateway events (log level info):",
|
||||
"traces":"Expose traces:"
|
||||
},
|
||||
"htmlPages": {
|
||||
"idpermissions": "This will allow the bot to:",
|
||||
"addBot": "Add to guild",
|
||||
|
||||
Reference in new issue
Block a user