-
-
Notifications
You must be signed in to change notification settings - Fork 3
/
tour.min.js
1 lines (1 loc) · 3.5 KB
/
tour.min.js
1
if(window.rcmail){function tour(a){var c=[];if(rcmail.task=="mail"){if(rcmail.env.action==""){if(rcmail.env.tour.welcome==true){c.push({element:"#rcmbtn105",intro:rcmail.gettext("welcome","tour"),position:"bottom-left-aligned"})}if(rcmail.env.tour.support==true){c.push({element:"#supportlink",intro:rcmail.gettext("support","tour"),position:"bottom-left-aligned"})}if(rcmail.env.tour.taskbar==true){c.push({element:"#taskbar",intro:rcmail.gettext("taskbar","tour"),position:"bottom-right-aligned"})}if(rcmail.env.tour.taskbar_buttons){["mail","addressbook","cloud","calendar","files","notes","tasklist","settings"].forEach(function(g,f,e){if(typeof rcmail.env.tour.taskbar_buttons[g]!="undefined"&&rcmail.env.tour.taskbar_buttons[g]==true){c.push({element:"#taskbar .button-"+g,intro:rcmail.gettext("taskbar_"+g,"tour"),position:"bottom-right-aligned"})}})}if(rcmail.env.tour.toolbar==true){c.push({element:"#messagetoolbar",intro:rcmail.gettext("toolbar","tour"),position:"bottom-right-aligned"})}if(rcmail.env.tour.toolbar_buttons){["archive","junk"].forEach(function(g,f,e){if(typeof rcmail.env.tour.toolbar_buttons[g]!="undefined"&&rcmail.env.tour.toolbar_buttons[g]==true){switch(g){case"junk":c.push({element:"#messagetoolbar .button.junk, #messagetoolbar .button.markasjunk2",intro:rcmail.gettext("toolbar_"+g,"tour"),position:"bottom"});break;default:c.push({element:"#messagetoolbar .button."+g,intro:rcmail.gettext("toolbar_"+g,"tour"),position:"bottom"});break}}})}if(rcmail.env.tour.folders==true){c.push({element:(rcmail.env.skin=="classic"?"#mailboxlist-container ul":"#folderlist-content ul"),intro:rcmail.gettext("folders","tour"),position:"right"})}if(rcmail.env.tour.quota==true){c.push({element:(rcmail.env.skin=="classic"?"#quota":"#quotadisplay"),intro:rcmail.gettext("quota","tour"),position:"top"})}if(rcmail.env.tour.messages_view==true){c.push({element:(rcmail.env.layout=="widescreen"?"#listmenulink":".messagelist.fixedcopy #rcmthreads #listmenulink"),intro:rcmail.gettext("messages_view","tour"),position:"bottom"})}if(rcmail.env.tour.messages_threads==true&&rcmail.env.skin!="classic"){c.push({element:"#listcontrols",intro:rcmail.gettext("messages_threads","tour"),position:"top"})}if(rcmail.env.tour.taglist==true){c.push({element:"#taglist",intro:rcmail.gettext("taglist","tour"),position:"bottom-right-aligned"})}}}else{if(rcmail.task=="settings"){if(rcmail.env.action==""){if(rcmail.env.tour.settings){["preferences","folders","identities","responses","pluginmanagesieve","pluginmanagesievevacation","pluginpassword"].forEach(function(g,f,e){if(typeof rcmail.env.tour.settings[g]!="undefined"&&rcmail.env.tour.settings[g]==true){c.push({element:"#settingstab"+g,intro:rcmail.gettext("settings_"+g,"tour"),position:"right"})}})}}}}if(c.length>0){var d=introJs();var b=0;d.setOptions({nextLabel:rcmail.gettext("next","tour"),prevLabel:rcmail.gettext("prev","tour"),skipLabel:rcmail.gettext("skip","tour"),doneLabel:rcmail.gettext("done","tour"),hidePrev:true,hideNext:true,showStepNumbers:false,showBullets:false,disableInteraction:true,exitOnOverlayClick:false,tooltipPosition:"bottom"});d.addSteps(c);if(typeof a=="undefined"||a!=true){d.oncomplete(function(){b=1;rcmail.http_post("plugin.tour_complete",{task:rcmail.task,action:rcmail.env.action,complete:2})});d.onexit(function(){if(typeof b=="undefined"||b==0){rcmail.http_post("plugin.tour_complete",{task:rcmail.task,action:rcmail.env.action,complete:1})}})}d.start()}}rcmail.addEventListener("init",function(a){if(typeof rcmail.env.tour_run!="undefined"&&rcmail.env.tour_run==1){tour()}})};