mirror of https://github.com/kiwix/libkiwix.git
corrected working of magnet link
This commit is contained in:
parent
a517d3b529
commit
a8a96a99f4
|
@ -330,7 +330,11 @@ body {
|
|||
text-decoration: none;
|
||||
}
|
||||
|
||||
.modal-content a>div {
|
||||
.modal-content span {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.modal-content a>div, .modal-content span>div {
|
||||
position: relative;
|
||||
top: -26px;
|
||||
left: 50px;
|
||||
|
|
|
@ -153,10 +153,10 @@
|
|||
</a>
|
||||
</div>
|
||||
<div class="modal-regular-download">
|
||||
<a href="${downloadLink}.magnet">
|
||||
<span onclick="fetchAndRedirect('${downloadLink}.magnet')">
|
||||
<img src="../skin/magnet.png" alt="download magnet" />
|
||||
<div>Download magnet link</div>
|
||||
</a>
|
||||
</span>
|
||||
</div>
|
||||
<div class="modal-regular-download">
|
||||
<a href="${downloadLink}.torrent" download>
|
||||
|
|
|
@ -77,5 +77,10 @@
|
|||
modal.remove();
|
||||
}
|
||||
}
|
||||
async function fetchAndRedirect(link) {
|
||||
const response = await fetch(link);
|
||||
const magnetLink = await response.text();
|
||||
window.location = magnetLink;
|
||||
}
|
||||
</script>
|
||||
</html>
|
||||
|
|
Loading…
Reference in New Issue