define([ 'underscore', 'jquery', 'storage', 'utils', 'classes/Extension', 'bootstrap-tour' ], function(_, $, storage, utils, 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.parent().addClass('info-tooltip-container'); tooltip.one('click', function() { tooltip.tooltip('hide').removeClass('info-tooltip').parent().removeClass('info-tooltip-container'); }); setTimeout(function() { tooltip.tooltip('hide').removeClass('info-tooltip').parent().removeClass('info-tooltip-container'); }, 30000); } var tour = new Tour({ keyboard: false, storage: { getItem: function() { }, setItem: function() { }, removeItem: function() { } }, onEnd: function() { // storage.welcomeTour = 'done'; // infoTooltip('.drag-me', 'Drag me!', 'left'); // infoTooltip('.layout-toggler-preview', 'Toggle preview', 'right'); }, template: [ '
', '
', '

', '
', ' ', '
' ].join("") }); tour.addSteps([ { element: '.navbar-inner', title: 'StackEdit 4 is deprecated', content: [ '

StackEdit 5 is now ready for production!

', '

If you want to migrate, click here to export a backup of your files.

', '

To import the backup in StackEdit 5, go to Menu > More > Import workspace backup.

', '

Click here to open StackEdit 5 now!

', 'You can always click OK to continue with StackEdit 4.' ].join(""), placement: 'bottom', onShown: function() { $(".action-export-docs-tour").click(function() { utils.saveAs(JSON.stringify(storage), "StackEdit local storage.json"); }); } }, ]); tour.start(); $('.action-welcome-tour').click(function() { tour.restart(); }); }; return welcomeTour; });