From f444835d8f1cfd0cf9c0ca6d55c03fc07f9de5e0 Mon Sep 17 00:00:00 2001 From: Peter Date: Mon, 18 Mar 2024 21:51:36 -0600 Subject: [PATCH] jr: show shortened ak_... string in popup window --- jrx/src/popup.ts | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/jrx/src/popup.ts b/jrx/src/popup.ts index 78dd01a..74d0efa 100644 --- a/jrx/src/popup.ts +++ b/jrx/src/popup.ts @@ -97,10 +97,24 @@ pi_repop for (let this_akstr of akstrs) { // make an li let this_li = document.createElement('li'); + // shorten akstr + let this_shakstr = pi_shakstr(this_akstr); // make inner text the key - this_li.innerHTML = this_akstr; + this_li.innerHTML = this_shakstr; // add it to the list pubkeys_ul.appendChild(this_li); } } } + +/** + * shorten the ak_... str + */ +function +pi_shakstr + (akstr : string) + : string +{ + console.log('popup shakstr'); + return akstr.slice(0, 10) + '...'; +}