fixed error in selecting path and naming screenshot

This commit is contained in:
Queen Bee 2018-01-19 09:03:45 -08:00
parent 8ab1dadf54
commit 01fdfcf420
3 changed files with 913 additions and 237 deletions

1124
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -4,7 +4,8 @@
"description": "tool for documenting online harassment",
"main": "main.js",
"dependencies": {
"electron": "^1.7.10"
"electron": "^1.7.10",
"eslint": "^4.15.0"
},
"devDependencies": {},
"scripts": {

View File

@ -1,7 +1,9 @@
const electron = require('electron');
const remote = electron.remote;
const desktopCapturer = electron.desktopCapturer;
const electronScreen = electron.screen;
const shell = electron.shell;
const dialog = remote.dialog;
const fs = require('fs');
const os = require('os');
@ -16,13 +18,18 @@ var screenshotPath = '';
var caseName = '';
pathButton.addEventListener('click', function(event) {
dialog.showSaveDialog(function(fileName) {
if (fileName === undefined) {
return;
}
screenshotPath = fileName;
screenshotMsg.textContent = screenshotPath;
});
dialog.showSaveDialog({
filters: [
{ name: 'png', extensions: ['png'] }
]
},
function(fileName) {
if (fileName === undefined) {
return;
}
screenshotPath = fileName;
screenshotMsg.textContent = screenshotPath;
});
});
screenshot.addEventListener('click', function(event) {