restructured directories

This commit is contained in:
Kevin Froman 2020-10-09 07:44:04 +00:00
parent 94045057c3
commit 14c8aac76b
13 changed files with 30 additions and 17 deletions

View File

@ -11,16 +11,16 @@
<link rel="icon" href="data:image/svg+xml,<svg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 100 100%22><text y=%22.9em%22 font-size=%2290%22>👁️</text></svg>"> <link rel="icon" href="data:image/svg+xml,<svg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 100 100%22><text y=%22.9em%22 font-size=%2290%22>👁️</text></svg>">
<link rel="stylesheet" href="css/bulma-dark.min.css"> <link rel="stylesheet" href="css/bulma-dark.min.css">
<link rel="stylesheet" href="style.css"> <link rel="stylesheet" href="css/style.css">
<script src="tordetect.js" async></script> <script src="js/tordetect.js" async></script>
<script src="marked.min.js" defer></script> <script src="js/marked.min.js" defer></script>
<script src="purify.min.js" defer></script> <script src="js/purify.min.js" defer></script>
<script src="sha3.js" defer></script> <script src="js/sha3.js" defer></script>
<script src="jspow/index.js" defer></script> <script src="jspow/index.js" defer></script>
<script src="onionr-blocks.js" defer></script> <script src="js/onionr-blocks.js" defer></script>
<script src="hush-hush.js" defer></script> <script src="js/hush-hush.js" defer></script>
<script src="worker-handler.js" defer></script> <script src="js/worker-handler.js" defer></script>
<script src="message-creator.js" defer></script> <script src="js/message-creator.js" defer></script>
</head> </head>
<body> <body>
<section class="section"> <section class="section">
@ -38,13 +38,19 @@
JavaScript is required for this app. The server has no knowledge of posts, so content must be served by P2P nodes. JavaScript is required for this app. The server has no knowledge of posts, so content must be served by P2P nodes.
</p></noscript> </p></noscript>
<p>kiccan is a message board program that utilizes the <a href="https://onionr.net/">Onionr</a> network.</p> <p>kiccan is a message board program that utilizes the <a href="https://onionr.net/">Onionr</a> network.</p>
<p>posts are rate-limited using a partial hash collision proof of work function.</p> <p>posts are rate-limited and protected using a partial hash collision proof of work function.</p>
<p>kiccan is <i>decentralized as in power</i></p>
<p>⚠️ the host of this web page has no control over posts. Browse and post at your own risk.</p> <p>⚠️ the host of this web page has no control over posts. Browse and post at your own risk.</p>
<br> <br>
<label class="checkbox"> <div class="columns">
<input type="checkbox" id="use-markdown" checked> <div id="lastReached" class="column has-text-warning is-one-fifth">Last reached network: never</div>
write using markdown/HTML <div class="column">
</label> <label class="checkbox">
<input type="checkbox" id="use-markdown" checked>
draft using markdown/HTML
</label>
</div>
</div>
<p class="is-pulled-right">feed size: <span id="memUsage">0kb</span> | page size: 289kb</p> <p class="is-pulled-right">feed size: <span id="memUsage">0kb</span> | page size: 289kb</p>
<p class="is-hidden has-text-warning noTor">You do not seem to be able to reach .onion services. Please use Tor Browser.</p> <p class="is-hidden has-text-warning noTor">You do not seem to be able to reach .onion services. Please use Tor Browser.</p>
</div> </div>
@ -70,6 +76,9 @@
</section> </section>
<div class="container messageFeed"> <div class="container messageFeed">
</div> </div>
<div class="container block">
<footer>Privacy policy: We log nothing, but Onionr node operators may log data. Nothing personalized is sent to Onionr nodes, but all posts should be considered public and immutable.</footer>
</div>
<template id="cMsgTemplate"> <template id="cMsgTemplate">
<div class="box cMsgBox"> <div class="box cMsgBox">
<div class="columns"> <div class="columns">

View File

@ -17,7 +17,8 @@
*/ */
var findMessageIntervalTime = 5000 var findMessageIntervalTime = 5000
var publicNodes = [ var publicNodes = [
"ty3rq3kub6gvzpngnrvfsk5emhoh2ltkti62u4ophca6ijciajotqqid" "ty3rq3kub6gvzpngnrvfsk5emhoh2ltkti62u4ophca6ijciajotqqid",
"aekulizc7lsl4bh3ainlnnbfqtboavitfxuvanqq3eyposdifzzeddqd"
] ]
var messageHashes = [] var messageHashes = []
var blocks = [] var blocks = []
@ -118,9 +119,12 @@ async function apiGET(path, queryString, raw=false){
if (response.ok) { // if HTTP-status is 200-299 if (response.ok) { // if HTTP-status is 200-299
// get the response body (the method explained below) // get the response body (the method explained below)
if (raw){ if (raw){
connectedToOnionr = true
return await response.blob() return await response.blob()
} }
clearTimeout(requestTimeout) clearTimeout(requestTimeout)
document.getElementById("lastReached").classList.replace("has-text-warning", "has-text-success")
document.getElementById("lastReached").innerText = "Onionr network reached"
return await response.text() return await response.text()
} else { } else {
console.debug("HTTP-Error: " + response.status) console.debug("HTTP-Error: " + response.status)
@ -128,9 +132,9 @@ async function apiGET(path, queryString, raw=false){
} }
async function findMessages(){ async function findMessages(){
findMessageIntervalTime = 5000
if (document.hidden){ if (document.hidden){
setTimeout(function(){findMessages()}, 1000) findMessageIntervalTime = 10000
return
} }
let messages = (await apiGET("getblocklist", "?type=" + postTopic + "&date=" + lastLookup)).split('\n') let messages = (await apiGET("getblocklist", "?type=" + postTopic + "&date=" + lastLookup)).split('\n')
lastLookup = Math.floor((Date.now() / 1000)) lastLookup = Math.floor((Date.now() / 1000))

View File

View File

View File

View File