40
40
41
41
< body >
42
42
< h1 > Schemascii Playground</ h1 >
43
+ < h2 id ="version "> Loading version...</ h2 >
43
44
< div class ="flex row ">
44
45
< div class ="flex column ">
45
46
< h2 > Schemascii Source</ h2 > < textarea id ="schemascii " disabled > </ textarea >
@@ -55,7 +56,7 @@ <h2>Messages</h2>
55
56
< h2 > Errors</ h2 >
56
57
< pre id ="errors "> </ pre >
57
58
< h2 > More Information</ h2 >
58
- < p > < a href ="https://github.com/dragoncoder047/schemascii/ " targer ="_blank "> https://github.com/dragoncoder047/schemascii/</ a > </ p >
59
+ < p > < a href ="https://github.com/dragoncoder047/schemascii/ " target ="_blank "> https://github.com/dragoncoder047/schemascii/</ a > </ p >
59
60
</ body >
60
61
< script >
61
62
// cSpell:ignore pyodide pyproject pyimport
@@ -65,7 +66,6 @@ <h2>More Information</h2>
65
66
var console = document . getElementById ( "console" ) ;
66
67
var source = document . getElementById ( "schemascii" ) ;
67
68
var style_elem = document . getElementById ( "custom-css" ) ;
68
- var render_button = document . getElementById ( "render" ) ;
69
69
var schemascii ;
70
70
async function main ( ) {
71
71
try {
@@ -76,6 +76,7 @@ <h2>More Information</h2>
76
76
info ( "done\nFetching current Schemascii version... " ) ;
77
77
var pyproject_toml = await fetch ( "pyproject.toml" ) . then ( x => x . text ( ) ) ;
78
78
var ver = / v e r s i o n = " ( [ \d . ] + ) " / . exec ( pyproject_toml ) [ 1 ] ;
79
+ document . getElementById ( "version" ) . textContent = `using Schemascii version ${ ver } ` ;
79
80
info ( `${ ver } \nInstalling schemascii-${ ver } ... ` ) ;
80
81
await pyodide . pyimport ( "micropip" , { errorCallback : error , messageCallback : info } )
81
82
. install ( `https://dragoncoder047.github.io/schemascii/dist/schemascii-${ ver } -py3-none-any.whl` ) ;
@@ -102,6 +103,7 @@ <h2>More Information</h2>
102
103
var timeout = null ;
103
104
source . addEventListener ( "input" , ( ) => {
104
105
if ( timeout ) clearTimeout ( timeout ) ;
106
+ // Debouncing
105
107
timeout = setTimeout ( async ( ) => {
106
108
console . textContent = "" ;
107
109
errors . textContent = "" ;
0 commit comments