Add Source Setting to Example Button

This commit is contained in:
Leo
2021-11-10 03:14:47 +00:00
committed by GitHub
parent 9f26fb2384
commit 43f63d8f22
3 changed files with 19 additions and 1 deletions

View File

@@ -62726,12 +62726,18 @@ function start() {
example1.addEventListener('click', function(event) {
event.preventDefault();
notyf.success("Parsing Ubuntu 20.04 Magnet URL");
source = "magnet";
originalSourceIcon.innerHTML = '<span class="fad fa-magnet fa-fw"></span>';
sourceTooltip.setContent("Currently loaded information sourced from Magnet URL");
parse("magnet:?xt=urn:btih:9fc20b9e98ea98b4a35e6223041a5ef94ea27809&dn=ubuntu-20.04-desktop-amd64.iso&tr=https%3A%2F%2Ftorrent.ubuntu.com%2Fannounce&tr=https%3A%2F%2Fipv6.torrent.ubuntu.com%2Fannounce");
});
example2.addEventListener('click', async function(event) {
event.preventDefault();
notyf.success("Fetching and Parsing &ldquo;The WIRED CD&rdquo; Torrent File...");
source = "remote-torrent-file";
originalSourceIcon.innerHTML = '<span class="fad fa-file-alt fa-fw"></span>';
sourceTooltip.setContent("Currently loaded information sourced from remotely fetched Torrent file");
parseRemote("https://webtorrent.io/torrents/wired-cd.torrent");
});
@@ -62740,6 +62746,9 @@ function start() {
notyf.success("Parsing Jack Johnson Archive.org Torrent File");
let response = await fetch("/ext/jj2008-06-14.mk4_archive.torrent");
let arrayBuffer = await response.arrayBuffer();
source = "torrent-file";
originalSourceIcon.innerHTML = '<span class="fad fa-file-alt fa-fw"></span>';
sourceTooltip.setContent("Currently loaded information sourced from Torrent file");
parse(Buffer.from(arrayBuffer));
});

2
bin/bundle.min.js vendored

File diff suppressed because one or more lines are too long

View File

@@ -120,12 +120,18 @@ function start() {
example1.addEventListener('click', function(event) {
event.preventDefault();
notyf.success("Parsing Ubuntu 20.04 Magnet URL");
source = "magnet";
originalSourceIcon.innerHTML = '<span class="fad fa-magnet fa-fw"></span>';
sourceTooltip.setContent("Currently loaded information sourced from Magnet URL");
parse("magnet:?xt=urn:btih:9fc20b9e98ea98b4a35e6223041a5ef94ea27809&dn=ubuntu-20.04-desktop-amd64.iso&tr=https%3A%2F%2Ftorrent.ubuntu.com%2Fannounce&tr=https%3A%2F%2Fipv6.torrent.ubuntu.com%2Fannounce");
});
example2.addEventListener('click', async function(event) {
event.preventDefault();
notyf.success("Fetching and Parsing &ldquo;The WIRED CD&rdquo; Torrent File...");
source = "remote-torrent-file";
originalSourceIcon.innerHTML = '<span class="fad fa-file-alt fa-fw"></span>';
sourceTooltip.setContent("Currently loaded information sourced from remotely fetched Torrent file");
parseRemote("https://webtorrent.io/torrents/wired-cd.torrent");
});
@@ -134,6 +140,9 @@ function start() {
notyf.success("Parsing Jack Johnson Archive.org Torrent File");
let response = await fetch("/ext/jj2008-06-14.mk4_archive.torrent");
let arrayBuffer = await response.arrayBuffer();
source = "torrent-file";
originalSourceIcon.innerHTML = '<span class="fad fa-file-alt fa-fw"></span>';
sourceTooltip.setContent("Currently loaded information sourced from Torrent file");
parse(Buffer.from(arrayBuffer));
});