starting the tour from the menu works now

JavaScript makes me fond of this phrase:

  When there's nothing left to burn, you have to set yourself on fire.
Paul Ivanov 12 years ago
parent d7b569390f
commit 5fead3cdd7

@ -14,7 +14,8 @@
// which make both this file fail at setting marked configuration, and textcell.js
// which search marked into global.
require(['components/marked/lib/marked',
'widgets/js/init'],
'widgets/js/init',
'components/bootstrap-tour/build/js/bootstrap-tour'],
function (marked) {
"use strict";
@ -56,6 +57,7 @@ function (marked) {
IPython.layout_manager = new IPython.LayoutManager();
IPython.pager = new IPython.Pager('div#pager', 'div#pager_splitter');
IPython.quick_help = new IPython.QuickHelp();
IPython.tour = new IPython.NotebookTour();
IPython.login_widget = new IPython.LoginWidget('span#login_widget', opts);
IPython.notebook = new IPython.Notebook('div#notebook', opts);
IPython.keyboard_manager = new IPython.KeyboardManager();

@ -266,6 +266,9 @@ var IPython = (function (IPython) {
IPython.notebook.restart_kernel();
});
// Help
this.element.find('#notebook_tour').click(function () {
IPython.tour.start();
});
this.element.find('#keyboard_shortcuts').click(function () {
IPython.quick_help.show_keyboard_shortcuts();
});

@ -9,7 +9,6 @@
// Tour of IPython Notebok UI (with Bootstrap Tour)
//============================================================================
var step_duration = 5000;
var tour_steps = [
{
element: $("#ipython_notebook").parent(),
@ -93,22 +92,37 @@ var tour_steps = [
}
];
tour_steps[0].content = "This tour will take " + step_duration * tour_steps.length / 1000 + " seconds";
IPython = (function (IPython) {
"use strict";
var tour = new Tour({
//orphan: true,
storage: false, // start tour from beginning every time
//element: $("#ipython_notebook"),
debug: true,
reflex: true, // click on element to continue tour
//backdrop: true, // show dark behind popover
animation: false,
duration: step_duration,
onStart: function() { console.log('tour started'); },
steps: tour_steps,
});
// Initialize the tour
tour.init();
var NotebookTour = function () {
this.step_duration = 5000;
this.tour_steps = tour_steps ;
this.tour_steps[0].content = "This tour will take " + step_duration * tour_steps.length / 1000 + " seconds";
this.tour = new Tour({
//orphan: true,
storage: false, // start tour from beginning every time
//element: $("#ipython_notebook"),
debug: true,
reflex: true, // click on element to continue tour
//backdrop: true, // show dark behind popover
animation: false,
duration: this.step_duration,
onStart: function() { console.log('tour started'); },
steps: this.tour_steps,
});
};
// Start the tour
tour.start();
NotebookTour.prototype.start = function () {
console.log("let's start the tour");
this.tour.init();
this.tour.start();
};
// Set module variables
IPython.NotebookTour = NotebookTour;
return IPython;
}(IPython));

Loading…
Cancel
Save