add example callback func

This commit is contained in:
Hassan DRAGA 2021-07-04 22:18:42 -04:00 committed by GitHub
parent 3c586b7c0b
commit e34986cbf5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -78,21 +78,28 @@
</div>
</body>
<!-- WebUI Core -->
<script type="text/javascript">
document.addEventListener('DOMContentLoaded', function(event) {
if (typeof _webui_ws === 'undefined'){
let webui_searchParams = new URLSearchParams(window.location.search);
if(webui_searchParams.has('webui')){
let webui_url = webui_searchParams.get('webui');
var webui_elem = document.createElement("script");
webui_elem.type = "text/javascript";
webui_elem.src = webui_url;
document.getElementsByTagName('head')[0].appendChild(webui_elem);
}
else alert('Failed to get the WebUI Core link.');
}
})
</script>
<!-- WebUI Core ---------------------------------------------------->
<script type="text/javascript">
document.addEventListener("DOMContentLoaded", function (event) {
if (typeof _webui_ws === "undefined") {
let webui_searchParams = new URLSearchParams(window.location.search);
if (webui_searchParams.has("webui")) {
let webui_url = webui_searchParams.get("webui");
var webui_elem = document.createElement("script");
webui_elem.async = true;
webui_elem.type = "text/javascript";
webui_elem.src = webui_url;
document.body.appendChild(webui_elem);
} else alert("Failed to get the WebUI Core link.");
}
});
// Callbacks
function webui_ready() {
// WebUI is ready
webui_debug(false);
}
</script>
<!-- ------------------------------------------------------------ -->
</html>