Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 6 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,40 +56,39 @@ See [TRANSLATION.md](https://github.com/thinreports/thinreports-editor/blob/mast
* JDK 6+
* Python 2.7
* Node.js
* [yarn](https://yarnpkg.com/en/)

### Getting Started

Install dependencies:
```
$ yarn install
$ npm install
```

Compile javascript, css and templates:
```
$ yarn run compile
$ npm run compile
```

Launch Editor on development:
```
$ yarn start
$ npm start
```

### Other Tasks

Watch and compile:
```
$ yarn run watch
$ npm run watch
```

Build package for macOS, Windows, Ubuntu(linux):
```
$ yarn run build
$ npm run build
```

Run compilation and building on production:
```
$ yarn run release
$ npm run release
```

## License
Expand Down
10 changes: 5 additions & 5 deletions app/handlers.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const path = require('path');
const handlers = {};

handlers.layoutOpen = (callback) => {
const filenames = dialog.showOpenDialog({
const filenames = dialog.showOpenDialogSync({
filters: [
{name: 'Thinreports Layout File', extensions: ['tlf']}
],
Expand All @@ -32,7 +32,7 @@ handlers.layoutSave = (callback, data, attrs) => {
}

handlers.layoutSaveAs = (callback, data) => {
const filename = dialog.showSaveDialog({
const filename = dialog.showSaveDialogSync({
filters: [
{name: 'Thinreports Layout File', extensions: ['tlf']}
]
Expand All @@ -53,7 +53,7 @@ handlers.layoutSaveAs = (callback, data) => {
}

handlers.imageOpen = (callback) => {
const imagefiles = dialog.showOpenDialog({
const imagefiles = dialog.showOpenDialogSync({
filters: [
{name: 'Images', extensions: ['jpg', 'png']}
]
Expand Down Expand Up @@ -83,7 +83,7 @@ handlers.exportAs = (callback, type, content) => {
break;
}

const filename = dialog.showSaveDialog({
const filename = dialog.showSaveDialogSync({
filters: [
{extensions: [extName], name: description}
]
Expand All @@ -99,4 +99,4 @@ handlers.exportAs = (callback, type, content) => {
callback.onSuccess();
}

module.exports = handlers;
window.handlers = handlers;
2 changes: 1 addition & 1 deletion app/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

var App = {};

App.handlers = require('./handlers');
App.handlers = window.handlers;

/**
* @type {string}
Expand Down
7 changes: 6 additions & 1 deletion app/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,15 @@ process.env.NODE_ENV = process.env.NODE_ENV || 'production'
let win

function createWindow () {
console.log(app.getAppPath());
win = new BrowserWindow({
width: 1000,
height: 700,
icon: path.join(__dirname, 'assets/images/app-icon.png')
icon: path.join(__dirname, 'assets/images/app-icon.png'),
webPreferences: {
enableRemoteModule: true,
preload: path.join(__dirname, 'handlers.js')
}
})

win.loadURL(url.format({
Expand Down
5 changes: 5 additions & 0 deletions app/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion app/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "ThinreportsEditor",
"name": "thinreports-editor",
"productName": "Thinreports Editor",
"version": "0.10.0",
"license": "GPL-3.0",
Expand Down
Loading