forked from olcxjas-softworks/LarpixClient
Compatibility tweaks
- Fix (i hope all) electron issues - Add complete blah support - Add userscript
This commit is contained in:
parent
588d55abf8
commit
7ff648ba3a
19 changed files with 478 additions and 576 deletions
|
|
@ -84,14 +84,14 @@
|
|||
Splash
|
||||
</roomtopbar>
|
||||
<roomcontent2>
|
||||
<div style="display: flex;justify-content: center;align-items: center;height:100%;flex-direction: column;">
|
||||
<div style="display: flex;justify-content: center;align-items: center;height:100%;flex-direction: column;text-align: center;">
|
||||
<img src="favicon.svg" style="width: 6rem">
|
||||
<herotitle>Welcome to Miarven</herotitle>
|
||||
<p>First Larpix client. <span class="aqua">v<span class="clientver aqua">1.0</span></span></p>
|
||||
</div>
|
||||
</roomcontent2>
|
||||
</roomcontent>
|
||||
<sidebar class="second hidden" id="roomdetailsbar" style="display: none;">
|
||||
<sidebar class="second" id="roomdetailsbar" style="display: none;">
|
||||
</sidebar>
|
||||
|
||||
</body>
|
||||
|
|
@ -100,21 +100,28 @@
|
|||
<script>
|
||||
async function start() {
|
||||
try {
|
||||
|
||||
if (host != null)
|
||||
{
|
||||
await updateProtocolAndUrl(host);
|
||||
}
|
||||
else
|
||||
{
|
||||
await updateProtocolAndUrl(window.location.hostname);
|
||||
}
|
||||
|
||||
showAction("Authenticating...", "startauth");
|
||||
let res = await Auth(username, password);
|
||||
clearAction("startauth");
|
||||
if (res == "Login successful") {
|
||||
if (res.startsWith("success:")) {
|
||||
await refreshDms();
|
||||
} else {
|
||||
showNotification("Failed to auth. Redirecting to login...", "error", 3500);
|
||||
showBlahNotification("error:auth.failed.redirect.to.login");
|
||||
await delay(2000);
|
||||
window.location.href = "login/index.html";
|
||||
}
|
||||
} catch (e) {
|
||||
clearAction("startauth");
|
||||
showNotification("Failed to auth. Redirecting to login...", "error", 3500);
|
||||
showBlahNotification("error:auth.failed.redirect.to.login");
|
||||
await delay(2000);
|
||||
window.location.href = "login/index.html";
|
||||
}
|
||||
|
|
@ -131,9 +138,27 @@
|
|||
}
|
||||
catch (e) {
|
||||
clearAction("dmrefresh");
|
||||
showNotification("Failed to refresh dms", "error", 3500);
|
||||
showBlahNotification("error:dm.refresh.failed");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
async function addDm() {
|
||||
try {
|
||||
showAction("Adding...", "dmadd");
|
||||
let res = await fetchEncrypted("user/dm/invite", document.getElementById("addchat-username").value);
|
||||
console.log(res);
|
||||
let ressplit = res.split(":");
|
||||
clearAction("dmadd");
|
||||
showBlahNotification(res);
|
||||
}
|
||||
catch (e) {
|
||||
console.log(e);
|
||||
clearAction("dmadd");
|
||||
showBlahNotification("error:chat.add.failed");
|
||||
}
|
||||
}
|
||||
|
||||
start();
|
||||
</script>
|
||||
</script>
|
||||
<script src="userscript.js"></script>
|
||||
Loading…
Add table
Add a link
Reference in a new issue