From e6686057c85142374dc7b963a6d3370a841e0dab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diego=20Rodr=C3=ADguez?= Date: Fri, 11 Mar 2016 04:57:25 -0300 Subject: [PATCH] Added tracker stats, cleaned commans --- 200.jade | 53 ++++++++++++++++++++++++--------------------- views/download.jade | 36 +++++++++++++++--------------- views/full.jade | 40 +++++++++++++++++----------------- views/view.jade | 12 +++++----- 4 files changed, 72 insertions(+), 69 deletions(-) diff --git a/200.jade b/200.jade index 2cf23d9..e182b7e 100644 --- a/200.jade +++ b/200.jade @@ -1,49 +1,52 @@ doctype html -html(ng-app='BTorrent', lang='en') +html(ng-app="BTorrent" lang="en") head - base(href='') - meta(charset='UTF-8') + base(href="") + meta(charset="UTF-8") title βTorrent: Browser WebTorrent Client - meta(name='description', content='βTorrent is the first fully-featured Browser WebTorrent Client') - meta(name='keywords', content='βTorrent, btorrent, client, webtorrent, browser, torrent, stream, bittorrent, torrenting, sharing, filesharing') - meta(name='author', content='Diego Rodríguez Baquero - DiegoRBaquero') - meta(name='viewport', content='width=device-width, initial-scale=1') - script(src='https://cdn.jsdelivr.net/g/webtorrent@0,momentjs@2,angularjs@1.4(angular.min.js+angular-route.min.js+angular-sanitize.min.js),angular.ui-grid@3.1,angular.ng-notify@0.7,angular.file-upload@12') - link(rel='stylesheet', href='https://cdn.jsdelivr.net/g/normalize@3.0,skeleton@2.0,angular.ng-notify@0.7(ng-notify.min.css)') - link(rel='stylesheet', href='https://cdn.jsdelivr.net/fontawesome/4.5/css/font-awesome.min.css') - link(rel='stylesheet', href='https://cdn.jsdelivr.net/angular.ui-grid/3.1/ui-grid.min.css') - link(rel='stylesheet', href='style.css') - body(ng-controller='BTorrentCtrl', ng-cloak='') + meta(name="description" content="βTorrent is the first fully-featured Browser WebTorrent Client") + meta(name="keywords" content="βTorrent, btorrent, client, webtorrent, browser, torrent, stream, bittorrent, torrenting, sharing, filesharing") + meta(name="author" content="Diego Rodríguez Baquero - DiegoRBaquero") + meta(name="viewport" content="width=device-width, initial-scale=1") + script(src="https://cdn.jsdelivr.net/g/webtorrent@0,momentjs@2,angularjs@1.4(angular.min.js+angular-route.min.js+angular-sanitize.min.js),angular.ui-grid@3.1,angular.ng-notify@0.7,angular.file-upload@12") + link(rel="stylesheet" href="https://cdn.jsdelivr.net/g/normalize@3.0,skeleton@2.0,angular.ng-notify@0.7(ng-notify.min.css)") + link(rel="stylesheet" href="https://cdn.jsdelivr.net/fontawesome/4.5/css/font-awesome.min.css") + link(rel="stylesheet" href="https://cdn.jsdelivr.net/angular.ui-grid/3.1/ui-grid.min.css") + link(rel="stylesheet" href="style.css") + body(ng-controller="BTorrentCtrl" ng-cloak="") header h1 | βTorrent span.version v0.14 - div.views(ng-show='$root.client.torrents.length == 0') - a(ng-href='/#') Full + div.views(ng-show="$root.client.torrents.length == 0") + a(ng-href="/#") Full | | - a(ng-href='/download') Single Download + a(ng-href="/download") Single Download | | - a(ng-href='/view') Stream / View + a(ng-href="/view") Stream / View #viewer(ng-style="$root.viewerStyle") #view(ng-view) footer - a.button(href="https://github.com/DiegoRBaquero/BTorrent/issues", target="_blank") + a.button(href="https://github.com/DiegoRBaquero/BTorrent/issues" target="_blank") i.fa.fa-github | Suggest a feature / Report a bug i.fa.fa-comment br - | βTorrent is an Open-Source project by - a(href='http://diegorbaquero.com') DiegoRBaquero + b βTorrent is an Open-Source project by + a(href="http://diegorbaquero.com" target="_blank") DiegoRBaquero + br + b + a(href="https://tracker.btorrent.xyz/stats" target="_blank") βTorrent's Tracker Stats br | Powered by - a(href='https://github.com/feross/webtorrent') WebTorrent + a(href="https://github.com/feross/webtorrent" target="_blank") WebTorrent br small Hosted by - a(href='https://m.do.co/c/0b25a910e6e4') Digital Ocean + a(href="https://m.do.co/c/0b25a910e6e4" target="_blank") Digital Ocean | | - a(href="http://www.vultr.com/?ref=6823526") Vultr + a(href="http://www.vultr.com/?ref=6823526" target="_blank") Vultr | | - a(href="https://www.linode.com/?r=6d9b41c957019d7fe6d54d159635e5475048e319") Linode + a(href="https://www.linode.com/?r=6d9b41c957019d7fe6d54d159635e5475048e319" target="_blank") Linode .spinner(ng-show="client.processing") i.fa.fa-spinner.fa-spin.spinner-icon - script(src='app.js') \ No newline at end of file + script(src="app.js") \ No newline at end of file diff --git a/views/download.jade b/views/download.jade index 76b2d70..03bd60f 100644 --- a/views/download.jade +++ b/views/download.jade @@ -1,19 +1,19 @@ .container - div(ng-hide='$root.client.torrents.length != 0', style='vertical-align: middle; text-align: center') + div(ng-hide="$root.client.torrents.length != 0" style="vertical-align: middle; text-align: center") .row - form.no-margin(ng-submit='addMagnet()') + form.no-margin(ng-submit="addMagnet()") label Enter magnet, hash or http(s) .torrent - input(type='text', placeholder='magnet, hash or http(s) .torrent', ng-model='torrentInput', ng-disabled='$root.disabled', style='width: 50%') - //button(ng-click='addMagnet()', ng-disabled='!torrentInput.length || $root.disabled', ng-class='{"button-primary": torrentInput.length}') + input(type="text" placeholder="magnet, hash or http(s) .torrent" ng-model="torrentInput" ng-disabled="$root.disabled" style="width: 50%") + //button(ng-click="addMagnet()" ng-disabled="!torrentInput.length || $root.disabled" ng-class="{"button-primary": torrentInput.length}") i.fa.fa-download | Download .row label or... - button(type='file', ngf-select='$root.openTorrentFile($file)', ng-disabled='$root.disabled', ng-class='{"button-primary": !$root.disabled}') + button(type="file" ngf-select="$root.openTorrentFile($file)" ng-disabled="$root.disabled" ng-class="{'button-primary': !$root.disabled}") i.fa.fa-folder-open | Open torrent file - .div(ng-if="selectedTorrent", style="text-align: center") - .four.columns(style='overflow: auto') + .div(ng-if="selectedTorrent" style="text-align: center") + .four.columns(style="overflow: auto") h4 Information table.u-full-width tbody @@ -44,26 +44,26 @@ th Size th Priority tbody - tr.files(ng-repeat='file in $root.selectedTorrent.files') - td(ng-hide='file.done') {{file.name}} - td(ng-show='file.done') - a(ng-href='{{file.url}}', download='{{file.name}}', target='_self', ng-show='file.done') {{file.name}} + tr.files(ng-repeat="file in $root.selectedTorrent.files") + td(ng-hide="file.done") {{file.name}} + td(ng-show="file.done") + a(ng-href="{{file.url}}" download="{{file.name}}" target="_self" ng-show="file.done") {{file.name}} td {{file.length | pbytes}} td - select.no-margin(name='{{file.name}}Priority', ng-model='file.priority', ng-init='file.priority = "0"', ng-change='$root.changePriority(file)') - option(value='1') High Priority - option(value='0' selected='') Low Priority - option(value='-1') Don't download + select.no-margin(name="{{file.name}}Priority" ng-model="file.priority" ng-init="file.priority = '0'" ng-change="$root.changePriority(file)") + option(value="1") High Priority + option(value="0" selected="") Low Priority + option(value="-1") Don't download h5 ↑ Click a file to download it .four.columns h4 Share ul(style="text-align: justify") li - a(ng-href='#{{$root.selectedTorrent.infoHash}}', target='_blank') βTorrent + a(ng-href="#{{$root.selectedTorrent.infoHash}}" target="_blank") βTorrent li - a(ng-href='{{$root.selectedTorrent.magnetURI}}', target='_blank') Magnet URI + a(ng-href="{{$root.selectedTorrent.magnetURI}}" target="_blank") Magnet URI li - a(ng-href='{{$root.selectedTorrent.safeTorrentFileURL}}', target='_self', download='{{$root.selectedTorrent.fileName}}') .torrent + a(ng-href="{{$root.selectedTorrent.safeTorrentFileURL}}" target="_self" download="{{$root.selectedTorrent.fileName}}") .torrent li strong Hash: | {{$root.selectedTorrent.infoHash}} \ No newline at end of file diff --git a/views/full.jade b/views/full.jade index 30f4fe1..5daa953 100644 --- a/views/full.jade +++ b/views/full.jade @@ -1,42 +1,42 @@ .container .row .four.columns - input.u-full-width(type='text', placeholder='magnet, hash or http(s) .torrent', ng-model='torrentInput', ng-disabled='$root.disabled') + input.u-full-width(type="text" placeholder="magnet, hash or http(s) .torrent" ng-model="torrentInput" ng-disabled="$root.disabled") .two.columns.download-button - button(ng-click='addMagnet()', ng-disabled='!torrentInput.length || $root.disabled', ng-class='{"button-primary": torrentInput.length}') + button(ng-click="addMagnet()" ng-disabled="!torrentInput.length || $root.disabled" ng-class="{'button-primary': torrentInput.length}") i.fa.fa-download | Download .three.columns - button(type='file', ngf-select='$root.openTorrentFile($file)', ng-disabled='$root.disabled', ng-class='{"button-primary": !$root.disabled}') + button(type="file" ngf-select="$root.openTorrentFile($file)" ng-disabled="$root.disabled" ng-class="{'button-primary': !$root.disabled}") i.fa.fa-folder-open | Open torrent file .three.columns.u-pull-right - button.u-pull-right(ngf-select='$root.seedFiles($files)', multiple='', ng-disabled='$root.disabled', ng-class='{"button-primary": !$root.disabled}') + button.u-pull-right(ngf-select="$root.seedFiles($files)" multiple="" ng-disabled="$root.disabled" ng-class="{'button-primary': !$root.disabled}") i.fa.fa-upload | Seed files - .row.grid(ui-grid='gridOptions', ui-grid-resize-columns, ui-grid-selection) + .row.grid(ui-grid="gridOptions" ui-grid-resize-columns, ui-grid-selection) .row(ng-if="selectedTorrent") - .six.columns(style='overflow: auto') + .six.columns(style="overflow: auto") h5 {{$root.selectedTorrent.name}} - button(ng-if='!$root.selectedTorrent.swarm.paused', ng-click='$root.selectedTorrent.pause()') + button(ng-if="!$root.selectedTorrent.swarm.paused" ng-click="$root.selectedTorrent.pause()") i.fa.fa-pause | Pause | - button(ng-if='$root.selectedTorrent.swarm.paused', ng-click='$root.selectedTorrent.resume()') + button(ng-if="$root.selectedTorrent.swarm.paused" ng-click="$root.selectedTorrent.resume()") i.fa.fa-play | Resume | - button.button-danger(ng-click='$root.selectedTorrent.destroy($root.destroyedTorrent)') + button.button-danger(ng-click="$root.selectedTorrent.destroy($root.destroyedTorrent)") i.fa.fa-times | Remove h6 Share ul li - a(ng-href='#{{$root.selectedTorrent.infoHash}}', target='_blank') βTorrent + a(ng-href="#{{$root.selectedTorrent.infoHash}}" target="_blank") βTorrent li - a(ng-href='{{$root.selectedTorrent.magnetURI}}', target='_blank') Magnet URI + a(ng-href="{{$root.selectedTorrent.magnetURI}}" target="_blank") Magnet URI li - a(ng-href='{{$root.selectedTorrent.safeTorrentFileURL}}', target='_self', download='{{$root.selectedTorrent.fileName}}') .torrent + a(ng-href="{{$root.selectedTorrent.safeTorrentFileURL}}" target="_self" download="{{$root.selectedTorrent.fileName}}") .torrent li strong Hash: | {{$root.selectedTorrent.infoHash}} @@ -49,16 +49,16 @@ th Size th Priority tbody - tr.files(ng-repeat='file in $root.selectedTorrent.files') - td(ng-hide='file.done') {{file.name}} - td(ng-show='file.done') - a(ng-href='{{file.url}}', download='{{file.name}}', target='_self', ng-show='file.done') {{file.name}} + tr.files(ng-repeat="file in $root.selectedTorrent.files") + td(ng-hide="file.done") {{file.name}} + td(ng-show="file.done") + a(ng-href="{{file.url}}" download="{{file.name}}" target="_self" ng-show="file.done") {{file.name}} td {{file.length | pbytes}} td - select.no-margin(name='{{file.name}}Priority', ng-model='file.priority', ng-init='file.priority = "0"', ng-change='$root.changePriority(file)') - option(value='1') High Priority - option(value='0' selected='') Low Priority - option(value='-1') Don't download + select.no-margin(name="{{file.name}}Priority" ng-model="file.priority" ng-init="file.priority = '0'" ng-change="$root.changePriority(file)") + option(value="1") High Priority + option(value="0" selected="") Low Priority + option(value="-1") Don't download .center strong Client Stats: | ↓ {{$root.client.downloadSpeed | pbytes}}/s · diff --git a/views/view.jade b/views/view.jade index 2d58f26..34902b0 100644 --- a/views/view.jade +++ b/views/view.jade @@ -1,16 +1,16 @@ .container - div(ng-hide='$root.client.torrents.length != 0', style='vertical-align: middle; text-align: center') + div(ng-hide="$root.client.torrents.length != 0" style="vertical-align: middle; text-align: center") .row - form.no-margin(ng-submit='addMagnet()') + form.no-margin(ng-submit="addMagnet()") label Enter magnet, hash or http(s) .torrent - input(type='text', placeholder='magnet, hash or http(s) .torrent', ng-model='torrentInput', ng-disabled='$root.disabled', style='width: 50%') - //button(ng-click='addMagnet()', ng-disabled='!torrentInput.length || $root.disabled', ng-class='{"button-primary": torrentInput.length}') + input(type="text" placeholder="magnet, hash or http(s) .torrent" ng-model="torrentInput" ng-disabled="$root.disabled" style="width: 50%") + //button(ng-click="addMagnet()" ng-disabled="!torrentInput.length || $root.disabled" ng-class="{"button-primary": torrentInput.length}") i.fa.fa-download | Download .row label or... - button(type='file', ngf-select='$root.openTorrentFile($file)', ng-disabled='$root.disabled', ng-class='{"button-primary": !$root.disabled}') + button(type="file" ngf-select="$root.openTorrentFile($file)" ng-disabled="$root.disabled" ng-class="{'button-primary': !$root.disabled}") i.fa.fa-folder-open | Open torrent file - .div(ng-if="selectedTorrent", style="text-align: center") + .div(ng-if="selectedTorrent" style="text-align: center") | Downloaded {{$root.selectedTorrent.downloaded | pbytes}}/{{$root.selectedTorrent.length | pbytes}} ({{$root.selectedTorrent.progress | progress}}) at {{$root.selectedTorrent.downloadSpeed | pbytes:1}} from {{$root.selectedTorrent.numPeers}} peers. ETA: {{$root.selectedTorrent.timeRemaining | humanTime}} \ No newline at end of file