From c593b1959d6838f1c225016812bbc9a3c3aa329c 2014-03-01 04:04:22 From: Paul Ivanov Date: 2014-03-01 04:04:22 Subject: [PATCH] pause/play buttons for starting/stopping the tour --- diff --git a/IPython/html/static/notebook/js/tour.js b/IPython/html/static/notebook/js/tour.js index 43667d6..f497362 100644 --- a/IPython/html/static/notebook/js/tour.js +++ b/IPython/html/static/notebook/js/tour.js @@ -34,7 +34,7 @@ var tour_steps = [ content: "Information about the last time this notebook was saved." }, { element: "#menus", - placement: 'bottom', + placement: 'left', title: "Notebook Menubar", content: "The actions that you can perform with this notebook, its cells, and its kernel" }, { @@ -48,7 +48,7 @@ var tour_steps = [ onShow: function(tour) { IPython.notification_area.widget_dict.kernel.set_message("sample notification"); }, onHide: function(tour) { IPython.notification_area.widget_dict.kernel.set_message("sample notification", 100); }, title: "Notification area", - content: "Message in response to user action (Kernel busy, Interrupt, etc)" + content: "Messages in response to user action (Kernel busy, Interrupt, etc)" }, { element: "#modal_indicator", title: "Mode indicator", @@ -99,6 +99,21 @@ var tour_steps = [ } ]; +var tour_style = "
\ +
\ +

+ \

\ +
\ +
\ + \ + \ + \ + +
\ +
" + +var toggle_pause_play = function () { $('#tour-pause').toggleClass('icon-pause icon-play'); } + IPython = (function (IPython) { "use strict"; @@ -117,7 +132,13 @@ IPython = (function (IPython) { 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: toggle_pause_play, + onResume: toggle_pause_play, steps: this.tour_steps, + template: tour_style }); this.tour.init(); };