<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>sqlite3 fiddle</title>
<style>
+ /* emcscript-related styling, used during the intialization phase... */
.emscripten { padding-right: 0; margin-left: auto; margin-right: auto; display: block; }
- textarea {
- font-family: monospace;
- flex: 1 1 auto;
- }
div.emscripten { text-align: center; }
div.emscripten_border { border: 1px solid black; }
+ #spinner { overflow: visible; }
+ #spinner > * {
+ margin-top: 1em;
+ }
.spinner {
height: 50px;
width: 50px;
from {transform: rotate(0deg);}
to {transform: rotate(360deg);}
}
+
+ /* The following styles are for app-level use. */
+
+ textarea {
+ font-family: monospace;
+ flex: 1 1 auto;
+ }
header {
font-size: 130%;
font-weight: bold;
}
-
#main-wrapper {
display: flex;
flex-direction: column;
pointer-events: none !important;
display: none !important;
}
+ .initially-hidden {
+ position: absolute !important;
+ opacity: 0 !important;
+ pointer-events: none !important;
+ display: none !important;
+ }
fieldset.options {
font-size: 75%;
}
padding-top: 0.25em;
margin-top: 0.5em;
}
+ .center { text-align: center; }
</style>
</head>
<body>
<header>sqlite3 fiddle</header>
- <figure style="overflow:visible;" id="spinner"><div class="spinner"></div><center style="margin-top:0.5em"><strong>emscripten</strong></center></figure>
+ <figure id="spinner">
+ <div class="spinner"></div>
+ <div class='center'><strong>Initializing app...</strong></div>
+ <div class='center'>
+ On a slow internet connection this may take a moment. If this
+ message displays for "a long time", intialization may have
+ failed and the JavaScript console may contain clues as to why.
+ </div>
+ </figure>
<div class="emscripten" id="status">Downloading...</div>
<div class="emscripten">
<progress value="0" max="100" id="progress" hidden='1'></progress>
</div>
- <fieldset class='options'>
+ <fieldset class='options initially-hidden'>
<legend>Options</legend>
<div class=''>
<span class='labeled-input'>
</span>
</div>
</fieldset>
- <div id='main-wrapper'>
+ <div id='main-wrapper' class='initially-hidden'>
<div class='ta-wrapper'>
<textarea id="input" rows="8"
placeholder="Shell input. Ctrl-enter/shift-enter runs it.">
INSERT INTO t(a,b) VALUES('abc',123),('def',456),(NULL,789),('ghi',012);
SELECT * FROM t;</textarea>
<div class='button-bar'>
- <button id='btn-run' disabled>Run</button>
- <button id='btn-clear' disabled>Clear</button>
- <button data-cmd='.help' disabled>Help</button>
+ <button id='btn-run'>Run</button>
+ <button id='btn-clear'>Clear</button>
+ <button data-cmd='.help'>Help</button>
</div>
</div>
<div class='ta-wrapper'>
<textarea id="output" rows="18" readonly
placeholder="Shell output."></textarea>
<div class='button-bar'>
- <button id='btn-clear-output' disabled>Clear</button>
+ <button id='btn-clear-output'>Clear</button>
</div>
</div>
</div>
- <div id='notes-caveats'>
+ <div id='notes-caveats' class='initially-hidden'>
<header>
Notes and Caveats
<button id='btn-notes-caveats'>Remove</button>
'use strict';
const Module = window.Module /* wasm module as set up by emscripten */;
delete Module.onRuntimeInitialized;
- const taInput = document.querySelector('#input');
- const btnClearIn = document.querySelector('#btn-clear');
- document.querySelectorAll('button').forEach(function(e){
- e.removeAttribute('disabled');
- });
+
+ /* querySelectorAll() proxy */
+ const EAll = function(/*[element=document,] cssSelector*/){
+ return (arguments.length>1 ? arguments[0] : document)
+ .querySelectorAll(arguments[arguments.length-1]);
+ };
+ /* querySelector() proxy */
+ const E = function(/*[element=document,] cssSelector*/){
+ return (arguments.length>1 ? arguments[0] : document)
+ .querySelector(arguments[arguments.length-1]);
+ };
+
+ // Unhide all elements which start out hidden
+ EAll('.initially-hidden').forEach((e)=>e.classList.remove('initially-hidden'));
+
+ const taInput = E('#input');
+ const btnClearIn = E('#btn-clear');
btnClearIn.addEventListener('click',function(){
taInput.value = '';
},false);
btnRun.click();
}
}, false);
- const taOutput = document.querySelector('#output');
- const btnClearOut = document.querySelector('#btn-clear-output');
+ const taOutput = E('#output');
+ const btnClearOut = E('#btn-clear-output');
btnClearOut.addEventListener('click',function(){
taOutput.value = '';
},false);
if(Module.config.autoClearOutput) taOutput.value='';
f._(sql);
};
- const btnRun = document.querySelector('#btn-run');
+ const btnRun = E('#btn-run');
btnRun.addEventListener('click',function(){
const sql = taInput.value.trim();
if(sql){
}
},false);
- document.querySelector('#opt-cb-sbs')
+ E('#opt-cb-sbs')
.addEventListener('change', function(){
- document.querySelector('#main-wrapper').classList[
+ E('#main-wrapper').classList[
this.checked ? 'add' : 'remove'
]('side-by-side');
}, false);
- document.querySelector('#btn-notes-caveats')
+ E('#btn-notes-caveats')
.addEventListener('click', function(){
- document.querySelector('#notes-caveats').remove();
+ E('#notes-caveats').remove();
}, false);
/* For each checkbox with data-config=X, set up a binding to
Module.config[X]. */
- document.querySelectorAll('input[type=checkbox][data-config]')
+ EAll('input[type=checkbox][data-config]')
.forEach(function(e){
e.checked = !!Module.config[e.dataset.config];
e.addEventListener('change', function(){
/* For each button with data-cmd=X, map a click handler which
calls doExec(X). */
const cmdClick = function(){doExec(this.dataset.cmd);};
- document.querySelectorAll('button[data-cmd]').forEach(
+ EAll('button[data-cmd]').forEach(
e => e.addEventListener('click', cmdClick, false)
);
progressElement.hidden = false;
spinnerElement.hidden = false;
} else {
- progressElement.value = null;
- progressElement.max = null;
- progressElement.hidden = true;
- if(!text) spinnerElement.hidden = true;
+ progressElement.remove();
+ if(!text) spinnerElement.remove();
}
- statusElement.innerHTML = text;
+ if(text) statusElement.innerText = text;
+ else statusElement.remove();
},
totalDependencies: 0,
monitorRunDependencies: function(left) {
-C Split\sthe\sfiddle\sJS\scode\sinto\sseparate\spre-/post-init\sfiles\sto\ssimplify\sediting.\semcc\swill\scombine\sthese\sinto\sthe\sfinal\sfiddle.js,\sso\sthe\snumber\sof\soutput\sdeliverables\sdoes\snot\schange.
-D 2022-05-19T09:55:14.804
+C #if'd\sout\sthe\s'.log'\scommand\sin\sWASM\sbuilds.\sCleaned\sup\sthe\suser-visible\sparts\sof\sthe\sWASM\smodule\sinitialization.
+D 2022-05-19T10:24:50.097
F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1
F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea
F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724
F ext/expert/sqlite3expert.h ca81efc2679a92373a13a3e76a6138d0310e32be53d6c3bfaedabd158ea8969b
F ext/expert/test_expert.c d56c194b769bdc90cf829a14c9ecbc1edca9c850b837a4d0b13be14095c32a72
F ext/fiddle/Makefile ea647919e6ac4b50edde1490f60ee87e8ccd75141e4aa650718c6f28eb323bbc
-F ext/fiddle/fiddle.in.html 69f8eeb8dc22cbaca2c890ed689d65dd8ad00e896b1a29caae8a22893fc51d8e
+F ext/fiddle/fiddle.in.html fc5bb8e6c13cac9880dfb41eceed3ff031d51d2a73bf66da51e5cc171e1ee28c
F ext/fiddle/index.md d9c1c308d8074341bc3b11d1d39073cd77754cb3ca9aeb949f23fdd8323d81cf
-F ext/fiddle/module-post.js 8d62f2199cb367267b7799f259c43673f43578f788f30e106a17b2eccbc8a918
-F ext/fiddle/module-pre.js 31661050c461fa05fbaa564e5369795eed8957458ea81fd2038157d852ff93c8
+F ext/fiddle/module-post.js 5d0eafba848a3e129c46ab1e1af99dcc7e8b7fc207f86ad05c5f45079cca9b6d
+F ext/fiddle/module-pre.js 7c093908bd7768c96fb812e5fc1f15073ab129527fa2124a6f3e5076455761ed
F ext/fts1/README.txt 20ac73b006a70bcfd80069bdaf59214b6cf1db5e
F ext/fts1/ft_hash.c 3927bd880e65329bdc6f506555b228b28924921b
F ext/fts1/ft_hash.h 06df7bba40dadd19597aa400a875dbc2fed705ea
F src/resolve.c a4eb3c617027fd049b07432f3b942ea7151fa793a332a11a7d0f58c9539e104f
F src/rowset.c ba9515a922af32abe1f7d39406b9d35730ed65efab9443dc5702693b60854c92
F src/select.c 74060a09f66c0c056f3c61627e22cb484af0bbfa29d7d14dcf17c684742c15de
-F src/shell.c.in ce99ca3e14211ca8d3eb82ba012504422ef42a59e4abd38c9a08a9638aee8694
+F src/shell.c.in cc3e19b2d2eefbadc4139b016c097d6478eae01d14eca993368ee5cff8820fff
F src/sqlite.h.in d15c307939039086adca159dd340a94b79b69827e74c6d661f343eeeaefba896
F src/sqlite3.rc 5121c9e10c3964d5755191c80dd1180c122fc3a8
F src/sqlite3ext.h a988810c9b21c0dc36dc7a62735012339dc76fc7ab448fb0792721d30eacb69d
F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc
F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e
F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0
-P 1a1e4e7fdbd0ec61218c3a311164086316d825181f3fc1c1ec235b63488746ef
-R 845cc95de5a1a485fbec7d915e3ef826
+P d3d8ea011868bcfa11bb3fe2db78eea6e77ac1005534d9c091f9a81e03f0a7e6
+R d7744af6398d083bf2a1bc37b40874d9
U stephan
-Z 439fa3de2a51242095eb61aca5099555
+Z 4e1f89c6494ab0a52794383c827e3145
# Remove this line to create a well-formed Fossil manifest.
-d3d8ea011868bcfa11bb3fe2db78eea6e77ac1005534d9c091f9a81e03f0a7e6
\ No newline at end of file
+b5fa12f824690c1022e4d69b0f5c3949324b311557a7412810741731db7e2cce
\ No newline at end of file
#if !defined(SQLITE_OMIT_LOAD_EXTENSION) && !defined(SQLITE_SHELL_WASM_MODE)
".load FILE ?ENTRY? Load an extension library",
#endif
+#ifndef SQLITE_SHELL_WASM_MODE
".log FILE|off Turn logging on or off. FILE can be stderr/stdout",
+#endif
".mode MODE ?OPTIONS? Set output mode",
" MODE is one of:",
" ascii Columns/rows delimited by 0x1F and 0x1E",
}else
#endif
+#ifndef SQLITE_SHELL_WASM_MODE
if( c=='l' && strncmp(azArg[0], "log", n)==0 ){
failIfSafeMode(p, "cannot run .log in safe mode");
if( nArg!=2 ){
p->pLog = output_file_open(zFile, 0);
}
}else
+#endif
if( c=='m' && strncmp(azArg[0], "mode", n)==0 ){
const char *zMode = 0;