fix: changed crlf to lf in some docs files (#20832)

This commit is contained in:
CezaryKulakowski 2019-11-05 22:39:39 +01:00 committed by Samuel Attard
parent 15dffb3dde
commit 00a1cd9395
4 changed files with 453 additions and 453 deletions

View file

@ -1,360 +1,360 @@
// Modules to control application life and create native browser window // Modules to control application life and create native browser window
const { const {
BrowserWindow, BrowserWindow,
Menu, Menu,
MenuItem, MenuItem,
ipcMain, ipcMain,
app, app,
shell, shell,
dialog dialog
} = require('electron') } = require('electron')
const menu = new Menu() const menu = new Menu()
menu.append(new MenuItem({ label: 'Hello' })) menu.append(new MenuItem({ label: 'Hello' }))
menu.append(new MenuItem({ type: 'separator' })) menu.append(new MenuItem({ type: 'separator' }))
menu.append( menu.append(
new MenuItem({ label: 'Electron', type: 'checkbox', checked: true }) new MenuItem({ label: 'Electron', type: 'checkbox', checked: true })
) )
const template = [ const template = [
{ {
label: 'Edit', label: 'Edit',
submenu: [ submenu: [
{ {
label: 'Undo', label: 'Undo',
accelerator: 'CmdOrCtrl+Z', accelerator: 'CmdOrCtrl+Z',
role: 'undo' role: 'undo'
}, },
{ {
label: 'Redo', label: 'Redo',
accelerator: 'Shift+CmdOrCtrl+Z', accelerator: 'Shift+CmdOrCtrl+Z',
role: 'redo' role: 'redo'
}, },
{ {
type: 'separator' type: 'separator'
}, },
{ {
label: 'Cut', label: 'Cut',
accelerator: 'CmdOrCtrl+X', accelerator: 'CmdOrCtrl+X',
role: 'cut' role: 'cut'
}, },
{ {
label: 'Copy', label: 'Copy',
accelerator: 'CmdOrCtrl+C', accelerator: 'CmdOrCtrl+C',
role: 'copy' role: 'copy'
}, },
{ {
label: 'Paste', label: 'Paste',
accelerator: 'CmdOrCtrl+V', accelerator: 'CmdOrCtrl+V',
role: 'paste' role: 'paste'
}, },
{ {
label: 'Select All', label: 'Select All',
accelerator: 'CmdOrCtrl+A', accelerator: 'CmdOrCtrl+A',
role: 'selectall' role: 'selectall'
} }
] ]
}, },
{ {
label: 'View', label: 'View',
submenu: [ submenu: [
{ {
label: 'Reload', label: 'Reload',
accelerator: 'CmdOrCtrl+R', accelerator: 'CmdOrCtrl+R',
click: (item, focusedWindow) => { click: (item, focusedWindow) => {
if (focusedWindow) { if (focusedWindow) {
// on reload, start fresh and close any old // on reload, start fresh and close any old
// open secondary windows // open secondary windows
if (focusedWindow.id === 1) { if (focusedWindow.id === 1) {
BrowserWindow.getAllWindows().forEach(win => { BrowserWindow.getAllWindows().forEach(win => {
if (win.id > 1) win.close() if (win.id > 1) win.close()
}) })
} }
focusedWindow.reload() focusedWindow.reload()
} }
} }
}, },
{ {
label: 'Toggle Full Screen', label: 'Toggle Full Screen',
accelerator: (() => { accelerator: (() => {
if (process.platform === 'darwin') { if (process.platform === 'darwin') {
return 'Ctrl+Command+F' return 'Ctrl+Command+F'
} else { } else {
return 'F11' return 'F11'
} }
})(), })(),
click: (item, focusedWindow) => { click: (item, focusedWindow) => {
if (focusedWindow) { if (focusedWindow) {
focusedWindow.setFullScreen(!focusedWindow.isFullScreen()) focusedWindow.setFullScreen(!focusedWindow.isFullScreen())
} }
} }
}, },
{ {
label: 'Toggle Developer Tools', label: 'Toggle Developer Tools',
accelerator: (() => { accelerator: (() => {
if (process.platform === 'darwin') { if (process.platform === 'darwin') {
return 'Alt+Command+I' return 'Alt+Command+I'
} else { } else {
return 'Ctrl+Shift+I' return 'Ctrl+Shift+I'
} }
})(), })(),
click: (item, focusedWindow) => { click: (item, focusedWindow) => {
if (focusedWindow) { if (focusedWindow) {
focusedWindow.toggleDevTools() focusedWindow.toggleDevTools()
} }
} }
}, },
{ {
type: 'separator' type: 'separator'
}, },
{ {
label: 'App Menu Demo', label: 'App Menu Demo',
click: function (item, focusedWindow) { click: function (item, focusedWindow) {
if (focusedWindow) { if (focusedWindow) {
const options = { const options = {
type: 'info', type: 'info',
title: 'Application Menu Demo', title: 'Application Menu Demo',
buttons: ['Ok'], buttons: ['Ok'],
message: message:
'This demo is for the Menu section, showing how to create a clickable menu item in the application menu.' 'This demo is for the Menu section, showing how to create a clickable menu item in the application menu.'
} }
dialog.showMessageBox(focusedWindow, options, function () {}) dialog.showMessageBox(focusedWindow, options, function () {})
} }
} }
} }
] ]
}, },
{ {
label: 'Window', label: 'Window',
role: 'window', role: 'window',
submenu: [ submenu: [
{ {
label: 'Minimize', label: 'Minimize',
accelerator: 'CmdOrCtrl+M', accelerator: 'CmdOrCtrl+M',
role: 'minimize' role: 'minimize'
}, },
{ {
label: 'Close', label: 'Close',
accelerator: 'CmdOrCtrl+W', accelerator: 'CmdOrCtrl+W',
role: 'close' role: 'close'
}, },
{ {
type: 'separator' type: 'separator'
}, },
{ {
label: 'Reopen Window', label: 'Reopen Window',
accelerator: 'CmdOrCtrl+Shift+T', accelerator: 'CmdOrCtrl+Shift+T',
enabled: false, enabled: false,
key: 'reopenMenuItem', key: 'reopenMenuItem',
click: () => { click: () => {
app.emit('activate') app.emit('activate')
} }
} }
] ]
}, },
{ {
label: 'Help', label: 'Help',
role: 'help', role: 'help',
submenu: [ submenu: [
{ {
label: 'Learn More', label: 'Learn More',
click: () => { click: () => {
shell.openExternal('http://electron.atom.io') shell.openExternal('http://electron.atom.io')
} }
} }
] ]
} }
] ]
function addUpdateMenuItems (items, position) { function addUpdateMenuItems (items, position) {
if (process.mas) return if (process.mas) return
const version = app.getVersion() const version = app.getVersion()
const updateItems = [ const updateItems = [
{ {
label: `Version ${version}`, label: `Version ${version}`,
enabled: false enabled: false
}, },
{ {
label: 'Checking for Update', label: 'Checking for Update',
enabled: false, enabled: false,
key: 'checkingForUpdate' key: 'checkingForUpdate'
}, },
{ {
label: 'Check for Update', label: 'Check for Update',
visible: false, visible: false,
key: 'checkForUpdate', key: 'checkForUpdate',
click: () => { click: () => {
require('electron').autoUpdater.checkForUpdates() require('electron').autoUpdater.checkForUpdates()
} }
}, },
{ {
label: 'Restart and Install Update', label: 'Restart and Install Update',
enabled: true, enabled: true,
visible: false, visible: false,
key: 'restartToUpdate', key: 'restartToUpdate',
click: () => { click: () => {
require('electron').autoUpdater.quitAndInstall() require('electron').autoUpdater.quitAndInstall()
} }
} }
] ]
items.splice.apply(items, [position, 0].concat(updateItems)) items.splice.apply(items, [position, 0].concat(updateItems))
} }
function findReopenMenuItem () { function findReopenMenuItem () {
const menu = Menu.getApplicationMenu() const menu = Menu.getApplicationMenu()
if (!menu) return if (!menu) return
let reopenMenuItem let reopenMenuItem
menu.items.forEach(item => { menu.items.forEach(item => {
if (item.submenu) { if (item.submenu) {
item.submenu.items.forEach(item => { item.submenu.items.forEach(item => {
if (item.key === 'reopenMenuItem') { if (item.key === 'reopenMenuItem') {
reopenMenuItem = item reopenMenuItem = item
} }
}) })
} }
}) })
return reopenMenuItem return reopenMenuItem
} }
if (process.platform === 'darwin') { if (process.platform === 'darwin') {
const name = app.getName() const name = app.getName()
template.unshift({ template.unshift({
label: name, label: name,
submenu: [ submenu: [
{ {
label: `About ${name}`, label: `About ${name}`,
role: 'about' role: 'about'
}, },
{ {
type: 'separator' type: 'separator'
}, },
{ {
label: 'Services', label: 'Services',
role: 'services', role: 'services',
submenu: [] submenu: []
}, },
{ {
type: 'separator' type: 'separator'
}, },
{ {
label: `Hide ${name}`, label: `Hide ${name}`,
accelerator: 'Command+H', accelerator: 'Command+H',
role: 'hide' role: 'hide'
}, },
{ {
label: 'Hide Others', label: 'Hide Others',
accelerator: 'Command+Alt+H', accelerator: 'Command+Alt+H',
role: 'hideothers' role: 'hideothers'
}, },
{ {
label: 'Show All', label: 'Show All',
role: 'unhide' role: 'unhide'
}, },
{ {
type: 'separator' type: 'separator'
}, },
{ {
label: 'Quit', label: 'Quit',
accelerator: 'Command+Q', accelerator: 'Command+Q',
click: () => { click: () => {
app.quit() app.quit()
} }
} }
] ]
}) })
// Window menu. // Window menu.
template[3].submenu.push( template[3].submenu.push(
{ {
type: 'separator' type: 'separator'
}, },
{ {
label: 'Bring All to Front', label: 'Bring All to Front',
role: 'front' role: 'front'
} }
) )
addUpdateMenuItems(template[0].submenu, 1) addUpdateMenuItems(template[0].submenu, 1)
} }
if (process.platform === 'win32') { if (process.platform === 'win32') {
const helpMenu = template[template.length - 1].submenu const helpMenu = template[template.length - 1].submenu
addUpdateMenuItems(helpMenu, 0) addUpdateMenuItems(helpMenu, 0)
} }
// Keep a global reference of the window object, if you don't, the window will // Keep a global reference of the window object, if you don't, the window will
// be closed automatically when the JavaScript object is garbage collected. // be closed automatically when the JavaScript object is garbage collected.
let mainWindow let mainWindow
function createWindow () { function createWindow () {
// Create the browser window. // Create the browser window.
mainWindow = new BrowserWindow({ mainWindow = new BrowserWindow({
width: 800, width: 800,
height: 600, height: 600,
webPreferences: { webPreferences: {
nodeIntegration: true nodeIntegration: true
} }
}) })
// and load the index.html of the app. // and load the index.html of the app.
mainWindow.loadFile('index.html') mainWindow.loadFile('index.html')
// Open the DevTools. // Open the DevTools.
// mainWindow.webContents.openDevTools() // mainWindow.webContents.openDevTools()
// Emitted when the window is closed. // Emitted when the window is closed.
mainWindow.on('closed', function () { mainWindow.on('closed', function () {
// Dereference the window object, usually you would store windows // Dereference the window object, usually you would store windows
// in an array if your app supports multi windows, this is the time // in an array if your app supports multi windows, this is the time
// when you should delete the corresponding element. // when you should delete the corresponding element.
mainWindow = null mainWindow = null
}) })
} }
// This method will be called when Electron has finished // This method will be called when Electron has finished
// initialization and is ready to create browser windows. // initialization and is ready to create browser windows.
// Some APIs can only be used after this event occurs. // Some APIs can only be used after this event occurs.
app.on('ready', () => { app.on('ready', () => {
createWindow() createWindow()
const menu = Menu.buildFromTemplate(template) const menu = Menu.buildFromTemplate(template)
Menu.setApplicationMenu(menu) Menu.setApplicationMenu(menu)
}) })
// Quit when all windows are closed. // Quit when all windows are closed.
app.on('window-all-closed', function () { app.on('window-all-closed', function () {
// On OS X it is common for applications and their menu bar // On OS X it is common for applications and their menu bar
// to stay active until the user quits explicitly with Cmd + Q // to stay active until the user quits explicitly with Cmd + Q
const reopenMenuItem = findReopenMenuItem() const reopenMenuItem = findReopenMenuItem()
if (reopenMenuItem) reopenMenuItem.enabled = true if (reopenMenuItem) reopenMenuItem.enabled = true
if (process.platform !== 'darwin') { if (process.platform !== 'darwin') {
app.quit() app.quit()
} }
}) })
app.on('activate', function () { app.on('activate', function () {
// On OS X it's common to re-create a window in the app when the // On OS X it's common to re-create a window in the app when the
// dock icon is clicked and there are no other windows open. // dock icon is clicked and there are no other windows open.
if (mainWindow === null) { if (mainWindow === null) {
createWindow() createWindow()
} }
}) })
app.on('browser-window-created', (event, win) => { app.on('browser-window-created', (event, win) => {
const reopenMenuItem = findReopenMenuItem() const reopenMenuItem = findReopenMenuItem()
if (reopenMenuItem) reopenMenuItem.enabled = false if (reopenMenuItem) reopenMenuItem.enabled = false
win.webContents.on('context-menu', (e, params) => { win.webContents.on('context-menu', (e, params) => {
menu.popup(win, params.x, params.y) menu.popup(win, params.x, params.y)
}) })
}) })
ipcMain.on('show-context-menu', event => { ipcMain.on('show-context-menu', event => {
const win = BrowserWindow.fromWebContents(event.sender) const win = BrowserWindow.fromWebContents(event.sender)
menu.popup(win) menu.popup(win)
}) })
// In this file you can include the rest of your app's specific main process // In this file you can include the rest of your app's specific main process
// code. You can also put them in separate files and require them here. // code. You can also put them in separate files and require them here.

View file

@ -1,8 +1,8 @@
const { ipcRenderer } = require('electron') const { ipcRenderer } = require('electron')
// Tell main process to show the menu when demo button is clicked // Tell main process to show the menu when demo button is clicked
const contextMenuBtn = document.getElementById('context-menu') const contextMenuBtn = document.getElementById('context-menu')
contextMenuBtn.addEventListener('click', () => { contextMenuBtn.addEventListener('click', () => {
ipcRenderer.send('show-context-menu') ipcRenderer.send('show-context-menu')
}) })

View file

@ -1,64 +1,64 @@
// Modules to control application life and create native browser window // Modules to control application life and create native browser window
const { app, BrowserWindow, ipcMain, nativeImage } = require('electron') const { app, BrowserWindow, ipcMain, nativeImage } = require('electron')
// Keep a global reference of the window object, if you don't, the window will // Keep a global reference of the window object, if you don't, the window will
// be closed automatically when the JavaScript object is garbage collected. // be closed automatically when the JavaScript object is garbage collected.
let mainWindow let mainWindow
function createWindow () { function createWindow () {
// Create the browser window. // Create the browser window.
mainWindow = new BrowserWindow({ mainWindow = new BrowserWindow({
width: 800, width: 800,
height: 600, height: 600,
webPreferences: { webPreferences: {
nodeIntegration: true nodeIntegration: true
} }
}) })
// and load the index.html of the app. // and load the index.html of the app.
mainWindow.loadFile('index.html') mainWindow.loadFile('index.html')
// Open the DevTools. // Open the DevTools.
// mainWindow.webContents.openDevTools() // mainWindow.webContents.openDevTools()
// Emitted when the window is closed. // Emitted when the window is closed.
mainWindow.on('closed', function () { mainWindow.on('closed', function () {
// Dereference the window object, usually you would store windows // Dereference the window object, usually you would store windows
// in an array if your app supports multi windows, this is the time // in an array if your app supports multi windows, this is the time
// when you should delete the corresponding element. // when you should delete the corresponding element.
mainWindow = null mainWindow = null
}) })
} }
// This method will be called when Electron has finished // This method will be called when Electron has finished
// initialization and is ready to create browser windows. // initialization and is ready to create browser windows.
// Some APIs can only be used after this event occurs. // Some APIs can only be used after this event occurs.
app.on('ready', createWindow) app.on('ready', createWindow)
// Quit when all windows are closed. // Quit when all windows are closed.
app.on('window-all-closed', function () { app.on('window-all-closed', function () {
// On OS X it is common for applications and their menu bar // On OS X it is common for applications and their menu bar
// to stay active until the user quits explicitly with Cmd + Q // to stay active until the user quits explicitly with Cmd + Q
if (process.platform !== 'darwin') { if (process.platform !== 'darwin') {
app.quit() app.quit()
} }
}) })
app.on('activate', function () { app.on('activate', function () {
// On OS X it's common to re-create a window in the app when the // On OS X it's common to re-create a window in the app when the
// dock icon is clicked and there are no other windows open. // dock icon is clicked and there are no other windows open.
if (mainWindow === null) { if (mainWindow === null) {
createWindow() createWindow()
} }
}) })
ipcMain.on('ondragstart', (event, filepath) => { ipcMain.on('ondragstart', (event, filepath) => {
const icon = nativeImage.createFromDataURL('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAkCAYAAADhAJiYAAAAAXNSR0IArs4c6QAAAAlwSFlzAAALEwAACxMBAJqcGAAAAVlpVFh0WE1M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fFG5dqa7h406qaeX8384uTZL5w9+UqxhYHFp0YLIYA9ddfu3T+4UJF6Rg+YAc9D0+RoIGP1ULhpWspr10evyK7+ftWTrk9PS/++A9KZSm26cih2mMOErem6n/ZsZwA2TM/MPHXs2LEftnSTbh0Q36mIIbx44cLvOnu3f+xUwbWLmoHTCUlF6g2jBQo/GnFrnGNqSHdvr+rIKGMW1KahwEBdzHft98aNwMr8zd8/NDDwccihc0hLi3GubRjY0Bm6H19fPvnZI4c/fHd7PJ2peXYZ+WQ26JufZELjQ6lbAQtnWre0d3apY8TFIdtAo+Qri6mupsB49lBMC+QXF0YefObZT8j0eKWlswVjEyCCOXHihPGb575VCvVuf3lvetsH9rXF0rla3cnhpoIGjgsUPhR3I4TMKYJQV1Z6WO02aEjHa5mNe3OPW3OPRHVrbXFh9Ocvv/KR1372owx1Pf3005uc35Ddgtd8rsf06IdS5777zZ+mUqmPzjm6TPpmvayZOq4LyATeCzkanmiy4qEuC/yXiO8CSMRzvLs1x9phepLNZl868sy3Pyen/5hd1/EfRvWmuvSWNeaRS/RkPDI4+NjE1NSXEoXlpaNB1zqo20abi59/vu/UfM2pie7WUDVq8l3wTwnskeZ+zTbIQ17KoCzKpGzq2KqX32/roRbh8ePHdUzl0s9/5Rv9n/7go19MxCKfCkZiu3V06wrO5gocxL7Dgd/IEobEMH6rejg+auXidL5Y/vWv/vTX53/y/e/MkGajTH7fOt4RUJOY1df4RdtY6ICFRzqTySOhUOA+3Ai3o31H1ZbnlXBruFmt2iMrudy5xx9//BzWV7nXDBGN2xpjbt/5oGUEdhtO3iD47xZOvm8a5CHvpsV38wsUaMwBWsz3rbK5xr0mzdv2t9Jv/f5vhsF4J+Q63IUAAAAASUVORK5CYII=') const icon = nativeImage.createFromDataURL('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAkCAYAAADhAJiYAAAAAXNSR0IArs4c6QAAAAlwSFlzAAALEwAACxMBAJqcGAAAAVlpVFh0WE1MOmNvbS5hZG9iZS54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384uTZL5w9+UqxhYHFp0YLIYA9ddfu3T+4UJF6Rg+YAc9D0+RoIGP1ULhpWspr10evyK7+ftWTrk9PS/++A9KZSm26cih2mMOErem6n/ZsZwA2TM/MPHXs2LEftnSTbh0Q36mIIbx44cLvOnu3f+xUwbWLmoHTCUlF6g2jBQo/GnFrnGNqSHdvr+rIKGMW1KahwEBdzHft98aNwMr8zd8/NDDwccihc0hLi3GubRjY0Bm6H19fPvnZI4c/fHd7PJ2peXYZ+WQ26JufZELjQ6lbAQtnWre0d3apY8TFIdtAo+Qri6mupsB49lBMC+QXF0YefObZT8j0eKWlswVjEyCCOXHihPGb575VCvVuf3lvetsH9rXF0rla3cnhpoIGjgsUPhR3I4TMKYJQV1Z6WO02aEjHa5mNe3OPW3OPRHVrbXFh9Ocvv/KR1372owx1Pf3005uc35Ddgtd8rsf06IdS5777zZ+mUqmPzjm6TPpmvayZOq4LyATeCzkanmiy4qEuC/yXiO8CSMRzvLs1x9phepLNZl868sy3Pyen/5hd1/EfRvWmuvSWNeaRS/RkPDI4+NjE1NSXEoXlpaNB1zqo20abi59/vu/UfM2pie7WUDVq8l3wTwnskeZ+zTbIQ17KoCzKpGzq2KqX32/roRbh8ePHdUzl0s9/5Rv9n/7go19MxCKfCkZiu3V06wrO5gocxL7Dgd/IEobEMH6rejg+auXidL5Y/vWv/vTX53/y/e/MkGajTH7fOt4RUJOY1df4RdtY6ICFRzqTySOhUOA+3Ai3o31H1ZbnlXBruFmt2iMrudy5xx9//BzWV7nXDBGN2xpjbt/5oGUEdhtO3iD47xZOvm8a5CHvpsV38wsUaMwBWsz3rbK5xr0mzdv2t9Jv/f5vhsF4J+Q63IUAAAAASUVORK5CYII=')
event.sender.startDrag({ event.sender.startDrag({
file: filepath, file: filepath,
icon icon
}) })
}) })
// In this file you can include the rest of your app's specific main process // In this file you can include the rest of your app's specific main process
// code. You can also put them in separate files and require them here. // code. You can also put them in separate files and require them here.

View file

@ -1,21 +1,21 @@
const { ipcRenderer } = require('electron') const { ipcRenderer } = require('electron')
const shell = require('electron').shell const shell = require('electron').shell
const links = document.querySelectorAll('a[href]') const links = document.querySelectorAll('a[href]')
Array.prototype.forEach.call(links, (link) => { Array.prototype.forEach.call(links, (link) => {
const url = link.getAttribute('href') const url = link.getAttribute('href')
if (url.indexOf('http') === 0) { if (url.indexOf('http') === 0) {
link.addEventListener('click', (e) => { link.addEventListener('click', (e) => {
e.preventDefault() e.preventDefault()
shell.openExternal(url) shell.openExternal(url)
}) })
} }
}) })
const dragFileLink = document.getElementById('drag-file-link') const dragFileLink = document.getElementById('drag-file-link')
dragFileLink.addEventListener('dragstart', event => { dragFileLink.addEventListener('dragstart', event => {
event.preventDefault() event.preventDefault()
ipcRenderer.send('ondragstart', __filename) ipcRenderer.send('ondragstart', __filename)
}) })