-
Notifications
You must be signed in to change notification settings - Fork 20
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
9 changed files
with
235 additions
and
27 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
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,11 @@ | ||
/* eslint-disable @typescript-eslint/no-require-imports */ | ||
const { contextBridge, ipcRenderer } = require('electron') | ||
|
||
const aboutApi = { | ||
getVersion: async (): Promise<string> => ipcRenderer.invoke('getVersion'), | ||
openShell: async (url: string): Promise<void> => ipcRenderer.invoke('openShell', url), | ||
} | ||
|
||
contextBridge.exposeInMainWorld('aboutApi', aboutApi) | ||
|
||
export type { aboutApi } |
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,123 @@ | ||
<!doctype html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
<link rel="icon" type="image/png" href="/icon.png" /> | ||
<meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-scale=1, user-scalable=yes" /> | ||
<title>About Companion Satellite</title> | ||
|
||
<!-- <link rel="stylesheet" href="/src/App.css" /> --> | ||
<style type="text/css"> | ||
body, | ||
html { | ||
width: 100%; | ||
height: 100%; | ||
-webkit-user-select: none; | ||
user-select: none; | ||
-webkit-app-region: drag; | ||
} | ||
|
||
body { | ||
margin: 0; | ||
display: flex; | ||
flex-direction: column; | ||
justify-content: center; | ||
align-items: center; | ||
color: #ccc; | ||
background-color: rgb(38, 38, 38); | ||
font-size: 12px; | ||
font-family: 'Helvetica', 'Arial', 'ヒラギノ角ゴ Pro W3', 'Hiragino Kaku Gothic Pro', 'メイリオ', Meiryo, | ||
'MS Pゴシック', 'MS PGothic', sans-serif; | ||
} | ||
|
||
.logo { | ||
width: 200px; | ||
-webkit-user-select: none; | ||
user-select: none; | ||
} | ||
|
||
.title, | ||
.copyright, | ||
.description { | ||
margin: 0.2em; | ||
text-align: center; | ||
} | ||
|
||
.clickable { | ||
cursor: pointer; | ||
} | ||
|
||
.description { | ||
margin-bottom: 1em; | ||
text-align: center; | ||
} | ||
|
||
.versions { | ||
border-collapse: collapse; | ||
margin-top: 1em; | ||
} | ||
|
||
.copyright, | ||
.versions { | ||
color: #999; | ||
} | ||
|
||
.buttons { | ||
margin-bottom: 1em; | ||
text-align: center; | ||
} | ||
|
||
.buttons button { | ||
margin-top: 1em; | ||
width: 100px; | ||
height: 24px; | ||
} | ||
|
||
.link { | ||
cursor: pointer; | ||
color: #80a0c2; | ||
} | ||
|
||
.bug-report-link { | ||
position: absolute; | ||
right: 0.5em; | ||
bottom: 0.5em; | ||
} | ||
|
||
.clickable, | ||
.bug-report-link, | ||
.buttons button { | ||
-webkit-app-region: no-drag; | ||
} | ||
</style> | ||
</head> | ||
<body class="dark"> | ||
<!-- Page is based on electron-about-window npm package --> | ||
<div class="logo"> | ||
<img id="app-icon" alt="App icon" height="200" src="/icon.png" /> | ||
</div> | ||
<h2 class="title">Companion Satellite</h2> | ||
<h3 class="description"> | ||
Satellite Streamdeck connector for Bitfocus Companion | ||
<br /> | ||
Supports 2.2.0 and newer | ||
</h3> | ||
<div class="copyright"> | ||
<span id="year">Copyright</span> Julian Waller | ||
<br /> | ||
Distributed under MIT license. | ||
</div> | ||
<table class="versions"></table> | ||
<div class="buttons"></div> | ||
<footer class="footer"> | ||
<div class="link bug-report-link">Report an issue</div> | ||
</footer> | ||
|
||
<!-- https://github.com/electron/electron/issues/2863 --> | ||
<script> | ||
var exports = exports || {} | ||
</script> | ||
|
||
<script src="./src/about.ts"></script> | ||
</body> | ||
</html> |
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,37 @@ | ||
declare const aboutApi: typeof import('../../satellite/dist/aboutPreload.cjs').aboutApi | ||
|
||
const bug_report = document.querySelector('.bug-report-link') as HTMLDivElement | ||
bug_report.addEventListener('click', (e) => { | ||
e.preventDefault() | ||
aboutApi.openShell('https://github.com/bitfocus/companion-satellite/issues').catch((e) => { | ||
console.error('failed to open bug report url', e) | ||
}) | ||
}) | ||
|
||
const open_home = () => { | ||
aboutApi.openShell('https://github.com/bitfocus/companion-satellite').catch((e) => { | ||
console.error('failed to open homepage url', e) | ||
}) | ||
} | ||
|
||
const title_elem = document.querySelector('.title') as HTMLHeadingElement | ||
// title_elem.innerText += ` ${version}` | ||
|
||
title_elem.addEventListener('click', open_home) | ||
title_elem.classList.add('clickable') | ||
const logo_elem = document.querySelector('.logo') as HTMLHeadingElement | ||
logo_elem.addEventListener('click', open_home) | ||
logo_elem.classList.add('clickable') | ||
|
||
const yearElm = document.querySelector('#year') as HTMLSpanElement | ||
yearElm.innerText = new Date().getFullYear().toString() | ||
|
||
aboutApi | ||
.getVersion() | ||
.then((version) => { | ||
console.log('eaa', version) | ||
title_elem.innerText += ` ${version}` | ||
}) | ||
.catch((e) => { | ||
console.error('failed to get version', e) | ||
}) |
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