This commit is contained in:
Joseph Cheung 2023-03-06 01:55:10 +08:00
parent 55660af790
commit 899d7cdb41
2 changed files with 5 additions and 1249 deletions

File diff suppressed because one or more lines are too long

View file

@ -1325,9 +1325,9 @@ function modal_open(url, num)
let stopLoop = false; let stopLoop = false;
while (!stopLoop && iframe.contentWindow.PDFViewerApplication.pdfDocument==null) { while (!stopLoop && iframe.contentWindow.PDFViewerApplication.pdfDocument==null) {
if (Date.now() - startTime > 30000) { if (Date.now() - startTime > 30000) {
stopLoop = true; stopLoop = true;
modalele = ['这是一个PDF文档,加载失败了'] }
} }
var pdf = iframe.contentWindow.PDFViewerApplication.pdfDocument; var pdf = iframe.contentWindow.PDFViewerApplication.pdfDocument;
var numPages = pdf.numPages; //获取总页数 var numPages = pdf.numPages; //获取总页数
@ -1480,13 +1480,12 @@ function modal_open(url, num)
console.error(error); //处理错误情况 console.error(error); //处理错误情况
}); });
modalele = ['这是一个PDF文档'] modalele = ['这是一个PDF文档']
if(stopLoop = true) modalele = ['这是一个PDF文档但是加载失败了']
sentencesContent = '' sentencesContent = ''
for (let i = 0; i < sentences.length; i++) { for (let i = 0; i < sentences.length; i++) {
sentencesContent += sentences[i][1]; sentencesContent += sentences[i][1];
} }
article = {'textContent':sentencesContent,'title':iframe.contentWindow.PDFViewerApplication._title} article = {'textContent':sentencesContent,'title':iframe.contentWindow.PDFViewerApplication._title}
}
} }
else else
{ {