define([ 'underscore', 'jquery', 'storage', 'classes/Extension', 'bootstrap-tour' ], function(_, $, storage, Extension, Tour) { var welcomeTour = new Extension('welcomeTour', 'Welcome tour', false, true); var eventMgr; welcomeTour.onEventMgrCreated = function(eventMgrParam) { eventMgr = eventMgrParam; }; welcomeTour.onReady = function() { function infoTooltip(btnSelector, title, placement) { var tooltip = $(btnSelector).tooltip({ html: true, //container: $('.extension-preview-buttons'), placement: placement, trigger: 'manual', title: title }).tooltip('show').addClass('info-tooltip'); tooltip.one('click', function() { tooltip.tooltip('hide').removeClass('info-tooltip'); }); setTimeout(function() { tooltip.tooltip('hide').removeClass('info-tooltip'); }, 20000); } var tour = new Tour({ keyboard: false, storage: { getItem: function() { }, setItem: function() { }, removeItem: function() { } }, onEnd: function() { storage.welcomeTour = 'done'; infoTooltip('.menu-panel .toggle-button *', 'Synchronize, publish and more...', 'right'); infoTooltip('.document-panel .toggle-button *', 'Create and manage documents', 'left'); infoTooltip('.extension-preview-buttons .btn-group:first', 'Need help with Markdown syntax?', 'left'); infoTooltip('.layout-toggler-preview', 'Toggle preview', 'right'); }, template: [ '
What\'s new?
', 'Please provide your feedback here and declare issues on GitHub... Thanks!
', '', ].join(""), placement: 'bottom', onShown: function() { eventMgr.onTweet(); } }, ]); if(!_.has(storage, 'welcomeTour')) { tour.start(); } $('.action-welcome-tour').click(function() { tour.restart(); }); }; return welcomeTour; });