kopher

A simple Gopher client for KaiOS
git clone git://git.luxferre.top/kopher.git
Log | Files | Refs | README | LICENSE

commit 00cd1ed0a60532ad9a68d8a3a13fee58f00235ca
parent 1bbe1ffd8172cc3678ddf14355f77a0a6aaee42d
Author: Luxferre <lux@ferre>
Date:   Mon,  3 Apr 2023 13:16:08 +0300

Fixed shared URL representation

Diffstat:
Mjs/app.js | 5+++--
1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/js/app.js b/js/app.js @@ -16,6 +16,7 @@ function saveBlob(blob, fname, successCb, errorCb) { } function hi2gopher(hiurl) { + if(!hiurl.startsWith('hi:')) return hiurl var parts = hiurl.split(':')[1].split('|') return 'gopher://'+parts[2]+':'+parts[3]+'/'+parts[0]+parts[1] } @@ -108,7 +109,7 @@ addEventListener('DOMContentLoaded', function() { function loadURL(url, noNavUpdate) { // wrapper to openURL that actually updates all the UI and history logoStatus.textContent = logoLoadingChar - statusBar.textContent = 'Loading ' + url + statusBar.textContent = 'Loading ' + hi2gopher(url) openURL(url, function(res) { // success callback logoStatus.textContent = logoDefaultChar statusBar.textContent = '' @@ -314,7 +315,7 @@ addEventListener('DOMContentLoaded', function() { navigator.mozApps.getSelf().then(function(app) { var mfst = app.manifest var aboutText = mfst.name + ' v' + mfst.version + ' by ' + mfst.developer.name - aboutText += '\nPage: ' + currentUrl + aboutText += '\nPage: ' + hi2gopher(currentUrl) alert(aboutText) }) break