From a4d0d8dfff8332687f0bdd030ec687dd2ba556c5 Mon Sep 17 00:00:00 2001 From: qkqpttgf <45693631+qkqpttgf@users.noreply.github.com> Date: Sat, 16 Apr 2022 10:51:43 +0800 Subject: [PATCH] try, try nothing --- theme/classic.html | 35 ++++++++++++++++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) diff --git a/theme/classic.html b/theme/classic.html index fe2ff16..a4b19bb 100644 --- a/theme/classic.html +++ b/theme/classic.html @@ -665,6 +665,21 @@ disableAutoFetch: true, rangeChunkSize: 65535 }); + /*loadingTask.onProgress = (e) => { + //console.log(e); + var p = document.getElementById('p'); + if (p==null) { + p = document.createElement('div'); + p.id = 'p'; + p.setAttribute('onclick', "this.style.display = 'none';"); + p.style = 'left: 10px; top: 30%; position: fixed;'; + document.body.appendChild(p); + } + p.innerHTML = 'Loaded: ' + ((e.loaded/e.total)*100).toFixed(2) + '%
(' + size_format(e.loaded) + ' / ' + size_format(e.total) + ')'; + p.style.display = ''; + if (e.loaded==e.total) p.style.display = 'none'; + + }*/ loadingTask.promise.then(function(pdf) { var pagenum = pdf.numPages; var pdfContainer = document.getElementById('pdf-d'); @@ -678,7 +693,6 @@ pdfContainer.appendChild(pdfnextpagebutton); var pdfWaitNextPage = setInterval(function(){ //console.log(document.documentElement.scrollTop + ", " + document.body.scrollHeight); - console.log("next page: " + pagepos + " / " + pagenum); if (pdfnextpagebutton.style.display=='none') { for (var i=pagepos;i<=(pagepos+41024) { + num=num/1024; + } else { + return num.toFixed(2) + ' B'; + } + if (num>1024) { + num=num/1024; + } else { + return num.toFixed(2) + ' KB'; + } + if (num>1024) { + num=num/1024; + } else { + return num.toFixed(2) + ' MB'; + } + return num.toFixed(2) + ' GB'; + }