Skip to content

Commit ffae902

Browse files
authored
Merge pull request #76 from thinreports/update-electron-and-others
Update to Electron v9
2 parents fd8a9ec + 8957334 commit ffae902

9 files changed

Lines changed: 2081 additions & 1942 deletions

File tree

README.md

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -56,40 +56,39 @@ See [TRANSLATION.md](https://github.com/thinreports/thinreports-editor/blob/mast
5656
* JDK 6+
5757
* Python 2.7
5858
* Node.js
59-
* [yarn](https://yarnpkg.com/en/)
6059

6160
### Getting Started
6261

6362
Install dependencies:
6463
```
65-
$ yarn install
64+
$ npm install
6665
```
6766

6867
Compile javascript, css and templates:
6968
```
70-
$ yarn run compile
69+
$ npm run compile
7170
```
7271

7372
Launch Editor on development:
7473
```
75-
$ yarn start
74+
$ npm start
7675
```
7776

7877
### Other Tasks
7978

8079
Watch and compile:
8180
```
82-
$ yarn run watch
81+
$ npm run watch
8382
```
8483

8584
Build package for macOS, Windows, Ubuntu(linux):
8685
```
87-
$ yarn run build
86+
$ npm run build
8887
```
8988

9089
Run compilation and building on production:
9190
```
92-
$ yarn run release
91+
$ npm run release
9392
```
9493

9594
## License

app/handlers.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ const path = require('path');
55
const handlers = {};
66

77
handlers.layoutOpen = (callback) => {
8-
const filenames = dialog.showOpenDialog({
8+
const filenames = dialog.showOpenDialogSync({
99
filters: [
1010
{name: 'Thinreports Layout File', extensions: ['tlf']}
1111
],
@@ -32,7 +32,7 @@ handlers.layoutSave = (callback, data, attrs) => {
3232
}
3333

3434
handlers.layoutSaveAs = (callback, data) => {
35-
const filename = dialog.showSaveDialog({
35+
const filename = dialog.showSaveDialogSync({
3636
filters: [
3737
{name: 'Thinreports Layout File', extensions: ['tlf']}
3838
]
@@ -53,7 +53,7 @@ handlers.layoutSaveAs = (callback, data) => {
5353
}
5454

5555
handlers.imageOpen = (callback) => {
56-
const imagefiles = dialog.showOpenDialog({
56+
const imagefiles = dialog.showOpenDialogSync({
5757
filters: [
5858
{name: 'Images', extensions: ['jpg', 'png']}
5959
]
@@ -83,7 +83,7 @@ handlers.exportAs = (callback, type, content) => {
8383
break;
8484
}
8585

86-
const filename = dialog.showSaveDialog({
86+
const filename = dialog.showSaveDialogSync({
8787
filters: [
8888
{extensions: [extName], name: description}
8989
]
@@ -99,4 +99,4 @@ handlers.exportAs = (callback, type, content) => {
9999
callback.onSuccess();
100100
}
101101

102-
module.exports = handlers;
102+
window.handlers = handlers;

app/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
var App = {};
1717

18-
App.handlers = require('./handlers');
18+
App.handlers = window.handlers;
1919

2020
/**
2121
* @type {string}

app/main.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,15 @@ process.env.NODE_ENV = process.env.NODE_ENV || 'production'
77
let win
88

99
function createWindow () {
10+
console.log(app.getAppPath());
1011
win = new BrowserWindow({
1112
width: 1000,
1213
height: 700,
13-
icon: path.join(__dirname, 'assets/images/app-icon.png')
14+
icon: path.join(__dirname, 'assets/images/app-icon.png'),
15+
webPreferences: {
16+
enableRemoteModule: true,
17+
preload: path.join(__dirname, 'handlers.js')
18+
}
1419
})
1520

1621
win.loadURL(url.format({

app/package-lock.json

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "ThinreportsEditor",
2+
"name": "thinreports-editor",
33
"productName": "Thinreports Editor",
44
"version": "0.10.0",
55
"license": "GPL-3.0",

0 commit comments

Comments
 (0)