:memo: Match variable names
authorPlusb Preco <plusb21@gmail.com>
Tue, 10 May 2016 17:38:42 +0000 (02:38 +0900)
committerPlusb Preco <plusb21@gmail.com>
Tue, 10 May 2016 17:38:42 +0000 (02:38 +0900)
[ci skip]

docs/api/screen.md
docs/api/web-contents.md
docs/faq/electron-faq.md
docs/tutorial/quick-start.md
docs/tutorial/using-pepper-flash-plugin.md
docs/tutorial/using-widevine-cdm-plugin.md

index 258263904b6d3883a80b348b7bd1b8adab57e401..7dd6203316d2f26d327e9d658a9871ecbb187b86 100644 (file)
@@ -15,11 +15,11 @@ An example of creating a window that fills the whole screen:
 ```javascript
 const {app, BrowserWindow, screen: electronScreen} = require('electron');
 
-let mainWindow;
+let win;
 
 app.on('ready', () => {
   const {width, height} = electronScreen.getPrimaryDisplay().workAreaSize;
-  mainWindow = new BrowserWindow({width, height});
+  win = new BrowserWindow({width, height});
 });
 ```
 
@@ -28,7 +28,7 @@ Another example of creating a window in the external display:
 ```javascript
 const {app, BrowserWindow, screen: electronScreen} = require('electron');
 
-let mainWindow;
+let win;
 
 app.on('ready', () => {
   let displays = electronScreen.getAllDisplays();
@@ -41,7 +41,7 @@ app.on('ready', () => {
   }
 
   if (externalDisplay) {
-    mainWindow = new BrowserWindow({
+    win = new BrowserWindow({
       x: externalDisplay.bounds.x + 50,
       y: externalDisplay.bounds.y + 50
     });
index 55021945e46d0f53920972b4157a05fad3e2c0fd..47e2e4c349110715416cc09b3d433bbd5bdccf11 100644 (file)
@@ -700,8 +700,8 @@ Adds the specified path to DevTools workspace. Must be used after DevTools
 creation:
 
 ```javascript
-mainWindow.webContents.on('devtools-opened', () => {
-  mainWindow.webContents.addWorkSpace(__dirname);
+win.webContents.on('devtools-opened', () => {
+  win.webContents.addWorkSpace(__dirname);
 });
 ```
 
@@ -763,13 +763,13 @@ An example of sending messages from the main process to the renderer process:
 
 ```javascript
 // In the main process.
-let mainWindow = null;
+let win = null;
 
 app.on('ready', () => {
-  mainWindow = new BrowserWindow({width: 800, height: 600});
-  mainWindow.loadURL(`file://${__dirname}/index.html`);
-  mainWindow.webContents.on('did-finish-load', () => {
-    mainWindow.webContents.send('ping', 'whoooooooh!');
+  win = new BrowserWindow({width: 800, height: 600});
+  win.loadURL(`file://${__dirname}/index.html`);
+  win.webContents.on('did-finish-load', () => {
+    win.webContents.send('ping', 'whoooooooh!');
   });
 });
 ```
index 94a4c6714b55b324e530117c3bf47d47025e544a..239b4411d42e952064b13319887dd14695052cf9 100644 (file)
@@ -87,7 +87,7 @@ To solve this, you can turn off node integration in Electron:
 
 ```javascript
 // In the main process.
-let mainWindow = new BrowserWindow({
+let win = new BrowserWindow({
   webPreferences: {
     nodeIntegration: false
   }
index abbaf105537cc3134d7643141f8bda1f8a1fd935..59ee27602b3ba34a90d209cd2d13b447b36ef1ea 100644 (file)
@@ -88,24 +88,24 @@ const {BrowserWindow} = electron;
 
 // 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.
-let mainWindow;
+let win;
 
 function createWindow() {
   // Create the browser window.
-  mainWindow = new BrowserWindow({width: 800, height: 600});
+  win = new BrowserWindow({width: 800, height: 600});
 
   // and load the index.html of the app.
-  mainWindow.loadURL(`file://${__dirname}/index.html`);
+  win.loadURL(`file://${__dirname}/index.html`);
 
   // Open the DevTools.
-  mainWindow.webContents.openDevTools();
+  win.webContents.openDevTools();
 
   // Emitted when the window is closed.
-  mainWindow.on('closed', () => {
+  win.on('closed', () => {
     // Dereference the window object, usually you would store windows
     // in an array if your app supports multi windows, this is the time
     // when you should delete the corresponding element.
-    mainWindow = null;
+    win = null;
   });
 }
 
@@ -126,7 +126,7 @@ app.on('window-all-closed', () => {
 app.on('activate', () => {
   // 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.
-  if (mainWindow === null) {
+  if (win === null) {
     createWindow();
   }
 });
index 31ab1104b1a3bc005247e8d6c9d2b82b2f2e2613..76c89d6fdd43a213386c91bc708b4f0daf8a25ea 100644 (file)
@@ -29,14 +29,14 @@ app.commandLine.appendSwitch('ppapi-flash-path', '/path/to/libpepflashplayer.so'
 app.commandLine.appendSwitch('ppapi-flash-version', '17.0.0.169');
 
 app.on('ready', () => {
-  mainWindow = new BrowserWindow({
+  win = new BrowserWindow({
     width: 800,
     height: 600,
     webPreferences: {
       plugins: true
     }
   });
-  mainWindow.loadURL(`file://${__dirname}/index.html`);
+  win.loadURL(`file://${__dirname}/index.html`);
   // Something else
 });
 ```
index d1afae8558d70ee15611a73fb01c61b87a0ce768..af1337c5eae8ff0bc6376877288035b767832df3 100644 (file)
@@ -59,9 +59,9 @@ app.commandLine.appendSwitch('widevine-cdm-path', '/path/to/widevinecdmadapter.p
 // The version of plugin can be got from `chrome://plugins` page in Chrome.
 app.commandLine.appendSwitch('widevine-cdm-version', '1.4.8.866');
 
-let mainWindow = null;
+let win = null;
 app.on('ready', () => {
-  mainWindow = new BrowserWindow({
+  win = new BrowserWindow({
     webPreferences: {
       // The `plugins` have to be enabled.
       plugins: true