From 37be2226d68a27dd908a17770d93443d0d782c9f Mon Sep 17 00:00:00 2001 From: grant-kun Date: Fri, 14 Oct 2022 09:42:29 -0500 Subject: deleting and less logging --- html/home.html | 14 +++++++++ html/index.html | 7 +++-- html/mail.html | 91 ++++++++++++++++++++++++++++++++++++++++++++++++++++----- 3 files changed, 102 insertions(+), 10 deletions(-) create mode 100644 html/home.html (limited to 'html') diff --git a/html/home.html b/html/home.html new file mode 100644 index 0000000..89c4730 --- /dev/null +++ b/html/home.html @@ -0,0 +1,14 @@ + + + +

hello!

+

here have some quick links:

+ + + + \ No newline at end of file diff --git a/html/index.html b/html/index.html index f28a971..04d4c9f 100644 --- a/html/index.html +++ b/html/index.html @@ -123,7 +123,7 @@ var xhr = new XMLHttpRequest(); xhr.open("POST", window.location.href + 'login/submit', true); xhr.setRequestHeader('Content-Type', 'application/json'); - xhr.onreadystatechange = function () { + xhr.onreadystatechange = async function () { if (xhr.readyState == XMLHttpRequest.DONE) { let dec = (kekw.decrypt(JSON.parse(xhr.responseText).data)); if (JSON.parse(xhr.responseText).html) { @@ -132,7 +132,10 @@ if (JSON.parse(xhr.responseText).json && JSON.parse(xhr.responseText).type == 'key') { let decc = new TextDecoder().decode(dec) //console.log(JSON.parse(decc)) - setCookie('login_key', JSON.parse(decc).login_key, 7) + let u = await document.getElementById('user').value + await setCookie('login_key', JSON.parse(decc).login_key, 7) + await setCookie('user', u, 7) + location.href = location.href + 'home' } } } diff --git a/html/mail.html b/html/mail.html index 6c66f3a..7e306e8 100644 --- a/html/mail.html +++ b/html/mail.html @@ -6,6 +6,12 @@ + + + + + + @@ -248,9 +276,9 @@ xhr.onreadystatechange = function () { if (xhr.readyState == XMLHttpRequest.DONE) { console.log('recived') - pub = new TextDecoder().decode(kekw.decrypt(JSON.parse(xhr.responseText).data)); + let pubb = new TextDecoder().decode(kekw.decrypt(JSON.parse(xhr.responseText).data)); console.log('decrypted') - resolve(pub) + resolve(pubb) } } let out = {} @@ -323,6 +351,11 @@ async function lm(index) { let m + if (preview == index) { + document.getElementById('box').style.display = 'none' + preview = -1 + return + } if (html) { m = autoLink((emails[index]['body[2]'])) } else { @@ -332,20 +365,62 @@ document.getElementById('box').style.display = 'block' document.getElementById('view').innerHTML = (m) - + preview = index } + function del(index) { + preview = index //to not view in side + revved = emails.reverse() + index = revved.indexOf(emails[index]) - 1 + //pretty proud of this reverse indexer :) + sendenc('/del', { 'index': index, 'fuck you': true, 'user': 'root', 'login_key': getCookie('login_key'), 'requested': 0 }) + } function umail() { let ret = '' let evo = false for (let email of emails) { - let c = '#2C3333' + let c = '#21252B' if (evo) { - c = '#395B64' + c = '#2A3135' } evo = !evo ret += '
' + + ret += '\ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ +' + ret += 'sub:' + email.envelope.subject + '
frm:' + email.envelope.from[0].address + '
' + email.envelope.date + '

' } @@ -361,7 +436,7 @@ if (getCookie('login_key') == null) { window.location.href = '/' } - await update() + await init() //return //document.getElementsByClassName('loading')[0].style.display = 'none' let xx = document.getElementsByClassName('card')[0] @@ -377,7 +452,7 @@ setInterval(() => { - umail() + //umail() }, 5000) } // -- cgit v1.2.3