added signature toggle on circles posts

This commit is contained in:
Kevin Froman 2019-08-31 05:56:44 -05:00
parent 271307fbe1
commit 2cb36875d2
5 changed files with 19 additions and 13 deletions

View File

@ -10,7 +10,7 @@
<img src='https://img.shields.io/github/license/beardog108/onionr'> <img src='https://gitlab.com/beardog/Onionr/badges/master/build.svg'> <img src='https://img.shields.io/badge/docker%20%F0%9F%90%8B-supported-success'> <img src='https://img.shields.io/badge/python%20version%20%F0%9F%90%8D-3.6+-blue'> <img src='https://img.shields.io/github/commit-activity/m/beardog108/onionr'> <img src='https://img.shields.io/github/license/beardog108/onionr'> <img src='https://gitlab.com/beardog/Onionr/badges/master/build.svg'> <img src='https://img.shields.io/badge/docker%20%F0%9F%90%8B-supported-success'> <img src='https://img.shields.io/badge/python%20version%20%F0%9F%90%8D-3.6+-blue'> <img src='https://img.shields.io/github/commit-activity/m/beardog108/onionr'>
<img src = 'https://img.shields.io/reddit/subreddit-subscribers/onionr?style=social'> <img src='https://img.shields.io/twitter/follow/onionrnet?style=social'> <a href='https://www.reddit.com/r/onionr'><img src = 'https://img.shields.io/reddit/subreddit-subscribers/onionr?style=social'></a> <a href='https://twitter.com/onionrnet'><img src='https://img.shields.io/twitter/follow/onionrnet?style=social'></a>
| | | | | | | |
| ----------- | ----------- | ----------- | | ----------- | ----------- | ----------- |

View File

@ -39,7 +39,11 @@ function appendMessages(msg){
var clone = document.importNode(template.content, true); var clone = document.importNode(template.content, true);
var div = clone.querySelectorAll("div") var div = clone.querySelectorAll("div")
div[2].textContent = msg['content'] 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){ if (firstLoad){
feed.appendChild(clone) feed.appendChild(clone)
@ -82,7 +86,7 @@ function getBlocks(){
appendMessages(bl) appendMessages(bl)
requested.push(blockList[i]) requested.push(blockList[i])
} }
} }
firstLoad = false firstLoad = false
} }
@ -94,7 +98,8 @@ newPostForm.onsubmit = function(){
var message = document.getElementById('newMsgText').value var message = document.getElementById('newMsgText').value
var channel = document.getElementById('feedIDInput').value var channel = document.getElementById('feedIDInput').value
var meta = {'ch': channel} 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) postData = JSON.stringify(postData)
newPostForm.style.display = 'none' newPostForm.style.display = 'none'
fetch('/insertblock', { fetch('/insertblock', {
@ -111,7 +116,6 @@ newPostForm.onsubmit = function(){
alert('This message is already queued') alert('This message is already queued')
return return
} }
alert('Queued for submission! ' + data)
setTimeout(function(){getBlocks()}, 3000) setTimeout(function(){getBlocks()}, 3000)
}) })
return false return false

View File

@ -113,11 +113,9 @@
</div> </div>
<input type="checkbox" class="checkbox" id="refreshCheckbox" checked> <input type="checkbox" class="checkbox" id="refreshCheckbox" checked>
<label for="refreshCheckbox">Auto Refresh Feed</label> <label for="refreshCheckbox">Auto Refresh Feed</label>
<!--
<br> <br>
<input type="checkbox" class="checkbox" id="postAnon" checked> <input type="checkbox" class="checkbox" id="postAnon" checked>
<label for="postAnon">Sign posts</label> <label for="postAnon">Sign posts</label>
-->
</div> </div>
</div> </div>
<div class="content"> <div class="content">
@ -139,6 +137,7 @@
<div class="column cMsg"> <div class="column cMsg">
Message Message
</div> </div>
<div class="column cAuthor is-narrow"></div>
<div class="column is-narrow cMsgDate"> <div class="column is-narrow cMsgDate">
Date Date
</div> </div>

View File

@ -9,7 +9,7 @@
Onionr Onionr
</title> </title>
<link rel='shortcut icon' type='image/ico' href='/shared/images/favicon.ico'> <link rel='shortcut icon' type='image/ico' href='/shared/images/favicon.ico'>
<link rel="stylesheet" href="/shared/fontawesome-free-5.10.2/css/all.css"> <link rel="stylesheet" href="/shared/fontawesome-free-5.10.2/css/all.min.css">
<link rel="stylesheet" href="/shared/main/bulma.min.css"> <link rel="stylesheet" href="/shared/main/bulma.min.css">
<link rel="stylesheet" href="/shared/main/styles-new.css"> <link rel="stylesheet" href="/shared/main/styles-new.css">
<script defer src='/shared/navbar.js'></script> <script defer src='/shared/navbar.js'></script>

View File

@ -106,11 +106,14 @@ for (var i = 0; i < idStrings.length; i++){
} }
/* Copy public ID on homepage */ /* Copy public ID on homepage */
myPubCopy.onclick = function() { if (typeof myPubCopy != "undefined"){
var copyText = document.getElementById("myPub");
copyText.select(); myPubCopy.onclick = function() {
document.execCommand("copy") var copyText = document.getElementById("myPub");
} copyText.select()
document.execCommand("copy")
}
}
/* For Config toggle on homepage */ /* For Config toggle on homepage */
var toggle = document.getElementById("configToggle"); var toggle = document.getElementById("configToggle");