##// END OF EJS Templates
starting the tour from the menu works now...
Paul Ivanov -
Show More
@@ -14,7 +14,8
14 // which make both this file fail at setting marked configuration, and textcell.js
14 // which make both this file fail at setting marked configuration, and textcell.js
15 // which search marked into global.
15 // which search marked into global.
16 require(['components/marked/lib/marked',
16 require(['components/marked/lib/marked',
17 'widgets/js/init'],
17 'widgets/js/init',
18 'components/bootstrap-tour/build/js/bootstrap-tour'],
18
19
19 function (marked) {
20 function (marked) {
20 "use strict";
21 "use strict";
@@ -56,6 +57,7 function (marked) {
56 IPython.layout_manager = new IPython.LayoutManager();
57 IPython.layout_manager = new IPython.LayoutManager();
57 IPython.pager = new IPython.Pager('div#pager', 'div#pager_splitter');
58 IPython.pager = new IPython.Pager('div#pager', 'div#pager_splitter');
58 IPython.quick_help = new IPython.QuickHelp();
59 IPython.quick_help = new IPython.QuickHelp();
60 IPython.tour = new IPython.NotebookTour();
59 IPython.login_widget = new IPython.LoginWidget('span#login_widget', opts);
61 IPython.login_widget = new IPython.LoginWidget('span#login_widget', opts);
60 IPython.notebook = new IPython.Notebook('div#notebook', opts);
62 IPython.notebook = new IPython.Notebook('div#notebook', opts);
61 IPython.keyboard_manager = new IPython.KeyboardManager();
63 IPython.keyboard_manager = new IPython.KeyboardManager();
@@ -266,6 +266,9 var IPython = (function (IPython) {
266 IPython.notebook.restart_kernel();
266 IPython.notebook.restart_kernel();
267 });
267 });
268 // Help
268 // Help
269 this.element.find('#notebook_tour').click(function () {
270 IPython.tour.start();
271 });
269 this.element.find('#keyboard_shortcuts').click(function () {
272 this.element.find('#keyboard_shortcuts').click(function () {
270 IPython.quick_help.show_keyboard_shortcuts();
273 IPython.quick_help.show_keyboard_shortcuts();
271 });
274 });
@@ -9,7 +9,6
9 // Tour of IPython Notebok UI (with Bootstrap Tour)
9 // Tour of IPython Notebok UI (with Bootstrap Tour)
10 //============================================================================
10 //============================================================================
11
11
12 var step_duration = 5000;
13 var tour_steps = [
12 var tour_steps = [
14 {
13 {
15 element: $("#ipython_notebook").parent(),
14 element: $("#ipython_notebook").parent(),
@@ -93,22 +92,37 var tour_steps = [
93 }
92 }
94 ];
93 ];
95
94
96 tour_steps[0].content = "This tour will take " + step_duration * tour_steps.length / 1000 + " seconds";
95 IPython = (function (IPython) {
96 "use strict";
97
97
98 var tour = new Tour({
98
99 //orphan: true,
99 var NotebookTour = function () {
100 storage: false, // start tour from beginning every time
100 this.step_duration = 5000;
101 //element: $("#ipython_notebook"),
101 this.tour_steps = tour_steps ;
102 debug: true,
102 this.tour_steps[0].content = "This tour will take " + step_duration * tour_steps.length / 1000 + " seconds";
103 reflex: true, // click on element to continue tour
103 this.tour = new Tour({
104 //backdrop: true, // show dark behind popover
104 //orphan: true,
105 animation: false,
105 storage: false, // start tour from beginning every time
106 duration: step_duration,
106 //element: $("#ipython_notebook"),
107 onStart: function() { console.log('tour started'); },
107 debug: true,
108 steps: tour_steps,
108 reflex: true, // click on element to continue tour
109 });
109 //backdrop: true, // show dark behind popover
110 // Initialize the tour
110 animation: false,
111 tour.init();
111 duration: this.step_duration,
112 onStart: function() { console.log('tour started'); },
113 steps: this.tour_steps,
114 });
115 };
112
116
113 // Start the tour
117 NotebookTour.prototype.start = function () {
114 tour.start();
118 console.log("let's start the tour");
119 this.tour.init();
120 this.tour.start();
121 };
122
123 // Set module variables
124 IPython.NotebookTour = NotebookTour;
125
126 return IPython;
127
128 }(IPython));
General Comments 0
You need to be logged in to leave comments. Login now