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() { var tour = new Tour({ keyboard: false, storage: { getItem: function() { }, setItem: function() { }, removeItem: function() { } }, onEnd: function() { storage.welcomeTour = 'done'; var tooltip = $('.button-markdown-syntax').parent().tooltip({ html: true, container: $('.extension-preview-buttons'), placement: 'bottom', trigger: 'manual', title: 'Need help with Markdown syntax?' }).tooltip('show').addClass('info-tooltip'); tooltip.one('click', function() { tooltip.tooltip('hide').removeClass('info-tooltip'); }); setTimeout(function() { tooltip.tooltip('hide').removeClass('info-tooltip'); }, 15000); }, template: [ '
You are using the new secured platform. If you want to recover your documents from the old platform click here.
', 'Please clickNext
to take a quick tour.'
].join(""),
placement: 'bottom',
},
{
element: '.navbar-inner > .nav .action-create-file, .navbar .right-buttons-dropdown > .nav > .btn:not(:hidden)',
title: 'New document',
content: 'Click the New document
button to create a new document.',
placement: 'left',
reflex: true,
},
{
element: '.document-panel .collapse-button',
title: 'Toggle document',
content: [
'Click the Select document
button to switch to another document.
Ctrl+[
and Ctrl+]
shortcuts to toggle quickly.'
].join(""),
placement: 'left',
reflex: true,
},
{
element: '.menu-panel .collapse-button',
title: 'Menu',
content: [
'Use the menu to synchronize your document on Google Drive
or Dropbox
.
GitHub
, Blogger
...'
].join(""),
placement: 'right',
reflex: true,
},
{
element: '.navbar-inner > .nav .button-synchronize, .navbar .right-buttons-dropdown > .nav > .btn:not(:hidden)',
title: 'Synchronize',
content: 'Once imported or exported, use the Synchronize
button to force the synchronization
Publish
button to update the publication.',
placement: 'left',
reflex: true,
},
{
element: '.navbar-inner',
title: 'Happy StackWriting!',
content: [
'Enjoy, and don\'t forget to rate StackEdit on Chrome Web Store...
', '', ].join(""), placement: 'bottom', onShown: function() { eventMgr.onTweet(); } }, ]); if(!_.has(storage, 'welcomeTour')) { tour.start(); } $('.action-welcome-tour').click(function() { tour.restart(); }); }; return welcomeTour; });