jr code cleanups
This commit is contained in:
+2
-2
@@ -1,5 +1,5 @@
|
|||||||
{type, extension}.
|
{type, library}.
|
||||||
{realm, local}.
|
{realm, local}.
|
||||||
{name, jrx}.
|
{name, jrx}.
|
||||||
{version, "0.1.0"}.
|
{version, "0.1.0"}.
|
||||||
{deps, []}.
|
{deps, ["local-tweetnacl-1.0.3"]}.
|
||||||
|
|||||||
+1
-2
@@ -37,7 +37,6 @@
|
|||||||
</table>
|
</table>
|
||||||
<ul id="keypairs">
|
<ul id="keypairs">
|
||||||
</ul>
|
</ul>
|
||||||
<button id="generate">Generate New Keypair</button>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<pre id="scratch">
|
<pre id="scratch">
|
||||||
@@ -45,7 +44,7 @@
|
|||||||
|
|
||||||
|
|
||||||
<!-- including nacl here -->
|
<!-- 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>
|
<script type="module" src="dist/popup.js"></script>
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
|
|||||||
@@ -9,11 +9,13 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
export {
|
export type {
|
||||||
// types
|
|
||||||
jr_data,
|
jr_data,
|
||||||
named_keypair,
|
named_keypair,
|
||||||
keypair
|
keypair
|
||||||
|
}
|
||||||
|
|
||||||
|
export {
|
||||||
// top-level getters/setters
|
// top-level getters/setters
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -33,7 +35,7 @@ type jr_data
|
|||||||
*
|
*
|
||||||
* @private
|
* @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 : []};
|
named_keypairs : []};
|
||||||
|
|
||||||
|
|
||||||
@@ -88,7 +90,3 @@ put
|
|||||||
{
|
{
|
||||||
await browser.storage.local.set({jr: state});
|
await browser.storage.local.set({jr: state});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -12,15 +12,5 @@ main
|
|||||||
()
|
()
|
||||||
: Promise<void>
|
: 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