platypush/platypush/backend/http/static/js/assistant.google.js
Fabio Manganiello 02e951bd57 - Added hidden plugins configuration for plugins that shouldn't be shown
on the web panel as tabs

- Added support for popup notifications on the web panel

- Added voice assistant interactive notifications to the web panel

- Added new playing music notifications to the web panel
2018-04-17 23:10:49 +02:00

36 lines
931 B
JavaScript

$(document).ready(function() {
var onEvent = function(event) {
switch (event.args.type) {
case 'platypush.message.event.assistant.ConversationStartEvent':
createNotification({
'text': 'Assistant listening',
'icon': 'microphone',
});
break;
case 'platypush.message.event.assistant.SpeechRecognizedEvent':
createNotification({
'title': 'Speech recognized',
'text': event.args.phrase,
'icon': 'microphone',
});
break;
case 'platypush.message.event.assistant.ConversationEndEvent':
break;
}
};
var initEvents = function() {
window.registerEventListener(onEvent);
};
var init = function() {
initEvents();
};
init();
});