##// END OF EJS Templates
Make tour functional again
Jessica B. Hamrick -
Show More
@@ -1,173 +1,168
1 // Copyright (c) IPython Development Team.
1 // Copyright (c) IPython Development Team.
2 // Distributed under the terms of the Modified BSD License.
2 // Distributed under the terms of the Modified BSD License.
3
3
4 define([
4 define([
5 'base/js/namespace',
5 'base/js/namespace',
6 'jquery',
6 'jquery',
7 'bootstraptour',
7 'bootstraptour',
8 ], function(IPython, $, Tour) {
8 ], function(IPython, $, Tour) {
9 "use strict";
9 "use strict";
10
10
11 var tour_style = "<div class='popover tour'>\n" +
11 var tour_style = "<div class='popover tour'>\n" +
12 "<div class='arrow'></div>\n" +
12 "<div class='arrow'></div>\n" +
13 "<div style='position:absolute; top:7px; right:7px'>\n" +
13 "<div style='position:absolute; top:7px; right:7px'>\n" +
14 "<button class='btn btn-default btn-sm fa fa-times' data-role='end'></button>\n" +
14 "<button class='btn btn-default btn-sm fa fa-times' data-role='end'></button>\n" +
15 "</div><h3 class='popover-title'></h3>\n" +
15 "</div><h3 class='popover-title'></h3>\n" +
16 "<div class='popover-content'></div>\n" +
16 "<div class='popover-content'></div>\n" +
17 "<div class='popover-navigation'>\n" +
17 "<div class='popover-navigation'>\n" +
18 "<button class='btn btn-default fa fa-step-backward' data-role='prev'></button>\n" +
18 "<button class='btn btn-default fa fa-step-backward' data-role='prev'></button>\n" +
19 "<button class='btn btn-default fa fa-step-forward pull-right' data-role='next'></button>\n" +
19 "<button class='btn btn-default fa fa-step-forward pull-right' data-role='next'></button>\n" +
20 "<button id='tour-pause' class='btn btn-sm btn-default fa fa-pause' data-resume-text='' data-pause-text='' data-role='pause-resume'></button>\n" +
20 "<button id='tour-pause' class='btn btn-sm btn-default fa fa-pause' data-resume-text='' data-pause-text='' data-role='pause-resume'></button>\n" +
21 "</div>\n" +
21 "</div>\n" +
22 "</div>";
22 "</div>";
23
23
24 var NotebookTour = function (notebook, events) {
24 var NotebookTour = function (notebook, events) {
25 var that = this;
25 var that = this;
26 this.notebook = notebook;
26 this.notebook = notebook;
27 this.step_duration = 0;
27 this.step_duration = 0;
28 this.events = events;
28 this.events = events;
29 this.tour_steps = [
29 this.tour_steps = [
30 {
30 {
31 title: "Welcome to the Notebook Tour",
31 title: "Welcome to the Notebook Tour",
32 placement: 'bottom',
32 placement: 'bottom',
33 orphan: true,
33 orphan: true,
34 content: "You can use the left and right arrow keys to go backwards and forwards."
34 content: "You can use the left and right arrow keys to go backwards and forwards."
35 }, {
35 }, {
36 element: "#notebook_name",
36 element: "#notebook_name",
37 title: "Filename",
37 title: "Filename",
38 placement: 'bottom',
38 placement: 'bottom',
39 content: "Click here to change the filename for this notebook."
39 content: "Click here to change the filename for this notebook."
40 }, {
40 }, {
41 element: $("#menus").parent(),
41 element: $("#menus").parent(),
42 placement: 'bottom',
42 placement: 'bottom',
43 backdrop: true,
44 title: "Notebook Menubar",
43 title: "Notebook Menubar",
45 content: "The menubar has menus for actions on the notebook, its cells, and the kernel it communicates with."
44 content: "The menubar has menus for actions on the notebook, its cells, and the kernel it communicates with."
46 }, {
45 }, {
47 element: "#maintoolbar",
46 element: "#maintoolbar",
48 placement: 'bottom',
47 placement: 'bottom',
49 backdrop: true,
50 title: "Notebook Toolbar",
48 title: "Notebook Toolbar",
51 content: "The toolbar has buttons for the most common actions. Hover your mouse over each button for more information."
49 content: "The toolbar has buttons for the most common actions. Hover your mouse over each button for more information."
52 }, {
50 }, {
53 element: "#modal_indicator",
51 element: "#modal_indicator",
54 title: "Mode Indicator",
52 title: "Mode Indicator",
55 placement: 'bottom',
53 placement: 'bottom',
56 content: "The Notebook has two modes: Edit Mode and Command Mode. In this area, an indicator can appear to tell you which mode you are in.",
54 content: "The Notebook has two modes: Edit Mode and Command Mode. In this area, an indicator can appear to tell you which mode you are in.",
57 onShow: function(tour) { that.command_icon_hack(); }
55 onShow: function(tour) { that.command_icon_hack(); }
58 }, {
56 }, {
59 element: "#modal_indicator",
57 element: "#modal_indicator",
60 title: "Command Mode",
58 title: "Command Mode",
61 placement: 'bottom',
59 placement: 'bottom',
62 onShow: function(tour) { notebook.command_mode(); that.command_icon_hack(); },
60 onShow: function(tour) { notebook.command_mode(); that.command_icon_hack(); },
63 onNext: function(tour) { that.edit_mode(); },
61 onNext: function(tour) { that.edit_mode(); },
64 content: "Right now you are in Command Mode, and many keyboard shortcuts are available. In this mode, no icon is displayed in the indicator area."
62 content: "Right now you are in Command Mode, and many keyboard shortcuts are available. In this mode, no icon is displayed in the indicator area."
65 }, {
63 }, {
66 element: "#modal_indicator",
64 element: "#modal_indicator",
67 title: "Edit Mode",
65 title: "Edit Mode",
68 placement: 'bottom',
66 placement: 'bottom',
69 onShow: function(tour) { that.edit_mode(); },
67 onShow: function(tour) { that.edit_mode(); },
70 content: "Pressing <code>Enter</code> or clicking in the input text area of the cell switches to Edit Mode."
68 content: "Pressing <code>Enter</code> or clicking in the input text area of the cell switches to Edit Mode."
71 }, {
69 }, {
72 element: '.selected',
70 element: '.selected',
73 title: "Edit Mode",
71 title: "Edit Mode",
74 placement: 'bottom',
72 placement: 'bottom',
75 onShow: function(tour) { that.edit_mode(); },
73 onShow: function(tour) { that.edit_mode(); },
76 content: "Notice that the border around the currently active cell changed color. Typing will insert text into the currently active cell."
74 content: "Notice that the border around the currently active cell changed color. Typing will insert text into the currently active cell."
77 }, {
75 }, {
78 element: '.selected',
76 element: '.selected',
79 title: "Back to Command Mode",
77 title: "Back to Command Mode",
80 placement: 'bottom',
78 placement: 'bottom',
81 onShow: function(tour) { notebook.command_mode(); },
79 onShow: function(tour) { notebook.command_mode(); },
82 onHide: function(tour) { $('#help_menu').parent().children('a').click(); },
80 onHide: function(tour) { $('#help_menu').parent().children('a').click(); },
83 content: "Pressing <code>Esc</code> or clicking outside of the input text area takes you back to Command Mode."
81 content: "Pressing <code>Esc</code> or clicking outside of the input text area takes you back to Command Mode."
84 }, {
82 }, {
85 element: '#keyboard_shortcuts',
83 element: '#keyboard_shortcuts',
86 title: "Keyboard Shortcuts",
84 title: "Keyboard Shortcuts",
87 placement: 'bottom',
85 placement: 'bottom',
88 onHide: function(tour) { $('#help_menu').parent().children('a').click(); },
86 onHide: function(tour) { $('#help_menu').parent().children('a').click(); },
89 content: "You can click here to get a list of all of the keyboard shortcuts."
87 content: "You can click here to get a list of all of the keyboard shortcuts."
90 }, {
88 }, {
91 element: "#kernel_indicator",
89 element: "#kernel_indicator_icon",
92 title: "Kernel Indicator",
90 title: "Kernel Indicator",
93 placement: 'bottom',
91 placement: 'bottom',
94 onShow: function(tour) { events.trigger('kernel_idle.Kernel');},
92 onShow: function(tour) { events.trigger('kernel_idle.Kernel');},
95 content: "This is the Kernel indicator. It looks like this when the Kernel is idle."
93 content: "This is the Kernel indicator. It looks like this when the Kernel is idle."
96 }, {
94 }, {
97 element: "#kernel_indicator",
95 element: "#kernel_indicator_icon",
98 title: "Kernel Indicator",
96 title: "Kernel Indicator",
99 placement: 'bottom',
97 placement: 'bottom',
100 onShow: function(tour) { events.trigger('kernel_busy.Kernel'); },
98 onShow: function(tour) { events.trigger('kernel_busy.Kernel'); },
101 content: "The Kernel indicator looks like this when the Kernel is busy."
99 content: "The Kernel indicator looks like this when the Kernel is busy."
102 }, {
100 }, {
103 element: ".fa-stop",
101 element: ".fa-stop",
104 placement: 'bottom',
102 placement: 'bottom',
105 title: "Interrupting the Kernel",
103 title: "Interrupting the Kernel",
106 onHide: function(tour) { events.trigger('kernel_idle.Kernel'); },
104 onHide: function(tour) { events.trigger('kernel_idle.Kernel'); },
107 content: "To cancel a computation in progress, you can click here."
105 content: "To cancel a computation in progress, you can click here."
108 }, {
106 }, {
109 element: "#notification_kernel",
107 element: "#notification_kernel",
110 placement: 'bottom',
108 placement: 'bottom',
111 onShow: function(tour) { $('.fa-stop').click(); },
109 onShow: function(tour) { $('.fa-stop').click(); },
112 title: "Notification Area",
110 title: "Notification Area",
113 content: "Messages in response to user actions (Save, Interrupt, etc) appear here."
111 content: "Messages in response to user actions (Save, Interrupt, etc) appear here."
114 }, {
112 }, {
115 title: "Fin.",
113 title: "Fin.",
116 placement: 'bottom',
114 placement: 'bottom',
117 orphan: true,
115 orphan: true,
118 content: "This concludes the IPython Notebook User Interface Tour. Happy hacking!"
116 content: "This concludes the IPython Notebook User Interface Tour. Happy hacking!"
119 }
117 }
120 ];
118 ];
121
119
122 this.tour = new Tour({
120 this.tour = new Tour({
123 //orphan: true,
124 storage: false, // start tour from beginning every time
121 storage: false, // start tour from beginning every time
125 //element: $("#ipython_notebook"),
126 debug: true,
122 debug: true,
127 reflex: true, // click on element to continue tour
123 reflex: true, // click on element to continue tour
128 //backdrop: true, // show dark behind popover
129 animation: false,
124 animation: false,
130 duration: this.step_duration,
125 duration: this.step_duration,
131 onStart: function() { console.log('tour started'); },
126 onStart: function() { console.log('tour started'); },
132 // TODO: remove the onPause/onResume logic once pi's patch has been
127 // TODO: remove the onPause/onResume logic once pi's patch has been
133 // merged upstream to make this work via data-resume-class and
128 // merged upstream to make this work via data-resume-class and
134 // data-resume-text attributes.
129 // data-resume-text attributes.
135 onPause: this.toggle_pause_play,
130 onPause: this.toggle_pause_play,
136 onResume: this.toggle_pause_play,
131 onResume: this.toggle_pause_play,
137 steps: this.tour_steps,
132 steps: this.tour_steps,
138 template: tour_style,
133 template: tour_style,
139 orphan: true
134 orphan: true
140 });
135 });
141
136
142 };
137 };
143
138
144 NotebookTour.prototype.start = function () {
139 NotebookTour.prototype.start = function () {
145 console.log("let's start the tour");
140 console.log("let's start the tour");
146 this.tour.init();
141 this.tour.init();
147 this.tour.start();
142 this.tour.start();
148 if (this.tour.ended())
143 if (this.tour.ended())
149 {
144 {
150 this.tour.restart();
145 this.tour.restart();
151 }
146 }
152 };
147 };
153
148
154 NotebookTour.prototype.command_icon_hack = function() {
149 NotebookTour.prototype.command_icon_hack = function() {
155 $('#modal_indicator').css('min-height', 20);
150 $('#modal_indicator').css('min-height', 20);
156 };
151 };
157
152
158 NotebookTour.prototype.toggle_pause_play = function () {
153 NotebookTour.prototype.toggle_pause_play = function () {
159 $('#tour-pause').toggleClass('fa-pause fa-play');
154 $('#tour-pause').toggleClass('fa-pause fa-play');
160 };
155 };
161
156
162 NotebookTour.prototype.edit_mode = function() {
157 NotebookTour.prototype.edit_mode = function() {
163 this.notebook.focus_cell();
158 this.notebook.focus_cell();
164 this.notebook.edit_mode();
159 this.notebook.edit_mode();
165 };
160 };
166
161
167 // For backwards compatability.
162 // For backwards compatability.
168 IPython.NotebookTour = NotebookTour;
163 IPython.NotebookTour = NotebookTour;
169
164
170 return {'Tour': NotebookTour};
165 return {'Tour': NotebookTour};
171
166
172 });
167 });
173
168
@@ -1,320 +1,320
1 {% extends "page.html" %}
1 {% extends "page.html" %}
2
2
3 {% block stylesheet %}
3 {% block stylesheet %}
4
4
5 {% if mathjax_url %}
5 {% if mathjax_url %}
6 <script type="text/javascript" src="{{mathjax_url}}?config=TeX-AMS_HTML-full&delayStartupUntil=configured" charset="utf-8"></script>
6 <script type="text/javascript" src="{{mathjax_url}}?config=TeX-AMS_HTML-full&delayStartupUntil=configured" charset="utf-8"></script>
7 {% endif %}
7 {% endif %}
8 <script type="text/javascript">
8 <script type="text/javascript">
9 // MathJax disabled, set as null to distingish from *missing* MathJax,
9 // MathJax disabled, set as null to distingish from *missing* MathJax,
10 // where it will be undefined, and should prompt a dialog later.
10 // where it will be undefined, and should prompt a dialog later.
11 window.mathjax_url = "{{mathjax_url}}";
11 window.mathjax_url = "{{mathjax_url}}";
12 </script>
12 </script>
13
13
14 <link rel="stylesheet" href="{{ static_url("components/bootstrap-tour/build/css/bootstrap-tour.min.css") }}" type="text/css" />
14 <link rel="stylesheet" href="{{ static_url("components/bootstrap-tour/build/css/bootstrap-tour.min.css") }}" type="text/css" />
15 <link rel="stylesheet" href="{{ static_url("components/codemirror/lib/codemirror.css") }}">
15 <link rel="stylesheet" href="{{ static_url("components/codemirror/lib/codemirror.css") }}">
16
16
17 {{super()}}
17 {{super()}}
18
18
19 <link rel="stylesheet" href="{{ static_url("notebook/css/override.css") }}" type="text/css" />
19 <link rel="stylesheet" href="{{ static_url("notebook/css/override.css") }}" type="text/css" />
20 <link rel="stylesheet" href="" id='kernel-css' type="text/css" />
20 <link rel="stylesheet" href="" id='kernel-css' type="text/css" />
21
21
22 {% endblock %}
22 {% endblock %}
23
23
24 {% block bodyclasses %}notebook_app {{super()}}{% endblock %}
24 {% block bodyclasses %}notebook_app {{super()}}{% endblock %}
25
25
26 {% block params %}
26 {% block params %}
27
27
28 data-project="{{project}}"
28 data-project="{{project}}"
29 data-base-url="{{base_url}}"
29 data-base-url="{{base_url}}"
30 data-ws-url="{{ws_url}}"
30 data-ws-url="{{ws_url}}"
31 data-notebook-name="{{notebook_name}}"
31 data-notebook-name="{{notebook_name}}"
32 data-notebook-path="{{notebook_path}}"
32 data-notebook-path="{{notebook_path}}"
33
33
34 {% endblock %}
34 {% endblock %}
35
35
36
36
37 {% block headercontainer %}
37 {% block headercontainer %}
38
38
39
39
40 <span id="save_widget" class="pull-left save_widget">
40 <span id="save_widget" class="pull-left save_widget">
41 <span class="filename"></span>
41 <span id="notebook_name" class="filename"></span>
42 <span class="checkpoint_status"></span>
42 <span class="checkpoint_status"></span>
43 <span class="autosave_status"></span>
43 <span class="autosave_status"></span>
44 </span>
44 </span>
45
45
46 <span id="kernel_logo_widget">
46 <span id="kernel_logo_widget">
47 <img class="current_kernel_logo" src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7"/>
47 <img class="current_kernel_logo" src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7"/>
48 </span>
48 </span>
49
49
50 {% endblock headercontainer %}
50 {% endblock headercontainer %}
51
51
52 {% block header %}
52 {% block header %}
53 <div id="menubar-container" class="container">
53 <div id="menubar-container" class="container">
54 <div id="menubar">
54 <div id="menubar">
55 <div id="menus" class="navbar navbar-default" role="navigation">
55 <div id="menus" class="navbar navbar-default" role="navigation">
56 <div class="container-fluid">
56 <div class="container-fluid">
57 <button type="button" class="btn btn-default navbar-btn navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
57 <button type="button" class="btn btn-default navbar-btn navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
58 <i class="fa fa-bars"></i>
58 <i class="fa fa-bars"></i>
59 <span class="navbar-text">Menu</span>
59 <span class="navbar-text">Menu</span>
60 </button>
60 </button>
61 <p id="kernel_indicator" class="navbar-text">
61 <p id="kernel_indicator" class="navbar-text">
62 <span class="kernel_indicator_name">Kernel</span>
62 <span class="kernel_indicator_name">Kernel</span>
63 <i id="kernel_indicator_icon"></i>
63 <i id="kernel_indicator_icon"></i>
64 </p>
64 </p>
65 <i id="modal_indicator" class="navbar-text"></i>
65 <i id="modal_indicator" class="navbar-text"></i>
66 <span id="notification_area"></span>
66 <span id="notification_area"></span>
67 <div class="navbar-collapse collapse">
67 <div class="navbar-collapse collapse">
68 <ul class="nav navbar-nav">
68 <ul class="nav navbar-nav">
69 <li class="dropdown"><a href="#" class="dropdown-toggle" data-toggle="dropdown">File</a>
69 <li class="dropdown"><a href="#" class="dropdown-toggle" data-toggle="dropdown">File</a>
70 <ul id="file_menu" class="dropdown-menu">
70 <ul id="file_menu" class="dropdown-menu">
71 <li id="new_notebook" class="dropdown-submenu">
71 <li id="new_notebook" class="dropdown-submenu">
72 <a href="#">New Notebook</a>
72 <a href="#">New Notebook</a>
73 <ul class="dropdown-menu" id="menu-new-notebook-submenu"></ul>
73 <ul class="dropdown-menu" id="menu-new-notebook-submenu"></ul>
74 </li>
74 </li>
75 <li id="open_notebook"
75 <li id="open_notebook"
76 title="Opens a new window with the Dashboard view">
76 title="Opens a new window with the Dashboard view">
77 <a href="#">Open...</a></li>
77 <a href="#">Open...</a></li>
78 <!-- <hr/> -->
78 <!-- <hr/> -->
79 <li class="divider"></li>
79 <li class="divider"></li>
80 <li id="copy_notebook"
80 <li id="copy_notebook"
81 title="Open a copy of this notebook's contents and start a new kernel">
81 title="Open a copy of this notebook's contents and start a new kernel">
82 <a href="#">Make a Copy...</a></li>
82 <a href="#">Make a Copy...</a></li>
83 <li id="rename_notebook"><a href="#">Rename...</a></li>
83 <li id="rename_notebook"><a href="#">Rename...</a></li>
84 <li id="save_checkpoint"><a href="#">Save and Checkpoint</a></li>
84 <li id="save_checkpoint"><a href="#">Save and Checkpoint</a></li>
85 <!-- <hr/> -->
85 <!-- <hr/> -->
86 <li class="divider"></li>
86 <li class="divider"></li>
87 <li id="restore_checkpoint" class="dropdown-submenu"><a href="#">Revert to Checkpoint</a>
87 <li id="restore_checkpoint" class="dropdown-submenu"><a href="#">Revert to Checkpoint</a>
88 <ul class="dropdown-menu">
88 <ul class="dropdown-menu">
89 <li><a href="#"></a></li>
89 <li><a href="#"></a></li>
90 <li><a href="#"></a></li>
90 <li><a href="#"></a></li>
91 <li><a href="#"></a></li>
91 <li><a href="#"></a></li>
92 <li><a href="#"></a></li>
92 <li><a href="#"></a></li>
93 <li><a href="#"></a></li>
93 <li><a href="#"></a></li>
94 </ul>
94 </ul>
95 </li>
95 </li>
96 <li class="divider"></li>
96 <li class="divider"></li>
97 <li id="print_preview"><a href="#">Print Preview</a></li>
97 <li id="print_preview"><a href="#">Print Preview</a></li>
98 <li class="dropdown-submenu"><a href="#">Download as</a>
98 <li class="dropdown-submenu"><a href="#">Download as</a>
99 <ul class="dropdown-menu">
99 <ul class="dropdown-menu">
100 <li id="download_ipynb"><a href="#">IPython Notebook (.ipynb)</a></li>
100 <li id="download_ipynb"><a href="#">IPython Notebook (.ipynb)</a></li>
101 <li id="download_script"><a href="#">Script</a></li>
101 <li id="download_script"><a href="#">Script</a></li>
102 <li id="download_html"><a href="#">HTML (.html)</a></li>
102 <li id="download_html"><a href="#">HTML (.html)</a></li>
103 <li id="download_rst"><a href="#">reST (.rst)</a></li>
103 <li id="download_rst"><a href="#">reST (.rst)</a></li>
104 <li id="download_pdf"><a href="#">PDF (.pdf)</a></li>
104 <li id="download_pdf"><a href="#">PDF (.pdf)</a></li>
105 </ul>
105 </ul>
106 </li>
106 </li>
107 <li class="divider"></li>
107 <li class="divider"></li>
108 <li id="trust_notebook"
108 <li id="trust_notebook"
109 title="Trust the output of this notebook">
109 title="Trust the output of this notebook">
110 <a href="#" >Trust Notebook</a></li>
110 <a href="#" >Trust Notebook</a></li>
111 <li class="divider"></li>
111 <li class="divider"></li>
112 <li id="kill_and_exit"
112 <li id="kill_and_exit"
113 title="Shutdown this notebook's kernel, and close this window">
113 title="Shutdown this notebook's kernel, and close this window">
114 <a href="#" >Close and halt</a></li>
114 <a href="#" >Close and halt</a></li>
115 </ul>
115 </ul>
116 </li>
116 </li>
117 <li class="dropdown"><a href="#" class="dropdown-toggle" data-toggle="dropdown">Edit</a>
117 <li class="dropdown"><a href="#" class="dropdown-toggle" data-toggle="dropdown">Edit</a>
118 <ul id="edit_menu" class="dropdown-menu">
118 <ul id="edit_menu" class="dropdown-menu">
119 <li id="cut_cell"><a href="#">Cut Cell</a></li>
119 <li id="cut_cell"><a href="#">Cut Cell</a></li>
120 <li id="copy_cell"><a href="#">Copy Cell</a></li>
120 <li id="copy_cell"><a href="#">Copy Cell</a></li>
121 <li id="paste_cell_above" class="disabled"><a href="#">Paste Cell Above</a></li>
121 <li id="paste_cell_above" class="disabled"><a href="#">Paste Cell Above</a></li>
122 <li id="paste_cell_below" class="disabled"><a href="#">Paste Cell Below</a></li>
122 <li id="paste_cell_below" class="disabled"><a href="#">Paste Cell Below</a></li>
123 <li id="paste_cell_replace" class="disabled"><a href="#">Paste Cell &amp; Replace</a></li>
123 <li id="paste_cell_replace" class="disabled"><a href="#">Paste Cell &amp; Replace</a></li>
124 <li id="delete_cell"><a href="#">Delete Cell</a></li>
124 <li id="delete_cell"><a href="#">Delete Cell</a></li>
125 <li id="undelete_cell" class="disabled"><a href="#">Undo Delete Cell</a></li>
125 <li id="undelete_cell" class="disabled"><a href="#">Undo Delete Cell</a></li>
126 <li class="divider"></li>
126 <li class="divider"></li>
127 <li id="split_cell"><a href="#">Split Cell</a></li>
127 <li id="split_cell"><a href="#">Split Cell</a></li>
128 <li id="merge_cell_above"><a href="#">Merge Cell Above</a></li>
128 <li id="merge_cell_above"><a href="#">Merge Cell Above</a></li>
129 <li id="merge_cell_below"><a href="#">Merge Cell Below</a></li>
129 <li id="merge_cell_below"><a href="#">Merge Cell Below</a></li>
130 <li class="divider"></li>
130 <li class="divider"></li>
131 <li id="move_cell_up"><a href="#">Move Cell Up</a></li>
131 <li id="move_cell_up"><a href="#">Move Cell Up</a></li>
132 <li id="move_cell_down"><a href="#">Move Cell Down</a></li>
132 <li id="move_cell_down"><a href="#">Move Cell Down</a></li>
133 <li class="divider"></li>
133 <li class="divider"></li>
134 <li id="edit_nb_metadata"><a href="#">Edit Notebook Metadata</a></li>
134 <li id="edit_nb_metadata"><a href="#">Edit Notebook Metadata</a></li>
135 </ul>
135 </ul>
136 </li>
136 </li>
137 <li class="dropdown"><a href="#" class="dropdown-toggle" data-toggle="dropdown">View</a>
137 <li class="dropdown"><a href="#" class="dropdown-toggle" data-toggle="dropdown">View</a>
138 <ul id="view_menu" class="dropdown-menu">
138 <ul id="view_menu" class="dropdown-menu">
139 <li id="toggle_header"
139 <li id="toggle_header"
140 title="Show/Hide the IPython Notebook logo and notebook title (above menu bar)">
140 title="Show/Hide the IPython Notebook logo and notebook title (above menu bar)">
141 <a href="#">Toggle Header</a></li>
141 <a href="#">Toggle Header</a></li>
142 <li id="toggle_toolbar"
142 <li id="toggle_toolbar"
143 title="Show/Hide the action icons (below menu bar)">
143 title="Show/Hide the action icons (below menu bar)">
144 <a href="#">Toggle Toolbar</a></li>
144 <a href="#">Toggle Toolbar</a></li>
145 </ul>
145 </ul>
146 </li>
146 </li>
147 <li class="dropdown"><a href="#" class="dropdown-toggle" data-toggle="dropdown">Insert</a>
147 <li class="dropdown"><a href="#" class="dropdown-toggle" data-toggle="dropdown">Insert</a>
148 <ul id="insert_menu" class="dropdown-menu">
148 <ul id="insert_menu" class="dropdown-menu">
149 <li id="insert_cell_above"
149 <li id="insert_cell_above"
150 title="Insert an empty Code cell above the currently active cell">
150 title="Insert an empty Code cell above the currently active cell">
151 <a href="#">Insert Cell Above</a></li>
151 <a href="#">Insert Cell Above</a></li>
152 <li id="insert_cell_below"
152 <li id="insert_cell_below"
153 title="Insert an empty Code cell below the currently active cell">
153 title="Insert an empty Code cell below the currently active cell">
154 <a href="#">Insert Cell Below</a></li>
154 <a href="#">Insert Cell Below</a></li>
155 </ul>
155 </ul>
156 </li>
156 </li>
157 <li class="dropdown"><a href="#" class="dropdown-toggle" data-toggle="dropdown">Cell</a>
157 <li class="dropdown"><a href="#" class="dropdown-toggle" data-toggle="dropdown">Cell</a>
158 <ul id="cell_menu" class="dropdown-menu">
158 <ul id="cell_menu" class="dropdown-menu">
159 <li id="run_cell" title="Run this cell, and move cursor to the next one">
159 <li id="run_cell" title="Run this cell, and move cursor to the next one">
160 <a href="#">Run</a></li>
160 <a href="#">Run</a></li>
161 <li id="run_cell_select_below" title="Run this cell, select below">
161 <li id="run_cell_select_below" title="Run this cell, select below">
162 <a href="#">Run and Select Below</a></li>
162 <a href="#">Run and Select Below</a></li>
163 <li id="run_cell_insert_below" title="Run this cell, insert below">
163 <li id="run_cell_insert_below" title="Run this cell, insert below">
164 <a href="#">Run and Insert Below</a></li>
164 <a href="#">Run and Insert Below</a></li>
165 <li id="run_all_cells" title="Run all cells in the notebook">
165 <li id="run_all_cells" title="Run all cells in the notebook">
166 <a href="#">Run All</a></li>
166 <a href="#">Run All</a></li>
167 <li id="run_all_cells_above" title="Run all cells above (but not including) this cell">
167 <li id="run_all_cells_above" title="Run all cells above (but not including) this cell">
168 <a href="#">Run All Above</a></li>
168 <a href="#">Run All Above</a></li>
169 <li id="run_all_cells_below" title="Run this cell and all cells below it">
169 <li id="run_all_cells_below" title="Run this cell and all cells below it">
170 <a href="#">Run All Below</a></li>
170 <a href="#">Run All Below</a></li>
171 <li class="divider"></li>
171 <li class="divider"></li>
172 <li id="change_cell_type" class="dropdown-submenu"
172 <li id="change_cell_type" class="dropdown-submenu"
173 title="All cells in the notebook have a cell type. By default, new cells are created as 'Code' cells">
173 title="All cells in the notebook have a cell type. By default, new cells are created as 'Code' cells">
174 <a href="#">Cell Type</a>
174 <a href="#">Cell Type</a>
175 <ul class="dropdown-menu">
175 <ul class="dropdown-menu">
176 <li id="to_code"
176 <li id="to_code"
177 title="Contents will be sent to the kernel for execution, and output will display in the footer of cell">
177 title="Contents will be sent to the kernel for execution, and output will display in the footer of cell">
178 <a href="#">Code</a></li>
178 <a href="#">Code</a></li>
179 <li id="to_markdown"
179 <li id="to_markdown"
180 title="Contents will be rendered as HTML and serve as explanatory text">
180 title="Contents will be rendered as HTML and serve as explanatory text">
181 <a href="#">Markdown</a></li>
181 <a href="#">Markdown</a></li>
182 <li id="to_raw"
182 <li id="to_raw"
183 title="Contents will pass through nbconvert unmodified">
183 title="Contents will pass through nbconvert unmodified">
184 <a href="#">Raw NBConvert</a></li>
184 <a href="#">Raw NBConvert</a></li>
185 </ul>
185 </ul>
186 </li>
186 </li>
187 <li class="divider"></li>
187 <li class="divider"></li>
188 <li id="current_outputs" class="dropdown-submenu"><a href="#">Current Output</a>
188 <li id="current_outputs" class="dropdown-submenu"><a href="#">Current Output</a>
189 <ul class="dropdown-menu">
189 <ul class="dropdown-menu">
190 <li id="toggle_current_output"
190 <li id="toggle_current_output"
191 title="Hide/Show the output of the current cell">
191 title="Hide/Show the output of the current cell">
192 <a href="#">Toggle</a>
192 <a href="#">Toggle</a>
193 </li>
193 </li>
194 <li id="toggle_current_output_scroll"
194 <li id="toggle_current_output_scroll"
195 title="Scroll the output of the current cell">
195 title="Scroll the output of the current cell">
196 <a href="#">Toggle Scrolling</a>
196 <a href="#">Toggle Scrolling</a>
197 </li>
197 </li>
198 <li id="clear_current_output"
198 <li id="clear_current_output"
199 title="Clear the output of the current cell">
199 title="Clear the output of the current cell">
200 <a href="#">Clear</a>
200 <a href="#">Clear</a>
201 </li>
201 </li>
202 </ul>
202 </ul>
203 </li>
203 </li>
204 <li id="all_outputs" class="dropdown-submenu"><a href="#">All Output</a>
204 <li id="all_outputs" class="dropdown-submenu"><a href="#">All Output</a>
205 <ul class="dropdown-menu">
205 <ul class="dropdown-menu">
206 <li id="toggle_all_output"
206 <li id="toggle_all_output"
207 title="Hide/Show the output of all cells">
207 title="Hide/Show the output of all cells">
208 <a href="#">Toggle</a>
208 <a href="#">Toggle</a>
209 </li>
209 </li>
210 <li id="toggle_all_output_scroll"
210 <li id="toggle_all_output_scroll"
211 title="Scroll the output of all cells">
211 title="Scroll the output of all cells">
212 <a href="#">Toggle Scrolling</a>
212 <a href="#">Toggle Scrolling</a>
213 </li>
213 </li>
214 <li id="clear_all_output"
214 <li id="clear_all_output"
215 title="Clear the output of all cells">
215 title="Clear the output of all cells">
216 <a href="#">Clear</a>
216 <a href="#">Clear</a>
217 </li>
217 </li>
218 </ul>
218 </ul>
219 </li>
219 </li>
220 </ul>
220 </ul>
221 </li>
221 </li>
222 <li class="dropdown"><a href="#" class="dropdown-toggle" data-toggle="dropdown">Kernel</a>
222 <li class="dropdown"><a href="#" class="dropdown-toggle" data-toggle="dropdown">Kernel</a>
223 <ul id="kernel_menu" class="dropdown-menu">
223 <ul id="kernel_menu" class="dropdown-menu">
224 <li id="int_kernel"
224 <li id="int_kernel"
225 title="Send KeyboardInterrupt (CTRL-C) to the Kernel">
225 title="Send KeyboardInterrupt (CTRL-C) to the Kernel">
226 <a href="#">Interrupt</a>
226 <a href="#">Interrupt</a>
227 </li>
227 </li>
228 <li id="restart_kernel"
228 <li id="restart_kernel"
229 title="Restart the Kernel">
229 title="Restart the Kernel">
230 <a href="#">Restart</a>
230 <a href="#">Restart</a>
231 </li>
231 </li>
232 <li id="reconnect_kernel"
232 <li id="reconnect_kernel"
233 title="Reconnect to the Kernel">
233 title="Reconnect to the Kernel">
234 <a href="#">Reconnect</a>
234 <a href="#">Reconnect</a>
235 </li>
235 </li>
236 <li class="divider"></li>
236 <li class="divider"></li>
237 <li id="menu-change-kernel" class="dropdown-submenu">
237 <li id="menu-change-kernel" class="dropdown-submenu">
238 <a href="#">Change kernel</a>
238 <a href="#">Change kernel</a>
239 <ul class="dropdown-menu" id="menu-change-kernel-submenu"></ul>
239 <ul class="dropdown-menu" id="menu-change-kernel-submenu"></ul>
240 </li>
240 </li>
241 </ul>
241 </ul>
242 </li>
242 </li>
243 <li class="dropdown"><a href="#" class="dropdown-toggle" data-toggle="dropdown">Help</a>
243 <li class="dropdown"><a href="#" class="dropdown-toggle" data-toggle="dropdown">Help</a>
244 <ul id="help_menu" class="dropdown-menu">
244 <ul id="help_menu" class="dropdown-menu">
245 <li id="notebook_tour" title="A quick tour of the notebook user interface"><a href="#">User Interface Tour</a></li>
245 <li id="notebook_tour" title="A quick tour of the notebook user interface"><a href="#">User Interface Tour</a></li>
246 <li id="keyboard_shortcuts" title="Opens a tooltip with all keyboard shortcuts"><a href="#">Keyboard Shortcuts</a></li>
246 <li id="keyboard_shortcuts" title="Opens a tooltip with all keyboard shortcuts"><a href="#">Keyboard Shortcuts</a></li>
247 <li class="divider"></li>
247 <li class="divider"></li>
248 {% set
248 {% set
249 sections = (
249 sections = (
250 (
250 (
251 ("http://nbviewer.ipython.org/github/ipython/ipython/blob/3.x/examples/Notebook/Index.ipynb", "Notebook Help", True),
251 ("http://nbviewer.ipython.org/github/ipython/ipython/blob/3.x/examples/Notebook/Index.ipynb", "Notebook Help", True),
252 ("https://help.github.com/articles/markdown-basics/","Markdown",True),
252 ("https://help.github.com/articles/markdown-basics/","Markdown",True),
253 ),
253 ),
254 )
254 )
255 %}
255 %}
256
256
257 {% for helplinks in sections %}
257 {% for helplinks in sections %}
258 {% for link in helplinks %}
258 {% for link in helplinks %}
259 <li><a href="{{link[0]}}" {{'target="_blank" title="Opens in a new window"' if link[2]}}>
259 <li><a href="{{link[0]}}" {{'target="_blank" title="Opens in a new window"' if link[2]}}>
260 {{'<i class="fa fa-external-link menu-icon pull-right"></i>' if link[2]}}
260 {{'<i class="fa fa-external-link menu-icon pull-right"></i>' if link[2]}}
261 {{link[1]}}
261 {{link[1]}}
262 </a></li>
262 </a></li>
263 {% endfor %}
263 {% endfor %}
264 {% if not loop.last %}
264 {% if not loop.last %}
265 <li class="divider"></li>
265 <li class="divider"></li>
266 {% endif %}
266 {% endif %}
267 {% endfor %}
267 {% endfor %}
268 <li class="divider"></li>
268 <li class="divider"></li>
269 <li title="About IPython Notebook"><a id="notebook_about" href="#">About</a></li>
269 <li title="About IPython Notebook"><a id="notebook_about" href="#">About</a></li>
270 </ul>
270 </ul>
271 </li>
271 </li>
272 </ul>
272 </ul>
273 </div>
273 </div>
274 </div>
274 </div>
275 </div>
275 </div>
276 </div>
276 </div>
277
277
278 <div id="maintoolbar" class="navbar">
278 <div id="maintoolbar" class="navbar">
279 <div class="toolbar-inner navbar-inner navbar-nobg">
279 <div class="toolbar-inner navbar-inner navbar-nobg">
280 <div id="maintoolbar-container" class="container"></div>
280 <div id="maintoolbar-container" class="container"></div>
281 </div>
281 </div>
282 </div>
282 </div>
283 </div>
283 </div>
284
284
285 <div class="lower-header-bar"></div>
285 <div class="lower-header-bar"></div>
286 {% endblock header %}
286 {% endblock header %}
287
287
288 {% block site %}
288 {% block site %}
289
289
290
290
291 <div id="ipython-main-app">
291 <div id="ipython-main-app">
292 <div id="notebook_panel">
292 <div id="notebook_panel">
293 <div id="notebook"></div>
293 <div id="notebook"></div>
294 </div>
294 </div>
295 </div>
295 </div>
296
296
297 <div id="pager">
297 <div id="pager">
298 <div id="pager-contents">
298 <div id="pager-contents">
299 <div id="pager-container" class="container"></div>
299 <div id="pager-container" class="container"></div>
300 </div>
300 </div>
301 <div id='pager-button-area'></div>
301 <div id='pager-button-area'></div>
302 </div>
302 </div>
303
303
304 <div id='tooltip' class='ipython_tooltip' style='display:none'></div>
304 <div id='tooltip' class='ipython_tooltip' style='display:none'></div>
305
305
306
306
307 {% endblock %}
307 {% endblock %}
308
308
309
309
310 {% block script %}
310 {% block script %}
311 {{super()}}
311 {{super()}}
312 <script type="text/javascript">
312 <script type="text/javascript">
313 sys_info = {{sys_info}};
313 sys_info = {{sys_info}};
314 </script>
314 </script>
315
315
316 <script src="{{ static_url("components/text-encoding/lib/encoding.js") }}" charset="utf-8"></script>
316 <script src="{{ static_url("components/text-encoding/lib/encoding.js") }}" charset="utf-8"></script>
317
317
318 <script src="{{ static_url("notebook/js/main.js") }}" charset="utf-8"></script>
318 <script src="{{ static_url("notebook/js/main.js") }}" charset="utf-8"></script>
319
319
320 {% endblock %}
320 {% endblock %}
General Comments 0
You need to be logged in to leave comments. Login now