mirror of
https://github.com/searxng/searxng
synced 2024-01-01 19:24:07 +01:00
c
This commit is contained in:
parent
ac726e0d8f
commit
15afd7c14a
2 changed files with 6 additions and 6 deletions
|
@ -1321,15 +1321,15 @@ function modal_open(url, num)
|
||||||
var iframe = document.querySelector("#iframe-wrapper > iframe");
|
var iframe = document.querySelector("#iframe-wrapper > iframe");
|
||||||
if(num=='pdf')
|
if(num=='pdf')
|
||||||
{
|
{
|
||||||
var pdf = iframe.contentWindow.PDFViewerApplication.pdfDocument;
|
|
||||||
new Promise((resolve, reject) => {
|
new Promise((resolve, reject) => {
|
||||||
const interval = setInterval(() => {
|
const interval = setInterval(() => {
|
||||||
if (pdf.numPages) {
|
if (iframe.contentWindow.PDFViewerApplication.pdfDocument !== null) {
|
||||||
clearInterval(interval);
|
clearInterval(interval);
|
||||||
resolve(pdf.numPages);
|
resolve(1);
|
||||||
}
|
}
|
||||||
}, 1000); // 定期检查 numPages 是否不为 null,这里是每隔1秒检查一次
|
}, 1000); // 定期检查 numPages 是否不为 null,这里是每隔1秒检查一次
|
||||||
}).then( function foo(){
|
}).then( function foo(){
|
||||||
|
var pdf = iframe.contentWindow.PDFViewerApplication.pdfDocument;
|
||||||
var numPages = pdf.numPages; //获取总页数
|
var numPages = pdf.numPages; //获取总页数
|
||||||
var promises = []; //用来存放每一页的Promise对象
|
var promises = []; //用来存放每一页的Promise对象
|
||||||
sentences=[]
|
sentences=[]
|
||||||
|
|
|
@ -1321,15 +1321,15 @@ function modal_open(url, num)
|
||||||
var iframe = document.querySelector("#iframe-wrapper > iframe");
|
var iframe = document.querySelector("#iframe-wrapper > iframe");
|
||||||
if(num=='pdf')
|
if(num=='pdf')
|
||||||
{
|
{
|
||||||
var pdf = iframe.contentWindow.PDFViewerApplication.pdfDocument;
|
|
||||||
new Promise((resolve, reject) => {
|
new Promise((resolve, reject) => {
|
||||||
const interval = setInterval(() => {
|
const interval = setInterval(() => {
|
||||||
if (pdf.numPages) {
|
if (iframe.contentWindow.PDFViewerApplication.pdfDocument !== null) {
|
||||||
clearInterval(interval);
|
clearInterval(interval);
|
||||||
resolve(pdf.numPages);
|
resolve(1);
|
||||||
}
|
}
|
||||||
}, 1000); // 定期检查 numPages 是否不为 null,这里是每隔1秒检查一次
|
}, 1000); // 定期检查 numPages 是否不为 null,这里是每隔1秒检查一次
|
||||||
}).then( function foo(){
|
}).then( function foo(){
|
||||||
|
var pdf = iframe.contentWindow.PDFViewerApplication.pdfDocument;
|
||||||
var numPages = pdf.numPages; //获取总页数
|
var numPages = pdf.numPages; //获取总页数
|
||||||
var promises = []; //用来存放每一页的Promise对象
|
var promises = []; //用来存放每一页的Promise对象
|
||||||
sentences=[]
|
sentences=[]
|
||||||
|
|
Loading…
Add table
Reference in a new issue