fixed error in selecting path and naming screenshot
This commit is contained in:
parent
8ab1dadf54
commit
01fdfcf420
1124
package-lock.json
generated
1124
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
|
@ -4,7 +4,8 @@
|
||||||
"description": "tool for documenting online harassment",
|
"description": "tool for documenting online harassment",
|
||||||
"main": "main.js",
|
"main": "main.js",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"electron": "^1.7.10"
|
"electron": "^1.7.10",
|
||||||
|
"eslint": "^4.15.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {},
|
"devDependencies": {},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|
|
@ -1,7 +1,9 @@
|
||||||
const electron = require('electron');
|
const electron = require('electron');
|
||||||
|
const remote = electron.remote;
|
||||||
const desktopCapturer = electron.desktopCapturer;
|
const desktopCapturer = electron.desktopCapturer;
|
||||||
const electronScreen = electron.screen;
|
const electronScreen = electron.screen;
|
||||||
const shell = electron.shell;
|
const shell = electron.shell;
|
||||||
|
const dialog = remote.dialog;
|
||||||
|
|
||||||
const fs = require('fs');
|
const fs = require('fs');
|
||||||
const os = require('os');
|
const os = require('os');
|
||||||
|
@ -16,7 +18,12 @@ var screenshotPath = '';
|
||||||
var caseName = '';
|
var caseName = '';
|
||||||
|
|
||||||
pathButton.addEventListener('click', function(event) {
|
pathButton.addEventListener('click', function(event) {
|
||||||
dialog.showSaveDialog(function(fileName) {
|
dialog.showSaveDialog({
|
||||||
|
filters: [
|
||||||
|
{ name: 'png', extensions: ['png'] }
|
||||||
|
]
|
||||||
|
},
|
||||||
|
function(fileName) {
|
||||||
if (fileName === undefined) {
|
if (fileName === undefined) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user