Minor bug fixed
This commit is contained in:
parent
827c0117a7
commit
2f9eea0e4e
|
@ -1,7 +1,7 @@
|
||||||
class TPDF {
|
class TPDF {
|
||||||
|
|
||||||
static display() {
|
static display() {
|
||||||
console.log(TPDF.xhr.responseText);
|
// console.log(TPDF.xhr.responseText);
|
||||||
|
|
||||||
if (TPDF.xhr.readyState == 4 && TPDF.xhr.status == 200) {
|
if (TPDF.xhr.readyState == 4 && TPDF.xhr.status == 200) {
|
||||||
/* Clean up output div */
|
/* Clean up output div */
|
||||||
|
@ -99,7 +99,11 @@ class TPDF {
|
||||||
}
|
}
|
||||||
|
|
||||||
static submit() {
|
static submit() {
|
||||||
|
/* Initialization */
|
||||||
TPDF.xhr = new XMLHttpRequest();
|
TPDF.xhr = new XMLHttpRequest();
|
||||||
|
TPDF.output = document.getElementById('tpdfOutput');
|
||||||
|
|
||||||
|
/* AJAX */
|
||||||
TPDF.xhr.onload = TPDF.display;
|
TPDF.xhr.onload = TPDF.display;
|
||||||
TPDF.xhr.open('GET',
|
TPDF.xhr.open('GET',
|
||||||
'main.py?format=json' +
|
'main.py?format=json' +
|
||||||
|
@ -107,11 +111,13 @@ class TPDF {
|
||||||
'&title=' + encodeURIComponent(document.querySelector('#tpdfForm input[name="title"]').value));
|
'&title=' + encodeURIComponent(document.querySelector('#tpdfForm input[name="title"]').value));
|
||||||
TPDF.xhr.send(null);
|
TPDF.xhr.send(null);
|
||||||
|
|
||||||
TPDF.output = document.getElementById('tpdfOutput');
|
/* Nice GUI */
|
||||||
while (TPDF.output.firstChild) {
|
while (TPDF.output.firstChild) {
|
||||||
TPDF.output.removeChild(TPDF.output.firstChild);
|
TPDF.output.removeChild(TPDF.output.firstChild);
|
||||||
}
|
}
|
||||||
TPDF.output.childNodes[0].textContent = 'Searching...';
|
var pStatus = document.createElement('p');
|
||||||
|
pStatus.textContent = 'Searching...';
|
||||||
|
TPDF.output.appendChild(pStatus);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -27,6 +27,7 @@
|
||||||
|
|
||||||
<main>
|
<main>
|
||||||
<div id="tpdfOutput">
|
<div id="tpdfOutput">
|
||||||
|
<span> </span>
|
||||||
</div>
|
</div>
|
||||||
</main>
|
</main>
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue