mirror of
https://github.com/searxng/searxng
synced 2024-01-01 19:24:07 +01:00
d
This commit is contained in:
parent
55660af790
commit
899d7cdb41
2 changed files with 5 additions and 1249 deletions
1245
searx/webapp.py
1245
searx/webapp.py
File diff suppressed because one or more lines are too long
|
@ -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
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Reference in a new issue