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'; + }