mirror of
https://github.com/leoherzog/TorrentParts.git
synced 2026-01-23 19:58:03 -08:00
Progress Adding More Fields
This commit is contained in:
17
bundle.js
17
bundle.js
@@ -2379,6 +2379,10 @@ const Buffer = require('Buffer');
|
||||
const size = require('filesize');
|
||||
|
||||
var name = document.getElementById('name');
|
||||
var creationDate = document.getElementById('creationDate');
|
||||
var createdBy = document.getElementById('createdBy');
|
||||
var comment = document.getElementById('comment');
|
||||
var hash = document.getElementById('hash');
|
||||
var parsed;
|
||||
|
||||
document.addEventListener('DOMContentLoaded', start);
|
||||
@@ -2400,7 +2404,6 @@ function start() {
|
||||
}
|
||||
|
||||
function parse(toLoad) {
|
||||
console.info(toLoad);
|
||||
if (typeof toLoad === "string" && toLoad.toLowerCase().trim().startsWith("http")) {
|
||||
parser.remote(toLoad, handleRemote);
|
||||
} else {
|
||||
@@ -2416,7 +2419,17 @@ function handleRemote(err, result) {
|
||||
|
||||
function display() {
|
||||
console.log(parsed);
|
||||
name.value = parsed.name;
|
||||
name.value = parsed.name || "";
|
||||
if (parsed.created) {
|
||||
creationDate.disabled = false;
|
||||
creationDate.value = parsed.created.toISOString().slice(0, 19);
|
||||
} else {
|
||||
creationDate.disabled = true;
|
||||
creationDate.value = "";
|
||||
}
|
||||
createdBy.value = parsed.createdBy || "";
|
||||
comment.value = parsed.comment || "";
|
||||
hash.value = parsed.infoHash;
|
||||
}
|
||||
},{"Buffer":1,"filesize":6,"parse-torrent":9}],21:[function(require,module,exports){
|
||||
'use strict'
|
||||
|
||||
19
index.html
19
index.html
@@ -14,7 +14,24 @@
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-form-label" for="name">Torrent Name</label>
|
||||
<input id="name" type="text" class="form-control" value="" />
|
||||
<input id="name" type="text" class="form-control" value="" placeholder="No name" />
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-form-label" for="creationDate">Created</label>
|
||||
<input id="creationDate" type="datetime-local" class="form-control" value="" placeholder="Empty" />
|
||||
<label class="col-form-label" for="createdBy">with</label>
|
||||
<input id="createdBy" type="text" class="form-control" value="" placeholder="Unspecified" disabled />
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-form-label" for="comment">Comment</label>
|
||||
<input id="comment" type="text" class="form-control" value="" placeholder="Empty" />
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-form-label" for="hash">Unique Hash</label>
|
||||
<input id="hash" type="text" class="form-control" value="" placeholder="" disabled/>
|
||||
</div>
|
||||
|
||||
<script src="bundle.js"></script>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "torrentparts",
|
||||
"version": "0.0.1",
|
||||
"description": "🗃️ A website to inspect and edit Torrent files and Magnet URLs",
|
||||
"description": "📑 A website to inspect and edit Torrent files and Magnet URLs",
|
||||
"main": "bundle.js",
|
||||
"dependencies": {
|
||||
"browserify": "latest",
|
||||
|
||||
17
parse.js
17
parse.js
@@ -3,6 +3,10 @@ const Buffer = require('Buffer');
|
||||
const size = require('filesize');
|
||||
|
||||
var name = document.getElementById('name');
|
||||
var creationDate = document.getElementById('creationDate');
|
||||
var createdBy = document.getElementById('createdBy');
|
||||
var comment = document.getElementById('comment');
|
||||
var hash = document.getElementById('hash');
|
||||
var parsed;
|
||||
|
||||
document.addEventListener('DOMContentLoaded', start);
|
||||
@@ -24,7 +28,6 @@ function start() {
|
||||
}
|
||||
|
||||
function parse(toLoad) {
|
||||
console.info(toLoad);
|
||||
if (typeof toLoad === "string" && toLoad.toLowerCase().trim().startsWith("http")) {
|
||||
parser.remote(toLoad, handleRemote);
|
||||
} else {
|
||||
@@ -40,5 +43,15 @@ function handleRemote(err, result) {
|
||||
|
||||
function display() {
|
||||
console.log(parsed);
|
||||
name.value = parsed.name;
|
||||
name.value = parsed.name || "";
|
||||
if (parsed.created) {
|
||||
creationDate.disabled = false;
|
||||
creationDate.value = parsed.created.toISOString().slice(0, 19);
|
||||
} else {
|
||||
creationDate.disabled = true;
|
||||
creationDate.value = "";
|
||||
}
|
||||
createdBy.value = parsed.createdBy || "";
|
||||
comment.value = parsed.comment || "";
|
||||
hash.value = parsed.infoHash;
|
||||
}
|
||||
Reference in New Issue
Block a user