standardize by hand

This commit is contained in:
Zeke Sikelianos 2016-03-28 17:40:40 -07:00 committed by Kevin Sawicki
parent e6698102c9
commit 2c3cacdc08
8 changed files with 16 additions and 15 deletions

View file

@ -93,7 +93,7 @@ Menu.prototype._init = function () {
this.commandsMap = {}
this.groupsMap = {}
this.items = []
return this.delegate = {
this.delegate = {
isCommandIdChecked: (commandId) => {
var command = this.commandsMap[commandId]
return command != null ? command.checked : undefined
@ -142,7 +142,7 @@ Menu.prototype._init = function () {
}
Menu.prototype.popup = function (window, x, y, positioningItem) {
if (typeof window != 'object' || window.constructor !== BrowserWindow) {
if (typeof window !== 'object' || window.constructor !== BrowserWindow) {
// Shift.
positioningItem = y
y = x
@ -224,7 +224,7 @@ Menu.prototype.insert = function (pos, item) {
// Remember the items.
this.items.splice(pos, 0, item)
return this.commandsMap[item.commandId] = item
this.commandsMap[item.commandId] = item
}
// Force menuWillShow to be called
@ -284,7 +284,7 @@ Menu.buildFromTemplate = function (template) {
}
positionedTemplate.splice(insertIndex, 0, item)
}
menu = new Menu
menu = new Menu()
for (k = 0, len1 = positionedTemplate.length; k < len1; k++) {
item = positionedTemplate[k]
if (typeof item !== 'object') {

View file

@ -27,7 +27,7 @@ Object.defineProperty(exports, 'defaultSession', {
var wrapSession = function (session) {
// session is an EventEmitter.
return session.__proto__ = EventEmitter.prototype
session.__proto__ = EventEmitter.prototype
}
bindings._setWrapSession(wrapSession)

View file

@ -17,7 +17,7 @@ Tray.prototype.setContextMenu = function (menu) {
this._setContextMenu(menu)
// Keep a strong reference of menu.
return this.menu = menu
this.menu = menu
}
module.exports = Tray

View file

@ -168,7 +168,7 @@ let wrapWebContents = function (webContents) {
deprecate.event(webContents, 'page-title-set', 'page-title-updated', function (...args) {
return this.emit.apply(this, ['page-title-set'].concat(args))
})
return webContents.printToPDF = function (options, callback) {
webContents.printToPDF = function (options, callback) {
var printingSetting
printingSetting = {
pageRage: [],

View file

@ -71,7 +71,8 @@ app.on('will-quit', function () {
// We can not use protocol or BrowserWindow until app is ready.
app.once('ready', function () {
var BrowserWindow, chromeExtensionHandler, i, init, len, protocol, srcDirectory
protocol = electron.protocol, BrowserWindow = electron.BrowserWindow
protocol = electron.protocol
BrowserWindow = electron.BrowserWindow
// Load persisted extensions.
loadedExtensionsPath = path.join(app.getPath('userData'), 'DevTools Extensions')
@ -133,7 +134,7 @@ app.once('ready', function () {
// Load persisted extensions when devtools is opened.
init = BrowserWindow.prototype._init
return BrowserWindow.prototype._init = function () {
BrowserWindow.prototype._init = function () {
init.call(this)
return this.on('devtools-opened', function () {
return this._loadDevToolsExtensions(Object.keys(extensionInfoMap).map(function (key) {

View file

@ -29,7 +29,7 @@ ipcMain.on('ATOM_BROWSER_DESKTOP_CAPTURER_GET_SOURCES', function (event, capture
// If the WebContents is destroyed before receiving result, just remove the
// reference from requestsQueue to make the module not send the result to it.
return event.sender.once('destroyed', function () {
return request.webContents = null
request.webContents = null
})
})

View file

@ -131,7 +131,7 @@ var createGuest = function (embedder, params) {
}
this.loadURL(params.src, opts)
}
return guest.allowPopups = params.allowpopups
guest.allowPopups = params.allowpopups
})
// Dispatch events to embedder.
@ -188,7 +188,7 @@ var attachGuest = function (embedder, elementInstanceId, guestInstanceId, params
webViewManager.addGuest(guestInstanceId, elementInstanceId, embedder, guest, webPreferences)
guest.attachParams = params
embedderElementsMap[key] = guestInstanceId
return reverseEmbedderElementsMap[guestInstanceId] = key
reverseEmbedderElementsMap[guestInstanceId] = key
}
// Destroy an existing guest instance.

View file

@ -84,9 +84,9 @@ ipcMain.on('ATOM_SHELL_GUEST_WINDOW_MANAGER_WINDOW_OPEN', function (event, url,
options = mergeBrowserWindowOptions(event.sender, options)
event.sender.emit('new-window', event, url, frameName, 'new-window', options)
if ((event.sender.isGuest() && !event.sender.allowPopups) || event.defaultPrevented) {
return event.returnValue = null
event.returnValue = null
} else {
return event.returnValue = createGuest(event.sender, url, frameName, options)
event.returnValue = createGuest(event.sender, url, frameName, options)
}
})
@ -97,7 +97,7 @@ ipcMain.on('ATOM_SHELL_GUEST_WINDOW_MANAGER_WINDOW_CLOSE', function (event, gues
ipcMain.on('ATOM_SHELL_GUEST_WINDOW_MANAGER_WINDOW_METHOD', function (event, guestId, method, ...args) {
var ref1
return event.returnValue = (ref1 = BrowserWindow.fromId(guestId)) != null ? ref1[method].apply(ref1, args) : void 0
event.returnValue = (ref1 = BrowserWindow.fromId(guestId)) != null ? ref1[method].apply(ref1, args) : void 0
})
ipcMain.on('ATOM_SHELL_GUEST_WINDOW_MANAGER_WINDOW_POSTMESSAGE', function (event, guestId, message, targetOrigin, sourceOrigin) {