aboutsummaryrefslogtreecommitdiffstats
path: root/js/main.ts
diff options
context:
space:
mode:
authorFeuerfuchs <git@feuerfuchs.dev>2019-06-26 20:23:29 +0200
committerFeuerfuchs <git@feuerfuchs.dev>2019-06-26 20:23:29 +0200
commit3f799ca13a894b7e0b716bc43b3174b2f9f35ee4 (patch)
tree14006f9ddfc2ba98a2049bf7bfd8c25ffd6ad603 /js/main.ts
parentNew feature: Clickable links in plain text (opt) (diff)
downloadgopherproxy-3f799ca13a894b7e0b716bc43b3174b2f9f35ee4.tar.gz
gopherproxy-3f799ca13a894b7e0b716bc43b3174b2f9f35ee4.tar.bz2
gopherproxy-3f799ca13a894b7e0b716bc43b3174b2f9f35ee4.zip
Improved mobile layout
Diffstat (limited to 'js/main.ts')
-rw-r--r--js/main.ts29
1 files changed, 16 insertions, 13 deletions
diff --git a/js/main.ts b/js/main.ts
index 5bbcd97..765aa25 100644
--- a/js/main.ts
+++ b/js/main.ts
@@ -46,22 +46,25 @@ const settings = new KeyValueStore({
46})(); 46})();
47 47
48(() => { 48(() => {
49 const locationPrefixEl = document.getElementsByClassName('location__prefix')[0]; 49 const locationPrefixEls = document.getElementsByClassName('location__prefix');
50 locationPrefixEl.addEventListener('click', e => { 50 let i = locationPrefixEls.length;
51 e.preventDefault(); 51 while (i--) {
52 locationPrefixEls[i].addEventListener('click', e => {
53 e.preventDefault();
52 54
53 let resp = prompt('Please enter new location: ', ''); 55 let resp = prompt('Please enter new location: ', '');
54 if ((resp !== null) && (resp.trim() !== "")) { 56 if ((resp !== null) && (resp.trim() !== "")) {
55 resp = resp.trim(); 57 resp = resp.trim();
56 if (resp.indexOf('gopher://') === 0) { 58 if (resp.indexOf('gopher://') === 0) {
57 resp = resp.substring(9); 59 resp = resp.substring(9);
58 } 60 }
59 61
60 window.location.href = window.location.origin + '/' + resp; 62 window.location.href = window.location.origin + '/' + resp;
61 } 63 }
62 64
63 return false; 65 return false;
64 }); 66 });
67 }
65})(); 68})();
66 69
67(() => { 70(() => {