initial commit
This commit is contained in:
parent
c9092688d6
commit
0a4fe9ee9c
29 changed files with 2686 additions and 2 deletions
BIN
src/com.elgato.template.sdPlugin/actions/template/action.sketch
Normal file
BIN
src/com.elgato.template.sdPlugin/actions/template/action.sketch
Normal file
Binary file not shown.
Binary file not shown.
|
After Width: | Height: | Size: 5.7 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 18 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 521 B |
Binary file not shown.
|
After Width: | Height: | Size: 988 B |
|
|
@ -0,0 +1,64 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta
|
||||
name="viewport"
|
||||
content="width=device-width,initial-scale=1,maximum-scale=1,minimum-scale=1,user-scalable=no,minimal-ui,viewport-fit=cover"
|
||||
/>
|
||||
<meta name="apple-mobile-web-app-capable" content="yes" />
|
||||
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
|
||||
<title>com.elgato.template Property Inspector</title>
|
||||
<link rel="stylesheet" href="../../../libs/css/sdpi.css" />
|
||||
</head>
|
||||
<body>
|
||||
<div class="sdpi-wrapper">
|
||||
<!--TODOZ: add one of each control from pi-samples to test FormUtils & CSS -->
|
||||
<form id="property-inspector">
|
||||
<div class="sdpi-item">
|
||||
<div data-localize class="sdpi-item-label">Name</div>
|
||||
<input
|
||||
class="sdpi-item-value"
|
||||
name="name"
|
||||
type="text"
|
||||
value=""
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div type="textarea" class="sdpi-item">
|
||||
<div class="sdpi-item-label up20" data-localize>
|
||||
Message
|
||||
</div>
|
||||
<div class="sdpi-item-value textarea">
|
||||
<textarea
|
||||
name="message"
|
||||
type="textarea"
|
||||
maxlength="50"
|
||||
class="three-lines"
|
||||
></textarea>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="sdpi-item">
|
||||
<div class="sdpi-item-label" data-localize>Button</div>
|
||||
<button
|
||||
class="sdpi-item-value"
|
||||
value="Click Me"
|
||||
data-localize
|
||||
id="open-external"
|
||||
>
|
||||
Click Me
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<div class="sdpi-info-label hidden" style="top: -1000" value=""></div>
|
||||
<script src="../../../libs/js/utils.js"></script>
|
||||
<script src="../../../libs/js/constants.js"></script>
|
||||
<script src="../../../libs/js/event-handler.js"></script>
|
||||
<script src="../../../libs/js/deck.js"></script>
|
||||
<script src="../../../libs/js/dynamic-styles.js"></script>
|
||||
<script src="inspector.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -0,0 +1,36 @@
|
|||
/// <reference path="../../../libs/js/deck.js" />
|
||||
/// <reference path="../../../libs/js/utils.js" />
|
||||
|
||||
const streamDeck = new StreamDeck();
|
||||
|
||||
streamDeck.onConnected((jsn) => {
|
||||
streamDeck.loadLocalization('../../../');
|
||||
|
||||
const form = document.querySelector('#property-inspector');
|
||||
const { actionInfo, appInfo, connection, messageType, port, uuid } = jsn;
|
||||
const { payload, context } = actionInfo;
|
||||
const { settings } = payload;
|
||||
|
||||
Utils.setFormValue(settings, form);
|
||||
|
||||
form.addEventListener(
|
||||
'input',
|
||||
Utils.debounce(150, () => {
|
||||
const value = Utils.getFormValue(form);
|
||||
streamDeck.sendToPlugin(value, context);
|
||||
streamDeck.setSettings(value);
|
||||
})
|
||||
);
|
||||
});
|
||||
|
||||
/**
|
||||
* Provide window level functions to use in the external window
|
||||
* (this can be removed if the external window is not used)
|
||||
*/
|
||||
window.sendToInspector = (data) => {
|
||||
console.log(data);
|
||||
};
|
||||
|
||||
document.querySelector('#open-external').addEventListener('click', () => {
|
||||
window.open('../../../external.html');
|
||||
});
|
||||
Loading…
Reference in a new issue