diff --git a/config.js b/config.js new file mode 100644 index 00000000..d8e90215 --- /dev/null +++ b/config.js @@ -0,0 +1,6 @@ +var path = require('path') + +module.exports = { + APP_NAME: 'WebTorrent', + INDEX: 'file://' + path.resolve(__dirname, 'renderer', 'index.html') +} diff --git a/main/config.js b/main/config.js deleted file mode 100644 index 0f435f5f..00000000 --- a/main/config.js +++ /dev/null @@ -1,6 +0,0 @@ -var path = require('path') - -module.exports = { - APP_NAME: 'WebTorrent', - INDEX: 'file://' + path.resolve(__dirname, '..', 'renderer', 'index.html') -} diff --git a/main/menu.js b/main/menu.js index 617ba158..b7ec6743 100644 --- a/main/menu.js +++ b/main/menu.js @@ -1,3 +1,4 @@ +var config = require('../config') var debug = require('debug')('webtorrent-app:menu') var electron = require('electron') var windows = require('./windows') @@ -205,7 +206,7 @@ function getMenuTemplate () { role: 'help', submenu: [ { - label: 'Learn more about WebTorrent', + label: 'Learn more about ' + config.APP_NAME, click: function () { electron.shell.openExternal('https://webtorrent.io') } }, { diff --git a/main/windows.js b/main/windows.js index e8c0d3d9..4b7c08b9 100644 --- a/main/windows.js +++ b/main/windows.js @@ -1,6 +1,6 @@ -var electron = require('electron') +var config = require('../config') var debug = require('debug')('webtorrent-app:windows') -var config = require('./config') +var electron = require('electron') var app = electron.app diff --git a/renderer/index.css b/renderer/index.css index 24a565f3..e15ba144 100644 --- a/renderer/index.css +++ b/renderer/index.css @@ -265,10 +265,6 @@ body.drag::before { flex: 1 1 auto; } -.lead { - font-size: 150%; -} - .torrent { height: 120px; background: linear-gradient(to bottom right, #4B79A1, #283E51); diff --git a/renderer/index.js b/renderer/index.js index 4a015fff..d0b088b1 100644 --- a/renderer/index.js +++ b/renderer/index.js @@ -4,6 +4,7 @@ console.time('init') var airplay = require('airplay-js') var cfg = require('application-config')('WebTorrent') var chromecasts = require('chromecasts')() +var config = require('../config') var createTorrent = require('create-torrent') var dragDrop = require('drag-drop') var electron = require('electron') @@ -167,6 +168,7 @@ function dispatch (action, ...args) { closeServer() } state.url = '/' + state.title = config.APP_NAME update() } if (action === 'forward') { @@ -397,6 +399,7 @@ function closeServer () { function openPlayer (torrent) { startServer(torrent, function () { state.url = '/player' + state.title = torrent.name update() }) } @@ -410,7 +413,7 @@ function deleteTorrent (torrent) { function openChromecast (torrent) { startServer(torrent, function () { state.devices.chromecast.play(state.server.networkURL, { - title: 'WebTorrent — ' + torrent.name + title: config.APP_NAME + ' — ' + torrent.name }) state.devices.chromecast.on('error', function (err) { err.message = 'Chromecast: ' + err.message diff --git a/renderer/lib/torrent-poster.js b/renderer/lib/torrent-poster.js index 18e700f6..9e0f7463 100644 --- a/renderer/lib/torrent-poster.js +++ b/renderer/lib/torrent-poster.js @@ -7,7 +7,7 @@ function torrentPoster (torrent, cb) { // filter out file formats that the