remove debug dependency
This commit is contained in:
11
main/ipc.js
11
main/ipc.js
@@ -2,7 +2,6 @@ module.exports = {
|
|||||||
init
|
init
|
||||||
}
|
}
|
||||||
|
|
||||||
var debug = require('debug')('webtorrent-app:ipcMain')
|
|
||||||
var electron = require('electron')
|
var electron = require('electron')
|
||||||
|
|
||||||
var app = electron.app
|
var app = electron.app
|
||||||
@@ -95,7 +94,7 @@ function setBounds (bounds, maximize) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function setAspectRatio (aspectRatio, extraSize) {
|
function setAspectRatio (aspectRatio, extraSize) {
|
||||||
debug('setAspectRatio %o %o', aspectRatio, extraSize)
|
log('setAspectRatio %o %o', aspectRatio, extraSize)
|
||||||
if (windows.main) {
|
if (windows.main) {
|
||||||
windows.main.setAspectRatio(aspectRatio, extraSize)
|
windows.main.setAspectRatio(aspectRatio, extraSize)
|
||||||
}
|
}
|
||||||
@@ -103,13 +102,13 @@ function setAspectRatio (aspectRatio, extraSize) {
|
|||||||
|
|
||||||
// Display string in dock badging area (OS X)
|
// Display string in dock badging area (OS X)
|
||||||
function setBadge (text) {
|
function setBadge (text) {
|
||||||
debug('setBadge %s', text)
|
log('setBadge %s', text)
|
||||||
if (app.dock) app.dock.setBadge(String(text))
|
if (app.dock) app.dock.setBadge(String(text))
|
||||||
}
|
}
|
||||||
|
|
||||||
// Show progress bar. Valid range is [0, 1]. Remove when < 0; indeterminate when > 1.
|
// Show progress bar. Valid range is [0, 1]. Remove when < 0; indeterminate when > 1.
|
||||||
function setProgress (progress) {
|
function setProgress (progress) {
|
||||||
debug('setProgress %s', progress)
|
log('setProgress %s', progress)
|
||||||
if (windows.main) {
|
if (windows.main) {
|
||||||
windows.main.setProgressBar(progress)
|
windows.main.setProgressBar(progress)
|
||||||
}
|
}
|
||||||
@@ -117,12 +116,12 @@ function setProgress (progress) {
|
|||||||
|
|
||||||
function blockPowerSave () {
|
function blockPowerSave () {
|
||||||
powerSaveBlockID = powerSaveBlocker.start('prevent-display-sleep')
|
powerSaveBlockID = powerSaveBlocker.start('prevent-display-sleep')
|
||||||
debug('blockPowerSave %d', powerSaveBlockID)
|
log('blockPowerSave %d', powerSaveBlockID)
|
||||||
}
|
}
|
||||||
|
|
||||||
function unblockPowerSave () {
|
function unblockPowerSave () {
|
||||||
if (powerSaveBlocker.isStarted(powerSaveBlockID)) {
|
if (powerSaveBlocker.isStarted(powerSaveBlockID)) {
|
||||||
powerSaveBlocker.stop(powerSaveBlockID)
|
powerSaveBlocker.stop(powerSaveBlockID)
|
||||||
debug('unblockPowerSave %d', powerSaveBlockID)
|
log('unblockPowerSave %d', powerSaveBlockID)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
16
main/menu.js
16
main/menu.js
@@ -10,12 +10,12 @@ module.exports = {
|
|||||||
toggleFullScreen
|
toggleFullScreen
|
||||||
}
|
}
|
||||||
|
|
||||||
var debug = require('debug')('webtorrent-app:menu')
|
|
||||||
var electron = require('electron')
|
var electron = require('electron')
|
||||||
|
|
||||||
var app = electron.app
|
var app = electron.app
|
||||||
|
|
||||||
var config = require('../config')
|
var config = require('../config')
|
||||||
|
var log = require('./log')
|
||||||
var windows = require('./windows')
|
var windows = require('./windows')
|
||||||
|
|
||||||
var appMenu, dockMenu
|
var appMenu, dockMenu
|
||||||
@@ -29,7 +29,7 @@ function init () {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function toggleFullScreen (flag) {
|
function toggleFullScreen (flag) {
|
||||||
debug('toggleFullScreen %s', flag)
|
log('toggleFullScreen %s', flag)
|
||||||
if (windows.main && windows.main.isVisible()) {
|
if (windows.main && windows.main.isVisible()) {
|
||||||
flag = flag != null ? flag : !windows.main.isFullScreen()
|
flag = flag != null ? flag : !windows.main.isFullScreen()
|
||||||
windows.main.setFullScreen(flag)
|
windows.main.setFullScreen(flag)
|
||||||
@@ -38,7 +38,7 @@ function toggleFullScreen (flag) {
|
|||||||
|
|
||||||
// Sets whether the window should always show on top of other windows
|
// Sets whether the window should always show on top of other windows
|
||||||
function toggleFloatOnTop (flag) {
|
function toggleFloatOnTop (flag) {
|
||||||
debug('toggleFloatOnTop %s', flag)
|
log('toggleFloatOnTop %s', flag)
|
||||||
if (windows.main) {
|
if (windows.main) {
|
||||||
flag = flag != null ? flag : !windows.main.isAlwaysOnTop()
|
flag = flag != null ? flag : !windows.main.isAlwaysOnTop()
|
||||||
windows.main.setAlwaysOnTop(flag)
|
windows.main.setAlwaysOnTop(flag)
|
||||||
@@ -59,32 +59,32 @@ function decreaseVolume () {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function toggleDevTools () {
|
function toggleDevTools () {
|
||||||
debug('toggleDevTools')
|
log('toggleDevTools')
|
||||||
if (windows.main) {
|
if (windows.main) {
|
||||||
windows.main.toggleDevTools()
|
windows.main.toggleDevTools()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function reloadWindow () {
|
function reloadWindow () {
|
||||||
debug('reloadWindow')
|
log('reloadWindow')
|
||||||
if (windows.main) {
|
if (windows.main) {
|
||||||
windows.main.webContents.reloadIgnoringCache()
|
windows.main.webContents.reloadIgnoringCache()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function addFakeDevice (device) {
|
function addFakeDevice (device) {
|
||||||
debug('addFakeDevice %s', device)
|
log('addFakeDevice %s', device)
|
||||||
windows.main.send('addFakeDevice', device)
|
windows.main.send('addFakeDevice', device)
|
||||||
}
|
}
|
||||||
|
|
||||||
function onWindowShow () {
|
function onWindowShow () {
|
||||||
debug('onWindowShow')
|
log('onWindowShow')
|
||||||
getMenuItem('Full Screen').enabled = true
|
getMenuItem('Full Screen').enabled = true
|
||||||
getMenuItem('Float on Top').enabled = true
|
getMenuItem('Float on Top').enabled = true
|
||||||
}
|
}
|
||||||
|
|
||||||
function onWindowHide () {
|
function onWindowHide () {
|
||||||
debug('onWindowHide')
|
log('onWindowHide')
|
||||||
getMenuItem('Full Screen').enabled = false
|
getMenuItem('Full Screen').enabled = false
|
||||||
getMenuItem('Float on Top').enabled = false
|
getMenuItem('Float on Top').enabled = false
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,7 +16,6 @@
|
|||||||
"application-config-path": "^0.1.0",
|
"application-config-path": "^0.1.0",
|
||||||
"chromecasts": "^1.8.0",
|
"chromecasts": "^1.8.0",
|
||||||
"create-torrent": "^3.22.1",
|
"create-torrent": "^3.22.1",
|
||||||
"debug": "^2.2.0",
|
|
||||||
"drag-drop": "^2.11.0",
|
"drag-drop": "^2.11.0",
|
||||||
"electron-localshortcut": "^0.6.0",
|
"electron-localshortcut": "^0.6.0",
|
||||||
"electron-prebuilt": "0.37.2",
|
"electron-prebuilt": "0.37.2",
|
||||||
@@ -61,7 +60,6 @@
|
|||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"clean": "node ./bin/clean.js",
|
"clean": "node ./bin/clean.js",
|
||||||
"debug": "DEBUG=* electron .",
|
|
||||||
"package": "npm install && npm prune && npm dedupe && node ./bin/package.js",
|
"package": "npm install && npm prune && npm dedupe && node ./bin/package.js",
|
||||||
"size": "npm run package -- darwin && du -ch dist/WebTorrent-darwin-x64 | grep total",
|
"size": "npm run package -- darwin && du -ch dist/WebTorrent-darwin-x64 | grep total",
|
||||||
"start": "electron .",
|
"start": "electron .",
|
||||||
|
|||||||
Reference in New Issue
Block a user