From 2cb36875d2f32bf8369300c1a243268e8fbf6c8b Mon Sep 17 00:00:00 2001 From: Kevin Froman Date: Sat, 31 Aug 2019 05:56:44 -0500 Subject: [PATCH] added signature toggle on circles posts --- README.md | 2 +- onionr/static-data/www/board/board.js | 12 ++++++++---- onionr/static-data/www/board/index.html | 3 +-- onionr/static-data/www/private/index.html | 2 +- onionr/static-data/www/shared/misc.js | 13 ++++++++----- 5 files changed, 19 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index 73eb458e..d0e9116e 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ - + | | | | | ----------- | ----------- | ----------- | diff --git a/onionr/static-data/www/board/board.js b/onionr/static-data/www/board/board.js index dd9f887f..9e03c6eb 100755 --- a/onionr/static-data/www/board/board.js +++ b/onionr/static-data/www/board/board.js @@ -39,7 +39,11 @@ function appendMessages(msg){ var clone = document.importNode(template.content, true); var div = clone.querySelectorAll("div") div[2].textContent = msg['content'] - div[3].textContent = msgDate + if (typeof msg['meta']['signer'] != 'undefined'){ + div[3].textContent = msg['meta']['signer'].substr(0, 5) + div[3].title = msg['meta']['signer'] + } + div[4].textContent = msgDate if (firstLoad){ feed.appendChild(clone) @@ -82,7 +86,7 @@ function getBlocks(){ appendMessages(bl) requested.push(blockList[i]) } - } + } firstLoad = false } @@ -94,7 +98,8 @@ newPostForm.onsubmit = function(){ var message = document.getElementById('newMsgText').value var channel = document.getElementById('feedIDInput').value var meta = {'ch': channel} - var postData = {'message': message, 'sign': false, 'type': 'brd', 'encrypt': false, 'meta': JSON.stringify(meta)} + let doSign = document.getElementById('postAnon').checked + var postData = {'message': message, 'sign': doSign, 'type': 'brd', 'encrypt': false, 'meta': JSON.stringify(meta)} postData = JSON.stringify(postData) newPostForm.style.display = 'none' fetch('/insertblock', { @@ -111,7 +116,6 @@ newPostForm.onsubmit = function(){ alert('This message is already queued') return } - alert('Queued for submission! ' + data) setTimeout(function(){getBlocks()}, 3000) }) return false diff --git a/onionr/static-data/www/board/index.html b/onionr/static-data/www/board/index.html index 11e0dce4..4c0050b0 100755 --- a/onionr/static-data/www/board/index.html +++ b/onionr/static-data/www/board/index.html @@ -113,11 +113,9 @@ -
@@ -139,6 +137,7 @@
Message
+
Date
diff --git a/onionr/static-data/www/private/index.html b/onionr/static-data/www/private/index.html index 57b32375..62d0e9bc 100755 --- a/onionr/static-data/www/private/index.html +++ b/onionr/static-data/www/private/index.html @@ -9,7 +9,7 @@ Onionr - + diff --git a/onionr/static-data/www/shared/misc.js b/onionr/static-data/www/shared/misc.js index 775ef7c8..8f3e16c9 100755 --- a/onionr/static-data/www/shared/misc.js +++ b/onionr/static-data/www/shared/misc.js @@ -106,11 +106,14 @@ for (var i = 0; i < idStrings.length; i++){ } /* Copy public ID on homepage */ -myPubCopy.onclick = function() { - var copyText = document.getElementById("myPub"); - copyText.select(); - document.execCommand("copy") -} +if (typeof myPubCopy != "undefined"){ + + myPubCopy.onclick = function() { + var copyText = document.getElementById("myPub"); + copyText.select() + document.execCommand("copy") + } +} /* For Config toggle on homepage */ var toggle = document.getElementById("configToggle");