Pārlūkot izejas kodu

Passage à electron 1.6.5

upgrade-electron
Benjamin Gaudé pirms 2 gadiem
vecāks
revīzija
ac60596bb3
7 mainītis faili ar 19 papildinājumiem un 20 dzēšanām
  1. +7
    -5
      main.js
  2. +3
    -4
      package.json
  3. +2
    -5
      src/app.js
  4. +2
    -2
      src/components/edit/profile-menu.js
  5. +1
    -1
      src/store/actions/launcher.js
  6. +3
    -3
      src/util/app.js
  7. +1
    -0
      src/util/profile.js

+ 7
- 5
main.js Parādīt failu

@@ -1,6 +1,8 @@
var app = require('app'); // Module to control application life.
var BrowserWindow = require('browser-window'); // Module to create native browser window.
var Menu = require('menu');
var app = require('electron').app; // Module to control application life.
//var BrowserWindow = require('browser-window'); // Module to create native browser window
var BrowserWindow = require('electron').BrowserWindow;

var Menu = require('electron').menu;
var isDev = process.env.NODE_ENV === 'development';
var Util = require('./'+(isDev ? 'src': 'dist')+'/util');

@@ -16,7 +18,7 @@ app.on('window-all-closed', function() {

app.on('ready', function() {
// Create the browser window.
var electronScreen = require('screen');
var electronScreen = require('electron').screen;
var workArea = electronScreen.getPrimaryDisplay().workArea;

var asDesktop = process.env.PITAYA_AS_DESKTOP == 1;
@@ -37,7 +39,7 @@ app.on('ready', function() {
}

// and load the index.html of the app.
mainWindow.loadUrl('file://' + __dirname + '/index.html');
mainWindow.loadURL('file://' + __dirname + '/index.html');

mainWindow.on('closed', function() {
mainWindow = null;

+ 3
- 4
package.json Parādīt failu

@@ -4,11 +4,10 @@
"private": "true",
"main": "main.js",
"devDependencies": {
"electron-packager": "^5.1.0",
"electron-prebuilt": "^0.37.5",
"electron": "^1.6.5",
"node-jsx": "^0.13.3",
"nodeunit": "^0.9.1",
"react-tools": "^0.13.3",
"node-jsx": "^0.13.3"
"react-tools": "^0.13.3"
},
"scripts": {
"test": "./node_modules/.bin/nodeunit test",

+ 2
- 5
src/app.js Parādīt failu

@@ -31,10 +31,7 @@ function select(state) {
// Connect App to Redux store
App = connect(select)(App);

ReactDOM.render(
<Provider store={store}>
<App />
</Provider>
,

ReactDOM.render(<Provider store={store}><App /></Provider>,
document.getElementById('pitaya')
);

+ 2
- 2
src/components/edit/profile-menu.js Parādīt failu

@@ -2,7 +2,7 @@
var React = require('react');
var connect = require('react-redux').connect;
var actions = require('../../store/actions');
var dialog = require('remote').require('dialog');
var dialog = require('electron').remote.dialog;

var ProfileMenu = React.createClass({

@@ -57,7 +57,7 @@ var ProfileMenu = React.createClass({
},

showSaveProfileDialog: function(defaultPath) {
return new Promise(function(resolve) {
dialog.showSaveDialog(
{

+ 1
- 1
src/store/actions/launcher.js Parādīt failu

@@ -1,6 +1,6 @@
var Util = require('../../util');
var logger = Util.Logger;
var remote = require('remote');
var remote = require('electron').Remote;

var RUN_APP = exports.RUN_APP = 'RUN_APP';
var RUN_APP_SUCCESS = exports.RUN_APP_SUCCESS = 'RUN_APP_SUCCESS';

+ 3
- 3
src/util/app.js Parādīt failu

@@ -1,8 +1,9 @@
var ipc = require('ipc');
//var ipc = require('ipc');
var ipc = require('electron').ipcMain;
var isMainProcess = process.type === 'browser';

var QUIT_CMD = 'app-util:quit';


exports.quit = function(exitCode) {
if(isMainProcess) {
process.exit(exitCode);
@@ -13,7 +14,6 @@ exports.quit = function(exitCode) {

// Main process, setup listeners
if(isMainProcess) {

ipc.on(QUIT_CMD, function(evt, exitCode) {
exports.quit(exitCode);
});

+ 1
- 0
src/util/profile.js Parādīt failu

@@ -24,6 +24,7 @@ exports.load = function(profileUrl, withImports) {

for(var node, item = iterator.next(); !item.done; item = iterator.next()) {
node = item.value.node;

// For each import found, load the partial and "mount" it on the current item
if(node.import) {
var importPath = path.resolve(path.dirname(profileUrl), node.import)

Notiek ielāde…
Atcelt
Saglabāt