Commit e9f67015 authored by sajolida's avatar sajolida

Add back counter to BitTorrent download

parent ff4c6e54
......@@ -232,6 +232,21 @@ document.addEventListener("DOMContentLoaded", function() {
}
}
// Display "Verify with BitTorrent" when Torrent file is clicked
document.getElementById("download-img-torrent").onclick = function(e) { downloadTorrent(e, this); }
document.getElementById("download-iso-torrent").onclick = function(e) { downloadTorrent(e, this); }
function downloadTorrent(e, elm) {
try {
e.preventDefault();
hitCounter("download-torrent");
} finally {
// Setting window.location.href will abort AJAX requests resulting
// in a NetworkError depending on the timing and browser.
window.open(elm.getAttribute("href"), "_blank");
}
}
// Trigger verification when file is chosen
document.getElementById("verify-file").onchange = function(e) { verifyFile(e, this); }
......
......@@ -29,8 +29,8 @@ were solved, and known issues that have already been identified.</p>
<p id="bittorrent">
or download using
<span id="bittorrent-download">
<a href="[[!inline pages="inc/stable_amd64_img_torrent_url" raw="yes" sort="age"]]" class="usb upgrade download-only-img">BitTorrent</a>
<a href="[[!inline pages="inc/stable_amd64_iso_torrent_url" raw="yes" sort="age"]]" class="dvd vm download-only-iso">BitTorrent</a>
<a href="[[!inline pages="inc/stable_amd64_img_torrent_url" raw="yes" sort="age"]]" id="download-img-torrent" class="usb upgrade download-only-img">BitTorrent</a>
<a href="[[!inline pages="inc/stable_amd64_iso_torrent_url" raw="yes" sort="age"]]" id="download-iso-torrent" class="dvd vm download-only-iso">BitTorrent</a>
</span>
</p>
<p id="try-another-mirror">If the download fails, try to
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment