From 1ced21f40cca08167a7f610f1c47a584c5759bbf Mon Sep 17 00:00:00 2001
From: Kevin Froman
Date: Wed, 17 Jul 2019 00:10:39 -0500
Subject: [PATCH] forgot navbar.js, work on board web ui refreshing and
appearance
---
onionr/static-data/www/board/board.js | 29 ++++----
onionr/static-data/www/board/index.html | 70 +++++++++++--------
onionr/static-data/www/board/theme.css | 38 +---------
onionr/static-data/www/clandestine/index.html | 1 +
onionr/static-data/www/friends/index.html | 3 +-
onionr/static-data/www/mail/index.html | 2 +-
onionr/static-data/www/private/index.html | 1 +
onionr/static-data/www/profiles/index.html | 2 +-
onionr/static-data/www/shared/navbar.js | 49 +++++++++++++
onionr/static-data/www/shared/onionrblocks.js | 7 --
10 files changed, 112 insertions(+), 90 deletions(-)
create mode 100644 onionr/static-data/www/shared/navbar.js
delete mode 100755 onionr/static-data/www/shared/onionrblocks.js
diff --git a/onionr/static-data/www/board/board.js b/onionr/static-data/www/board/board.js
index ad6c4faf..c4ead3c1 100755
--- a/onionr/static-data/www/board/board.js
+++ b/onionr/static-data/www/board/board.js
@@ -3,7 +3,7 @@ requested = []
var windowHeight = window.innerHeight;
webpassword = webpass
newPostForm = document.getElementById('addMsg')
-
+firstLoad = true
function appendMessages(msg){
var humanDate = new Date(0)
if (msg.length == 0){
@@ -18,9 +18,8 @@ function appendMessages(msg){
}
else{
humanDate.setUTCSeconds(msgDate)
- msgDate = humanDate.toDateString() + ' ' + humanDate.toTimeString()
+ msgDate = humanDate.toDateString()
}
- dateEl.textContent = msgDate
el.className = 'entry'
el.innerText = msg['content']
@@ -31,16 +30,21 @@ function appendMessages(msg){
// Instantiate the table with the existing HTML tbody
// and the row with the template
- var template = document.getElementById('cMsgTemplate');
+ var template = document.getElementById('cMsgTemplate')
// Clone the new row and insert it into the table
- var feed = document.getElementById("feed");
+ var feed = document.getElementById("feed")
var clone = document.importNode(template.content, true);
- var div = clone.querySelectorAll("div");
- div[2].textContent = msg['content'];
- div[3].textContent = msgDate;
+ var div = clone.querySelectorAll("div")
+ div[2].textContent = msg['content']
+ div[3].textContent = msgDate
- feed.appendChild(clone);
+ if (firstLoad){
+ feed.appendChild(clone)
+ }
+ else{
+ feed.prepend(clone)
+ }
} else {
// Find another way to add the rows to the table because
@@ -54,7 +58,7 @@ function getBlocks(){
}
var feedText = httpGet('/getblocksbytype/txt')
- var blockList = feedText.split(',')
+ var blockList = feedText.split(',').reverse()
for (i = 0; i < blockList.length; i++){
if (! requested.includes(blockList[i])){
bl = httpGet('/getblockdata/' + blockList[i])
@@ -62,16 +66,13 @@ function getBlocks(){
requested.push(blockList[i])
}
}
+ firstLoad = false
}
document.getElementById('refreshFeed').onclick = function(){
getBlocks()
}
-window.onload = function() {
- getBlocks();
-}
-
newPostForm.onsubmit = function(){
var message = document.getElementById('newMsgText').value
var postData = {'message': message, 'type': 'txt', 'encrypt': false}
diff --git a/onionr/static-data/www/board/index.html b/onionr/static-data/www/board/index.html
index 8b17dc53..4d718078 100755
--- a/onionr/static-data/www/board/index.html
+++ b/onionr/static-data/www/board/index.html
@@ -11,6 +11,10 @@
+
+
+
+
@@ -66,11 +70,7 @@
-
+
@@ -86,25 +86,24 @@
@@ -116,6 +115,21 @@
+
None Yet :)
@@ -130,21 +144,17 @@
-