5 <meta http-equiv=
"Content-Type" content=
"text/html; charset=utf-8">
6 <link rel=
"shortcut icon" href=
"data:image/x-icon;," type=
"image/x-icon">
7 <link rel=
"stylesheet" href=
"common/testing.css"/>
8 <title>sqlite3-api batch SQL runner for the SAHPool VFS
</title>
11 <header id='titlebar'
><span>sqlite3-api batch SQL runner for the SAHPool VFS
</span></header>
13 <span class='input-wrapper'
>
14 <input type='checkbox' class='disable-during-eval' id='cb-reverse-log-order' checked
></input>
15 <label for='cb-reverse-log-order' id='lbl-reverse-log-order'
>Reverse log order
</label>
18 <div id='test-output' class='reverse'
></div>
21 const E
= (sel
)=>document
.querySelector(sel
);
23 const eOut
= E('#test-output');
24 const log2 = function(cssClass
,...args
){
27 ln
= document
.createElement('div');
28 if(cssClass
) ln
.classList
.add(cssClass
);
29 ln
.append(document
.createTextNode(args
.join(' ')));
31 // This doesn't work with the "reverse order" option!
32 ln
= document
.createTextNode(args
.join(' ')+'\n');
36 const log
= (...args
)=>{
37 //console.log(...args);
40 const logErr = function(...args
){
41 console
.error(...args
);
42 log2('error', ...args
);
44 const logWarn = function(...args
){
45 console
.warn(...args
);
46 log2('warning', ...args
);
49 const cbReverseLog
= E('#cb-reverse-log-order');
50 const lblReverseLog
= E('#lbl-reverse-log-order');
51 if(cbReverseLog
.checked
){
52 lblReverseLog
.classList
.add('warning');
53 eOut
.classList
.add('reverse');
55 cbReverseLog
.addEventListener('change', function(){
57 eOut
.classList
.add('reverse');
58 lblReverseLog
.classList
.add('warning');
60 eOut
.classList
.remove('reverse');
61 lblReverseLog
.classList
.remove('warning');
65 const w
= new Worker('batch-runner-sahpool.js?sqlite3.dir=jswasm');
66 w
.onmessage = function(msg
){
69 case 'stdout': log(...msg
.data
); break;
70 case 'warn': logWarn(...msg
.data
); break;
71 case 'error': logErr(...msg
.data
); break;
73 logErr("Unhandled worker message type:",msg
);
81 white-space: break-spaces;