Tweaked HTML application to add warning message if scripts aren't loaded.

This commit is contained in:
Project Nayuki 2019-07-30 18:01:16 +00:00
parent 1207d89c33
commit 588d1a6b87
2 changed files with 8 additions and 1 deletions

View File

@ -27,6 +27,8 @@
namespace app {
function initialize(): void {
(document.getElementById("loading") as HTMLElement).style.display = "none";
(document.getElementById("loaded") as HTMLElement).style.removeProperty("display");
let elems = document.querySelectorAll("input[type=number], textarea");
for (let el of elems) {
if (el.id.indexOf("version-") != 0)

View File

@ -51,7 +51,12 @@
<body>
<h1>QR Code generator demo library (JavaScript)</h1>
<form action="#" method="get" onsubmit="return false;">
<div id="loading">
<p>Loading application...</p>
<p>(Are the JavaScript files missing?)</p>
<p>(The JavaScript code needs to be compiled from the TypeScript code.)</p>
</div>
<form id="loaded" style="display:none" action="#" method="get" onsubmit="return false;">
<table class="noborder" style="width:100%">
<tbody>
<tr>