Files
ESP3D-WEBUI/extensions_samples/capabilities.html
Luc d9ad884d48 Merge 3.0 refactoring
## What's Changed
* Complete refactoring using spectre.css and correct Preact API per @alexblog suggestion
* Smaller footprint
* Add support for extensions/pluggins
* Add theme support by using external css
* Remove banner as unnecessary
* Remove information bar and put information to separate page and respective panel
* Add audio and haptic feedback
* Add Repetier / ESP3DLib V2 / Smoothieware / GRBL support
* Split code for 3DPrinter / CNC / Sand Table

## Limitations
* CNC / Sand Table specific UI is still not defined
* Wizard is not implemented yet
* Works with ESP3D 3.0- alpha-2 - no backward compatibility
* Language packs are not ready to be translated yet as UI is not finished

## Discussion / status
[Discussion](https://github.com/luc-github/ESP3D-WEBUI/discussions/94)

## New Contributors
@alexblog made several contributions like https://github.com/luc-github/ESP3D-WEBUI/pull/236
2022-06-01 15:31:57 +08:00

31 lines
957 B
HTML

<script type="text/javascript">
function sendMessage(msg){
window.parent.postMessage(msg, '*');
}
function processMessage(eventMsg){
if (eventMsg.data.type && (!eventMsg.data.id||eventMsg.data.id=="infopanel")){
if (eventMsg.data.type=="capabilities"){
const line = eventMsg.data.content
const resultPanel = document.getElementById("output");
resultPanel.innerHTML = resultPanel.innerHTML + "<br>"+ JSON.stringify(line.response, " ", "<br>")+"</span><br><hr />";
}
}
}
window.onload = (event) => {
window.addEventListener("message", processMessage, false);
}
</script>
<div class="container">
<button class="btn m-1" onclick="sendMessage({type:'capabilities', target:'webui', id:'infopanel',});">Capabilities</button>
<div class="container m-2" id="output">
</div>
</div>