Skip to content

Commit

Permalink
feat: update dependencies & add temp update check
Browse files Browse the repository at this point in the history
  • Loading branch information
Toinane committed Apr 8, 2021
1 parent 98db538 commit 47ee604
Show file tree
Hide file tree
Showing 36 changed files with 11,357 additions and 3,896 deletions.
9,790 changes: 8,360 additions & 1,430 deletions package-lock.json

Large diffs are not rendered by default.

22 changes: 11 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "colorpicker",
"productName": "colorpicker",
"version": "2.0.4",
"version": "2.0.5",
"description": "Colorpicker is a little Electron app that can show colors with hex/rgb code, and generate shading for your color.",
"main": "src/main.js",
"scripts": {
Expand All @@ -15,7 +15,7 @@
"release-window": "electron-builder --publish=never --config colorpicker-build.json --win nsis portable",
"nightly": "electron-builder --publish=never --config colorpicker-build-nightly.json",
"nightly-linux": "electron-builder --publish=never --config colorpicker-build-nightly.json --linux deb appImage",
"rebuild": "npm rebuild --runtime=electron --target=8.2.1 --disturl=https://atom.io/download/electron --abi=76"
"rebuild": "npm rebuild --runtime=electron --target=9.4.4 --disturl=https://atom.io/download/electron --abi=80"
},
"repository": "https://github.com/toinane/colorpicker",
"keywords": [
Expand All @@ -29,22 +29,22 @@
"crea-that"
],
"dependencies": {
"electron-json-storage": "^4.1.8",
"electron-json-storage": "^4.4.0",
"request": "^2.88.2",
"robotjs": "git+https://github.com/Toinane/robotjs",
"sortablejs": "^1.10.2",
"tippy.js": "^6.1.1"
"sortablejs": "^1.13.0",
"tippy.js": "^6.3.1"
},
"optionalDependencies": {
"iohook": "^0.9.0",
"osx-mouse": "git+https://github.com/Toinane/osx-mouse",
"win-mouse": "git+https://github.com/Toinane/win-mouse",
"iohook": "^0.6.5"
"win-mouse": "git+https://github.com/Toinane/win-mouse"
},
"devDependencies": {
"electron": "8.5.2",
"electron-builder": "22.4.1",
"electron": "9.4.4",
"electron-builder": "22.10.5",
"minimist": "^1.2.5",
"standard": "14.3.3"
"standard": "16.0.3"
},
"author": {
"name": "Toinane",
Expand All @@ -56,7 +56,7 @@
"license": "GPL-3.0",
"iohook": {
"targets": [
"electron-76"
"electron-80"
],
"platforms": [
"linux"
Expand Down
32 changes: 17 additions & 15 deletions src/browsers/colorpicker.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict';
"use strict";

const { BrowserWindow } = require('electron');
const { BrowserWindow, nativeImage } = require("electron");

module.exports = (dirname, storage, util) => {
const { touchbar } = util;
Expand All @@ -12,7 +12,7 @@ module.exports = (dirname, storage, util) => {
* @return {void} [new Colorpicker]
*/
let init = (force, color) => {
const size = storage.get('size');
const size = storage.get("size");
if (win === null || win === undefined || force)
createWindow(size.width, size.height);
else win.show();
Expand All @@ -25,7 +25,7 @@ module.exports = (dirname, storage, util) => {
* @return {void}
*/
let createWindow = (width, height) => {
const pos = storage.get('pos');
const pos = storage.get("pos");
let options = {
frame: false,
autoHideMenuBar: true,
Expand All @@ -34,10 +34,10 @@ module.exports = (dirname, storage, util) => {
minWidth: 440,
minHeight: 150,
transparent: true,
icon: `${dirname}/build/icon.png`,
icon: nativeImage.createFromPath(`${dirname}/build/icon.png`),
webPreferences: {
nodeIntegration: true
}
nodeIntegration: true,
},
};
if (pos) {
options.x = pos.x;
Expand All @@ -49,7 +49,7 @@ module.exports = (dirname, storage, util) => {

if (touchbar) win.setTouchBar(touchbar);

win.on('closed', () => {
win.on("closed", () => {
win = undefined;
let totalWin = BrowserWindow.getAllWindows();
for (let wins of totalWin) wins.close();
Expand All @@ -63,25 +63,27 @@ module.exports = (dirname, storage, util) => {
* @param {BrowserWindow} win [current window]
* @return {void}
*/
let windowEvents = win => {
let windowEvents = (win) => {
let timing;

win.on('focus', event => win.webContents.send('hasLooseFocus', false));
win.on('blur', event => win.webContents.send('hasLooseFocus', true));
win.on("focus", (event) =>
win.webContents.send("hasLooseFocus", false)
);
win.on("blur", (event) => win.webContents.send("hasLooseFocus", true));

win.on('resize', event => {
win.on("resize", (event) => {
const size = win.getBounds();
clearTimeout(timing);
timing = setTimeout(
() =>
storage.add({
size: { width: size.width, height: size.height }
size: { width: size.width, height: size.height },
}),
300
);
});

win.on('move', event => {
win.on("move", (event) => {
const pos = win.getBounds();
clearTimeout(timing);
timing = setTimeout(
Expand All @@ -95,6 +97,6 @@ module.exports = (dirname, storage, util) => {

return {
init: init,
getWindow: getWindow
getWindow: getWindow,
};
};
20 changes: 11 additions & 9 deletions src/browsers/colorsbook.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict';
"use strict";

const { BrowserWindow } = require('electron');
const { BrowserWindow, nativeImage } = require("electron");

module.exports = (dirname, storage) => {
let win;
Expand All @@ -25,26 +25,28 @@ module.exports = (dirname, storage) => {
height: 400,
minHeight: 285,
minWidth: 360,
icon: `${dirname}/build/icon.png`,
icon: nativeImage.createFromPath(`${dirname}/build/icon.png`),
webPreferences: {
nodeIntegration: true
}
nodeIntegration: true,
},
});

win.loadURL(`file://${dirname}/views/colorsbook.html`);

win.on('closed', () => {
win.on("closed", () => {
win = undefined;
});

win.on('focus', event => win.webContents.send('hasLooseFocus', false));
win.on('blur', event => win.webContents.send('hasLooseFocus', true));
win.on("focus", (event) =>
win.webContents.send("hasLooseFocus", false)
);
win.on("blur", (event) => win.webContents.send("hasLooseFocus", true));
};

let getWindow = () => win;

return {
init: init,
getWindow: getWindow
getWindow: getWindow,
};
};
16 changes: 8 additions & 8 deletions src/browsers/index.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
'use strict'
"use strict";

module.exports = (dirname, storage, util) => ({
colorpicker: require('./colorpicker')(dirname, storage, util),
colorsbook: require('./colorsbook')(dirname, storage, util),
picker: require('./picker')(dirname, storage, util),
preview: require('./preview')(dirname, storage, util),
settings: require('./settings')(dirname, storage, util),
support: require('./support')(dirname, storage, util)
})
colorpicker: require("./colorpicker")(dirname, storage, util),
colorsbook: require("./colorsbook")(dirname, storage, util),
picker: require("./picker")(dirname, storage, util),
preview: require("./preview")(dirname, storage, util),
settings: require("./settings")(dirname, storage, util),
support: require("./support")(dirname, storage, util),
});
14 changes: 7 additions & 7 deletions src/browsers/picker.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict';
"use strict";

const { BrowserWindow } = require('electron');
const { BrowserWindow, nativeImage } = require("electron");

module.exports = (dirname, storage) => {
let win;
Expand All @@ -22,14 +22,14 @@ module.exports = (dirname, storage) => {
resizable: false,
focusable: true,
hasShadow: false,
icon: `${dirname}/build/icon.png`,
icon: nativeImage.createFromPath(`${dirname}/build/icon.png`),
webPreferences: {
nodeIntegration: true
}
nodeIntegration: true,
},
});

win.loadURL(`file://${dirname}/views/picker.html`);
win.on('closed', () => {
win.on("closed", () => {
win = undefined;
});
};
Expand All @@ -38,6 +38,6 @@ module.exports = (dirname, storage) => {

return {
init: init,
getWindow: getWindow
getWindow: getWindow,
};
};
14 changes: 7 additions & 7 deletions src/browsers/preview.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict';
"use strict";

const { BrowserWindow } = require('electron');
const { BrowserWindow, nativeImage } = require("electron");

module.exports = (dirname, storage) => {
let win;
Expand All @@ -27,16 +27,16 @@ module.exports = (dirname, storage) => {
height: 300,
resizable: false,
fullscreenable: false,
icon: `${dirname}/build/icon.png`,
icon: nativeImage.createFromPath(`${dirname}/build/icon.png`),
webPreferences: {
nodeIntegration: true
}
nodeIntegration: true,
},
};

win = new BrowserWindow(options);
win.loadURL(`file://${dirname}/views/preview.html`);

win.on('closed', () => {
win.on("closed", () => {
win = undefined;
});
};
Expand All @@ -45,6 +45,6 @@ module.exports = (dirname, storage) => {

return {
init: init,
getWindow: getWindow
getWindow: getWindow,
};
};
14 changes: 7 additions & 7 deletions src/browsers/settings.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict';
"use strict";

const { BrowserWindow } = require('electron');
const { BrowserWindow, nativeImage } = require("electron");

module.exports = (dirname, storage) => {
let win;
Expand Down Expand Up @@ -28,16 +28,16 @@ module.exports = (dirname, storage) => {
minWidth: 460,
minHeight: 340,
fullscreenable: false,
icon: `${dirname}/build/icon.png`,
icon: nativeImage.createFromPath(`${dirname}/build/icon.png`),
webPreferences: {
nodeIntegration: true
}
nodeIntegration: true,
},
};

win = new BrowserWindow(options);
win.loadURL(`file://${dirname}/views/settings.html`);

win.on('closed', () => {
win.on("closed", () => {
win = undefined;
});
};
Expand All @@ -46,6 +46,6 @@ module.exports = (dirname, storage) => {

return {
init: init,
getWindow: getWindow
getWindow: getWindow,
};
};
Loading

0 comments on commit 47ee604

Please sign in to comment.