Skip to content
This repository has been archived by the owner on Mar 17, 2019. It is now read-only.

Commit

Permalink
console ready && version up
Browse files Browse the repository at this point in the history
  • Loading branch information
binjospookie committed Dec 18, 2016
1 parent 92f1c12 commit 51852e1
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 22 deletions.
51 changes: 34 additions & 17 deletions main.js
Expand Up @@ -116,6 +116,8 @@ ipcMain.on('synchronous-message', (event, arg, data) => {
} else if (arg === 'optimize') {
let oImg = optimizeShots(data);
event.returnValue = 'data';
} else if (arg === 'version') {
event.returnValue = app.getVersion();
} else {
appWindow.show();
appWindow.setPosition(0,0);
Expand Down Expand Up @@ -161,7 +163,7 @@ function createWindow() {
} else {
appWindow.loadURL(`file://${__dirname}/index.html`);
}
// appWindow.webContents.openDevTools();
// appWindow.webContents.openDevTools();
appWindow.on('closed', function() {
appWindow = null;
});
Expand Down Expand Up @@ -289,37 +291,52 @@ Example:
console.log(`--shots ${app.getVersion()}`);
break;
case '--about':
case '-=-about':
case '-about':
case '-a':
console.log('--shots is an application for creating screenshots.\n' +
'It was created on web-technologies.\nhttps://github.com/binjospookie/--shots');
break;
case '--capture':
case '-capture':
case '-c':
app.createShot = true;
appWindow.webContents.send('new', 'capture');
appWindow.setPosition(0,0);
appWindow.show();
appFirstStart = false;
dialog.showMessageBox(newShotDialog, function(index) {
// если пользователь подтвердил выбор — далем новый скриншот
if (index === 0) {
app.createShot = true;
appWindow.webContents.send('new', 'capture');
appWindow.setPosition(0,0);
appWindow.show();
appFirstStart = false;
}
})
break;
case '--fast':
case '-fast':
case '-f':
app.createShot = true;
appWindow.webContents.send('new', 'fast');
appWindow.setPosition(0,0);
appWindow.show();
appFirstStart = false;
dialog.showMessageBox(newShotDialog, function(index) {
// если пользователь подтвердил выбор — далем новый скриншот
if (index === 0) {
app.createShot = true;
appWindow.webContents.send('new', 'fast');
appWindow.setPosition(0,0);
appWindow.show();
appFirstStart = false;
}
})
break;
case '--new':
case '-new':
case '-n':
app.createShot = true;
appWindow.webContents.send('new');
appWindow.setPosition(0,0);
appWindow.show();
appFirstStart = false;
dialog.showMessageBox(newShotDialog, function(index) {
// если пользователь подтвердил выбор — далем новый скриншот
if (index === 0) {
app.createShot = true;
appWindow.webContents.send('new');
appWindow.setPosition(0,0);
appWindow.show();
appFirstStart = false;
}
})
break;
case '--save':
case '-save':
Expand Down
2 changes: 1 addition & 1 deletion package.json
@@ -1,6 +1,6 @@
{
"name": "shots",
"version": "1.0.3-rc14",
"version": "1.0.3-rc23",
"description": "An application for creating screenshots",
"main": "main.js",
"license": "NPOSL",
Expand Down
2 changes: 1 addition & 1 deletion scripts/ipc/ipcRendered.js
Expand Up @@ -238,7 +238,7 @@ function text(body, textSidebar) {
}
body.classList.add('text');
});
}
}
function emoji(createEmoji, textSidebar) {
ipcRenderer.on('emoji', (event, type) => {
if (textSidebar.classList.contains('show')) {
Expand Down
6 changes: 3 additions & 3 deletions scripts/renderer.js
@@ -1,6 +1,4 @@
/* eslint-disable */

const APP_VERSION = '1.0.3';
const CLOSE = 'close';
const MAX_ZOOM = 2;
const MIN_ZOOM = 0.5;
Expand All @@ -15,6 +13,7 @@ const isOnline = require('is-online');
const {
ipcRenderer
} = require('electron');

const ipc = require('electron').ipcRenderer;
const ipcAdd = require('./ipc/ipcAdd');
const determineScreenShotSize = require('./functions/determineScreenShotSize');
Expand Down Expand Up @@ -110,6 +109,7 @@ let IMMEDIATELY_CROP = false;
let DELAY_DURATION = 100;
let SHIFT_PRESSED;
let IN_PROCESS = false;
const APP_VERSION = ipcRenderer.sendSync('synchronous-message', 'version');

window.addEventListener('keydown', event => {
if (event.which === 16) {
Expand Down Expand Up @@ -829,7 +829,7 @@ function stageMouseMoveHandlerPen(event) {
activeShape.getChildAt(0).graphics.setStrokeStyle(penSize / areaZoom, 'round')
.moveTo(penOldX, penOldY)
.lineTo(newX, newY);

penOldX = newX;
penOldY = newY;
}
Expand Down

0 comments on commit 51852e1

Please sign in to comment.