From 3068b57c4841491ae885e555cc5560a1c2f80a9c Mon Sep 17 00:00:00 2001 From: kaotisk Date: Sat, 30 Nov 2024 14:24:18 +0200 Subject: Minor updates - Fix refreshRadio and exported function - Exported function refreshChat - New function debugLog to replace console.log with conditional printing - Licensing to be LibreJS compatible - Minor fixes where applicable (see diff) --- src/js/app.js | 23 ++++++------- src/js/arching-kaos-decentralized-radio.js | 14 ++++---- src/js/arching-kaos-fetch.js | 27 ++++++++------- src/js/arching-kaos-generator.js | 14 ++++---- src/js/arching-kaos-log.js | 14 ++++---- src/js/arching-kaos-modules-comments.js | 14 ++++---- src/js/arching-kaos-modules-files.js | 14 ++++---- src/js/arching-kaos-modules-mixtapes.js | 16 ++++----- src/js/arching-kaos-modules-news.js | 14 ++++---- src/js/arching-kaos-modules-references.js | 17 +++++----- src/js/arching-kaos-spa-router.js | 14 ++++---- src/js/arching-kaos-stellar-network.js | 23 +++++++------ src/js/arching-kaos-tools.js | 47 +++++++++++++------------- src/js/arching-kaos-web-ui-settings.js | 23 +++++++------ src/js/environment-setup.js | 14 ++++---- src/js/ui/footer.js | 8 +++++ src/js/ui/header.js | 8 +++++ src/js/ui/main.js | 8 +++++ src/js/ui/mainLayout.js | 8 +++++ src/js/ui/menu.js | 17 +++++----- src/js/ui/sections/aboutSection.js | 8 +++++ src/js/ui/sections/akNodeInfoSection.js | 8 +++++ src/js/ui/sections/chatSection.js | 8 +++++ src/js/ui/sections/commentsSection.js | 8 +++++ src/js/ui/sections/filesSection.js | 8 +++++ src/js/ui/sections/mixtapesSection.js | 8 +++++ src/js/ui/sections/myPageSection.js | 8 +++++ src/js/ui/sections/newsSection.js | 8 +++++ src/js/ui/sections/notFoundSection.js | 8 +++++ src/js/ui/sections/radioSection.js | 8 +++++ src/js/ui/sections/settingsSection.js | 24 ++++++------- src/js/ui/sections/statsSection.js | 8 +++++ src/js/ui/sections/stellarBalancesSection.js | 8 +++++ src/js/ui/sections/stellarDataConfigSection.js | 8 +++++ src/js/ui/sections/stellarSection.js | 8 +++++ src/js/ui/sections/welcomeSection.js | 8 +++++ src/js/ui/sections/zchainDataSection.js | 8 +++++ src/js/url-generators.js | 14 ++++---- src/js/utils.js | 32 ++++++++++++------ 39 files changed, 354 insertions(+), 181 deletions(-) (limited to 'src/js') diff --git a/src/js/app.js b/src/js/app.js index ceab2bc..a73c0c3 100644 --- a/src/js/app.js +++ b/src/js/app.js @@ -1,20 +1,16 @@ -/* Arching Kaos Web UI App Launcher - * - * Kaotisk Hund - 2024 - * - * @license magnet:?xt=urn:btih:0b31508aeb0634b347b8270c7bee4d411b5d4109&dn=agpl-3.0.txt AGPL v3.0 - * - * - * Body and pageLayout resizer to device's resolution. - * - * TODO: Figure out why it doesn't work in fullscreen App mode (android) - * - */ +// Arching Kaos Web UI App Launcher +// +// Kaotisk Hund - 2024 +// +// @license magnet:?xt=urn:btih:0b31508aeb0634b347b8270c7bee4d411b5d4109&dn=agpl-3.0.txt AGPL v3.0 +// + import { locationHashOnChange } from "./arching-kaos-spa-router.js"; import { doubleFloorMenu, menuinit, menusel, stellarSubToggle, modulesSubToggle, exploreSubToggle } from './ui/menu.js'; import { mainLayoutSpawn } from "./ui/mainLayout.js"; import { scanStellarNetworkForPeers } from "./arching-kaos-stellar-network.js"; import { checkLocalNodeInfo, checkLocalPeers, checkLocalSchain, seekZblock } from "./arching-kaos-tools.js"; +import { refreshChat, refreshRadio, setDebug } from "./utils.js"; window.menusel = menusel; window.locationHashOnChange = locationHashOnChange; @@ -26,6 +22,9 @@ window.seekZblock = seekZblock; window.checkLocalNodeInfo = checkLocalNodeInfo; window.checkLocalPeers = checkLocalPeers; window.checkLocalSchain = checkLocalSchain; +window.refreshChat = refreshChat; +window.refreshRadio = refreshRadio; +window.setDebug = setDebug; export function body() { diff --git a/src/js/arching-kaos-decentralized-radio.js b/src/js/arching-kaos-decentralized-radio.js index 061a142..63d2c2a 100644 --- a/src/js/arching-kaos-decentralized-radio.js +++ b/src/js/arching-kaos-decentralized-radio.js @@ -1,10 +1,10 @@ -/* Arching Kaos Dentralized Radio - * - * Kaotisk Hund - 2024 - * - * @license magnet:?xt=urn:btih:0b31508aeb0634b347b8270c7bee4d411b5d4109&dn=agpl-3.0.txt AGPL v3.0 - * - */ +// Arching Kaos Dentralized Radio +// +// Kaotisk Hund - 2024 +// +// @license magnet:?xt=urn:btih:0b31508aeb0634b347b8270c7bee4d411b5d4109&dn=agpl-3.0.txt AGPL v3.0 +// + // var radio = document.querySelector("#radio-player"); // var radioButton = document.querySelector("#radio-button-controller"); diff --git a/src/js/arching-kaos-fetch.js b/src/js/arching-kaos-fetch.js index 15394b2..5f27728 100644 --- a/src/js/arching-kaos-fetch.js +++ b/src/js/arching-kaos-fetch.js @@ -1,12 +1,13 @@ -/* Arching Kaos Fetch - * - * Kaotisk Hund - 2024 - * - * @license magnet:?xt=urn:btih:0b31508aeb0634b347b8270c7bee4d411b5d4109&dn=agpl-3.0.txt AGPL v3.0 - * - */ +// Arching Kaos Fetch +// +// Kaotisk Hund - 2024 +// +// @license magnet:?xt=urn:btih:0b31508aeb0634b347b8270c7bee4d411b5d4109&dn=agpl-3.0.txt AGPL v3.0 +// + import { archingKaosLog } from "./arching-kaos-log.js"; import { httpProgressPlaceholder, progressPlaceholder } from "./app.js"; +import { debugLog } from "./utils.js"; export function archingKaosFetchJSON( url, callback, params ){ const request = new XMLHttpRequest(); @@ -19,18 +20,18 @@ export function archingKaosFetchJSON( url, callback, params ){ } }); request.addEventListener("error", ()=>{ - // console.log("An error occured."); + debugLog("An error occured."); }); request.addEventListener("progress", (event)=>{ if (event.lengthComputable && progressPlaceholder()){ httpProgressPlaceholder().value = (event.loaded / event.total) * 100; } else { httpProgressPlaceholder().value = 0; - // console.log("Supposingly zeroed progressPlaceholder"); + debugLog("Supposingly zeroed progressPlaceholder"); } }); request.addEventListener("abort", ()=>{ - // console.log("Request aborted."); + debugLog("Request aborted."); }); request.open("GET", url); request.send(); @@ -48,18 +49,18 @@ export async function archingKaosFetchText( url, callback, params ){ } }); request.addEventListener("error", ()=>{ - // console.log("An error occured."); + debugLog("An error occured."); }); request.addEventListener("progress", (event)=>{ if (event.lengthComputable && progressPlaceholder()){ httpProgressPlaceholder().value = (event.loaded / event.total) * 100; } else { httpProgressPlaceholder.value = 0; - // console.log("Supposingly zeroed progressPlaceholder"); + debugLog("Supposingly zeroed progressPlaceholder"); } }); request.addEventListener("abort", ()=>{ - // console.log("Request aborted."); + debugLog("Request aborted."); }); request.open("GET", url); request.send(); diff --git a/src/js/arching-kaos-generator.js b/src/js/arching-kaos-generator.js index a3d1669..d8f2f2b 100644 --- a/src/js/arching-kaos-generator.js +++ b/src/js/arching-kaos-generator.js @@ -1,10 +1,10 @@ -/* Arching Kaos Generator - * - * Kaotisk Hund - 2024 - * - * @license magnet:?xt=urn:btih:0b31508aeb0634b347b8270c7bee4d411b5d4109&dn=agpl-3.0.txt AGPL v3.0 - * - */ +// Arching Kaos Generator +// +// Kaotisk Hund - 2024 +// +// @license magnet:?xt=urn:btih:0b31508aeb0634b347b8270c7bee4d411b5d4109&dn=agpl-3.0.txt AGPL v3.0 +// + export function makeElement(obj, attachTo) { if (obj.element !== 'head' && obj.element !== 'body' ) diff --git a/src/js/arching-kaos-log.js b/src/js/arching-kaos-log.js index e348ee6..104ca30 100644 --- a/src/js/arching-kaos-log.js +++ b/src/js/arching-kaos-log.js @@ -1,10 +1,10 @@ -/* Arching Kaos Log - * - * Kaotisk Hund - 2024 - * - * @license magnet:?xt=urn:btih:0b31508aeb0634b347b8270c7bee4d411b5d4109&dn=agpl-3.0.txt AGPL v3.0 - * - */ +// Arching Kaos Log +// +// Kaotisk Hund - 2024 +// +// @license magnet:?xt=urn:btih:0b31508aeb0634b347b8270c7bee4d411b5d4109&dn=agpl-3.0.txt AGPL v3.0 +// + import { currentLogMessageElement, logsAreaElement } from "./app.js"; import { makeElement } from "./arching-kaos-generator.js"; diff --git a/src/js/arching-kaos-modules-comments.js b/src/js/arching-kaos-modules-comments.js index 8db1b57..f831cc9 100644 --- a/src/js/arching-kaos-modules-comments.js +++ b/src/js/arching-kaos-modules-comments.js @@ -1,10 +1,10 @@ -/* Arching Kaos Module Comments - * - * Kaotisk Hund - 2024 - * - * @license magnet:?xt=urn:btih:0b31508aeb0634b347b8270c7bee4d411b5d4109&dn=agpl-3.0.txt AGPL v3.0 - * - */ +// Arching Kaos Module Comments +// +// Kaotisk Hund - 2024 +// +// @license magnet:?xt=urn:btih:0b31508aeb0634b347b8270c7bee4d411b5d4109&dn=agpl-3.0.txt AGPL v3.0 +// + import { makeElement } from "./arching-kaos-generator.js"; import { getFullText, diff --git a/src/js/arching-kaos-modules-files.js b/src/js/arching-kaos-modules-files.js index fb325aa..02f183e 100644 --- a/src/js/arching-kaos-modules-files.js +++ b/src/js/arching-kaos-modules-files.js @@ -1,10 +1,10 @@ -/* Arching Kaos Module Files - * - * Kaotisk Hund - 2024 - * - * @license magnet:?xt=urn:btih:0b31508aeb0634b347b8270c7bee4d411b5d4109&dn=agpl-3.0.txt AGPL v3.0 - * - */ +// Arching Kaos Module Files +// +// Kaotisk Hund - 2024 +// +// @license magnet:?xt=urn:btih:0b31508aeb0634b347b8270c7bee4d411b5d4109&dn=agpl-3.0.txt AGPL v3.0 +// + import { getNicknameAssossiatedWithGPG } from "./arching-kaos-tools.js"; import { makeElement } from "./arching-kaos-generator.js"; diff --git a/src/js/arching-kaos-modules-mixtapes.js b/src/js/arching-kaos-modules-mixtapes.js index bf11d9d..56cdfd6 100644 --- a/src/js/arching-kaos-modules-mixtapes.js +++ b/src/js/arching-kaos-modules-mixtapes.js @@ -1,10 +1,10 @@ -/* Arching Kaos Model Mixtapes - * - * Kaotisk Hund - 2024 - * - * @license magnet:?xt=urn:btih:0b31508aeb0634b347b8270c7bee4d411b5d4109&dn=agpl-3.0.txt AGPL v3.0 - * - */ +// Arching Kaos Model Mixtapes +// +// Kaotisk Hund - 2024 +// +// @license magnet:?xt=urn:btih:0b31508aeb0634b347b8270c7bee4d411b5d4109&dn=agpl-3.0.txt AGPL v3.0 +// + import { makeElement } from "./arching-kaos-generator.js"; import { getIPFSURL } from "./url-generators.js"; import { addMixtapeID, setMixtape, getMixtapes } from "./environment-setup.js"; @@ -57,7 +57,7 @@ export function akModuleMixtapes(zblockIPFSHash, zblockObject, blockObject, json audioDuration:audio.duration }); } - /* console.log( + /* debugLog( zblockIPFSHash+"'s duration is: "+ audio.duration + " Ceiled: " + Math.ceil(audio.duration) + diff --git a/src/js/arching-kaos-modules-news.js b/src/js/arching-kaos-modules-news.js index 49dfb0a..f9143bc 100644 --- a/src/js/arching-kaos-modules-news.js +++ b/src/js/arching-kaos-modules-news.js @@ -1,10 +1,10 @@ -/* Arching Kaos Module News - * - * Kaotisk Hund - 2024 - * - * @license magnet:?xt=urn:btih:0b31508aeb0634b347b8270c7bee4d411b5d4109&dn=agpl-3.0.txt AGPL v3.0 - * - */ +// Arching Kaos Module News +// +// Kaotisk Hund - 2024 +// +// @license magnet:?xt=urn:btih:0b31508aeb0634b347b8270c7bee4d411b5d4109&dn=agpl-3.0.txt AGPL v3.0 +// + import { makeElement } from "./arching-kaos-generator.js"; import { archingKaosFetchText } from "./arching-kaos-fetch.js"; import { diff --git a/src/js/arching-kaos-modules-references.js b/src/js/arching-kaos-modules-references.js index c6aca8a..6d70c9a 100644 --- a/src/js/arching-kaos-modules-references.js +++ b/src/js/arching-kaos-modules-references.js @@ -1,18 +1,19 @@ -/* Arching Kaos Module References - * - * Kaotisk Hund - 2024 - * - * @license magnet:?xt=urn:btih:0b31508aeb0634b347b8270c7bee4d411b5d4109&dn=agpl-3.0.txt AGPL v3.0 - * - */ +// Arching Kaos Module References +// +// Kaotisk Hund - 2024 +// +// @license magnet:?xt=urn:btih:0b31508aeb0634b347b8270c7bee4d411b5d4109&dn=agpl-3.0.txt AGPL v3.0 +// + import { getReferences, setReference, getReference } from "./environment-setup.js"; +import { debugLog } from "./utils.js"; export function resolveReferences(){ - console.log(getReferences()); + debugLog(getReferences()); const references = getReferences(); for( var entry = 0; entry < references.length; entry++ ){ var comment = document.querySelector('#comment-'+references[entry].dataExpansion.reference); diff --git a/src/js/arching-kaos-spa-router.js b/src/js/arching-kaos-spa-router.js index d1cf2a4..c6770f4 100644 --- a/src/js/arching-kaos-spa-router.js +++ b/src/js/arching-kaos-spa-router.js @@ -1,10 +1,10 @@ -/* Arching Kaos Single Page Application Router - * - * Kaotisk Hund - 2024 - * - * @license magnet:?xt=urn:btih:0b31508aeb0634b347b8270c7bee4d411b5d4109&dn=agpl-3.0.txt AGPL v3.0 - * - */ +// Arching Kaos Single Page Application Router +// +// Kaotisk Hund - 2024 +// +// @license magnet:?xt=urn:btih:0b31508aeb0634b347b8270c7bee4d411b5d4109&dn=agpl-3.0.txt AGPL v3.0 +// + /* * A new feature for a new future: * diff --git a/src/js/arching-kaos-stellar-network.js b/src/js/arching-kaos-stellar-network.js index a08147e..a20365c 100644 --- a/src/js/arching-kaos-stellar-network.js +++ b/src/js/arching-kaos-stellar-network.js @@ -1,10 +1,10 @@ -/* Arching Kaos Stellar Network - * - * Kaotisk Hund - 2024 - * - * @license magnet:?xt=urn:btih:0b31508aeb0634b347b8270c7bee4d411b5d4109&dn=agpl-3.0.txt AGPL v3.0 - * - */ +// Arching Kaos Stellar Network +// +// Kaotisk Hund - 2024 +// +// @license magnet:?xt=urn:btih:0b31508aeb0634b347b8270c7bee4d411b5d4109&dn=agpl-3.0.txt AGPL v3.0 +// + import { archingKaosLog } from "./arching-kaos-log.js"; import { archingKaosFetchJSON } from "./arching-kaos-fetch.js"; import { @@ -24,6 +24,7 @@ import { import { makeElement } from "./arching-kaos-generator.js"; import { getConfiguration } from "./arching-kaos-tools.js"; +import { debugLog } from "./utils.js"; var lastPage = ''; @@ -69,8 +70,8 @@ function renderConfigurationIPNSLinkAndProceed(json, stellarAddress){ renderStellarAddress(stellarAddress); document.querySelector('#'+stellarAddress).style="color: #3dbb3d;" increaseStellarNetworkConfiguredAddresses(); - console.log(atob(json.value)); - console.log(stellarAddress); + debugLog(atob(json.value)); + debugLog(stellarAddress); getConfiguration(atob(json.value),stellarAddress); } @@ -128,7 +129,7 @@ function steptwo(i){ } function letme(a){ - console.log("HERE WE GO"); + debugLog("HERE WE GO"); server.accounts() .accountId(a) .call() @@ -190,7 +191,7 @@ function connect(){ // showStellar(); // } else { const result = retrievePublicKey(); -// console.log(result); +// debugLog(result); // } } diff --git a/src/js/arching-kaos-tools.js b/src/js/arching-kaos-tools.js index 0901852..8a80d5b 100644 --- a/src/js/arching-kaos-tools.js +++ b/src/js/arching-kaos-tools.js @@ -1,10 +1,10 @@ -/* Arching Kaos Tools - * - * Kaotisk Hund - 2024 - * - * @license magnet:?xt=urn:btih:0b31508aeb0634b347b8270c7bee4d411b5d4109&dn=agpl-3.0.txt AGPL v3.0 - * - */ +// Arching Kaos Tools +// +// Kaotisk Hund - 2024 +// +// @license magnet:?xt=urn:btih:0b31508aeb0634b347b8270c7bee4d411b5d4109&dn=agpl-3.0.txt AGPL v3.0 +// + import { archingKaosLog } from "./arching-kaos-log.js"; import { makeElement } from "./arching-kaos-generator.js"; import { progressPlaceholder, resultsArea, aknet } from "./app.js"; @@ -31,6 +31,7 @@ import { akModuleMixtapes } from "./arching-kaos-modules-mixtapes.js"; import { akModuleNews } from "./arching-kaos-modules-news.js"; import { storeReference, resolveReferences } from "./arching-kaos-modules-references.js"; import { getSettings } from "./arching-kaos-web-ui-settings.js"; +import { debugLog } from "./utils.js"; var settings = getSettings(); @@ -81,7 +82,7 @@ function renderStellarAddressPlaceholder(stellarAddress){ function nodeInfoRender(json, stellarAddress){ var divs = renderStellarAddressPlaceholder(stellarAddress); - console.log(json); + debugLog(json); const keys = Object.keys(json); for( var i = 0; i < keys.length; i++ ) { @@ -115,9 +116,9 @@ function nodeInfoRenderAndProceed(json, stellarAddress){ } function renderZblockAndProceed(json, params){ - console.log(typeof(params)) + debugLog(typeof(params)) const [zblockIPFSHash, group, recursive] = params; - console.log(group); + debugLog(group); var zblockElement = document.querySelector('#zb-'+zblockIPFSHash); if(json.block){ var p = { @@ -222,7 +223,7 @@ function blockRenderAndProceed(json, params){ resolveReferences(); //radioLoad(); } else { - console.log("deep in :" +group); + debugLog("deep in :" +group); if (recursive) seekZblock(json.previous, [group]); } } @@ -254,7 +255,7 @@ function seekZchain(zchainIPNSLink,stellarAddress,json){ makeElement(p, details); } archingKaosLog("Seeking zchain " + zchainIPNSLink + "..."); - console.log(json) + debugLog(json) archingKaosFetchJSON(getIPNSURL(zchainIPNSLink), seekZblock, [zchainIPNSLink, stellarAddress, json]); } @@ -267,11 +268,11 @@ function checkIfGenesis(zblockIPFSHash){ } function seekBlock(blockIPFSHash, zblockIPFSHash, group, zblockObject, recursive){ - console.log(blockIPFSHash); - console.log(zblockIPFSHash); - console.log(group); - console.log(zblockObject); - console.log(recursive); + debugLog(blockIPFSHash); + debugLog(zblockIPFSHash); + debugLog(group); + debugLog(zblockObject); + debugLog(recursive); archingKaosLog("Seeking block "+blockIPFSHash+"..."); // detailsPlace = document.querySelector('#zb-'+zblockIPFSHash); progressPlaceholder().max++; @@ -317,7 +318,7 @@ function renderGroupOnDataSection(group){ }; makeElement(details, divs); } else { - //console.log('Else got hit in seekZchain'); + //debugLog('Else got hit in seekZchain'); return 0; } } @@ -336,8 +337,8 @@ function renderZblockUnderGroup(zblock, group){ export function seekZblock(zblockIPFSHash, params){ var [group, recursive=true] = params; - console.log(params) - console.log(group) + debugLog(params) + debugLog(group) // const [zchainIPNSLink, stellarAddress, recursive] = params; renderGroupOnDataSection(group); @@ -480,7 +481,7 @@ function sblockExpanding(json, args){ function crawlSchain(sblockHash){ var shatest = /0{128}/ if ( shatest.test(sblockHash) ){ - console.log('genesis!!!'); + debugLog('genesis!!!'); } else { setZchainLoadingStatus(sblockHash, {loading : "started"}); increaseZchainsFound(); @@ -524,9 +525,9 @@ export function checkLocalNodeInfo(){ export function checkLocalSchain(){ archingKaosLog("Querying for schain..."); - console.log(settings); + debugLog(settings); var url=settings.ak.connect.list[settings.ak.connect.active]+'/v0/slatest'; - console.log(url); + debugLog(url); archingKaosFetchJSON(url, initCrawlSchain); archingKaosLog("Querying for schain... Done!"); } diff --git a/src/js/arching-kaos-web-ui-settings.js b/src/js/arching-kaos-web-ui-settings.js index 0435de4..ddee8f8 100644 --- a/src/js/arching-kaos-web-ui-settings.js +++ b/src/js/arching-kaos-web-ui-settings.js @@ -1,10 +1,10 @@ -/* Arching Kaos Settings - * - * Kaotisk Hund - 2024 - * - * @license magnet:?xt=urn:btih:0b31508aeb0634b347b8270c7bee4d411b5d4109&dn=agpl-3.0.txt AGPL v3.0 - * - */ +// Arching Kaos Settings +// +// Kaotisk Hund - 2024 +// +// @license magnet:?xt=urn:btih:0b31508aeb0634b347b8270c7bee4d411b5d4109&dn=agpl-3.0.txt AGPL v3.0 +// + /* * We will be using browser's localStorage for the clients to configure their * desired way to visit the web-ui. @@ -24,6 +24,7 @@ */ import { makeElement } from "./arching-kaos-generator.js"; import { getSettingsPage } from "./ui/sections/settingsSection.js"; +import { debugLog } from "./utils.js"; var default_settings = { ipfs: { @@ -158,7 +159,7 @@ function renderAssets(container, value){ function settingPlaceToDOM(key, value){ var container = document.createElement("details"); var summary = document.createElement("summary"); - console.log("~~KEY: "+key); + debugLog("~~KEY: "+key); summary.innerText=key; container.appendChild(summary); if ( Array.isArray(value) ){ @@ -174,7 +175,7 @@ function settingPlaceToDOM(key, value){ }); container.appendChild(ul); } else if (value.constructor.name === "Object" ) { - console.log("KEY: "+key); + debugLog("KEY: "+key); switch (key){ case 'ipfs': makeElement({ element:"h4",innerText:"Gateway" }, container); @@ -205,7 +206,7 @@ function settingPlaceToDOM(key, value){ container.innerText += " unknonwn lol"; } } else { - console.log(`Settings value: ${value}, type: ${typeof(value)}`); + debugLog(`Settings value: ${value}, type: ${typeof(value)}`); // container.innerText = value; } getSettingsPage().appendChild(container); @@ -235,7 +236,7 @@ export function getSettings() return default_settings; } -// console.log(settings.ipfsGatewayAddress[settings.ipfsSelectedGatewayAddress]); +// debugLog(settings.ipfsGatewayAddress[settings.ipfsSelectedGatewayAddress]); // vim: tabstop=4 shiftwidth=4 expandtab softtabstop=4 // @license-end diff --git a/src/js/environment-setup.js b/src/js/environment-setup.js index 923676c..43563ab 100644 --- a/src/js/environment-setup.js +++ b/src/js/environment-setup.js @@ -1,10 +1,10 @@ -/* Arching Kaos Setup - * - * Kaotisk Hund - 2024 - * - * @license magnet:?xt=urn:btih:0b31508aeb0634b347b8270c7bee4d411b5d4109&dn=agpl-3.0.txt AGPL v3.0 - * - */ +// Arching Kaos Setup +// +// Kaotisk Hund - 2024 +// +// @license magnet:?xt=urn:btih:0b31508aeb0634b347b8270c7bee4d411b5d4109&dn=agpl-3.0.txt AGPL v3.0 +// + var mixtapeIds = new Array; export function addMixtapeID(zblockIPFSHash) { diff --git a/src/js/ui/footer.js b/src/js/ui/footer.js index fbde422..c447189 100644 --- a/src/js/ui/footer.js +++ b/src/js/ui/footer.js @@ -1,3 +1,10 @@ +// Arching Kaos Footer +// +// Kaotisk Hund - 2024 +// +// @license magnet:?xt=urn:btih:0b31508aeb0634b347b8270c7bee4d411b5d4109&dn=agpl-3.0.txt AGPL v3.0 +// + import { makeElement } from "../arching-kaos-generator.js"; export function footerSpawn() @@ -44,3 +51,4 @@ export function footerSpawn() makeElement(footer, document.querySelector('.footer')); } +// @license-end diff --git a/src/js/ui/header.js b/src/js/ui/header.js index 27c16ac..03b2332 100644 --- a/src/js/ui/header.js +++ b/src/js/ui/header.js @@ -1,3 +1,10 @@ +// Arching Kaos Header +// +// Kaotisk Hund - 2024 +// +// @license magnet:?xt=urn:btih:0b31508aeb0634b347b8270c7bee4d411b5d4109&dn=agpl-3.0.txt AGPL v3.0 +// + import { makeElement } from "../arching-kaos-generator.js"; export function headerSpawn() @@ -17,3 +24,4 @@ export function headerSpawn() makeElement(header, document.querySelector('#logo-title-placeholder')); } +// @license-end diff --git a/src/js/ui/main.js b/src/js/ui/main.js index a24d77e..a1a9ddc 100644 --- a/src/js/ui/main.js +++ b/src/js/ui/main.js @@ -1,3 +1,10 @@ +// Arching Kaos Main +// +// Kaotisk Hund - 2024 +// +// @license magnet:?xt=urn:btih:0b31508aeb0634b347b8270c7bee4d411b5d4109&dn=agpl-3.0.txt AGPL v3.0 +// + import { aboutSection } from "./sections/aboutSection.js"; import { akNodeInfoSection } from "./sections/akNodeInfoSection.js"; import { chatSection } from "./sections/chatSection.js"; @@ -36,3 +43,4 @@ export function mainSpawn() welcomeSection(); zchainDataSection(); } +// @license-end diff --git a/src/js/ui/mainLayout.js b/src/js/ui/mainLayout.js index 66f1d25..715d95c 100644 --- a/src/js/ui/mainLayout.js +++ b/src/js/ui/mainLayout.js @@ -1,3 +1,10 @@ +// Arching Kaos Main Layout +// +// Kaotisk Hund - 2024 +// +// @license magnet:?xt=urn:btih:0b31508aeb0634b347b8270c7bee4d411b5d4109&dn=agpl-3.0.txt AGPL v3.0 +// + import { headerSpawn } from "./header.js"; import { menuSpawn } from "./menu.js"; import { mainSpawn } from "./main.js"; @@ -10,3 +17,4 @@ export function mainLayoutSpawn() mainSpawn(); footerSpawn(); } +// @license-end diff --git a/src/js/ui/menu.js b/src/js/ui/menu.js index 1c4a8e3..6d2efd6 100644 --- a/src/js/ui/menu.js +++ b/src/js/ui/menu.js @@ -1,13 +1,14 @@ -/* Arching Kaos Menu - * - * Kaotisk Hund - 2024 - * - * @license magnet:?xt=urn:btih:0b31508aeb0634b347b8270c7bee4d411b5d4109&dn=agpl-3.0.txt AGPL v3.0 - * - */ +// Arching Kaos Menu +// +// Kaotisk Hund - 2024 +// +// @license magnet:?xt=urn:btih:0b31508aeb0634b347b8270c7bee4d411b5d4109&dn=agpl-3.0.txt AGPL v3.0 +// + import { makeElement } from "../arching-kaos-generator.js"; import { locationHashSetter } from "../arching-kaos-spa-router.js"; import { mainContainer } from "../app.js"; +import { debugLog } from "../utils.js"; export function doubleFloorMenu() { @@ -179,7 +180,7 @@ export function menuinit(){ } else { - console.log(`menuinit: ${menuids()[i]} was not found`); + debugLog(`menuinit: ${menuids()[i]} was not found`); } } } diff --git a/src/js/ui/sections/aboutSection.js b/src/js/ui/sections/aboutSection.js index 3a11a43..3ab4d1e 100644 --- a/src/js/ui/sections/aboutSection.js +++ b/src/js/ui/sections/aboutSection.js @@ -1,3 +1,10 @@ +// Arching Kaos About Section +// +// Kaotisk Hund - 2024 +// +// @license magnet:?xt=urn:btih:0b31508aeb0634b347b8270c7bee4d411b5d4109&dn=agpl-3.0.txt AGPL v3.0 +// + import { makeElement } from "../../arching-kaos-generator.js"; export function aboutSection() @@ -30,3 +37,4 @@ export function aboutSection() makeElement(aboutSection, document.querySelector('.main')); } +// @license-end diff --git a/src/js/ui/sections/akNodeInfoSection.js b/src/js/ui/sections/akNodeInfoSection.js index 38ad961..e6f82ac 100644 --- a/src/js/ui/sections/akNodeInfoSection.js +++ b/src/js/ui/sections/akNodeInfoSection.js @@ -1,3 +1,10 @@ +// Arching Kaos Node Info Section +// +// Kaotisk Hund - 2024 +// +// @license magnet:?xt=urn:btih:0b31508aeb0634b347b8270c7bee4d411b5d4109&dn=agpl-3.0.txt AGPL v3.0 +// +// import { makeElement } from "../../arching-kaos-generator.js"; export function akNodeInfoSection() @@ -13,3 +20,4 @@ export function akNodeInfoSection() makeElement(akNodeInfoSection, document.querySelector('.main')); } +// @license-end diff --git a/src/js/ui/sections/chatSection.js b/src/js/ui/sections/chatSection.js index 36348b3..b6d2ce3 100644 --- a/src/js/ui/sections/chatSection.js +++ b/src/js/ui/sections/chatSection.js @@ -1,3 +1,10 @@ +// Arching Kaos Chat Section +// +// Kaotisk Hund - 2024 +// +// @license magnet:?xt=urn:btih:0b31508aeb0634b347b8270c7bee4d411b5d4109&dn=agpl-3.0.txt AGPL v3.0 +// + import { makeElement } from "../../arching-kaos-generator.js"; export function chatSection() @@ -24,3 +31,4 @@ export function chatSection() makeElement(chatSection, document.querySelector('.main')); } +// @license-end diff --git a/src/js/ui/sections/commentsSection.js b/src/js/ui/sections/commentsSection.js index 1519ad9..5d520cf 100644 --- a/src/js/ui/sections/commentsSection.js +++ b/src/js/ui/sections/commentsSection.js @@ -1,3 +1,10 @@ +// Arching Kaos Comments Section +// +// Kaotisk Hund - 2024 +// +// @license magnet:?xt=urn:btih:0b31508aeb0634b347b8270c7bee4d411b5d4109&dn=agpl-3.0.txt AGPL v3.0 +// + import { makeElement } from "../../arching-kaos-generator.js"; export function commentsSection() @@ -13,3 +20,4 @@ export function commentsSection() makeElement(commentsSection, document.querySelector('.main')); } +// @license-end diff --git a/src/js/ui/sections/filesSection.js b/src/js/ui/sections/filesSection.js index 06ae29a..7a65187 100644 --- a/src/js/ui/sections/filesSection.js +++ b/src/js/ui/sections/filesSection.js @@ -1,3 +1,10 @@ +// Arching Kaos Files Section +// +// Kaotisk Hund - 2024 +// +// @license magnet:?xt=urn:btih:0b31508aeb0634b347b8270c7bee4d411b5d4109&dn=agpl-3.0.txt AGPL v3.0 +// + import { makeElement } from "../../arching-kaos-generator.js"; export function filesSection() @@ -19,3 +26,4 @@ export function filesSection() makeElement(filesSection, document.querySelector('.main')); } +// @license-end diff --git a/src/js/ui/sections/mixtapesSection.js b/src/js/ui/sections/mixtapesSection.js index 34bf1b6..6710c11 100644 --- a/src/js/ui/sections/mixtapesSection.js +++ b/src/js/ui/sections/mixtapesSection.js @@ -1,3 +1,10 @@ +// Arching Kaos Mixtapes Section +// +// Kaotisk Hund - 2024 +// +// @license magnet:?xt=urn:btih:0b31508aeb0634b347b8270c7bee4d411b5d4109&dn=agpl-3.0.txt AGPL v3.0 +// + import { makeElement } from "../../arching-kaos-generator.js"; export function mixtapesSection() @@ -19,3 +26,4 @@ export function mixtapesSection() makeElement(mixtapesSection, document.querySelector('.main')); } +// @license-end diff --git a/src/js/ui/sections/myPageSection.js b/src/js/ui/sections/myPageSection.js index 9926141..2cabcd5 100644 --- a/src/js/ui/sections/myPageSection.js +++ b/src/js/ui/sections/myPageSection.js @@ -1,3 +1,10 @@ +// Arching Kaos My Page Section +// +// Kaotisk Hund - 2024 +// +// @license magnet:?xt=urn:btih:0b31508aeb0634b347b8270c7bee4d411b5d4109&dn=agpl-3.0.txt AGPL v3.0 +// + import { makeElement } from "../../arching-kaos-generator.js"; export function myPageSection() @@ -25,3 +32,4 @@ export function myPageSection() makeElement(myPageSection, document.querySelector('.main')); } +// @license-end diff --git a/src/js/ui/sections/newsSection.js b/src/js/ui/sections/newsSection.js index b983b48..51cb0de 100644 --- a/src/js/ui/sections/newsSection.js +++ b/src/js/ui/sections/newsSection.js @@ -1,3 +1,10 @@ +// Arching Kaos News Section +// +// Kaotisk Hund - 2024 +// +// @license magnet:?xt=urn:btih:0b31508aeb0634b347b8270c7bee4d411b5d4109&dn=agpl-3.0.txt AGPL v3.0 +// + import { makeElement } from "../../arching-kaos-generator.js"; export function newsSection() @@ -19,3 +26,4 @@ export function newsSection() makeElement(newsSection, document.querySelector('.main')); } +// @license-end diff --git a/src/js/ui/sections/notFoundSection.js b/src/js/ui/sections/notFoundSection.js index a400d6a..3e3d000 100644 --- a/src/js/ui/sections/notFoundSection.js +++ b/src/js/ui/sections/notFoundSection.js @@ -1,3 +1,10 @@ +// Arching Kaos Not Found Section +// +// Kaotisk Hund - 2024 +// +// @license magnet:?xt=urn:btih:0b31508aeb0634b347b8270c7bee4d411b5d4109&dn=agpl-3.0.txt AGPL v3.0 +// + import { makeElement } from "../../arching-kaos-generator.js"; export function notFoundSection() @@ -24,3 +31,4 @@ export function notFoundSection() makeElement(notFoundSection, document.querySelector('.main')); } +// @license-end diff --git a/src/js/ui/sections/radioSection.js b/src/js/ui/sections/radioSection.js index f430023..cddd3f6 100644 --- a/src/js/ui/sections/radioSection.js +++ b/src/js/ui/sections/radioSection.js @@ -1,3 +1,10 @@ +// Arching Kaos Radio Section +// +// Kaotisk Hund - 2024 +// +// @license magnet:?xt=urn:btih:0b31508aeb0634b347b8270c7bee4d411b5d4109&dn=agpl-3.0.txt AGPL v3.0 +// + import { makeElement } from "../../arching-kaos-generator.js"; export function radioSection() @@ -25,3 +32,4 @@ export function radioSection() makeElement(radioSection, document.querySelector('.main')); } +// @license-end diff --git a/src/js/ui/sections/settingsSection.js b/src/js/ui/sections/settingsSection.js index 3a0e410..e2e2fe3 100644 --- a/src/js/ui/sections/settingsSection.js +++ b/src/js/ui/sections/settingsSection.js @@ -1,8 +1,16 @@ +// Arching Kaos Settings Section +// +// Kaotisk Hund - 2024 +// +// @license magnet:?xt=urn:btih:0b31508aeb0634b347b8270c7bee4d411b5d4109&dn=agpl-3.0.txt AGPL v3.0 +// + import { makeElement } from "../../arching-kaos-generator.js"; import { getSettings, showSettings } from "../../arching-kaos-web-ui-settings.js"; +import { debugLog } from "../../utils.js"; var settings = getSettings(); -console.log(settings); +debugLog(settings); export function settingsSection() { @@ -30,19 +38,6 @@ export function getSettingsPage() return document.querySelector('#settings-section'); } -// var scripts = [ -// { -// element:"script", -// type: "module", -// src:"./js/arching-kaos-web-ui-settings.js" -// } -// ]; -// -// for ( var i = 0; i < scripts.length; i++ ) -// { -// makeElement(scripts[i], document.querySelector('body')); -// } - // var server = new StellarSdk.Server(settings.stellar.horizon.list[settings.stellar.horizon.active], {allowHttp:true}); // if ( getSettings().stellar.scan ) @@ -55,3 +50,4 @@ export function getSettingsPage() // ringlocalbell(); // setInterval(ringlocalbell, 10*60*1000); // } +// @license-end diff --git a/src/js/ui/sections/statsSection.js b/src/js/ui/sections/statsSection.js index d54962a..8d99448 100644 --- a/src/js/ui/sections/statsSection.js +++ b/src/js/ui/sections/statsSection.js @@ -1,3 +1,10 @@ +// Arching Kaos Stellar Balances Section +// +// Kaotisk Hund - 2024 +// +// @license magnet:?xt=urn:btih:0b31508aeb0634b347b8270c7bee4d411b5d4109&dn=agpl-3.0.txt AGPL v3.0 +// + import { makeElement } from "../../arching-kaos-generator.js"; export function statsSection() @@ -30,3 +37,4 @@ export function statsSection() makeElement(statsSection, document.querySelector('.main')); } +// @license-end diff --git a/src/js/ui/sections/stellarBalancesSection.js b/src/js/ui/sections/stellarBalancesSection.js index 21ffaa7..867599f 100644 --- a/src/js/ui/sections/stellarBalancesSection.js +++ b/src/js/ui/sections/stellarBalancesSection.js @@ -1,3 +1,10 @@ +// Arching Kaos Stellar Balances Section +// +// Kaotisk Hund - 2024 +// +// @license magnet:?xt=urn:btih:0b31508aeb0634b347b8270c7bee4d411b5d4109&dn=agpl-3.0.txt AGPL v3.0 +// + import { makeElement } from "../../arching-kaos-generator.js"; export function stellarBalancesSection() @@ -20,3 +27,4 @@ export function stellarBalancesSection() makeElement(stellarBalancesSection, document.querySelector('.main')); } +// @license-end diff --git a/src/js/ui/sections/stellarDataConfigSection.js b/src/js/ui/sections/stellarDataConfigSection.js index 509ae57..8deff87 100644 --- a/src/js/ui/sections/stellarDataConfigSection.js +++ b/src/js/ui/sections/stellarDataConfigSection.js @@ -1,3 +1,10 @@ +// Arching Kaos Stellar Data Config Section +// +// Kaotisk Hund - 2024 +// +// @license magnet:?xt=urn:btih:0b31508aeb0634b347b8270c7bee4d411b5d4109&dn=agpl-3.0.txt AGPL v3.0 +// + import { makeElement } from "../../arching-kaos-generator.js"; export function stellarDataConfigSection() @@ -19,3 +26,4 @@ export function stellarDataConfigSection() makeElement(stellarDataConfigSection, document.querySelector('.main')); } +// @license-end diff --git a/src/js/ui/sections/stellarSection.js b/src/js/ui/sections/stellarSection.js index ddc5b91..587142b 100644 --- a/src/js/ui/sections/stellarSection.js +++ b/src/js/ui/sections/stellarSection.js @@ -1,3 +1,10 @@ +// Arching Kaos Stellar Section +// +// Kaotisk Hund - 2024 +// +// @license magnet:?xt=urn:btih:0b31508aeb0634b347b8270c7bee4d411b5d4109&dn=agpl-3.0.txt AGPL v3.0 +// + import { makeElement } from "../../arching-kaos-generator.js"; export function stellarSection() @@ -22,3 +29,4 @@ export function stellarSection() makeElement(stellarSection, document.querySelector('.main')); } +// @license-end diff --git a/src/js/ui/sections/welcomeSection.js b/src/js/ui/sections/welcomeSection.js index 025b1e8..c382050 100644 --- a/src/js/ui/sections/welcomeSection.js +++ b/src/js/ui/sections/welcomeSection.js @@ -1,3 +1,10 @@ +// Arching Kaos Welcome Section +// +// Kaotisk Hund - 2024 +// +// @license magnet:?xt=urn:btih:0b31508aeb0634b347b8270c7bee4d411b5d4109&dn=agpl-3.0.txt AGPL v3.0 +// + import { makeElement } from "../../arching-kaos-generator.js"; var whereAmI = { @@ -131,3 +138,4 @@ export function welcomeSection() makeElement(welcomeSection, document.querySelector('.main')); } +// @license-end diff --git a/src/js/ui/sections/zchainDataSection.js b/src/js/ui/sections/zchainDataSection.js index 0549249..95f8518 100644 --- a/src/js/ui/sections/zchainDataSection.js +++ b/src/js/ui/sections/zchainDataSection.js @@ -1,3 +1,10 @@ +// Arching Kaos Zchain Data Section +// +// Kaotisk Hund - 2024 +// +// @license magnet:?xt=urn:btih:0b31508aeb0634b347b8270c7bee4d411b5d4109&dn=agpl-3.0.txt AGPL v3.0 +// + import { makeElement } from "../../arching-kaos-generator.js"; export function zchainDataSection() @@ -19,3 +26,4 @@ export function zchainDataSection() makeElement(zchainDataSection, document.querySelector('.main')); } +// @license-end diff --git a/src/js/url-generators.js b/src/js/url-generators.js index 55b9cdb..239ce53 100644 --- a/src/js/url-generators.js +++ b/src/js/url-generators.js @@ -1,10 +1,10 @@ -/* Arching Kaos URL Generators - * - * Kaotisk Hund - 2024 - * - * @license magnet:?xt=urn:btih:0b31508aeb0634b347b8270c7bee4d411b5d4109&dn=agpl-3.0.txt AGPL v3.0 - * - */ +// Arching Kaos URL Generators +// +// Kaotisk Hund - 2024 +// +// @license magnet:?xt=urn:btih:0b31508aeb0634b347b8270c7bee4d411b5d4109&dn=agpl-3.0.txt AGPL v3.0 +// + /* * URL generators * diff --git a/src/js/utils.js b/src/js/utils.js index c59936b..74f3cfa 100644 --- a/src/js/utils.js +++ b/src/js/utils.js @@ -1,17 +1,29 @@ -/* Arching Kaos Utils - * - * Kaotisk Hund - 2024 - * - * @license magnet:?xt=urn:btih:0b31508aeb0634b347b8270c7bee4d411b5d4109&dn=agpl-3.0.txt AGPL v3.0 - * - */ -function refreshChat() +// Arching Kaos Utils +// +// Kaotisk Hund - 2024 +// +// @license magnet:?xt=urn:btih:0b31508aeb0634b347b8270c7bee4d411b5d4109&dn=agpl-3.0.txt AGPL v3.0 +// + +var showDebug = false; + +export function setDebug(value) +{ + if ( value === true || value === false ) showDebug = value; +} + +export function refreshChat() { document.querySelector('#chat-iframe').src = 'https://irc.arching-kaos.net'; } -function refreshRadio() +export function refreshRadio() +{ + document.querySelector('#radio-iframe').src = 'https://radio.arching-kaos.com'; +} + +export function debugLog(message) { - document.querySelector('#chat-iframe').src = 'https://radio.arching-kaos.com'; + if (showDebug) console.log(message); } // @license-end -- cgit v1.2.3