// Copyright (c) IPython Development Team. // Distributed under the terms of the Modified BSD License. define([ 'base/js/namespace', 'jquery', 'bootstraptour', ], function(IPython, $, Tour) { "use strict"; var tour_style = "
Enter
or clicking in the input text area of the cell switches to Edit Mode."
}, {
element: '.selected',
title: "Edit Mode",
placement: 'bottom',
onShow: function(tour) { that.edit_mode(); },
content: "Notice that the border around the currently active cell changed color. Typing will insert text into the currently active cell."
}, {
element: '.selected',
title: "Back to Command Mode",
placement: 'bottom',
onShow: function(tour) { notebook.command_mode(); },
onHide: function(tour) { $('#help_menu').parent().children('a').click(); },
content: "Pressing Esc
or clicking outside of the input text area takes you back to Command Mode."
}, {
element: '#keyboard_shortcuts',
title: "Keyboard Shortcuts",
placement: 'bottom',
onHide: function(tour) { $('#help_menu').parent().children('a').click(); },
content: "You can click here to get a list of all of the keyboard shortcuts."
}, {
element: "#kernel_indicator",
title: "Kernel Indicator",
placement: 'bottom',
onShow: function(tour) { events.trigger('status_idle.Kernel');},
content: "This is the Kernel indicator. It looks like this when the Kernel is idle.",
}, {
element: "#kernel_indicator",
title: "Kernel Indicator",
placement: 'bottom',
onShow: function(tour) { events.trigger('status_busy.Kernel'); },
content: "The Kernel indicator looks like this when the Kernel is busy.",
}, {
element: ".icon-stop",
placement: 'bottom',
title: "Interrupting the Kernel",
onHide: function(tour) { events.trigger('status_idle.Kernel'); },
content: "To cancel a computation in progress, you can click here."
}, {
element: "#notification_kernel",
placement: 'bottom',
onShow: function(tour) { $('.icon-stop').click(); },
title: "Notification Area",
content: "Messages in response to user actions (Save, Interrupt, etc) appear here."
}, {
title: "Fin.",
placement: 'bottom',
orphan: true,
content: "This concludes the IPython Notebook User Interface tour.Tour. Happy hacking!",
}
];
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'); },
// TODO: remove the onPause/onResume logic once pi's patch has been
// merged upstream to make this work via data-resume-class and
// data-resume-text attributes.
onPause: this.toggle_pause_play,
onResume: this.toggle_pause_play,
steps: this.tour_steps,
template: tour_style,
orphan: true
});
};
NotebookTour.prototype.start = function () {
console.log("let's start the tour");
this.tour.init();
this.tour.start();
if (this.tour.ended())
{
this.tour.restart();
}
};
NotebookTour.prototype.command_icon_hack = function() {
$('#modal_indicator').css('min-height', 20);
};
NotebookTour.prototype.toggle_pause_play = function () {
$('#tour-pause').toggleClass('icon-pause icon-play');
};
NotebookTour.prototype.edit_mode = function() {
this.notebook.focus_cell();
this.notebook.edit_mode();
};
// For backwards compatability.
IPython.NotebookTour = NotebookTour;
return {'Tour': NotebookTour};
});