External bus and configuration opening for Web UI

This commit is contained in:
Yegor Vialov
2020-02-11 22:55:16 +00:00
parent 01226cb9eb
commit e1ca2638e3
4 changed files with 41 additions and 49 deletions

View File

@ -13,4 +13,23 @@ window.externalApp.getExternalAuth = function(options) {
window[options.callback](true, responseData);
}, 500);
}
};
window.externalApp.externalBus = function(message) {
console.log("External bus message: " + message);
var messageObj = JSON.parse(message);
if (messageObj.type == "config/get") {
var responseData = {
id: messageObj.id,
type: "result",
success: true,
result: {
hasSettingsScreen: true
}
};
setTimeout(function(){
window.externalBus(responseData);
}, 500);
} else if (messageObj.type == "config_screen/show") {
window.location.href = "htcmd://show-settings";
}
};