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

Commit

Permalink
Merge pull request #19 from Kuzat/pre-release
Browse files Browse the repository at this point in the history
1.0.0 Release
  • Loading branch information
Kuzat authored Aug 5, 2017
2 parents 71640b9 + 5e47273 commit 108d1bb
Show file tree
Hide file tree
Showing 7 changed files with 65 additions and 4 deletions.
14 changes: 14 additions & 0 deletions autostart.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
const AutoLaunch = require('auto-launch');
const settings = require('electron-settings');

const hyperShotAutoLauncher = new AutoLaunch({
name: 'hyperShot'
});

exports.update = () => {
if (settings.get('user.general.autoLaunch')) {
hyperShotAutoLauncher.enable();
} else {
hyperShotAutoLauncher.disable();
}
};
14 changes: 12 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ const isDev = require('electron-is-dev');

// New Upload object to handle upload and upload events
const Upload = require('./upload');
const autostart = require('./autostart');

const upload = new Upload();

Expand Down Expand Up @@ -318,16 +319,25 @@ app.on('ready', () => {
folder: ''
},
copyToClipboard: false,
openLink: true
}
openLink: true,
autoLaunch: true
},
version: app.getVersion()
});

if (settings.get('user') === undefined) {
settings.set('user', settings.get('default'));
}

if (settings.get('user.version') !== app.getVersion()) {
settings.set('user', settings.get('default'));
}

mainWindow = createMainWindow();

// Update autostart settings
autostart.update();

// A suitable size for the preview window
let size = null;
if (!shouldQuit) {
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "hyperShot",
"productName": "hyperShot",
"version": "1.0.0-beta.0",
"version": "1.0.0",
"description": "A powerfull cross-platform screenshoting tool",
"license": "MIT",
"repository": "https://github.com/Kuzat/hyperShot",
Expand Down Expand Up @@ -51,6 +51,7 @@
"Linux"
],
"dependencies": {
"auto-launch": "5.0.X",
"electron-debug": "1.3.X",
"electron-is-dev": "0.1.X",
"electron-settings": "3.0.X",
Expand Down
12 changes: 12 additions & 0 deletions renderer/settings.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
const remote = require('electron').remote;
const settings = require('electron-settings');
const autostart = require('../autostart');

const dialog = remote.dialog;

Expand All @@ -10,6 +11,7 @@ let openLink;
let uploadTypes;
let fullscreenHotkey;
let selectiveHotkey;
let autoLaunchSetting;

function setupSettings() {
// Save to folder
Expand All @@ -23,6 +25,9 @@ function setupSettings() {
// Open link
openLink.checked = settings.get('user.general.openLink');

// Auto-launch
autoLaunchSetting.checked = settings.get('user.general.autoLaunch');

// Upload type
uploadTypes.selectedIndex = settings.get('user.upload.type');

Expand All @@ -42,6 +47,7 @@ document.addEventListener('DOMContentLoaded', () => {
uploadTypes = document.getElementsByName('upload-types')[0];
fullscreenHotkey = document.getElementsByName('fullscreen')[0];
selectiveHotkey = document.getElementsByName('selective')[0];
autoLaunchSetting = document.getElementsByName('autoLaunch')[0];

setupSettings();

Expand All @@ -65,6 +71,12 @@ document.addEventListener('DOMContentLoaded', () => {
settings.set('user.general.openLink', event.target.checked);
});

autoLaunchSetting.addEventListener('change', event => {
console.log(event.target.checked);
settings.set('user.general.autoLaunch', event.target.checked);
autostart.update();
});

uploadTypes.addEventListener('change', event => {
console.log(event.target.selectedIndex);
settings.set('user.upload.type', event.target.selectedIndex);
Expand Down
2 changes: 1 addition & 1 deletion windows/main.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<div class="box">
<h3>Upload Images</h3>
<p>Drag and drop images here, or select them by pressing browse
<button id="browse-btn">Browse</button>
<button class="browse-btn" id="browse-btn">Browse</button>
</div>
<hr class="divider">
<div class="box">
Expand Down
2 changes: 2 additions & 0 deletions windows/settings.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ <h3>General</h3>
<input type="checkbox" name="copyToClipboard"/>
<p>Open link after successful upload</p>
<input type="checkbox" name="openLink" />
<p>Auto-launch app on startup</p>
<input type="checkbox" name="autoLaunch" />
<h3>Uploading</h3>
<p>Upload type</p>
<select name="upload-types">
Expand Down
22 changes: 22 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,10 @@ any-promise@^1.0.0, any-promise@^1.3.0:
version "1.3.0"
resolved "https://registry.yarnpkg.com/any-promise/-/any-promise-1.3.0.tgz#abc6afeedcea52e809cdc0376aed3ce39635d17f"

applescript@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/applescript/-/applescript-1.0.0.tgz#bb87af568cad034a4e48c4bdaf6067a3a2701317"

aproba@^1.0.3:
version "1.1.2"
resolved "https://registry.yarnpkg.com/aproba/-/aproba-1.1.2.tgz#45c6629094de4e96f693ef7eab74ae079c240fc1"
Expand Down Expand Up @@ -152,6 +156,16 @@ asynckit@^0.4.0:
version "0.4.0"
resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79"

auto-launch@^5.0.1:
version "5.0.1"
resolved "https://registry.yarnpkg.com/auto-launch/-/auto-launch-5.0.1.tgz#2015a8a30384abe0e7f98cbdca8145cf154753ae"
dependencies:
applescript "^1.0.0"
mkdirp "^0.5.1"
path-is-absolute "^1.0.0"
untildify "^3.0.2"
winreg "1.2.2"

aws-sign2@~0.6.0:
version "0.6.0"
resolved "https://registry.yarnpkg.com/aws-sign2/-/aws-sign2-0.6.0.tgz#14342dd38dbcc94d0e5b87d763cd63612c0e794f"
Expand Down Expand Up @@ -2738,6 +2752,10 @@ universalify@^0.1.0:
version "0.1.0"
resolved "https://registry.yarnpkg.com/universalify/-/universalify-0.1.0.tgz#9eb1c4651debcc670cc94f1a75762332bb967778"

untildify@^3.0.2:
version "3.0.2"
resolved "https://registry.yarnpkg.com/untildify/-/untildify-3.0.2.tgz#7f1f302055b3fea0f3e81dc78eb36766cb65e3f1"

unzip-response@^2.0.1:
version "2.0.1"
resolved "https://registry.yarnpkg.com/unzip-response/-/unzip-response-2.0.1.tgz#d2f0f737d16b0615e72a6935ed04214572d56f97"
Expand Down Expand Up @@ -2828,6 +2846,10 @@ widest-line@^1.0.0:
dependencies:
string-width "^1.0.1"

[email protected]:
version "1.2.2"
resolved "https://registry.yarnpkg.com/winreg/-/winreg-1.2.2.tgz#8509afa3b71c5bbd110a6d7c6247ec67736c598f"

wordwrap@~1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-1.0.0.tgz#27584810891456a4171c8d0226441ade90cbcaeb"
Expand Down

0 comments on commit 108d1bb

Please sign in to comment.