-
Notifications
You must be signed in to change notification settings - Fork 107
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
26 changed files
with
1,228 additions
and
1,201 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
module.exports = (dirname, sharedObject) => ({ | ||
main: require('./main')(dirname, sharedObject), | ||
about: require('./about')(dirname, sharedObject), | ||
deficiency: require('./deficiency')(dirname, sharedObject), | ||
preferences: require('./preferences')(dirname, sharedObject), | ||
module.exports = (dirname, preferences) => ({ | ||
main: require('./main')(dirname, preferences), | ||
about: require('./about')(dirname), | ||
deficiency: require('./deficiency')(dirname), | ||
preferences: require('./preferences')(dirname), | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
module.exports = (browsers, sharedObject) => ({ | ||
main: require('./main')(browsers, sharedObject), | ||
about: require('./about')(browsers, sharedObject), | ||
deficiency: require('./deficiency')(browsers, sharedObject), | ||
preferences: require('./preferences')(browsers, sharedObject), | ||
module.exports = (browsers, preferences) => ({ | ||
main: require('./main')(browsers, preferences), | ||
about: require('./about')(browsers, preferences), | ||
deficiency: require('./deficiency')(browsers, preferences), | ||
preferences: require('./preferences')(browsers, preferences), | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
// Preferences structure | ||
// main : { | ||
// position : { | ||
// x, | ||
// y, | ||
// }, | ||
// rounding, | ||
// alwaysOnTop, | ||
// lang | ||
// }, | ||
// foreground : { | ||
// format, | ||
// picker : { | ||
// shortcut | ||
// }, | ||
// sliders : { | ||
// open, | ||
// tab | ||
// } | ||
// }, | ||
// background : { | ||
// format, | ||
// picker : { | ||
// shortcut | ||
// }, | ||
// sliders : { | ||
// open, | ||
// tab | ||
// } | ||
// } | ||
|
||
const defaults = { | ||
'main.checkForUpdates': false, | ||
'main.lang': 'auto', | ||
'main.checkForUpdates': false, | ||
'main.rounding': 1, | ||
'main.alwaysOnTop': true, | ||
'main.lang': 'auto', | ||
'foreground.format': 'hex', | ||
'background.format': 'hex', | ||
'foreground.picker.shortcut': 'F11', | ||
'background.picker.shortcut': 'F12', | ||
'foreground.sliders.open': false, | ||
'background.sliders.open': false, | ||
'foreground.sliders.tab': 'rgb', | ||
'background.sliders.tab': 'rgb', | ||
} | ||
|
||
function GlobalStorage(win) { | ||
if (win) { | ||
this.storage = win.localStorage; | ||
} else { | ||
const { localStorage } = require('electron-browser-storage'); | ||
this.storage = localStorage | ||
} | ||
} | ||
|
||
GlobalStorage.prototype = { | ||
get: async function (name) { | ||
let value = await this.storage.getItem(name) | ||
if (value === null && name in defaults) { | ||
value = defaults[name] | ||
} | ||
return value | ||
}, | ||
set: function (name, value) { | ||
this.storage.setItem(name, value) | ||
} | ||
} | ||
|
||
module.exports = GlobalStorage; |
Oops, something went wrong.