fixed merge conflicts

This commit is contained in:
Queen Bee 2018-01-19 08:30:50 -08:00
commit 8ab1dadf54
3 changed files with 29 additions and 7 deletions

2
.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
# npm install likes to mess with this, also it's huge
node_modules

View File

@ -11,9 +11,9 @@
<div class="container window align-content-center">
<h1>DocumentIt</h1>
<form>
<input type="text" name="casename" placeholder="Case Name"><br>
<input type="text" name="socialmedia" placeholder="Social Media"><br>
<textarea name="description" placeholder="Incident Description..." rows="10" cols="30"></textarea>
<input type="text" id="casename" name="casename" placeholder="Case Name"><br>
<input type="text" id="socialmedia" name="socialmedia" placeholder="Social Media"><br>
<textarea id="description" name="description" placeholder="Incident Description..." rows="10" cols="30"></textarea>
</form>
<label id="screenshot-path">Path:</label><br>

View File

@ -9,6 +9,21 @@ const path = require('path');
const screenshot = document.getElementById('screen-shot');
const screenshotMsg = document.getElementById('screenshot-path');
const pathButton = document.getElementById('path-button');
const casenameField = document.getElementById('casename');
var screenshotPath = '';
var caseName = '';
pathButton.addEventListener('click', function(event) {
dialog.showSaveDialog(function(fileName) {
if (fileName === undefined) {
return;
}
screenshotPath = fileName;
screenshotMsg.textContent = screenshotPath;
});
});
screenshot.addEventListener('click', function(event) {
screenshotMsg.textContent = 'Gathering screenshot...';
@ -19,11 +34,16 @@ screenshot.addEventListener('click', function(event) {
if (error) return console.log(error.message);
sources.forEach(function(source) {
if (source.name === 'Entire Screen' || source.name === 'Screen 1') {
const screenshotPath = path.join(os.tmpdir(), 'screenshot.png');
if (source.name === 'Entire Screen' || source.name === 'Entire screen' || source.name === 'Screen 1') {
fs.writeFile(screenshotPath, source.thumbnail.toPng(), function(err) {
if (err) return console.log(err.message);
caseName = casenameField.value;
if (screenshotPath === '') {
timestamp = new Date().getTime();
screenshotPath = path.join(os.tmpdir(), caseName + '-' + timestamp + '.png');
}
fs.writeFile(screenshotPath, source.thumbnail.toPng(), function(error) {
if (error) return console.log(error.message);
shell.openExternal('file://' + screenshotPath);
var message = 'Saved screenshot to: ' + screenshotPath;