mirror of
https://github.com/leoherzog/TorrentParts.git
synced 2026-10-28 18:54:10 -07:00
Add "Open in Torrent Client" Button
This commit is contained in:
7 files changed
+27
-9
No files matched your search
@@ -62552,10 +62552,13 @@ var removeWebseeds = document.getElementById('removeWebseeds');
|
||||
var pieces = document.getElementById('pieces');
|
||||
var files = document.getElementById('filesBody');
|
||||
var getFiles = document.getElementById('getFiles');
|
||||
var openURLWrapper = document.getElementById('openURLWrapper');
|
||||
var openURL = document.getElementById('openURL');
|
||||
var copyURL = document.getElementById('copyURL');
|
||||
var copyMagnet = document.getElementById('copyMagnet');
|
||||
var downloadTorrentWrapper = document.getElementById('downloadTorrentWrapper');
|
||||
var downloadTorrent = document.getElementById('downloadTorrent');
|
||||
var openURLTooltip = tippy(openURL, {"theme": "torrent-parts", "animation": "shift-away-subtle", "content": "Open this Magnet URL in your Torrent client"});
|
||||
var copyURLTooltip = tippy(copyURL, {"theme": "torrent-parts", "animation": "shift-away-subtle", "content": "Copy torrent.parts link to clipboard"});
|
||||
var copyMagnetTooltip = tippy(copyMagnet, {"theme": "torrent-parts", "animation": "shift-away-subtle", "content": "Copy Magnet link to clipboard"});
|
||||
var downloadTorrentTooltip = tippy(downloadTorrentWrapper, {"theme": "torrent-parts", "animation": "shift-away-subtle", "content": "Download Torrent file"});
|
||||
@@ -62585,10 +62588,12 @@ var notyf = new Notyf({
|
||||
|
||||
function placeDownloadTooltips(e) {
|
||||
if (window.innerWidth > 1080) {
|
||||
openURLTooltip.setProps({"placement": "right"});
|
||||
copyURLTooltip.setProps({"placement": "right"});
|
||||
copyMagnetTooltip.setProps({"placement": "right"});
|
||||
downloadTorrentTooltip.setProps({"placement": "right"});
|
||||
} else {
|
||||
openURLTooltip.setProps({"placement": "top"});
|
||||
copyURLTooltip.setProps({"placement": "top"});
|
||||
copyMagnetTooltip.setProps({"placement": "top"});
|
||||
downloadTorrentTooltip.setProps({"placement": "top"});
|
||||
@@ -62841,6 +62846,7 @@ function display() {
|
||||
files.appendChild(createFileRow('', '...and another ' + (parsed.files.length - 100) + ' more files', ''));
|
||||
}
|
||||
files.appendChild(createFileRow('folder-tree', '', parsed.length));
|
||||
openURLWrapper.href = parser.toMagnetURI(parsed);
|
||||
downloadTorrentTooltip.setContent('Download Torrent file');
|
||||
downloadTorrent.addEventListener('click', saveTorrent);
|
||||
downloadTorrent.disabled = false;
|
||||
|
||||
Vendored
+1
-1
@@ -105,4 +105,4 @@ const i=16384;class n{constructor(e){this.length=e,this.missing=e,this.sources=n
|
||||
/*! ut_metadata. MIT License. WebTorrent LLC <https://webtorrent.io/opensource> */
|
||||
const{EventEmitter:n}=e("events"),r=e("bencode"),s=e("bitfield").default,a=e("debug")("ut_metadata"),o=e("simple-sha1"),c=16384;t.exports=e=>{class t extends n{constructor(t){super(),this._wire=t,this._fetching=!1,this._metadataComplete=!1,this._metadataSize=null,this._remainingRejects=null,this._bitfield=new s(0,{grow:1e3}),i.isBuffer(e)&&this.setMetadata(e)}onHandshake(e,t,i){this._infoHash=e}onExtendedHandshake(e){return e.m&&e.m.ut_metadata?e.metadata_size?"number"!=typeof e.metadata_size||1e7<e.metadata_size||e.metadata_size<=0?this.emit("warning",new Error("Peer gave invalid metadata size")):(this._metadataSize=e.metadata_size,this._numPieces=Math.ceil(this._metadataSize/c),this._remainingRejects=2*this._numPieces,void this._requestPieces()):this.emit("warning",new Error("Peer does not have metadata")):this.emit("warning",new Error("Peer does not support ut_metadata"))}onMessage(e){let t,i;try{const n=e.toString(),s=n.indexOf("ee")+2;t=r.decode(n.substring(0,s)),i=e.slice(s)}catch(e){return}switch(t.msg_type){case 0:this._onRequest(t.piece);break;case 1:this._onData(t.piece,i,t.total_size);break;case 2:this._onReject(t.piece)}}fetch(){this._metadataComplete||(this._fetching=!0,this._metadataSize&&this._requestPieces())}cancel(){this._fetching=!1}setMetadata(e){if(this._metadataComplete)return!0;a("set metadata");try{const t=r.decode(e).info;t&&(e=r.encode(t))}catch(e){}return(!this._infoHash||this._infoHash===o.sync(e))&&(this.cancel(),this.metadata=e,this._metadataComplete=!0,this._metadataSize=this.metadata.length,this._wire.extendedHandshake.metadata_size=this._metadataSize,this.emit("metadata",r.encode({info:r.decode(this.metadata)})),!0)}_send(e,t){let n=r.encode(e);i.isBuffer(t)&&(n=i.concat([n,t])),this._wire.extended("ut_metadata",n)}_request(e){this._send({msg_type:0,piece:e})}_data(e,t,i){const n={msg_type:1,piece:e};"number"==typeof i&&(n.total_size=i),this._send(n,t)}_reject(e){this._send({msg_type:2,piece:e})}_onRequest(e){if(!this._metadataComplete)return void this._reject(e);const t=e*c;let i=t+c;i>this._metadataSize&&(i=this._metadataSize);const n=this.metadata.slice(t,i);this._data(e,n,this._metadataSize)}_onData(e,t,i){t.length>c||!this._fetching||(t.copy(this.metadata,e*c),this._bitfield.set(e),this._checkDone())}_onReject(e){this._remainingRejects>0&&this._fetching?(this._request(e),this._remainingRejects-=1):this.emit("warning",new Error('Peer sent "reject" too much'))}_requestPieces(){if(this._fetching){this.metadata=i.alloc(this._metadataSize);for(let e=0;e<this._numPieces;e++)this._request(e)}}_checkDone(){let e=!0;for(let t=0;t<this._numPieces;t++)if(!this._bitfield.get(t)){e=!1;break}if(!e)return;this.setMetadata(this.metadata)||this._failedMetadata()}_failedMetadata(){this._bitfield=new s(0,{grow:1e3}),this._remainingRejects-=this._numPieces,this._remainingRejects>0?this._requestPieces():this.emit("warning",new Error("Peer sent invalid metadata"))}}return t.prototype.name="ut_metadata",t}}).call(this)}).call(this,e("buffer").Buffer)},{bencode:22,bitfield:26,buffer:110,debug:146,events:178,"simple-sha1":366}],440:[function(e,t,i){(function(e){(function(){function i(t){try{if(!e.localStorage)return!1}catch(e){return!1}var i=e.localStorage[t];return null!=i&&"true"===String(i).toLowerCase()}t.exports=function(e,t){if(i("noDeprecation"))return e;var n=!1;return function(){if(!n){if(i("throwDeprecation"))throw new Error(t);i("traceDeprecation")?console.trace(t):console.warn(t),n=!0}return e.apply(this,arguments)}}}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],441:[function(e,t,i){(function(i){(function(){const n=e("binary-search"),r=e("events"),s=e("mp4-stream"),a=e("mp4-box-encoding"),o=e("range-slice-stream");class c{constructor(e,t){this._entries=e,this._countName=t||"count",this._index=0,this._offset=0,this.value=this._entries[0]}inc(){this._offset++,this._offset>=this._entries[this._index][this._countName]&&(this._index++,this._offset=0),this.value=this._entries[this._index]}}const l=1;t.exports=class extends r{constructor(e){super(),this._tracks=[],this._file=e,this._decoder=null,this._findMoov(0)}_findMoov(e){this._decoder&&this._decoder.destroy();let t=0;this._decoder=s.decode();const i=this._file.createReadStream({start:e});i.pipe(this._decoder);const n=r=>{"moov"===r.type?(this._decoder.removeListener("box",n),this._decoder.decode((e=>{i.destroy();try{this._processMoov(e)}catch(e){e.message=`Cannot parse mp4 file: ${e.message}`,this.emit("error",e)}}))):r.length<4096?(t+=r.length,this._decoder.ignore()):(this._decoder.removeListener("box",n),t+=r.length,i.destroy(),this._decoder.destroy(),this._findMoov(e+t))};this._decoder.on("box",n)}_processMoov(e){const t=e.traks;this._tracks=[],this._hasVideo=!1,this._hasAudio=!1;for(let i=0;i<t.length;i++){const r=t[i],s=r.mdia.minf.stbl,a=s.stsd.entries[0],o=r.mdia.hdlr.handlerType;let l,u;if("vide"===o&&"avc1"===a.type){if(this._hasVideo)contiLine truncated
|
||||
/*! webtorrent. MIT License. WebTorrent LLC <https://webtorrent.io/opensource> */
|
||||
const n=e("events"),r=e("path"),s=e("simple-concat"),a=e("create-torrent"),o=e("debug"),c=e("bittorrent-dht/client"),l=e("load-ip-set"),u=e("run-parallel"),p=e("parse-torrent"),d=e("simple-peer"),f=e("queue-microtask"),h=e("randombytes"),m=e("simple-sha1"),b=e("throughput"),{ThrottleGroup:v}=e("speed-limiter"),g=e("./lib/conn-pool.js"),y=e("./lib/torrent.js"),{version:x}=e("./package.json"),_=o("webtorrent"),w=x.replace(/\d*./g,(e=>("0"+e%100).slice(-2))).slice(0,4),k=`-WW${w}-`;class E extends n{constructor(t={}){super(),"string"==typeof t.peerId?this.peerId=t.peerId:i.isBuffer(t.peerId)?this.peerId=t.peerId.toString("hex"):this.peerId=i.from(k+h(9).toString("base64")).toString("hex"),this.peerIdBuffer=i.from(this.peerId,"hex"),"string"==typeof t.nodeId?this.nodeId=t.nodeId:i.isBuffer(t.nodeId)?this.nodeId=t.nodeId.toString("hex"):this.nodeId=h(20).toString("hex"),this.nodeIdBuffer=i.from(this.nodeId,"hex"),this._debugId=this.peerId.toString("hex").substring(0,7),this.destroyed=!1,this.listening=!1,this.torrentPort=t.torrentPort||0,this.dhtPort=t.dhtPort||0,this.tracker=void 0!==t.tracker?t.tracker:{},this.lsd=!1!==t.lsd,this.torrents=[],this.maxConns=Number(t.maxConns)||55,this.utp=E.UTP_SUPPORT&&!1!==t.utp,this._downloadLimit=Math.max("number"==typeof t.downloadLimit?t.downloadLimit:-1,-1),this._uploadLimit=Math.max("number"==typeof t.uploadLimit?t.uploadLimit:-1,-1),this.serviceWorker=null,this.workerKeepAliveInterval=null,this.workerPortCount=0,!0===t.secure&&e("./lib/peer").enableSecure(),this._debug("new webtorrent (peerId %s, nodeId %s, port %s)",this.peerId,this.nodeId,this.torrentPort),this.throttleGroups={down:new v({rate:Math.max(this._downloadLimit,0),enabled:this._downloadLimit>=0}),up:new v({rate:Math.max(this._uploadLimit,0),enabled:this._uploadLimit>=0})},this.tracker&&("object"!=typeof this.tracker&&(this.tracker={}),globalThis.WRTC&&!this.tracker.wrtc&&(this.tracker.wrtc=globalThis.WRTC)),"function"==typeof g?this._connPool=new g(this):f((()=>{this._onListening()})),this._downloadSpeed=b(),this._uploadSpeed=b(),!1!==t.dht&&"function"==typeof c?(this.dht=new c(Object.assign({},{nodeId:this.nodeId},t.dht)),this.dht.once("error",(e=>{this._destroy(e)})),this.dht.once("listening",(()=>{const e=this.dht.address();e&&(this.dhtPort=e.port)})),this.dht.setMaxListeners(0),this.dht.listen(this.dhtPort)):this.dht=!1,this.enableWebSeeds=!1!==t.webSeeds;const n=()=>{this.destroyed||(this.ready=!0,this.emit("ready"))};"function"==typeof l&&null!=t.blocklist?l(t.blocklist,{headers:{"user-agent":`WebTorrent/${x} (https://webtorrent.io)`}},((e,t)=>{if(e)return console.error(`Failed to load blocklist: ${e.message}`);this.blocked=t,n()})):f(n)}loadWorker(e,t=(()=>{})){if(!(e instanceof ServiceWorker))throw new Error("Invalid worker registration");if("activated"!==e.state)throw new Error("Worker isn't activated");this.serviceWorker=e,navigator.serviceWorker.addEventListener("message",(e=>{const{data:t}=e;if(!t.type||"webtorrent"===!t.type||!t.url)return null;let[i,...n]=t.url.slice(t.url.indexOf(t.scope+"webtorrent/")+11+t.scope.length).split("/");if(n=decodeURI(n.join("/")),!i||!n)return null;const[r]=e.ports,s=this.get(i)&&this.get(i).files.find((e=>e.path===n));if(!s)return null;const[a,o,c]=s._serve(t),l=o&&o[Symbol.asyncIterator](),u=()=>{r.onmessage=null,o&&o.destroy(),c&&c.destroy(),this.workerPortCount--,this.workerPortCount||(clearInterval(this.workerKeepAliveInterval),this.workerKeepAliveInterval=null)};r.onmessage=async e=>{if(e.data){let e;try{e=(await l.next()).value}catch(e){}r.postMessage(e),e||u(),this.workerKeepAliveInterval||(this.workerKeepAliveInterval=setInterval((()=>fetch(`${this.serviceWorker.scriptURL.slice(0,this.serviceWorker.scriptURL.lastIndexOf("/")+1).slice(window.location.origin.length)}webtorrent/keepalive/`)),2e4))}else u()},this.workerPortCount++,r.postMessage(a)})),fetch(`${this.serviceWorker.scriptURL.slice(0,this.serviceWorker.scriptURL.lastIndexOf("/")+1).slice(window.location.origin.length)}webtorrent/cancel/`).then((e=>{e.body.cancel()})),t(null,this.serviceWorker)}get downloadSpeed(){return this._downloadSpeed()}get uploadSpeed(){return this._uploadSpeed()}get progress(){const e=this.torrents.filter((e=>1!==e.progress));return e.reduce(((e,t)=>e+t.downloaded),0)/(e.reduce(((e,t)=>e+(t.length||0)),0)||1)}get ratio(){return this.torrents.reduce(((e,t)=>e+t.uploaded),0)/(this.torrents.reduce(((e,t)=>e+t.received),0)||1)}get(e){if(e instanceof y){if(this.torrents.includes(e))return e}else{let t;try{t=p(e)}catch(e){}if(!t)return null;if(!t.infoHash)throw new Error("Invalid torrent identifier");for(const e of this.torrents)if(e.infoHash===t.infoHash)return e}return null}add(e,t={},i=(()=>{})){if(this.destroyed)throw new Error("client is destroyed");"function"==typeof t&&([t,i]=[{},t]);const n=()=>{if(!this.destroyed)for(const e of this.torrents)if(e.infoHash===s.infoHash&&e!==s)return s._destroy(new Error(`Cannot add duplicate torrent ${s.infoHash}`)),void i(e)},r=()=>{thLine truncated
|
||||
const n=e("events"),r=e("path"),s=e("simple-concat"),a=e("create-torrent"),o=e("debug"),c=e("bittorrent-dht/client"),l=e("load-ip-set"),u=e("run-parallel"),p=e("parse-torrent"),d=e("simple-peer"),f=e("queue-microtask"),h=e("randombytes"),m=e("simple-sha1"),b=e("throughput"),{ThrottleGroup:v}=e("speed-limiter"),g=e("./lib/conn-pool.js"),y=e("./lib/torrent.js"),{version:x}=e("./package.json"),_=o("webtorrent"),w=x.replace(/\d*./g,(e=>("0"+e%100).slice(-2))).slice(0,4),k=`-WW${w}-`;class E extends n{constructor(t={}){super(),"string"==typeof t.peerId?this.peerId=t.peerId:i.isBuffer(t.peerId)?this.peerId=t.peerId.toString("hex"):this.peerId=i.from(k+h(9).toString("base64")).toString("hex"),this.peerIdBuffer=i.from(this.peerId,"hex"),"string"==typeof t.nodeId?this.nodeId=t.nodeId:i.isBuffer(t.nodeId)?this.nodeId=t.nodeId.toString("hex"):this.nodeId=h(20).toString("hex"),this.nodeIdBuffer=i.from(this.nodeId,"hex"),this._debugId=this.peerId.toString("hex").substring(0,7),this.destroyed=!1,this.listening=!1,this.torrentPort=t.torrentPort||0,this.dhtPort=t.dhtPort||0,this.tracker=void 0!==t.tracker?t.tracker:{},this.lsd=!1!==t.lsd,this.torrents=[],this.maxConns=Number(t.maxConns)||55,this.utp=E.UTP_SUPPORT&&!1!==t.utp,this._downloadLimit=Math.max("number"==typeof t.downloadLimit?t.downloadLimit:-1,-1),this._uploadLimit=Math.max("number"==typeof t.uploadLimit?t.uploadLimit:-1,-1),this.serviceWorker=null,this.workerKeepAliveInterval=null,this.workerPortCount=0,!0===t.secure&&e("./lib/peer").enableSecure(),this._debug("new webtorrent (peerId %s, nodeId %s, port %s)",this.peerId,this.nodeId,this.torrentPort),this.throttleGroups={down:new v({rate:Math.max(this._downloadLimit,0),enabled:this._downloadLimit>=0}),up:new v({rate:Math.max(this._uploadLimit,0),enabled:this._uploadLimit>=0})},this.tracker&&("object"!=typeof this.tracker&&(this.tracker={}),globalThis.WRTC&&!this.tracker.wrtc&&(this.tracker.wrtc=globalThis.WRTC)),"function"==typeof g?this._connPool=new g(this):f((()=>{this._onListening()})),this._downloadSpeed=b(),this._uploadSpeed=b(),!1!==t.dht&&"function"==typeof c?(this.dht=new c(Object.assign({},{nodeId:this.nodeId},t.dht)),this.dht.once("error",(e=>{this._destroy(e)})),this.dht.once("listening",(()=>{const e=this.dht.address();e&&(this.dhtPort=e.port)})),this.dht.setMaxListeners(0),this.dht.listen(this.dhtPort)):this.dht=!1,this.enableWebSeeds=!1!==t.webSeeds;const n=()=>{this.destroyed||(this.ready=!0,this.emit("ready"))};"function"==typeof l&&null!=t.blocklist?l(t.blocklist,{headers:{"user-agent":`WebTorrent/${x} (https://webtorrent.io)`}},((e,t)=>{if(e)return console.error(`Failed to load blocklist: ${e.message}`);this.blocked=t,n()})):f(n)}loadWorker(e,t=(()=>{})){if(!(e instanceof ServiceWorker))throw new Error("Invalid worker registration");if("activated"!==e.state)throw new Error("Worker isn't activated");this.serviceWorker=e,navigator.serviceWorker.addEventListener("message",(e=>{const{data:t}=e;if(!t.type||"webtorrent"===!t.type||!t.url)return null;let[i,...n]=t.url.slice(t.url.indexOf(t.scope+"webtorrent/")+11+t.scope.length).split("/");if(n=decodeURI(n.join("/")),!i||!n)return null;const[r]=e.ports,s=this.get(i)&&this.get(i).files.find((e=>e.path===n));if(!s)return null;const[a,o,c]=s._serve(t),l=o&&o[Symbol.asyncIterator](),u=()=>{r.onmessage=null,o&&o.destroy(),c&&c.destroy(),this.workerPortCount--,this.workerPortCount||(clearInterval(this.workerKeepAliveInterval),this.workerKeepAliveInterval=null)};r.onmessage=async e=>{if(e.data){let e;try{e=(await l.next()).value}catch(e){}r.postMessage(e),e||u(),this.workerKeepAliveInterval||(this.workerKeepAliveInterval=setInterval((()=>fetch(`${this.serviceWorker.scriptURL.slice(0,this.serviceWorker.scriptURL.lastIndexOf("/")+1).slice(window.location.origin.length)}webtorrent/keepalive/`)),2e4))}else u()},this.workerPortCount++,r.postMessage(a)})),fetch(`${this.serviceWorker.scriptURL.slice(0,this.serviceWorker.scriptURL.lastIndexOf("/")+1).slice(window.location.origin.length)}webtorrent/cancel/`).then((e=>{e.body.cancel()})),t(null,this.serviceWorker)}get downloadSpeed(){return this._downloadSpeed()}get uploadSpeed(){return this._uploadSpeed()}get progress(){const e=this.torrents.filter((e=>1!==e.progress));return e.reduce(((e,t)=>e+t.downloaded),0)/(e.reduce(((e,t)=>e+(t.length||0)),0)||1)}get ratio(){return this.torrents.reduce(((e,t)=>e+t.uploaded),0)/(this.torrents.reduce(((e,t)=>e+t.received),0)||1)}get(e){if(e instanceof y){if(this.torrents.includes(e))return e}else{let t;try{t=p(e)}catch(e){}if(!t)return null;if(!t.infoHash)throw new Error("Invalid torrent identifier");for(const e of this.torrents)if(e.infoHash===t.infoHash)return e}return null}add(e,t={},i=(()=>{})){if(this.destroyed)throw new Error("client is destroyed");"function"==typeof t&&([t,i]=[{},t]);const n=()=>{if(!this.destroyed)for(const e of this.torrents)if(e.infoHash===s.infoHash&&e!==s)return s._destroy(new Error(`Cannot add duplicate torrent ${s.infoHash}`)),void i(e)},r=()=>{thLine truncated
|
||||
@@ -1,5 +1,5 @@
|
||||
projectName: 'C:\Users\Leo\Desktop\TorrentPartsFASubset'
|
||||
version: 6.1.2
|
||||
version: 6.2.1
|
||||
icons:
|
||||
- magnet:
|
||||
- light
|
||||
@@ -13,11 +13,12 @@ icons:
|
||||
- solid
|
||||
- link:
|
||||
- light
|
||||
- duotone
|
||||
- share-nodes:
|
||||
- solid
|
||||
- duotone
|
||||
- file-arrow-down:
|
||||
- solid
|
||||
- arrow-up-right-from-square:
|
||||
- solid
|
||||
- file:
|
||||
- regular
|
||||
- file-word:
|
||||
|
||||
Vendored
+3
-3
@@ -1,6 +1,6 @@
|
||||
/*!
|
||||
* Font Awesome Pro 6.1.2 by @fontawesome - https://fontawesome.com
|
||||
* Font Awesome Pro 6.2.1 by @fontawesome - https://fontawesome.com
|
||||
* License - https://fontawesome.com/license (Commercial License)
|
||||
* Copyright 2022 Fonticons, Inc.
|
||||
* Copyright 2023 Fonticons, Inc.
|
||||
*/
|
||||
!function(){"use strict";var t={},e={};try{"undefined"!=typeof window&&(t=window),"undefined"!=typeof document&&(e=document)}catch(t){}var a=(t.navigator||{}).userAgent,a=void 0===a?"":a;t.document,e.documentElement&&e.head&&"function"==typeof e.addEventListener&&e.createElement,~a.indexOf("MSIE")||a.indexOf("Trident/");function i(e,t){var a,n=Object.keys(e);return Object.getOwnPropertySymbols&&(a=Object.getOwnPropertySymbols(e),t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,a)),n}function r(n){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?i(Object(r),!0).forEach(function(t){var e,a;e=n,a=r[t=t],t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(r)):i(Object(r)).forEach(function(t){Object.defineProperty(n,t,Object.getOwnPropertyDescriptor(r,t))})}return n}function n(t,e){(null==e||e>t.length)&&(e=t.length);for(var a=0,n=new Array(e);a<e;a++)n[a]=t[a];return n}var e="___FONT_AWESOME___",o=function(){try{return!0}catch(t){return!1}}(),a=[1,2,3,4,5,6,7,8,9,10],c=a.concat([11,12,13,14,15,16,17,18,19,20]),s="duotone-group",f="swap-opacity",l="primary",u="secondary";[].concat(function(t){if(Array.isArray(t))return n(t)}(m=Object.keys({solid:"fas",regular:"far",light:"fal",thin:"fat",duotone:"fad",brands:"fab",kit:"fak"}))||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(m)||function(t,e){if(t){if("string"==typeof t)return n(t,e);var a=Object.prototype.toString.call(t).slice(8,-1);return"Map"===(a="Object"===a&&t.constructor?t.constructor.name:a)||"Set"===a?Array.from(t):"Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?n(t,e):void 0}}(m)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),["2xs","xs","sm","lg","xl","2xl","beat","border","fade","beat-fade","bounce","flip-both","flip-horizontal","flip-vertical","flip","fw","inverse","layers-counter","layers-text","layers","li","pull-left","pull-right","pulse","rotate-180","rotate-270","rotate-90","rotate-by","shake","spin-pulse","spin-reverse","spin","stack-1x","stack-2x","stack","ul",s,f,l,u]).concat(a.map(function(t){return"".concat(t,"x")})).concat(c.map(function(t){return"w-".concat(t)}));var m=t||{},d=(m[e]||(m[e]={}),m[e].styles||(m[e].styles={}),m[e].hooks||(m[e].hooks={}),m[e].shims||(m[e].shims=[]),m[e]);function p(n){return Object.keys(n).reduce(function(t,e){var a=n[e];return!!a.icon?t[a.iconName]=a.icon:t[e]=a,t},{})}function b(t,e,a){var a=(2<arguments.length&&void 0!==a?a:{}).skipHooks,a=void 0!==a&&a,n=p(e);"function"!=typeof d.hooks.addPack||a?d.styles[t]=r(r({},d.styles[t]||{}),n):d.hooks.addPack(t,p(e)),"fas"===t&&b("fa",e)}var v={"file-lines":[384,512,[128462,61686,128441,"file-alt","file-text"],"f15c",["M256 128V0H48C21.49 0 0 21.49 0 48v416C0 490.5 21.49 512 48 512h288c26.51 0 48-21.49 48-48V128H256zM272 416h-160C103.2 416 96 408.8 96 400S103.2 384 112 384h160c8.836 0 16 7.164 16 16S280.8 416 272 416zM272 352h-160C103.2 352 96 344.8 96 336S103.2 320 112 320h160c8.836 0 16 7.164 16 16S280.8 352 272 352zM272 288h-160C103.2 288 96 280.8 96 272S103.2 256 112 256h160C280.8 256 288 263.2 288 272S280.8 288 272 288z","M256 0v128h128L256 0zM272 384h-160C103.2 384 96 391.2 96 400S103.2 416 112 416h160c8.836 0 16-7.164 16-16S280.8 384 272 384zM272 320h-160C103.2 320 96 327.2 96 336S103.2 352 112 352h160c8.836 0 16-7.164 16-16S280.8 320 272 320zM272 256h-160C103.2 256 96 263.2 96 272S103.2 288 112 288h160C280.8 288 288 280.8 288 272S280.8 256 272 256z"]],link:[640,512,[128279,"chain"],"f0c1",["M579.8 63.24C636.3 119.7 636.3 211.3 579.8 267.7L467.5 380C411 436.5 319.5 436.5 263 380C213 330 206.5 251.2 247.6 193.7L248.7 192.1C258.1 177.8 278.1 174.4 293.3 184.7C307.7 194.1 311.1 214.1 300.8 229.3L299.7 230.9C276.8 262.1 280.4 306.9 308.3 334.8C339.7 366.2 390.8 366.2 422.3 334.8L534.5 222.5C566 191 566 139.1 534.5 108.5C506.7 80.63 462.7 76.99 430.7 99.9L429.1 101C414.7 111.3 394.7 107.1 384.5 93.58C374.2 79.2 377.5 59.21 391.9 48.94L393.5 47.82C451 6.731 529.8 13.25 579.8 63.24L579.8 63.24z","M60.21 448.8C3.741 392.3 3.741 300.7 60.21 244.3L172.5 131.1C228.1 75.51 320.5 75.51 376.1 131.1C426.1 181.1 433.5 260.8 392.4 318.3L391.3 319.9C381 334.2 361 337.6 346.7 327.3C332.3 317 328.9 297 339.2 282.7L340.3 281.1C363.2 249 359.6 205.1 331.7 177.2C300.3 145.8 249.2 145.8 217.7 177.2L105.5 289.5C73.99 320.1 73.99 372 105.5 403.5C133.3 431.4 177.3 435 209.3 412.1L210.9 410.1C225.3 400.7 245.3 404 255.5 418.4C265.8 432.8 262.5 452.8 248.1 463.1L246.5 464.2C188.1 505.3 110.2 498.7 60.21 448.8L60.21 448.8z"]],magnet:[448,512,[129522],"f076",["M0 64C0 46.33 14.33 32 32 32H96C113.7 32 128 46.33 128 64V160H0V64zM320 64C320 46.33 334.3 32 352 32H416C43Line truncated
|
||||
!function(){"use strict";var t={},a={};try{"undefined"!=typeof window&&(t=window),"undefined"!=typeof document&&(a=document)}catch(t){}var e=(t.navigator||{}).userAgent,e=void 0===e?"":e;t.document,a.documentElement&&a.head&&"function"==typeof a.addEventListener&&a.createElement,~e.indexOf("MSIE")||e.indexOf("Trident/");function n(a,t){var e,n=Object.keys(a);return Object.getOwnPropertySymbols&&(e=Object.getOwnPropertySymbols(a),t&&(e=e.filter(function(t){return Object.getOwnPropertyDescriptor(a,t).enumerable})),n.push.apply(n,e)),n}function r(a){for(var t=1;t<arguments.length;t++){var e=null!=arguments[t]?arguments[t]:{};t%2?n(Object(e),!0).forEach(function(t){i(a,t,e[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(e)):n(Object(e)).forEach(function(t){Object.defineProperty(a,t,Object.getOwnPropertyDescriptor(e,t))})}return a}function i(t,a,e){a in t?Object.defineProperty(t,a,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[a]=e}function o(t,a){(null==a||a>t.length)&&(a=t.length);for(var e=0,n=new Array(a);e<a;e++)n[e]=t[e];return n}var a="___FONT_AWESOME___",c=function(){try{return!0}catch(t){return!1}}(),s="classic",e="sharp",f=[s,e];function l(t){return new Proxy(t,{get:function(t,a){return a in t?t[a]:t[s]}})}l((i(u={},s,{fa:"solid",fas:"solid","fa-solid":"solid",far:"regular","fa-regular":"regular",fal:"light","fa-light":"light",fat:"thin","fa-thin":"thin",fad:"duotone","fa-duotone":"duotone",fab:"brands","fa-brands":"brands",fak:"kit","fa-kit":"kit"}),i(u,e,{fa:"solid",fass:"solid","fa-solid":"solid"}),u));var u=l((i(u={},s,{solid:"fas",regular:"far",light:"fal",thin:"fat",duotone:"fad",brands:"fab",kit:"fak"}),i(u,e,{solid:"fass"}),u)),d=(l((i(d={},s,{fab:"fa-brands",fad:"fa-duotone",fak:"fa-kit",fal:"fa-light",far:"fa-regular",fas:"fa-solid",fat:"fa-thin"}),i(d,e,{fass:"fa-solid"}),d)),l((i(d={},s,{"fa-brands":"fab","fa-duotone":"fad","fa-kit":"fak","fa-light":"fal","fa-regular":"far","fa-solid":"fas","fa-thin":"fat"}),i(d,e,{"fa-solid":"fass"}),d)),l((i(d={},s,{900:"fas",400:"far",normal:"far",300:"fal",100:"fat"}),i(d,e,{900:"fass"}),d)),[1,2,3,4,5,6,7,8,9,10]),m=d.concat([11,12,13,14,15,16,17,18,19,20]),C="duotone-group",h="swap-opacity",p="primary",v="secondary",b=new Set;Object.keys(u[s]).map(b.add.bind(b)),Object.keys(u[e]).map(b.add.bind(b)),[].concat(f,function(t){if(Array.isArray(t))return o(t)}(u=b)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(u)||function(t,a){var e;if(t)return"string"==typeof t?o(t,a):"Map"===(e="Object"===(e=Object.prototype.toString.call(t).slice(8,-1))&&t.constructor?t.constructor.name:e)||"Set"===e?Array.from(t):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?o(t,a):void 0}(u)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),["2xs","xs","sm","lg","xl","2xl","beat","border","fade","beat-fade","bounce","flip-both","flip-horizontal","flip-vertical","flip","fw","inverse","layers-counter","layers-text","layers","li","pull-left","pull-right","pulse","rotate-180","rotate-270","rotate-90","rotate-by","shake","spin-pulse","spin-reverse","spin","stack-1x","stack-2x","stack","ul",C,h,p,v]).concat(d.map(function(t){return"".concat(t,"x")})).concat(m.map(function(t){return"w-".concat(t)}));var e=t||{},g=(e[a]||(e[a]={}),e[a].styles||(e[a].styles={}),e[a].hooks||(e[a].hooks={}),e[a].shims||(e[a].shims=[]),e[a]);function y(n){return Object.keys(n).reduce(function(t,a){var e=n[a];return!!e.icon?t[e.iconName]=e.icon:t[a]=e,t},{})}function H(t,a,e){var e=(2<arguments.length&&void 0!==e?e:{}).skipHooks,e=void 0!==e&&e,n=y(a);"function"!=typeof g.hooks.addPack||e?g.styles[t]=r(r({},g.styles[t]||{}),n):g.hooks.addPack(t,y(a)),"fas"===t&&H("fa",a)}var z={"file-lines":[384,512,[128441,128462,61686,"file-alt","file-text"],"f15c",["M256 128V0H48C21.49 0 0 21.49 0 48v416C0 490.5 21.49 512 48 512h288c26.51 0 48-21.49 48-48V128H256zM272 416h-160C103.2 416 96 408.8 96 400S103.2 384 112 384h160c8.836 0 16 7.164 16 16S280.8 416 272 416zM272 352h-160C103.2 352 96 344.8 96 336S103.2 320 112 320h160c8.836 0 16 7.164 16 16S280.8 352 272 352zM272 288h-160C103.2 288 96 280.8 96 272S103.2 256 112 256h160C280.8 256 288 263.2 288 272S280.8 288 272 288z","M256 0v128h128L256 0zM272 384h-160C103.2 384 96 391.2 96 400S103.2 416 112 416h160c8.836 0 16-7.164 16-16S280.8 384 272 384zM272 320h-160C103.2 320 96 327.2 96 336S103.2 352 112 352h160c8.836 0 16-7.164 16-16S280.8 320 272 320zM272 256h-160C103.2 256 96 263.2 96 272S103.2 288 112 288h160C280.8 288 288 280.8 288 272S280.8 256 272 256z"]],"file-csv":[384,512,[],"f6dd",["M0 64C0 28.65 28.65 0 64 0H224V160H384V448C384 483.3 355.3 512 320 512H64C28.65 512 0 483.3 0 448V64zM80 224C57.91 224 40 241.9 40 264V344C40 366.1 57.91 384 80 384H96C118.1 384 136 366.1 136 344V336C136 327.2 128.8 320 120 320C1Line truncated
|
||||
+6
-1
@@ -82,9 +82,14 @@
|
||||
</button>
|
||||
|
||||
<div id="share">
|
||||
<a id="openURLWrapper" target="_blank">
|
||||
<button id="openURL" aria-label="Open this Magnet URL in your Torrent client">
|
||||
<span class="fas fa-arrow-up-right-from-square fa-2x"></span>
|
||||
</button>
|
||||
</a>
|
||||
<div>
|
||||
<button id="copyURL" aria-label="Copy this torrent.parts link to the clipboard">
|
||||
<span class="fas fa-share-alt fa-2x" data-fa-transform="left-1"></span>
|
||||
<span class="fas fa-link fa-2x"></span>
|
||||
</button>
|
||||
</div>
|
||||
<div>
|
||||
|
||||
@@ -30,10 +30,13 @@ var removeWebseeds = document.getElementById('removeWebseeds');
|
||||
var pieces = document.getElementById('pieces');
|
||||
var files = document.getElementById('filesBody');
|
||||
var getFiles = document.getElementById('getFiles');
|
||||
var openURLWrapper = document.getElementById('openURLWrapper');
|
||||
var openURL = document.getElementById('openURL');
|
||||
var copyURL = document.getElementById('copyURL');
|
||||
var copyMagnet = document.getElementById('copyMagnet');
|
||||
var downloadTorrentWrapper = document.getElementById('downloadTorrentWrapper');
|
||||
var downloadTorrent = document.getElementById('downloadTorrent');
|
||||
var openURLTooltip = tippy(openURL, {"theme": "torrent-parts", "animation": "shift-away-subtle", "content": "Open this Magnet URL in your Torrent client"});
|
||||
var copyURLTooltip = tippy(copyURL, {"theme": "torrent-parts", "animation": "shift-away-subtle", "content": "Copy torrent.parts link to clipboard"});
|
||||
var copyMagnetTooltip = tippy(copyMagnet, {"theme": "torrent-parts", "animation": "shift-away-subtle", "content": "Copy Magnet link to clipboard"});
|
||||
var downloadTorrentTooltip = tippy(downloadTorrentWrapper, {"theme": "torrent-parts", "animation": "shift-away-subtle", "content": "Download Torrent file"});
|
||||
@@ -63,10 +66,12 @@ var notyf = new Notyf({
|
||||
|
||||
function placeDownloadTooltips(e) {
|
||||
if (window.innerWidth > 1080) {
|
||||
openURLTooltip.setProps({"placement": "right"});
|
||||
copyURLTooltip.setProps({"placement": "right"});
|
||||
copyMagnetTooltip.setProps({"placement": "right"});
|
||||
downloadTorrentTooltip.setProps({"placement": "right"});
|
||||
} else {
|
||||
openURLTooltip.setProps({"placement": "top"});
|
||||
copyURLTooltip.setProps({"placement": "top"});
|
||||
copyMagnetTooltip.setProps({"placement": "top"});
|
||||
downloadTorrentTooltip.setProps({"placement": "top"});
|
||||
@@ -319,6 +324,7 @@ function display() {
|
||||
files.appendChild(createFileRow('', '...and another ' + (parsed.files.length - 100) + ' more files', ''));
|
||||
}
|
||||
files.appendChild(createFileRow('folder-tree', '', parsed.length));
|
||||
openURLWrapper.href = parser.toMagnetURI(parsed);
|
||||
downloadTorrentTooltip.setContent('Download Torrent file');
|
||||
downloadTorrent.addEventListener('click', saveTorrent);
|
||||
downloadTorrent.disabled = false;
|
||||
|
||||
+1
-1
@@ -251,7 +251,7 @@ label[for="torrent"] {
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
#share > div > button {
|
||||
#share > * > button {
|
||||
width: 64px;
|
||||
height: 64px;
|
||||
border-radius: 50%;
|
||||
|
||||
Reference in new issue
Block a user