[wip] factoring vdk out into several packages

This commit is contained in:
2023-05-25 15:05:48 -06:00
parent 35ef2e0b1d
commit ee30eaaf7f
231 changed files with 13800 additions and 0 deletions
+32
View File
@@ -0,0 +1,32 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Sidekick Example: console logger</title>
</head>
<body>
<!-- link tree -->
<ul><li>
<a href="/">Examples</a>
<ul><li>
<b>Logging</b>
</li></ul>
</li></ul>
<h1>Sidekick Example: console logger</h1>
<h4>check the console</h4>
<p>
This example illustrates a debugging feature of sidekick. Sidekick
and the wallet each communicate with the other by sending
<code>MessageEvent</code>s to <code>window</code>. The code in this example
adds a listener to the <code>window</code> which just
<code>console.log</code>s each <code>MessageEvent</code>.
</p>
<!-- script -->
<script type="module" src="dist/logging.js"></script>
</body>
</html>
+6
View File
@@ -0,0 +1,6 @@
import * as sk from './jx_include/ppr-sidekick-0.1.0/dist/sidekick.js'
let logger = new sk.ConsoleLogger();
logger.listen(window);
window.postMessage("I have questions regarding my vehicle's extended warranty.");
@@ -0,0 +1,28 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Sidekick Example: HTTP logger</title>
</head>
<body>
<!-- link tree -->
<ul><li>
<a href="/">Examples</a>
<ul><li>
<b>HTTP Logging</b>
</li></ul>
</li></ul>
<h1>Sidekick Example: HTTP Logger</h1>
<p>
You need to have an HTTP server listening on port <code>8841</code>. You
can use <a href="https://gitlab.com/pharpend/vlogd">vlogd</a>.
</p>
<!-- script -->
<script type="module" src="dist/logging_http.js"></script>
</body>
</html>
+23
View File
@@ -0,0 +1,23 @@
import * as sk from './jx_include/ppr-sidekick-0.1.0/dist/sidekick.js'
//var body_count = 1;
//
//function
//message_event_to_request
// (evt : {data: object})
//{
// let url = 'http://localhost:8841/';
// let body = JSON.stringify(evt.data, undefined, 4);
// let result = new Request(url, {method: 'POST', body: body});
// return result;
//}
let cl = new sk.ConsoleLogger();
cl.listen(window);
let hl = new sk.HttpLogger('http://localhost:8841/');
hl.listen(window);
let logger = new sk.SeqLogger([cl, hl]);
window.postMessage("I have questions regarding my vehicle's extended warranty.");