finish standardizing!
This commit is contained in:
parent
4e2f1311e0
commit
42e7ee2b4a
6 changed files with 22 additions and 13 deletions
|
@ -251,7 +251,7 @@ function loadApplicationPackage (packagePath) {
|
||||||
|
|
||||||
// Run the app.
|
// Run the app.
|
||||||
require('module')._load(packagePath, module, true)
|
require('module')._load(packagePath, module, true)
|
||||||
} catch(e) {
|
} catch (e) {
|
||||||
if (e.code === 'MODULE_NOT_FOUND') {
|
if (e.code === 'MODULE_NOT_FOUND') {
|
||||||
app.focus()
|
app.focus()
|
||||||
dialog.showErrorBox(
|
dialog.showErrorBox(
|
||||||
|
@ -319,5 +319,6 @@ if (option.file && !option.webdriver) {
|
||||||
} else if (option.interactive) {
|
} else if (option.interactive) {
|
||||||
startRepl()
|
startRepl()
|
||||||
} else {
|
} else {
|
||||||
loadApplicationByUrl('file://' + __dirname + '/index.html')
|
var indexPath = path.join(__dirname, '/index.html')
|
||||||
|
loadApplicationByUrl(`file://${indexPath}`)
|
||||||
}
|
}
|
||||||
|
|
|
@ -45,7 +45,7 @@ if (process.platform === 'darwin') {
|
||||||
var appPath = null
|
var appPath = null
|
||||||
|
|
||||||
app.setAppPath = function (path) {
|
app.setAppPath = function (path) {
|
||||||
return appPath = path
|
appPath = path
|
||||||
}
|
}
|
||||||
|
|
||||||
app.getAppPath = function () {
|
app.getAppPath = function () {
|
||||||
|
|
|
@ -30,10 +30,10 @@ var spawnUpdate = function (args, detached, callback) {
|
||||||
stdout = ''
|
stdout = ''
|
||||||
stderr = ''
|
stderr = ''
|
||||||
spawnedProcess.stdout.on('data', function (data) {
|
spawnedProcess.stdout.on('data', function (data) {
|
||||||
return stdout += data
|
stdout += data
|
||||||
})
|
})
|
||||||
spawnedProcess.stderr.on('data', function (data) {
|
spawnedProcess.stderr.on('data', function (data) {
|
||||||
return stderr += data
|
stderr += data
|
||||||
})
|
})
|
||||||
errorEmitted = false
|
errorEmitted = false
|
||||||
spawnedProcess.on('error', function (error) {
|
spawnedProcess.on('error', function (error) {
|
||||||
|
|
|
@ -53,12 +53,11 @@ BrowserWindow.prototype._init = function () {
|
||||||
this.webContents.on('page-title-updated', (event, title) => {
|
this.webContents.on('page-title-updated', (event, title) => {
|
||||||
// The page-title-updated event is not emitted immediately (see #3645), so
|
// The page-title-updated event is not emitted immediately (see #3645), so
|
||||||
// when the callback is called the BrowserWindow might have been closed.
|
// when the callback is called the BrowserWindow might have been closed.
|
||||||
if (this.isDestroyed())
|
if (this.isDestroyed()) return
|
||||||
return
|
|
||||||
// Route the event to BrowserWindow.
|
// Route the event to BrowserWindow.
|
||||||
this.emit('page-title-updated', event, title)
|
this.emit('page-title-updated', event, title)
|
||||||
if (!event.defaultPrevented)
|
if (!event.defaultPrevented) this.setTitle(title)
|
||||||
this.setTitle(title)
|
|
||||||
})
|
})
|
||||||
|
|
||||||
// Sometimes the webContents doesn't get focus when window is shown, so we have
|
// Sometimes the webContents doesn't get focus when window is shown, so we have
|
||||||
|
|
|
@ -29,7 +29,18 @@ MenuItem = (function () {
|
||||||
function MenuItem (options) {
|
function MenuItem (options) {
|
||||||
var click, ref
|
var click, ref
|
||||||
const Menu = require('electron').Menu
|
const Menu = require('electron').Menu
|
||||||
click = options.click, this.selector = options.selector, this.type = options.type, this.role = options.role, this.label = options.label, this.sublabel = options.sublabel, this.accelerator = options.accelerator, this.icon = options.icon, this.enabled = options.enabled, this.visible = options.visible, this.checked = options.checked, this.submenu = options.submenu
|
click = options.click
|
||||||
|
this.selector = options.selector
|
||||||
|
this.type = options.type
|
||||||
|
this.role = options.role
|
||||||
|
this.label = options.label
|
||||||
|
this.sublabel = options.sublabel
|
||||||
|
this.accelerator = options.accelerator
|
||||||
|
this.icon = options.icon
|
||||||
|
this.enabled = options.enabled
|
||||||
|
this.visible = options.visible
|
||||||
|
this.checked = options.checked
|
||||||
|
this.submenu = options.submenu
|
||||||
if ((this.submenu != null) && this.submenu.constructor !== Menu) {
|
if ((this.submenu != null) && this.submenu.constructor !== Menu) {
|
||||||
this.submenu = Menu.buildFromTemplate(this.submenu)
|
this.submenu = Menu.buildFromTemplate(this.submenu)
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
/* globals $ */
|
|
||||||
|
|
||||||
(function () {
|
(function () {
|
||||||
const asar = process.binding('atom_common_asar')
|
const asar = process.binding('atom_common_asar')
|
||||||
const child_process = require('child_process')
|
const child_process = require('child_process')
|
||||||
|
|
Loading…
Reference in a new issue