+ 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:
parent
578a238f2e
commit
7e9fe03235
18 changed files with 171 additions and 44 deletions
|
@ -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()
|
||||
}
|
||||
|
|
|
@ -1,3 +1,22 @@
|
|||
/*
|
||||
Onionr - Private P2P Communication
|
||||
|
||||
Handle default board picker
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
recommendedIDs = document.getElementById('recommendedBoards')
|
||||
|
||||
recommendedIDs.onchange = function(){
|
||||
|
|
|
@ -11,9 +11,7 @@
|
|||
<link rel='shortcut icon' type='image/ico' href='/shared/images/favicon.ico'>
|
||||
<link rel='stylesheet' href='/shared/main/PNotifyBrightTheme.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/bulmaswatch.min.css'>
|
||||
<link rel="stylesheet" href='/shared/main/styles-new.css'>
|
||||
<link rel="stylesheet" href="/gettheme">
|
||||
<link rel="stylesheet" href="theme.css">
|
||||
<script defer src="/shared/base32.js"></script>
|
||||
<script defer src="/shared/identicon.js"></script>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue