jr code cleanups
This commit is contained in:
+2
-2
@@ -1,5 +1,5 @@
|
||||
{type, extension}.
|
||||
{type, library}.
|
||||
{realm, local}.
|
||||
{name, jrx}.
|
||||
{version, "0.1.0"}.
|
||||
{deps, []}.
|
||||
{deps, ["local-tweetnacl-1.0.3"]}.
|
||||
|
||||
+1
-2
@@ -37,7 +37,6 @@
|
||||
</table>
|
||||
<ul id="keypairs">
|
||||
</ul>
|
||||
<button id="generate">Generate New Keypair</button>
|
||||
</div>
|
||||
|
||||
<pre id="scratch">
|
||||
@@ -45,7 +44,7 @@
|
||||
|
||||
|
||||
<!-- including nacl here -->
|
||||
<script src="nacl.js"></script>
|
||||
<script src="dist/jex_include/local-nacl-1.0.3/nacl.js"></script>
|
||||
<script type="module" src="dist/popup.js"></script>
|
||||
|
||||
</body>
|
||||
|
||||
@@ -9,11 +9,13 @@
|
||||
*/
|
||||
|
||||
|
||||
export {
|
||||
// types
|
||||
export type {
|
||||
jr_data,
|
||||
named_keypair,
|
||||
keypair
|
||||
}
|
||||
|
||||
export {
|
||||
// top-level getters/setters
|
||||
};
|
||||
|
||||
@@ -33,7 +35,7 @@ type jr_data
|
||||
*
|
||||
* @private
|
||||
*/
|
||||
let jr_data_mzero = {version : 0,
|
||||
let jr_data_mzero = {version : 0 as 0, // yay ts type inference can't infer 0 is of type 0
|
||||
named_keypairs : []};
|
||||
|
||||
|
||||
@@ -88,7 +90,3 @@ put
|
||||
{
|
||||
await browser.storage.local.set({jr: state});
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -12,15 +12,5 @@ main
|
||||
()
|
||||
: Promise<void>
|
||||
{
|
||||
// detect button action
|
||||
document.getElementById('generate')!.onclick = generate_keypair;
|
||||
}
|
||||
|
||||
|
||||
async function
|
||||
generate_keypair
|
||||
()
|
||||
{
|
||||
let keypair = nacl.sign.keyPair();
|
||||
document.getElementById('scratch')!.innerHTML += JSON.stringify(keypair, undefined, 4);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user