diff options
-rw-r--r-- | src/css/akn.css | 16 | ||||
-rw-r--r-- | src/index.html | 29 | ||||
-rw-r--r-- | src/js/app.js | 13 | ||||
-rw-r--r-- | src/js/arching-kaos-decentralized-radio.js | 79 | ||||
-rw-r--r-- | src/js/arching-kaos-fetch.js | 8 | ||||
-rw-r--r-- | src/js/arching-kaos-log.js | 8 | ||||
-rw-r--r-- | src/js/arching-kaos-modules-comments.js | 8 | ||||
-rw-r--r-- | src/js/arching-kaos-modules-files.js | 8 | ||||
-rw-r--r-- | src/js/arching-kaos-modules-mixtapes.js | 8 | ||||
-rw-r--r-- | src/js/arching-kaos-modules-news.js | 8 | ||||
-rw-r--r-- | src/js/arching-kaos-modules-references.js | 8 | ||||
-rw-r--r-- | src/js/arching-kaos-spa-router.js | 8 | ||||
-rw-r--r-- | src/js/arching-kaos-stellar-network.js | 14 | ||||
-rw-r--r-- | src/js/arching-kaos-tools.js | 8 | ||||
-rw-r--r-- | src/js/arching-kaos-web-ui-settings.js | 64 | ||||
-rw-r--r-- | src/js/environment-setup.js | 9 | ||||
-rw-r--r-- | src/js/menu-magic.js | 8 | ||||
-rw-r--r-- | src/js/url-generators.js | 24 | ||||
-rw-r--r-- | src/js/utils.js | 13 |
19 files changed, 244 insertions, 97 deletions
diff --git a/src/css/akn.css b/src/css/akn.css index 9af42e4..0ad46eb 100644 --- a/src/css/akn.css +++ b/src/css/akn.css @@ -519,3 +519,19 @@ footer { justify-content: space-between; align-content: flex-start; } + +#home-grid { + display: flex; + align-items: center; + justify-content: center; + flex-wrap: wrap; +} + +#home-grid button { + width: 128px; + height: 128px; + margin: 0px; + text-align: center; + align-items: center; + justify-content: center; +} diff --git a/src/index.html b/src/index.html index 0b455d2..6b72365 100644 --- a/src/index.html +++ b/src/index.html @@ -32,6 +32,7 @@ <button class="has-dropdown menu-clickable" id="modules-submenu-link" onclick="modulesSubToggle(this)">🔌 Modules</button> <button class="has-dropdown menu-clickable" id="explore-submenu-link" onclick="exploreSubToggle(this)">🥽 Explore</button> <button class="menu-clickable" id="#/chat-section" onclick="menusel(this)">✍️ Chat</button> + <button class="menu-clickable" id="#/radio-section" onclick="menusel(this)">Radio</button> <button class="menu-clickable" id="#/settings-section" onclick="menusel(this)">🔧 Settings</button> <button class="has-dropdown menu-clickable" id="#/stellar-section" onclick="stellarSubToggle(this)"> <img style="width: 13px; height: 13px;" src="./img/stellar.svg"/> @@ -60,8 +61,8 @@ </div> </div> </nav> - <audio id="radio-player" controls autoplay hidden></audio> - <div> + <!-- <audio id="radio-player" controls autoplay hidden></audio> --> + <div hidden> <span>Radio</span> <button id="radio-button-controller" class="menu-clickable" onclick="radioToggle();">Loading...</button> </div> @@ -70,6 +71,13 @@ <div id="welcome-section"> <h2>🏡 Home</h2> <p>Welcome to Arching Kaos project.</p> + <div id="home-grid"> + <button class="menu-clickable" id="#/mixtapes-section" onclick="menusel(this)" style="background-image: url(img/mixtapes-logo.png); background-repeat: round;"></button> + <button class="menu-clickable" id="#/news-section" onclick="menusel(this)" style="background-image: url(img/news-logo.png); background-repeat: round;"></button> + <button class="menu-clickable" id="#/chat-section" onclick="menusel(this)" style="background-image: url(img/chat-logo.png); background-repeat: round;"></button> + <button class="menu-clickable" id="#/radio-section" onclick="menusel(this)" style="background-image: url(img/radio-logo.png); background-repeat: round; background-size: cover;"></button> + <button class="menu-clickable" id="#/stats-section" onclick="menusel(this)">Stats</button> + </div> <h3>Render explicit zblock</h3> <div style=" padding: 1vh 1vw; @@ -84,21 +92,16 @@ <div class="results-area"> <h3>Results</h3> </div> - <h3>Other options for loading</h3> + <h3>Manual scan</h3> <div style=" display: flex; flex-direction: row; - justify-content: center; + justify-content: start; + align-items: center; + flex-wrap: wrap; gap: 5px;" > <button onclick="scanStellarNetworkForPeers()">Check Stellar Network</button> - </div> - <div style=" - display: flex; - flex-direction: row; - justify-content: center; - gap: 5px;" - > <button onclick="checkLocalNodeInfo()">Check local Node</button> <button onclick="checkLocalPeers()">Check local Peers</button> <button onclick="checkLocalSchain()">Check Local Schain</button> @@ -193,6 +196,10 @@ <button style="position: fixed;" onclick="refreshChat()">Refresh</button> <iframe id="chat-iframe" src="https://irc.arching-kaos.net" style="width: 100%; height: 100%;"></iframe> </div> + <div id="radio-section" style="height: 100%;"> + <button style="position: fixed;" onclick="refreshRadio()">Refresh</button> + <iframe id="radio-iframe" src="https://radio.arching-kaos.com" style="width: 100%; height: 100%;"></iframe> + </div> <div id="stats-section"> <h2>Stats</h2> <div class="available-networks"> diff --git a/src/js/app.js b/src/js/app.js index 5703def..f8fca5a 100644 --- a/src/js/app.js +++ b/src/js/app.js @@ -1,4 +1,10 @@ -/* +/* 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) @@ -30,12 +36,12 @@ progressPlaceholder.value = '0'; progressPlaceholder.max++; -if ( activeSettings.scanStellar ) +if ( activeSettings.stellar.scan ) { scanStellarNetworkForPeers(); } -if ( activeSettings.ringLocalBell ) +if ( activeSettings.ak.scan ) { ringlocalbell(); setInterval(ringlocalbell, 10*60*1000); @@ -45,3 +51,4 @@ if ( activeSettings.ringLocalBell ) // setInterval(scanStellarNetworkForPeers, 60000); // vim: tabstop=4 shiftwidth=4 expandtab softtabstop=4 +// @license-end diff --git a/src/js/arching-kaos-decentralized-radio.js b/src/js/arching-kaos-decentralized-radio.js index c8b99d1..061a142 100644 --- a/src/js/arching-kaos-decentralized-radio.js +++ b/src/js/arching-kaos-decentralized-radio.js @@ -1,12 +1,22 @@ +/* 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"); -radio.addEventListener("play", ()=>{ - radioButton.innerHTML = '<svg width="32px" height="32px" viewBox="0 0 33.866666 33.866666" version="1.1" id="svg1" inkscape:version="1.3.2 (091e20ef0f, 2023-11-25)" sodipodi:docname="stop-button.svg" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns="http://www.w3.org/2000/svg" xmlns:svg="http://www.w3.org/2000/svg"> <sodipodi:namedview id="namedview1" pagecolor="#ffffff" bordercolor="#666666" borderopacity="1.0" inkscape:showpageshadow="2" inkscape:pageopacity="0.0" inkscape:pagecheckerboard="0" inkscape:deskcolor="#d1d1d1" inkscape:document-units="px" inkscape:zoom="2.56" inkscape:cx="34.960938" inkscape:cy="49.609375" inkscape:window-width="1364" inkscape:window-height="722" inkscape:window-x="1366" inkscape:window-y="22" inkscape:window-maximized="1" inkscape:current-layer="layer1" /> <defs id="defs1" /> <g inkscape:label="Layer 1" inkscape:groupmode="layer" id="layer1"> <rect style="fill:#fe3f00;fill-opacity:1;stroke:#000000;stroke-width:4.18075;stroke-dasharray:25.08449936,25.08449936;stroke-opacity:1;stroke-dashoffset:0" id="rect1" width="29.685917" height="29.685913" x="2.0903761" y="2.0903745" /> </g> </svg>'; -}) -radio.addEventListener("pause", ()=>{ - radioButton.innerHTML = '<svg width="32px" height="32px" viewBox="0 0 33.866666 33.866666" version="1.1" id="svg1" inkscape:version="1.3.2 (091e20ef0f, 2023-11-25)" sodipodi:docname="play-button.svg" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns="http://www.w3.org/2000/svg" xmlns:svg="http://www.w3.org/2000/svg"> <sodipodi:namedview id="namedview1" pagecolor="#ffffff" bordercolor="#666666" borderopacity="1.0" inkscape:showpageshadow="2" inkscape:pageopacity="0.0" inkscape:pagecheckerboard="0" inkscape:deskcolor="#d1d1d1" inkscape:document-units="px" inkscape:zoom="2.56" inkscape:cx="34.960938" inkscape:cy="49.609375" inkscape:window-width="1364" inkscape:window-height="722" inkscape:window-x="1366" inkscape:window-y="22" inkscape:window-maximized="1" inkscape:current-layer="layer1" /> <defs id="defs1" /> <g inkscape:label="Layer 1" inkscape:groupmode="layer" id="layer1"> <path id="rect1" style="fill:#fe3f00;stroke:#000000;stroke-width:4.18075;stroke-dasharray:25.0845, 25.0845" d="M 2.0903761,2.0903745 31.383535,16.963796 2.0903761,31.776288 Z" sodipodi:nodetypes="cccc" /> </g> </svg>'; -}) +if (radio !== null ) +{ + radio.addEventListener("play", ()=>{ + radioButton.innerHTML = '<svg width="32px" height="32px" viewBox="0 0 33.866666 33.866666" version="1.1" id="svg1" inkscape:version="1.3.2 (091e20ef0f, 2023-11-25)" sodipodi:docname="stop-button.svg" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns="http://www.w3.org/2000/svg" xmlns:svg="http://www.w3.org/2000/svg"> <sodipodi:namedview id="namedview1" pagecolor="#ffffff" bordercolor="#666666" borderopacity="1.0" inkscape:showpageshadow="2" inkscape:pageopacity="0.0" inkscape:pagecheckerboard="0" inkscape:deskcolor="#d1d1d1" inkscape:document-units="px" inkscape:zoom="2.56" inkscape:cx="34.960938" inkscape:cy="49.609375" inkscape:window-width="1364" inkscape:window-height="722" inkscape:window-x="1366" inkscape:window-y="22" inkscape:window-maximized="1" inkscape:current-layer="layer1" /> <defs id="defs1" /> <g inkscape:label="Layer 1" inkscape:groupmode="layer" id="layer1"> <rect style="fill:#fe3f00;fill-opacity:1;stroke:#000000;stroke-width:4.18075;stroke-dasharray:25.08449936,25.08449936;stroke-opacity:1;stroke-dashoffset:0" id="rect1" width="29.685917" height="29.685913" x="2.0903761" y="2.0903745" /> </g> </svg>'; + }) + radio.addEventListener("pause", ()=>{ + radioButton.innerHTML = '<svg width="32px" height="32px" viewBox="0 0 33.866666 33.866666" version="1.1" id="svg1" inkscape:version="1.3.2 (091e20ef0f, 2023-11-25)" sodipodi:docname="play-button.svg" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns="http://www.w3.org/2000/svg" xmlns:svg="http://www.w3.org/2000/svg"> <sodipodi:namedview id="namedview1" pagecolor="#ffffff" bordercolor="#666666" borderopacity="1.0" inkscape:showpageshadow="2" inkscape:pageopacity="0.0" inkscape:pagecheckerboard="0" inkscape:deskcolor="#d1d1d1" inkscape:document-units="px" inkscape:zoom="2.56" inkscape:cx="34.960938" inkscape:cy="49.609375" inkscape:window-width="1364" inkscape:window-height="722" inkscape:window-x="1366" inkscape:window-y="22" inkscape:window-maximized="1" inkscape:current-layer="layer1" /> <defs id="defs1" /> <g inkscape:label="Layer 1" inkscape:groupmode="layer" id="layer1"> <path id="rect1" style="fill:#fe3f00;stroke:#000000;stroke-width:4.18075;stroke-dasharray:25.0845, 25.0845" d="M 2.0903761,2.0903745 31.383535,16.963796 2.0903761,31.776288 Z" sodipodi:nodetypes="cccc" /> </g> </svg>'; + }) +} var played = []; var list = mixtapeIds; @@ -15,41 +25,54 @@ var currentPlaying = 0; function radioLoad() { - var elem = document.querySelector('#'+mixtapeIds[0]).firstChild.cloneNode(true); - currentPlaying = 0; - radio.appendChild(elem); - radio.play(); -} - -function radioLoadNextAndPlay() -{ - currentPlaying += 1; - radio.removeChild(radio.firstChild); - var elem = document.querySelector('#'+mixtapeIds[currentPlaying]).firstChild.cloneNode(true); - if ( elem !== null ) + if (radio !== null ) { + var elem = document.querySelector('#'+mixtapeIds[0]).firstChild.cloneNode(true); + currentPlaying = 0; radio.appendChild(elem); - radio.load(); radio.play(); } - else +} + +function radioLoadNextAndPlay() +{ + if (radio !== null ) { - radioLoad(); + currentPlaying += 1; + radio.removeChild(radio.firstChild); + var elem = document.querySelector('#'+mixtapeIds[currentPlaying]).firstChild.cloneNode(true); + if ( elem !== null ) + { + radio.appendChild(elem); + radio.load(); + radio.play(); + } + else + { + radioLoad(); + } } } -radio.addEventListener("ended", radioLoadNextAndPlay); +if ( radio !== null ) +{ + radio.addEventListener("ended", radioLoadNextAndPlay); +} function radioToggle() { - if (radio.paused) - { - radio.play(); - } - else + if ( radio !== null ) { - radio.pause(); + if (radio.paused) + { + radio.play(); + } + else + { + radio.pause(); + } } } // vim: tabstop=4 shiftwidth=4 expandtab softtabstop=4 +// @license-end diff --git a/src/js/arching-kaos-fetch.js b/src/js/arching-kaos-fetch.js index 9b401a3..523baff 100644 --- a/src/js/arching-kaos-fetch.js +++ b/src/js/arching-kaos-fetch.js @@ -1,3 +1,10 @@ +/* Arching Kaos Fetch + * + * Kaotisk Hund - 2024 + * + * @license magnet:?xt=urn:btih:0b31508aeb0634b347b8270c7bee4d411b5d4109&dn=agpl-3.0.txt AGPL v3.0 + * + */ function archingKaosFetchJSON( url, callback, params ){ const request = new XMLHttpRequest(); request.addEventListener("load", ()=>{ @@ -43,3 +50,4 @@ async function archingKaosFetchText( url, callback ){ } }) } +// @license-end diff --git a/src/js/arching-kaos-log.js b/src/js/arching-kaos-log.js index 47dcab9..67a9d37 100644 --- a/src/js/arching-kaos-log.js +++ b/src/js/arching-kaos-log.js @@ -1,3 +1,10 @@ +/* Arching Kaos Log + * + * Kaotisk Hund - 2024 + * + * @license magnet:?xt=urn:btih:0b31508aeb0634b347b8270c7bee4d411b5d4109&dn=agpl-3.0.txt AGPL v3.0 + * + */ function archingKaosLog(message){ var sta = document.createElement("div"); @@ -7,3 +14,4 @@ function archingKaosLog(message){ currentLogMessageElement.innerHTML = fmsg; logsAreaElement.appendChild(sta); } +// @license-end diff --git a/src/js/arching-kaos-modules-comments.js b/src/js/arching-kaos-modules-comments.js index 7e13400..041c481 100644 --- a/src/js/arching-kaos-modules-comments.js +++ b/src/js/arching-kaos-modules-comments.js @@ -1,3 +1,10 @@ +/* Arching Kaos Module Comments + * + * Kaotisk Hund - 2024 + * + * @license magnet:?xt=urn:btih:0b31508aeb0634b347b8270c7bee4d411b5d4109&dn=agpl-3.0.txt AGPL v3.0 + * + */ function akModuleComments(zblockIPFSHash, blockObject, json){ if (!document.querySelector('#comment-'+zblockIPFSHash)){ var divs = document.querySelector('#comments-section'); @@ -19,3 +26,4 @@ function akModuleComments(zblockIPFSHash, blockObject, json){ divs.appendChild(document.createElement("hr")); } } +// @license-end diff --git a/src/js/arching-kaos-modules-files.js b/src/js/arching-kaos-modules-files.js index c85a6aa..f5aed1b 100644 --- a/src/js/arching-kaos-modules-files.js +++ b/src/js/arching-kaos-modules-files.js @@ -1,3 +1,10 @@ +/* Arching Kaos Module Files + * + * Kaotisk Hund - 2024 + * + * @license magnet:?xt=urn:btih:0b31508aeb0634b347b8270c7bee4d411b5d4109&dn=agpl-3.0.txt AGPL v3.0 + * + */ function akModuleFiles(zblockIPFSHash, blockObject, json){ if (!document.querySelector('#file-'+zblockIPFSHash)){ var divs = document.querySelector('#files-section'); @@ -29,3 +36,4 @@ function akModuleFiles(zblockIPFSHash, blockObject, json){ divs.appendChild(document.createElement("hr")); } } +// @license-end diff --git a/src/js/arching-kaos-modules-mixtapes.js b/src/js/arching-kaos-modules-mixtapes.js index 79efe99..2702e95 100644 --- a/src/js/arching-kaos-modules-mixtapes.js +++ b/src/js/arching-kaos-modules-mixtapes.js @@ -1,3 +1,10 @@ +/* Arching Kaos Model Mixtapes + * + * Kaotisk Hund - 2024 + * + * @license magnet:?xt=urn:btih:0b31508aeb0634b347b8270c7bee4d411b5d4109&dn=agpl-3.0.txt AGPL v3.0 + * + */ function akModuleMixtapes(zblockIPFSHash, zblockObject, blockObject, json){ if(!document.querySelector('#mixtape-'+zblockIPFSHash)){ @@ -60,3 +67,4 @@ function akModuleMixtapes(zblockIPFSHash, zblockObject, blockObject, json){ divs.appendChild(art); } } +// @license-end diff --git a/src/js/arching-kaos-modules-news.js b/src/js/arching-kaos-modules-news.js index a4371e6..9292fad 100644 --- a/src/js/arching-kaos-modules-news.js +++ b/src/js/arching-kaos-modules-news.js @@ -1,3 +1,10 @@ +/* Arching Kaos Module News + * + * Kaotisk Hund - 2024 + * + * @license magnet:?xt=urn:btih:0b31508aeb0634b347b8270c7bee4d411b5d4109&dn=agpl-3.0.txt AGPL v3.0 + * + */ function akModuleNews(zblockIPFSHash, zblockObject, blockObject, json){ if (!document.querySelector('#news-'+zblockIPFSHash)){ @@ -32,3 +39,4 @@ function akModuleNews(zblockIPFSHash, zblockObject, blockObject, json){ newsSectionDivElement.appendChild(document.createElement("hr")); } } +// @license-end diff --git a/src/js/arching-kaos-modules-references.js b/src/js/arching-kaos-modules-references.js index c13f299..f609d3a 100644 --- a/src/js/arching-kaos-modules-references.js +++ b/src/js/arching-kaos-modules-references.js @@ -1,3 +1,10 @@ +/* Arching Kaos Module References + * + * Kaotisk Hund - 2024 + * + * @license magnet:?xt=urn:btih:0b31508aeb0634b347b8270c7bee4d411b5d4109&dn=agpl-3.0.txt AGPL v3.0 + * + */ function resolveReferences(references){ for( entry in references ){ var comment = document.querySelector('#comment-'+references[entry].dataExpansion.reference); @@ -22,3 +29,4 @@ function storeReference(zblockIPFSHash, zblockObject, blockObject, json, referen }; } } +// @license-end diff --git a/src/js/arching-kaos-spa-router.js b/src/js/arching-kaos-spa-router.js index c1cf13a..aa8ab31 100644 --- a/src/js/arching-kaos-spa-router.js +++ b/src/js/arching-kaos-spa-router.js @@ -1,3 +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 + * + */ /* * A new feature for a new future: * @@ -43,3 +50,4 @@ function locationHashOnChange(){ document.querySelector('#not-found-section').hidden=false; } } +// @license-end diff --git a/src/js/arching-kaos-stellar-network.js b/src/js/arching-kaos-stellar-network.js index 5fe503f..bcc0f5f 100644 --- a/src/js/arching-kaos-stellar-network.js +++ b/src/js/arching-kaos-stellar-network.js @@ -1,3 +1,10 @@ +/* Arching Kaos Stellar Network + * + * Kaotisk Hund - 2024 + * + * @license magnet:?xt=urn:btih:0b31508aeb0634b347b8270c7bee4d411b5d4109&dn=agpl-3.0.txt AGPL v3.0 + * + */ function getNumberOfTrustlinesAndRenderThem(json){ var number = json._embedded.records[0].accounts.authorized; @@ -78,11 +85,11 @@ function getHolders(a=0){ } function getStellarConfigurationVariableURL(stellarAddress){ - return activeSettings.horizonAddresses[activeSettings.horizonSelectedAddress]+ + return activeSettings.stellar.horizon.list[activeSettings.stellar.horizon.active]+ 'accounts/'+ stellarAddress+ '/data/'+ - activeSettings.stellarConfigVars[activeSettings.stellarDefaultConfig]; + activeSettings.stellar.variableNames.list[activeSettings.stellar.variableNames.active]; } function checkAddressForConfigurationVariable(stellarAddress) { @@ -91,7 +98,7 @@ function checkAddressForConfigurationVariable(stellarAddress) { progressPlaceholder.value++; } -var server = new StellarSdk.Server(activeSettings.horizonAddresses[activeSettings.horizonSelectedAddress], {allowHttp:true}); +var server = new StellarSdk.Server(activeSettings.stellar.horizon.list[activeSettings.stellar.horizon.active], {allowHttp:true}); function steptwo(r){ const L = r; @@ -208,3 +215,4 @@ function scanStellarNetworkForPeers(){ } // vim: tabstop=4 shiftwidth=4 expandtab softtabstop=4 +// @license-end diff --git a/src/js/arching-kaos-tools.js b/src/js/arching-kaos-tools.js index 38b5e51..99da9a3 100644 --- a/src/js/arching-kaos-tools.js +++ b/src/js/arching-kaos-tools.js @@ -1,3 +1,10 @@ +/* Arching Kaos Tools + * + * Kaotisk Hund - 2024 + * + * @license magnet:?xt=urn:btih:0b31508aeb0634b347b8270c7bee4d411b5d4109&dn=agpl-3.0.txt AGPL v3.0 + * + */ function getArrayLength(array){ var length = 0; for ( e in array ) { @@ -474,3 +481,4 @@ async function ringlocalbell(){ } // vim: tabstop=4 shiftwidth=4 expandtab softtabstop=4 +// @license-end diff --git a/src/js/arching-kaos-web-ui-settings.js b/src/js/arching-kaos-web-ui-settings.js index e5f24a9..802e770 100644 --- a/src/js/arching-kaos-web-ui-settings.js +++ b/src/js/arching-kaos-web-ui-settings.js @@ -1,3 +1,10 @@ +/* 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. @@ -23,7 +30,7 @@ var default_settings = { 'http://gw.ipfs.z.kaotisk-hund.com/', 'http://localhost:8080/' ], - active: 1 + active: 0 } }, stellar: { @@ -70,40 +77,7 @@ var default_settings = { active: 0 }, scan: false - }, - ipfsGatewayAddress: [ - 'https://ipfs.arching-kaos.com/', - 'http://gw.ipfs.z.kaotisk-hund.com/', - 'http://localhost:8080/' - ], - ipfsSelectedGatewayAddress: 1, - ringLocalBell: false, - scanStellar: false, - stellarAssetsForScanning: [ - { - code: 'ARCHINGKAOS', - issuer: 'GB4QVKD6NW3CSNO5TNPARAWNPPXOPSSTKB35XCWB7PUNBIQTK3DVELB2' - }, - { - code: 'KAOTISKHUND', - issuer: 'GDLJKMETTIXAVTZ2XXR2LHUITT7GZBNWEKQDN7V7SP4MURVY6266BIMO' - } - ], - stellarConfigVars: [ - 'config', - 'ak-config', - 'kh-config' - ], - horizonAddresses: [ - 'https://horizon.stellar.org/', - 'http://horizon.stellar.z.kaotisk-hund.com/' - ], - horizonSelectedAddress: 0, - stellarDefaultAsset: 0, - stellarDefaultConfig: 0, - zchainBasedDepthSeek: 10, - zblockBasedDepthSeek: 10, - localAPI: 'http://localhost:8610' + } } // TODO: Make up a settings configuration page to set this up initially rather @@ -180,7 +154,7 @@ function renderAssets(container, value){ } function settingPlaceToDOM(key, value){ - var container = document.createElement("fieldset"); + var container = document.createElement("details"); container.innerText=key; if ( Array.isArray(value) ){ var ul = document.createElement("select"); @@ -204,35 +178,35 @@ function settingPlaceToDOM(key, value){ console.log("KEY: "+key); switch (key){ case 'ipfs': - var label = document.createElement('label'); + var label = document.createElement('summary'); label.innerText = "Gateway"; container.appendChild(label); renderList(container, value.gateway); break; case 'stellar': - var label = document.createElement('label'); - label.innerText = "Asset"; + var label = document.createElement('summary'); + label.innerText = "Stellar"; container.appendChild(label); renderAssets(container, value.asset); - var label = document.createElement('label'); + var label = document.createElement('summary'); label.innerText = "Variable Names"; container.appendChild(label); renderList(container, value.variableNames); - var label = document.createElement('label'); + var label = document.createElement('summary'); label.innerText = "Horizon"; container.appendChild(label); renderList(container, value.horizon); - var label = document.createElement('label'); + var label = document.createElement('summary'); label.innerText = "Scan"; container.appendChild(label); renderCheck(container, value.scan); break; case 'ak': - var label = document.createElement('label'); + var label = document.createElement('summary'); label.innerText = "Connect"; container.appendChild(label); renderList(container, value.connect); @@ -241,7 +215,8 @@ function settingPlaceToDOM(key, value){ container.innerText += " unknonwn lol"; } } else { - container.innerText = value; + console.log(`Settings value: ${value}, type: ${typeof(value)}`); +// container.innerText = value; } settingsPage.appendChild(container); } @@ -261,3 +236,4 @@ settingsPage.appendChild(predump); // console.log(activeSettings.ipfsGatewayAddress[activeSettings.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 f33e0b8..d66465b 100644 --- a/src/js/environment-setup.js +++ b/src/js/environment-setup.js @@ -1,3 +1,10 @@ +/* Arching Kaos Setup + * + * Kaotisk Hund - 2024 + * + * @license magnet:?xt=urn:btih:0b31508aeb0634b347b8270c7bee4d411b5d4109&dn=agpl-3.0.txt AGPL v3.0 + * + */ var mixtapeIds = new Array; var mixtapes = new Array; var sortedMixtapes = new Array; @@ -37,6 +44,7 @@ var menuids = [ '#stats-section', '#mixtapes-section', '#chat-section', + '#radio-section', '#mypage-section', '#stellar-balances', '#stellar-data-config', @@ -72,3 +80,4 @@ var lastPage = ''; var stellar_connection_status = 0; +// @license-end diff --git a/src/js/menu-magic.js b/src/js/menu-magic.js index 7abd050..58a51dd 100644 --- a/src/js/menu-magic.js +++ b/src/js/menu-magic.js @@ -1,3 +1,10 @@ +/* Arching Kaos Menu Magic + * + * Kaotisk Hund - 2024 + * + * @license magnet:?xt=urn:btih:0b31508aeb0634b347b8270c7bee4d411b5d4109&dn=agpl-3.0.txt AGPL v3.0 + * + */ /* * Menu bar management * @@ -58,3 +65,4 @@ function toggleMenu(m){ mainContainer.style.display = 'none'; doubleFloorMenu.style.display = 'flex'; } +// @license-end diff --git a/src/js/url-generators.js b/src/js/url-generators.js index c950f1e..6158b6f 100644 --- a/src/js/url-generators.js +++ b/src/js/url-generators.js @@ -1,3 +1,10 @@ +/* Arching Kaos URL Generators + * + * Kaotisk Hund - 2024 + * + * @license magnet:?xt=urn:btih:0b31508aeb0634b347b8270c7bee4d411b5d4109&dn=agpl-3.0.txt AGPL v3.0 + * + */ /* * URL generators * @@ -9,28 +16,29 @@ */ function getIPNSURL(ipnsKey){ - return activeSettings.ipfsGatewayAddress[activeSettings.ipfsSelectedGatewayAddress]+'ipns/'+ipnsKey; + return activeSettings.ipfs.gateway.list[activeSettings.ipfs.gateway.active]+'ipns/'+ipnsKey; } function getIPFSURL(ipfsHash){ - return activeSettings.ipfsGatewayAddress[activeSettings.ipfsSelectedGatewayAddress]+'ipfs/'+ipfsHash; + return activeSettings.ipfs.gateway.list[activeSettings.ipfs.gateway.active]+'ipfs/'+ipfsHash; } function getHoldersOfActiveAssetURL(){ - return activeSettings.horizonAddresses[activeSettings.horizonSelectedAddress]+ + return activeSettings.stellar.horizon.list[activeSettings.stellar.horizon.active]+ 'accounts?asset='+ - activeSettings.stellarAssetsForScanning[activeSettings.stellarDefaultAsset].code+ + activeSettings.stellar.asset.list[activeSettings.stellar.asset.active].code+ ':'+ - activeSettings.stellarAssetsForScanning[activeSettings.stellarDefaultAsset].issuer+ + activeSettings.stellar.asset.list[activeSettings.stellar.asset.active].issuer+ '&limit=200'; } function getTrustlinesURL(code=null, issuer=null){ - var code = (code === null)? activeSettings.stellarAssetsForScanning[activeSettings.stellarDefaultAsset].code : code; - var issuer = (issuer === null) ? activeSettings.stellarAssetsForScanning[activeSettings.stellarDefaultAsset].issuer : issuer; - return activeSettings.horizonAddresses[activeSettings.horizonSelectedAddress]+ + var code = (code === null)? activeSettings.stellar.asset.list[activeSettings.stellar.asset.active].code : code; + var issuer = (issuer === null) ? activeSettings.stellar.asset.list[activeSettings.stellar.asset.active].issuer : issuer; + return activeSettings.stellar.horizon.list[activeSettings.stellar.horizon.active]+ 'assets?asset_code='+code+ '&asset_issuer='+issuer; } // vim: tabstop=4 shiftwidth=4 expandtab softtabstop=4 +// @license-end |