forked from olcxjas-softworks/LarpixClient
Add groups section, actions-notifier and auth
This commit is contained in:
parent
862642fd04
commit
8fe2b5cf28
3 changed files with 124 additions and 10 deletions
|
|
@ -39,23 +39,71 @@
|
|||
<hr>
|
||||
</sidebar>
|
||||
|
||||
<sidebar class="second">
|
||||
<button class="collapse-text-button" id="collapse-dms">
|
||||
<span>Direct messages</span>
|
||||
<svg class="chevron" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
||||
<polyline points="6 9 12 15 18 9"></polyline>
|
||||
</svg>
|
||||
</button>
|
||||
<sidebar class="second" id="roomsbar">
|
||||
<div class="sidebar-section-header">
|
||||
<button class="collapse-text-button" id="collapse-dms">
|
||||
<span>Direct messages</span>
|
||||
<svg class="chevron" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
||||
<polyline points="6 9 12 15 18 9"></polyline>
|
||||
</svg>
|
||||
</button>
|
||||
<button class="add-action-button" aria-label="New Direct Message" id="add-dm-btn">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
||||
<line x1="12" y1="5" x2="12" y2="19"></line>
|
||||
<line x1="5" y1="12" x2="19" y2="12"></line>
|
||||
</svg>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div class="sidebar-section-header">
|
||||
<button class="collapse-text-button" id="collapse-groups">
|
||||
<span>Groups</span>
|
||||
<svg class="chevron" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
||||
<polyline points="6 9 12 15 18 9"></polyline>
|
||||
</svg>
|
||||
</button>
|
||||
<button class="add-action-button" aria-label="New Group" id="add-group-btn">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
||||
<line x1="12" y1="5" x2="12" y2="19"></line>
|
||||
<line x1="5" y1="12" x2="19" y2="12"></line>
|
||||
</svg>
|
||||
</button>
|
||||
</div>
|
||||
</sidebar>
|
||||
|
||||
<roomcontent>
|
||||
|
||||
</roomcontent>
|
||||
<sidebar class="second">
|
||||
<sidebar class="second" id="roomdetailsbar">
|
||||
</sidebar>
|
||||
</body>
|
||||
</html>
|
||||
<script src="main.js"></script>
|
||||
<script>
|
||||
async function start()
|
||||
{
|
||||
showAction("Authenticating...", "startauth");
|
||||
let res = await Auth(username, password);
|
||||
clearAction("startauth");
|
||||
if (res == "Login successful")
|
||||
{
|
||||
await refreshDms();
|
||||
}
|
||||
else
|
||||
{
|
||||
showNotification("Failed to auth. Redirecting to login...", "error", 3500);
|
||||
await delay(2000);
|
||||
window.location.href = "login/";
|
||||
}
|
||||
}
|
||||
|
||||
async function refreshDms()
|
||||
{
|
||||
showAction("Refreshing dms...", "dmrefresh");
|
||||
let res = await fetchEncrypted("user/dm/list", "");
|
||||
console.log(res);
|
||||
clearAction("dmrefresh");
|
||||
}
|
||||
|
||||
start();
|
||||
</script>
|
||||
Loading…
Add table
Add a link
Reference in a new issue