support for new Swoole push server

This commit is contained in:
Ralf Becker
2019-11-04 09:29:49 +01:00
parent 9fd4ba1577
commit bf844b7598
8 changed files with 102 additions and 12 deletions

View File

@ -382,7 +382,7 @@
// Open tutorial popup with an introduction video about egroupware
if (window.framework === window.top.framework && typeof et2_dialog != 'undefined' &&
!egw.preference('egw_tutorial_noautoload', 'common') &&
!parseInt(document.getElementById('egw_script_id').getAttribute('data-framework-reload')) &&
!parseInt(egw_script.getAttribute('data-framework-reload')) &&
(!egw.config('egw_tutorial_disable', 'phpgwapi') || egw.config('egw_tutorial_disable', 'phpgwapi') == 'sidebox'))
{
// we need to wait until common translations are loaded
@ -409,6 +409,15 @@
{}, buttons, et2_dialog.QUESTION_MESSAGE, undefined, egw(window));
}, this);
}
// open websocket to push server for our top window
if (egw === window.top.egw && egw_script.getAttribute('data-websocket-url'))
{
egw.json('websocket', {}, undefined, this).openWebSocket(
egw_script.getAttribute('data-websocket-url'),
JSON.parse(egw_script.getAttribute('data-websocket-tokens'))
);
}
}
catch(e) {
// ignore SecurityError exception if top is different security context / cross-origin