Browse Source

Merge pull request #44 from electron/updates

Make updates
main
Zeke Sikelianos 10 years ago
parent
commit
732b807193
  1. 4
      README.md
  2. 6
      index.html
  3. 6
      main.js
  4. 2
      package.json
  5. 3
      renderer.js

4
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: 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. - `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). You can learn more about each of these components within the [Quick Start Guide](http://electron.atom.io/docs/latest/tutorial/quick-start).

6
index.html

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

6
main.js

@ -1,5 +1,3 @@
'use strict';
const electron = require('electron'); const electron = require('electron');
// Module to control application life. // Module to control application life.
const app = electron.app; const app = electron.app;
@ -31,6 +29,7 @@ function createWindow () {
// 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.
app.on('ready', createWindow); app.on('ready', createWindow);
// Quit when all windows are closed. // Quit when all windows are closed.
@ -49,3 +48,6 @@ app.on('activate', function () {
createWindow(); 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.

2
package.json

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

3
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.
Loading…
Cancel
Save