Explorar el Código

Merge pull request #44 from electron/updates

Make updates
Zeke Sikelianos hace 9 años
padre
commit
732b807193
Se han modificado 5 ficheros con 16 adiciones y 5 borrados
  1. 2 2
      README.md
  2. 6 0
      index.html
  3. 4 2
      main.js
  4. 1 1
      package.json
  5. 3 0
      renderer.js

+ 2 - 2
README.md

@@ -6,9 +6,9 @@ This is a minimal Electron application based on the [Quick Start Guide](http://e
 
 A basic Electron application needs just these files:
 
-- `index.html` - A web page to render.
-- `main.js` - Starts the app and creates a browser window to render HTML.
 - `package.json` - Points to the app's main file and lists its details and dependencies.
+- `main.js` - Starts the app and creates a browser window to render HTML. This is the app's **main process**.
+- `index.html` - A web page to render. This is the app's **renderer process**.
 
 You can learn more about each of these components within the [Quick Start Guide](http://electron.atom.io/docs/latest/tutorial/quick-start).
 

+ 6 - 0
index.html

@@ -6,8 +6,14 @@
   </head>
   <body>
     <h1>Hello World!</h1>
+    <!-- All of the Node.js APIs are available in this renderer process. -->
     We are using node <script>document.write(process.versions.node)</script>,
     Chromium <script>document.write(process.versions.chrome)</script>,
     and Electron <script>document.write(process.versions.electron)</script>.
   </body>
+
+  <script>
+    // You can also require other files to run in this process
+    require('./renderer.js')
+  </script>
 </html>

+ 4 - 2
main.js

@@ -1,5 +1,3 @@
-'use strict';
-
 const electron = require('electron');
 // Module to control application life.
 const app = electron.app;
@@ -31,6 +29,7 @@ function createWindow () {
 
 // This method will be called when Electron has finished
 // initialization and is ready to create browser windows.
+// Some APIs can only be used after this event occurs.
 app.on('ready', createWindow);
 
 // Quit when all windows are closed.
@@ -49,3 +48,6 @@ app.on('activate', function () {
     createWindow();
   }
 });
+
+// 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.

+ 1 - 1
package.json

@@ -23,6 +23,6 @@
   },
   "homepage": "https://github.com/electron/electron-quick-start#readme",
   "devDependencies": {
-    "electron-prebuilt": "^0.37.0"
+    "electron-prebuilt": "^0.37.7"
   }
 }

+ 3 - 0
renderer.js

@@ -0,0 +1,3 @@
+// This file is required by the index.html file and will
+// be executed in the renderer process for that window.
+// All of the Node.js APIs are available in this process.