style
This commit is contained in:
22
index.js
22
index.js
@@ -8,13 +8,8 @@ var path = require('path')
|
|||||||
|
|
||||||
var app = electron.app
|
var app = electron.app
|
||||||
|
|
||||||
app.on('open-file', onOpen)
|
// prevent windows from being garbage collected
|
||||||
app.on('open-url', onOpen)
|
var mainWindow // eslint-disable-line no-unused-vars
|
||||||
|
|
||||||
function onOpen (e, torrentId) {
|
|
||||||
e.preventDefault()
|
|
||||||
mainWindow.send('addTorrent', torrentId)
|
|
||||||
}
|
|
||||||
|
|
||||||
// report crashes
|
// report crashes
|
||||||
// require('crash-reporter').start({
|
// require('crash-reporter').start({
|
||||||
@@ -24,8 +19,8 @@ function onOpen (e, torrentId) {
|
|||||||
// autoSubmit: true
|
// autoSubmit: true
|
||||||
// })
|
// })
|
||||||
|
|
||||||
// prevent windows from being garbage collected
|
app.on('open-file', onOpen)
|
||||||
var mainWindow // eslint-disable-line no-unused-vars
|
app.on('open-url', onOpen)
|
||||||
|
|
||||||
app.on('ready', function () {
|
app.on('ready', function () {
|
||||||
mainWindow = createMainWindow()
|
mainWindow = createMainWindow()
|
||||||
@@ -43,7 +38,9 @@ app.on('activate', function () {
|
|||||||
})
|
})
|
||||||
|
|
||||||
app.on('window-all-closed', function () {
|
app.on('window-all-closed', function () {
|
||||||
if (process.platform !== 'darwin') app.quit()
|
if (process.platform !== 'darwin') {
|
||||||
|
app.quit()
|
||||||
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
var isQuitting = false
|
var isQuitting = false
|
||||||
@@ -94,6 +91,11 @@ function createMainWindow () {
|
|||||||
return win
|
return win
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function onOpen (e, torrentId) {
|
||||||
|
e.preventDefault()
|
||||||
|
mainWindow.send('addTorrent', torrentId)
|
||||||
|
}
|
||||||
|
|
||||||
function addTorrentFromPaste () {
|
function addTorrentFromPaste () {
|
||||||
debug('addTorrentFromPaste')
|
debug('addTorrentFromPaste')
|
||||||
var torrentIds = electron.clipboard.readText().split('\n')
|
var torrentIds = electron.clipboard.readText().split('\n')
|
||||||
|
|||||||
Reference in New Issue
Block a user