-
Notifications
You must be signed in to change notification settings - Fork 0
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
0 parents
commit 05ec268
Showing
13 changed files
with
12,143 additions
and
0 deletions.
There are no files selected for viewing
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,12 @@ | ||
# EditorConfig is awesome: https://EditorConfig.org | ||
|
||
# top-most EditorConfig file | ||
root = true | ||
|
||
[*] | ||
indent_style = tab | ||
indent_size = 2 | ||
end_of_line = lf | ||
charset = utf-8 | ||
trim_trailing_whitespace = true | ||
insert_final_newline = true |
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,16 @@ | ||
{ | ||
"env": { | ||
"browser": true, | ||
"commonjs": true, | ||
"es2021": true | ||
}, | ||
"extends": "standard", | ||
"parserOptions": { | ||
"ecmaVersion": 12 | ||
}, | ||
"rules": { | ||
"indent": ["error", "tab"], | ||
"no-tabs": ["error", { "allowIndentationTabs": true }], | ||
"node/no-callback-literal": "off" | ||
} | ||
} |
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 @@ | ||
/dist |
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,21 @@ | ||
The MIT License (MIT) | ||
|
||
Copyright (c) 2021 Mathias Rasmussen | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
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,13 @@ | ||
# ESC Configurator App | ||
|
||
Standalone app for [esc-configurator.com](https://esc-configurator.com/) | ||
|
||
Main repo at [stylesuxx/esc-configurator](https://github.com/stylesuxx/esc-configurator) | ||
|
||
## Note | ||
You can use and install [ESC Configurator](https://esc-configurator.com/) | ||
directly from a supported browser without the need to download anything! | ||
|
||
This app is provided as an alternative and should be used as a last resort. | ||
|
||
Find latest release [here](https://github.com/mathiasvr/esc-configurator-app/releases/latest). |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,7 @@ | ||
module.exports = { | ||
extends: '@commitlint/config-conventional', | ||
rules: { | ||
'subject-case': [2, 'always', 'sentence-case'], | ||
'body-case': [2, 'always', 'sentence-case'] | ||
} | ||
} |
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,86 @@ | ||
const { app, shell, BrowserWindow, Menu } = require('electron') | ||
|
||
app.enableSandbox() | ||
|
||
function createWindow () { | ||
const mainWindow = new BrowserWindow({ | ||
width: 1200, | ||
height: 800, | ||
minWidth: 900, | ||
minHeight: 600 | ||
}) | ||
|
||
mainWindow.loadURL('https://esc-configurator.com/') | ||
|
||
// Prevent navigation in main window | ||
mainWindow.webContents.on('will-navigate', e => { | ||
e.preventDefault() | ||
}) | ||
|
||
// Open links in user browser | ||
mainWindow.webContents.setWindowOpenHandler(({ url }) => { | ||
if (/https?:\/\//i.test(url)) shell.openExternal(url) | ||
return { action: 'deny' } | ||
}) | ||
|
||
mainWindow.webContents.session.on('select-serial-port', (event, ports, _, callback) => { | ||
event.preventDefault() | ||
|
||
if (ports.length === 0) return | ||
|
||
const child = new BrowserWindow({ | ||
parent: mainWindow, | ||
modal: true, | ||
show: false, | ||
resizable: false, | ||
width: 600, | ||
height: 300 | ||
}) | ||
|
||
const portNames = ports.map(p => p.displayName || p.portName) | ||
|
||
child.loadFile('port-modal/modal.html', { query: { data: JSON.stringify(portNames) } }) | ||
|
||
child.once('ready-to-show', () => { | ||
child.show() | ||
}) | ||
|
||
// https://github.com/electron/electron/issues/28215 | ||
// child.once('close', () => { | ||
child.webContents.once('close', () => { | ||
const url = new URL(child.webContents.getURL()) | ||
const index = parseInt(url.hash.slice(1), 10) | ||
const port = ports[index] | ||
callback(port ? port.portId : '') | ||
}) | ||
}) | ||
} | ||
|
||
app.whenReady().then(() => { | ||
createWindow() | ||
|
||
app.on('activate', () => { | ||
if (BrowserWindow.getAllWindows().length === 0) createWindow() | ||
}) | ||
}) | ||
|
||
app.on('window-all-closed', () => { | ||
if (process.platform !== 'darwin') app.quit() | ||
}) | ||
|
||
const menu = Menu.buildFromTemplate([ | ||
{ role: 'appMenu' }, | ||
{ role: 'fileMenu' }, | ||
{ role: 'editMenu' }, | ||
{ role: 'viewMenu' }, | ||
{ role: 'windowMenu' }, | ||
{ | ||
role: 'help', | ||
submenu: [{ | ||
label: 'Learn More', | ||
click: async () => await shell.openExternal('https://github.com/stylesuxx/esc-configurator') | ||
}] | ||
} | ||
]) | ||
|
||
Menu.setApplicationMenu(menu) |
Oops, something went wrong.