mirror of
https://github.com/searxng/searxng
synced 2024-01-01 19:24:07 +01:00
0
This commit is contained in:
parent
cf636b1a41
commit
30c56a55a1
4 changed files with 5242 additions and 2 deletions
2299
searx/static/themes/magi/Readability.js
Normal file
2299
searx/static/themes/magi/Readability.js
Normal file
File diff suppressed because it is too large
Load diff
2299
searx/static/themes/simple/Readability.js
Normal file
2299
searx/static/themes/simple/Readability.js
Normal file
File diff suppressed because it is too large
Load diff
620
searx/webapp.py
620
searx/webapp.py
File diff suppressed because one or more lines are too long
|
@ -1145,6 +1145,7 @@ button.btn_more {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<script src="/static/themes/magi/Readability.js"></script>
|
||||||
<script src="/static/themes/magi/markdown.js"></script>
|
<script src="/static/themes/magi/markdown.js"></script>
|
||||||
<script>
|
<script>
|
||||||
const original_search_query = "''' + original_search_query.replace('"',"") + r'''"
|
const original_search_query = "''' + original_search_query.replace('"',"") + r'''"
|
||||||
|
@ -1174,7 +1175,30 @@ function proxify()
|
||||||
function modal_open(url)
|
function modal_open(url)
|
||||||
{
|
{
|
||||||
modal.style.display = 'block';
|
modal.style.display = 'block';
|
||||||
document.querySelector("#iframe-wrapper > iframe").src = url;
|
var iframePromise = new Promise((resolve, reject) => {
|
||||||
|
var iframe = document.querySelector("#iframe-wrapper > iframe");
|
||||||
|
iframe.src = url;
|
||||||
|
if (iframe.attachEvent) {
|
||||||
|
iframe.attachEvent("onload", function() {
|
||||||
|
resolve("success");
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
iframe.onload = function() {
|
||||||
|
resolve("success");
|
||||||
|
};
|
||||||
|
}
|
||||||
|
});
|
||||||
|
iframePromise.then(
|
||||||
|
() => {
|
||||||
|
if (isProbablyReaderable(iframe.contentDocument)) {
|
||||||
|
let article = new Readability(iframe.contentDocument.cloneNode(true)).parse();
|
||||||
|
iframe.contentDocument.documentElement.innerHTML = article.content
|
||||||
|
}
|
||||||
|
},
|
||||||
|
error => {
|
||||||
|
console.log(error);
|
||||||
|
}
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
//rsa
|
//rsa
|
||||||
|
|
Loading…
Add table
Reference in a new issue