Standard complient, semver
This commit is contained in:
parent
ac454e6c8f
commit
7a3e11547f
1 changed files with 12 additions and 16 deletions
26
app.js
26
app.js
|
@ -1,16 +1,13 @@
|
||||||
let BUILD, VERSION, app, client, dbg, debug, er, opts, rtcConfig, trackers
|
/* global WebTorrent, angular, moment, prompt */
|
||||||
|
|
||||||
VERSION = '0.16'
|
const VERSION = '0.16.2'
|
||||||
|
|
||||||
BUILD = '1'
|
const trackers = ['wss://tracker.btorrent.xyz', 'wss://tracker.openwebtorrent.com', 'wss://tracker.fastcast.nz']
|
||||||
|
const opts = {
|
||||||
trackers = ['wss://tracker.btorrent.xyz', 'wss://tracker.openwebtorrent.com', 'wss://tracker.fastcast.nz']
|
|
||||||
|
|
||||||
opts = {
|
|
||||||
announce: trackers
|
announce: trackers
|
||||||
}
|
}
|
||||||
|
|
||||||
rtcConfig = {
|
const rtcConfig = {
|
||||||
'iceServers': [
|
'iceServers': [
|
||||||
{
|
{
|
||||||
'url': 'stun:stun.l.google.com:19305',
|
'url': 'stun:stun.l.google.com:19305',
|
||||||
|
@ -19,9 +16,9 @@ rtcConfig = {
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
debug = window.localStorage.getItem('debug') != null
|
const debug = window.localStorage.getItem('debug') != null
|
||||||
|
|
||||||
dbg = function (string, item, color) {
|
const dbg = function (string, item, color) {
|
||||||
color = color != null ? color : '#333333'
|
color = color != null ? color : '#333333'
|
||||||
if (debug) {
|
if (debug) {
|
||||||
if ((item != null) && item.name) {
|
if ((item != null) && item.name) {
|
||||||
|
@ -32,18 +29,18 @@ dbg = function (string, item, color) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
er = function (err, item) { dbg(err, item, '#FF0000') }
|
const er = function (err, item) { dbg(err, item, '#FF0000') }
|
||||||
|
|
||||||
dbg(`Starting... v${VERSION}b${BUILD}`)
|
dbg(`Starting... v${VERSION}`)
|
||||||
|
|
||||||
client = new WebTorrent({
|
const client = new WebTorrent({
|
||||||
tracker: {
|
tracker: {
|
||||||
rtcConfig: rtcConfig,
|
rtcConfig: rtcConfig,
|
||||||
announce: trackers
|
announce: trackers
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
app = angular.module('BTorrent',
|
const app = angular.module('BTorrent',
|
||||||
['ngRoute', 'ui.grid', 'ui.grid.resizeColumns', 'ui.grid.selection', 'ngFileUpload', 'ngNotify'],
|
['ngRoute', 'ui.grid', 'ui.grid.resizeColumns', 'ui.grid.selection', 'ngFileUpload', 'ngNotify'],
|
||||||
['$compileProvider', '$locationProvider', '$routeProvider', function ($compileProvider, $locationProvider, $routeProvider) {
|
['$compileProvider', '$locationProvider', '$routeProvider', function ($compileProvider, $locationProvider, $routeProvider) {
|
||||||
$compileProvider.aHrefSanitizationWhitelist(/^\s*(https?|magnet|blob|javascript):/)
|
$compileProvider.aHrefSanitizationWhitelist(/^\s*(https?|magnet|blob|javascript):/)
|
||||||
|
@ -80,7 +77,6 @@ app.controller('BTorrentCtrl', ['$scope', '$rootScope', '$http', '$log', '$locat
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
$rootScope.client = client
|
$rootScope.client = client
|
||||||
scope = $rootScope
|
|
||||||
updateAll = function () {
|
updateAll = function () {
|
||||||
if ($rootScope.client.processing) {
|
if ($rootScope.client.processing) {
|
||||||
return
|
return
|
||||||
|
|
Loading…
Reference in a new issue