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",
|
||||
"main": "main.js",
|
||||
"dependencies": {
|
||||
"electron": "^1.7.10"
|
||||
"electron": "^1.7.10",
|
||||
"eslint": "^4.15.0"
|
||||
},
|
||||
"devDependencies": {},
|
||||
"scripts": {
|
||||
|
@ -20,4 +21,4 @@
|
|||
"url": "https://github.com/kkemmis/documentit/issues"
|
||||
},
|
||||
"homepage": "https://github.com/kkemmis/documentit#readme"
|
||||
}
|
||||
}
|
||||
|
|
21
renderer.js
21
renderer.js
|
@ -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) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user