removed static event handler
This commit is contained in:
parent
0a4fe9ee9c
commit
c2bfece006
8 changed files with 79 additions and 75 deletions
|
|
@ -57,7 +57,7 @@
|
|||
<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/stream-deck.js"></script>
|
||||
<script src="../../../libs/js/dynamic-styles.js"></script>
|
||||
<script src="inspector.js"></script>
|
||||
</body>
|
||||
|
|
|
|||
|
|
@ -1,26 +1,24 @@
|
|||
/// <reference path="../../../libs/js/deck.js" />
|
||||
/// <reference path="../../../libs/js/stream-deck.js" />
|
||||
/// <reference path="../../../libs/js/utils.js" />
|
||||
|
||||
const streamDeck = new StreamDeck();
|
||||
StreamDeck.onConnected((jsn) => {
|
||||
StreamDeck.loadLocalization('../../../');
|
||||
|
||||
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;
|
||||
|
||||
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);
|
||||
|
||||
Utils.setFormValue(settings, form);
|
||||
|
||||
form.addEventListener(
|
||||
'input',
|
||||
Utils.debounce(150, () => {
|
||||
const value = Utils.getFormValue(form);
|
||||
streamDeck.sendToPlugin(value, context);
|
||||
streamDeck.setSettings(value);
|
||||
})
|
||||
);
|
||||
form.addEventListener(
|
||||
'input',
|
||||
Utils.debounce(150, () => {
|
||||
const value = Utils.getFormValue(form);
|
||||
StreamDeck.sendToPlugin(value, context);
|
||||
StreamDeck.setSettings(value);
|
||||
})
|
||||
);
|
||||
});
|
||||
|
||||
/**
|
||||
|
|
@ -28,9 +26,9 @@ streamDeck.onConnected((jsn) => {
|
|||
* (this can be removed if the external window is not used)
|
||||
*/
|
||||
window.sendToInspector = (data) => {
|
||||
console.log(data);
|
||||
console.log(data);
|
||||
};
|
||||
|
||||
document.querySelector('#open-external').addEventListener('click', () => {
|
||||
window.open('../../../external.html');
|
||||
window.open('../../../external.html');
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in a new issue