##// END OF EJS Templates
pause/play buttons for starting/stopping the tour
Paul Ivanov -
Show More
@@ -34,7 +34,7 var tour_steps = [
34 34 content: "Information about the last time this notebook was saved."
35 35 }, {
36 36 element: "#menus",
37 placement: 'bottom',
37 placement: 'left',
38 38 title: "Notebook Menubar",
39 39 content: "The actions that you can perform with this notebook, its cells, and its kernel"
40 40 }, {
@@ -48,7 +48,7 var tour_steps = [
48 48 onShow: function(tour) { IPython.notification_area.widget_dict.kernel.set_message("sample notification"); },
49 49 onHide: function(tour) { IPython.notification_area.widget_dict.kernel.set_message("sample notification", 100); },
50 50 title: "Notification area",
51 content: "Message in response to user action (Kernel busy, Interrupt, etc)"
51 content: "Messages in response to user action (Kernel busy, Interrupt, etc)"
52 52 }, {
53 53 element: "#modal_indicator",
54 54 title: "Mode indicator",
@@ -99,6 +99,21 var tour_steps = [
99 99 }
100 100 ];
101 101
102 var tour_style = "<div class='popover tour'>\
103 <div class='arrow'></div>\
104 <h3 class='popover-title'>
105 <button class='btn btn-default' data-role='end'>End tour</button>\</h3>\
106 <div class='popover-content'></div>\
107 <div class='popover-navigation'>\
108 <button class='btn btn-default icon-step-backward' data-role='prev'></button>\
109 <button class='btn btn-default icon-step-forward' data-role='next'></button>\
110 <button id='tour-pause' class='btn btn-sm btn-default icon-pause' data-resume-text='' data-pause-text='' data-role='pause-resume'></button>\
111
112 </div>\
113 </div>"
114
115 var toggle_pause_play = function () { $('#tour-pause').toggleClass('icon-pause icon-play'); }
116
102 117 IPython = (function (IPython) {
103 118 "use strict";
104 119
@@ -117,7 +132,13 IPython = (function (IPython) {
117 132 animation: false,
118 133 duration: this.step_duration,
119 134 onStart: function() { console.log('tour started'); },
135 // TODO: remove the onPause/onResume logic once pi's patch has been
136 // merged upstream to make this work via data-resume-class and
137 // data-resume-text attributes.
138 onPause: toggle_pause_play,
139 onResume: toggle_pause_play,
120 140 steps: this.tour_steps,
141 template: tour_style
121 142 });
122 143 this.tour.init();
123 144 };
General Comments 0
You need to be logged in to leave comments. Login now