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

pull/65/head
Project Nayuki 5 years ago
parent 1207d89c33
commit 588d1a6b87

@ -27,6 +27,8 @@
namespace app { namespace app {
function initialize(): void { 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"); let elems = document.querySelectorAll("input[type=number], textarea");
for (let el of elems) { for (let el of elems) {
if (el.id.indexOf("version-") != 0) if (el.id.indexOf("version-") != 0)

@ -51,7 +51,12 @@
<body> <body>
<h1>QR Code generator demo library (JavaScript)</h1> <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%"> <table class="noborder" style="width:100%">
<tbody> <tbody>
<tr> <tr>

Loading…
Cancel
Save