diff --git a/api/js/jsapi/egw.js b/api/js/jsapi/egw.js index 9936e483fc..2648da4af8 100644 --- a/api/js/jsapi/egw.js +++ b/api/js/jsapi/egw.js @@ -319,35 +319,40 @@ { window.scrollTo(0, 1); } - // 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')) && - (!egw.config('egw_tutorial_disable', 'phpgwapi') || egw.config('egw_tutorial_disable', 'phpgwapi') == 'sidebox')) - { - // we need to wait until common translations are loaded - egw.langRequireApp(window, 'common', function() + try { + // 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')) && + (!egw.config('egw_tutorial_disable', 'phpgwapi') || egw.config('egw_tutorial_disable', 'phpgwapi') == 'sidebox')) { - var buttons = [ - {text:egw.lang("Show now"), id:"show", image: "check", default:"true"}, - {text:egw.lang("Show next login"), id:"later", image: "right"}, - {text:egw.lang("No thanks"), id:"never", image: "cancel"} - ]; - et2_dialog.show_dialog(function (_button_id) + // we need to wait until common translations are loaded + egw.langRequireApp(window, 'common', function() { - if (_button_id == "show" ) + var buttons = [ + {text:egw.lang("Show now"), id:"show", image: "check", default:"true"}, + {text:egw.lang("Show next login"), id:"later", image: "right"}, + {text:egw.lang("No thanks"), id:"never", image: "cancel"} + ]; + et2_dialog.show_dialog(function (_button_id) { - egw.open_link(egw.link('/index.php', 'menuaction=api.EGroupware\\Api\\Framework\\Tutorial.popup&tuid=introduction-'+egw.preference('lang')+'-0-a'),'_blank','960x580'); - } - if(_button_id != "later") - { - egw.set_preference('common', 'egw_tutorial_noautoload',true); - } - }, - egw.lang('We would like to introduce you to EGroupware by showing a short introduction video.'), - egw.lang('Introduction'), - {}, buttons, et2_dialog.QUESTION_MESSAGE, undefined, egw(window)); - }, this); + if (_button_id == "show" ) + { + egw.open_link(egw.link('/index.php', 'menuaction=api.EGroupware\\Api\\Framework\\Tutorial.popup&tuid=introduction-'+egw.preference('lang')+'-0-a'),'_blank','960x580'); + } + if(_button_id != "later") + { + egw.set_preference('common', 'egw_tutorial_noautoload',true); + } + }, + egw.lang('We would like to introduce you to EGroupware by showing a short introduction video.'), + egw.lang('Introduction'), + {}, buttons, et2_dialog.QUESTION_MESSAGE, undefined, egw(window)); + }, this); + } + } + catch(e) { + // ignore SecurityError exception if top is different security context / cross-origin } }); });