From 524c16e5360d6315b3e290017c26bde5119962fc Mon Sep 17 00:00:00 2001 From: Hadi Nategh Date: Tue, 20 Oct 2015 12:51:40 +0000 Subject: [PATCH] Run tutorial intro confirmation dialog only once per framework reload and session together --- phpgwapi/js/framework/fw_base.js | 29 +++++++++++++++++++++++++++++ phpgwapi/js/framework/fw_browser.js | 29 +---------------------------- 2 files changed, 30 insertions(+), 28 deletions(-) diff --git a/phpgwapi/js/framework/fw_base.js b/phpgwapi/js/framework/fw_base.js index b45691bd26..b952d2bdfd 100644 --- a/phpgwapi/js/framework/fw_base.js +++ b/phpgwapi/js/framework/fw_base.js @@ -57,6 +57,35 @@ var fw_base = Class.extend({ // Override the egw_getAppName function window.egw_getAppName = this.egw_getAppName; + + + // Open tutorial popup with an introduction video about egroupware + // the popup can be discarded for the next time show if user + // select "Never" or can select "Later" and the introduction + // dialog will show upon the next session refresh + if (!egw.preference('egw_tutorial_noautoload', 'common') + && !parseInt(document.getElementById('egw_script_id').getAttribute('data-framework-reload'))) + { + var buttons = [ + {text:"Show", id:"show", default:"true"}, + {text:"Later", id:"later"}, + {text:"Never", id:"never"} + ]; + et2_dialog.show_dialog(function (_button_id) + { + if (_button_id == "show" ) + { + egw.open_link(egw.link('/index.php', 'menuaction=home.home_tutorial_ui.popup&tuid=introduction-'+egw.preference('lang')+'-0-a'),'_blank','960x580'); + } + else if(_button_id == "never") + { + 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); + } }, /** diff --git a/phpgwapi/js/framework/fw_browser.js b/phpgwapi/js/framework/fw_browser.js index e92d78cb79..3b1511b580 100644 --- a/phpgwapi/js/framework/fw_browser.js +++ b/phpgwapi/js/framework/fw_browser.js @@ -173,34 +173,7 @@ var fw_browser = Class.extend({ clearTimeout(self.ajaxLoaderDivTimeout); } - // Open tutorial popup with an introduction video about egroupware - // the popup can be discarded for the next time show if user - // select "Never" or can select "Later" and the introduction - // dialog will show upon the next session refresh - if (!egw.preference('egw_tutorial_noautoload', 'common') - && !parseInt(document.getElementById('egw_script_id').getAttribute('data-framework-reload'))) - { - var buttons = [ - {text:"Show", id:"show", default:"true"}, - {text:"Later", id:"later"}, - {text:"Never", id:"never"} - ]; - et2_dialog.show_dialog(function (_button_id) - { - if (_button_id == "show" ) - { - egw.open_link(egw.link('/index.php', 'menuaction=home.home_tutorial_ui.popup&tuid=introduction-'+egw.preference('lang')+'-0-a'),'_blank','960x580'); - } - else if(_button_id == "never") - { - 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); - - } + }); // Check whether the given url is a pseudo url which should be executed