+ added theme api

+ added switcher from dark and light theme
- deleted profiles directory for now
+ added theme config option
* added boilerplate to circle picker and useridenticons
This commit is contained in:
Kevin Froman 2019-10-05 18:35:40 -05:00
parent 578a238f2e
commit 7e9fe03235
No known key found for this signature in database
GPG key ID: 0D414D0FE405B63B
18 changed files with 171 additions and 44 deletions

View file

@ -25,6 +25,8 @@ newPostForm = document.getElementById('addMsg')
firstLoad = true
lastLoadedBoard = 'global'
loadingMessage = document.getElementById('loadingBoard')
loadedAny = false
loadingTimeout = 8000
let toggleLoadingMessage = function(){
switch (loadingMessage.style.display){
@ -107,6 +109,7 @@ function appendMessages(msg, blockHash, beforeHash){
div[4].textContent = msgDate
loadingMessage.style.display = "none"
loadedAny = true
if (firstLoad){
//feed.appendChild(clone)
feed.prepend(clone)
@ -130,10 +133,16 @@ function getBlocks(){
var ch = document.getElementById('feedIDInput').value
if (lastLoadedBoard !== ch){
toggleLoadingMessage()
loadedAny = false
while (feed.firstChild) {
feed.removeChild(feed.firstChild);
}
requested = [] // reset requested list
setTimeout(function(){
if (! loadedAny && ch == document.getElementById('feedIDInput').value){
PNotify.notice("There are no posts for " + ch + " (yet).")
}
}, loadingTimeout)
}
lastLoadedBoard = ch
@ -142,7 +151,7 @@ function getBlocks(){
}
var feedText = httpGet('/flow/getpostsbyboard/' + ch)
var feedText = httpGet('/flow/getpostsbyboard/' + ch) // TODO switch to fetch
var blockList = feedText.split(',')
for (i = 0; i < blockList.length; i++){
@ -183,7 +192,6 @@ function loadMessage(blockHash, blockList, count){
})
}
document.getElementById('refreshFeed').onclick = function(){
getBlocks()
}