fixed merge conflicts
This commit is contained in:
commit
8ab1dadf54
2
.gitignore
vendored
Normal file
2
.gitignore
vendored
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
# npm install likes to mess with this, also it's huge
|
||||||
|
node_modules
|
|
@ -11,9 +11,9 @@
|
||||||
<div class="container window align-content-center">
|
<div class="container window align-content-center">
|
||||||
<h1>DocumentIt</h1>
|
<h1>DocumentIt</h1>
|
||||||
<form>
|
<form>
|
||||||
<input type="text" name="casename" placeholder="Case Name"><br>
|
<input type="text" id="casename" name="casename" placeholder="Case Name"><br>
|
||||||
<input type="text" name="socialmedia" placeholder="Social Media"><br>
|
<input type="text" id="socialmedia" name="socialmedia" placeholder="Social Media"><br>
|
||||||
<textarea name="description" placeholder="Incident Description..." rows="10" cols="30"></textarea>
|
<textarea id="description" name="description" placeholder="Incident Description..." rows="10" cols="30"></textarea>
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
<label id="screenshot-path">Path:</label><br>
|
<label id="screenshot-path">Path:</label><br>
|
||||||
|
|
28
renderer.js
28
renderer.js
|
@ -9,6 +9,21 @@ const path = require('path');
|
||||||
|
|
||||||
const screenshot = document.getElementById('screen-shot');
|
const screenshot = document.getElementById('screen-shot');
|
||||||
const screenshotMsg = document.getElementById('screenshot-path');
|
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) {
|
screenshot.addEventListener('click', function(event) {
|
||||||
screenshotMsg.textContent = 'Gathering screenshot...';
|
screenshotMsg.textContent = 'Gathering screenshot...';
|
||||||
|
@ -19,11 +34,16 @@ screenshot.addEventListener('click', function(event) {
|
||||||
if (error) return console.log(error.message);
|
if (error) return console.log(error.message);
|
||||||
|
|
||||||
sources.forEach(function(source) {
|
sources.forEach(function(source) {
|
||||||
if (source.name === 'Entire Screen' || source.name === 'Screen 1') {
|
if (source.name === 'Entire Screen' || source.name === 'Entire screen' || source.name === 'Screen 1') {
|
||||||
const screenshotPath = path.join(os.tmpdir(), 'screenshot.png');
|
|
||||||
|
|
||||||
fs.writeFile(screenshotPath, source.thumbnail.toPng(), function(err) {
|
caseName = casenameField.value;
|
||||||
if (err) return console.log(err.message);
|
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);
|
shell.openExternal('file://' + screenshotPath);
|
||||||
var message = 'Saved screenshot to: ' + screenshotPath;
|
var message = 'Saved screenshot to: ' + screenshotPath;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user