mirror of
https://github.com/kiwix/libkiwix.git
synced 2025-06-26 10:11:30 +00:00
corrected working of magnet link
This commit is contained in:
@ -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>
|
||||
|
Reference in New Issue
Block a user