From 2d5fc6cf54c897eb04be629db961bd48743cc542 Mon Sep 17 00:00:00 2001 From: Kevin Froman Date: Mon, 14 Oct 2019 06:02:51 -0500 Subject: [PATCH] use span instead of input in mail ui --- TODO.txt | 1 + docs/usage/mail.md | 16 ++++++++++++++++ static-data/www/mail/mail.js | 21 +++++++++++---------- static-data/www/mail/sethumanreadable.js | 2 +- 4 files changed, 29 insertions(+), 11 deletions(-) diff --git a/TODO.txt b/TODO.txt index 93850055..b8c43cd1 100644 --- a/TODO.txt +++ b/TODO.txt @@ -12,3 +12,4 @@ * add node online check for web ui * add edits to circles posts * use truncated words in mail instead of inputs +* make node "speed" setting such as when ui is open to reduce bandwidth usage diff --git a/docs/usage/mail.md b/docs/usage/mail.md index e69de29b..b747bada 100644 --- a/docs/usage/mail.md +++ b/docs/usage/mail.md @@ -0,0 +1,16 @@ +To use OnionrMail, open the web interface: + +`$ onionr.sh openweb` + +Navigate to the mail interface from the navbar. + +## Receiving mail + +Copy your ID from the textbox below the navbar. Publish the ID so that someone (or general people) know your ID to send messages to it. Note that associating the ID with your real ID publicly removes anonymity. + +## Sending mail + +1. optionally add the recipient as a friend via the friends page. +2. click compose in the mail menu +3. either select the recipient from the friend list or paste their ID in manually into the recipient box +4. send away! diff --git a/static-data/www/mail/mail.js b/static-data/www/mail/mail.js index 82afa137..d65d933d 100755 --- a/static-data/www/mail/mail.js +++ b/static-data/www/mail/mail.js @@ -179,8 +179,8 @@ function loadInboxEntries(bHash){ //console.log(resp) var entry = document.createElement('div') var bHashDisplay = document.createElement('span') - var senderInput = document.createElement('input') - //var senderInput = document.createElement('div') + //var senderInput = document.createElement('input') + var senderInput = document.createElement('span') var subjectLine = document.createElement('span') var dateStr = document.createElement('span') var validSig = document.createElement('span') @@ -204,7 +204,7 @@ function loadInboxEntries(bHash){ else{ resp2.text().then(function(resp2){ loadHumanReadableToCache(resp['meta']['signer']) - senderInput.value = resp2 + senderInput.innerText = resp2 entry.setAttribute('data-nameSet', true) }) } @@ -212,7 +212,7 @@ function loadInboxEntries(bHash){ } else{ - senderInput.value = 'Anonymous' + senderInput.innerText = 'Anonymous' entry.setAttribute('data-nameSet', false) } if (! resp['meta']['validSig']){ @@ -246,7 +246,7 @@ function loadInboxEntries(bHash){ if (event.target.classList.contains('deleteBtn')){ return } - openThread(entry.getAttribute('data-hash'), senderInput.value, dateStr.innerText, resp['meta']['validSig'], entry.getAttribute('data-pubkey'), subjectLine.innerText) + openThread(entry.getAttribute('data-hash'), senderInput.innerText, dateStr.innerText, resp['meta']['validSig'], entry.getAttribute('data-pubkey'), subjectLine.innerText) } deleteBtn.onclick = function(){ @@ -305,7 +305,8 @@ function getSentbox(){ var entry = document.createElement('div') var toLabel = document.createElement('span') toLabel.innerText = 'To: ' - var toEl = document.createElement('input') + var toEl = document.createElement('span') + toEl.classList.add('toElement') var sentDate = document.createElement('span') var humanDate = new Date(0) humanDate.setUTCSeconds(resp[i]['date']) @@ -314,14 +315,14 @@ function getSentbox(){ var deleteBtn = document.createElement('button') var message = resp[i]['message'] deleteBtn.classList.add('deleteBtn', 'delete') - toEl.readOnly = true + sentDate.innerText = humanDate.substring(0, humanDate.indexOf('(')) if (resp[i]['name'] == null || resp[i]['name'].toLowerCase() == 'anonymous'){ - toEl.value = resp[i]['peer'] + toEl.innerText = resp[i]['peer'] setHumanReadableValue(toEl, resp[i]['peer']) } else{ - toEl.value = resp[i]['name'] + toEl.innerText = resp[i]['name'] } preview.innerText = '(' + resp[i]['subject'] + ')' entry.classList.add('sentboxList') @@ -340,7 +341,7 @@ function getSentbox(){ e.target.parentNode.parentNode.removeChild(e.target.parentNode) return } - showSentboxWindow(toEl.value, message) + showSentboxWindow(toEl.innerText, message) } })(i, resp) threadPart.appendChild(entry) diff --git a/static-data/www/mail/sethumanreadable.js b/static-data/www/mail/sethumanreadable.js index 0e536f94..6a4df08d 100644 --- a/static-data/www/mail/sethumanreadable.js +++ b/static-data/www/mail/sethumanreadable.js @@ -29,7 +29,7 @@ function loadHumanReadableToCache(key){ function setHumanReadableValue(el, key){ if (typeof humanReadableCache[key] != 'undefined'){ - el.value = humanReadableCache[key] + el.innerText = humanReadableCache[key].split('-').slice(0,3).join('-') return } else{