##// END OF EJS Templates
Add readonly indicator to notification area.
Jonathan Frederic -
Show More
@@ -1,337 +1,347 b''
1 1 define([
2 2 'base/js/namespace',
3 3 'jquery',
4 4 'base/js/utils',
5 5 'base/js/dialog',
6 6 'base/js/notificationarea',
7 7 'moment'
8 8 ], function(IPython, $, utils, dialog, notificationarea, moment) {
9 9 "use strict";
10 10 var NotificationArea = notificationarea.NotificationArea;
11 11
12 12 var NotebookNotificationArea = function(selector, options) {
13 13 NotificationArea.apply(this, [selector, options]);
14 14 this.save_widget = options.save_widget;
15 15 this.notebook = options.notebook;
16 16 this.keyboard_manager = options.keyboard_manager;
17 17 };
18 18
19 19 NotebookNotificationArea.prototype = Object.create(NotificationArea.prototype);
20 20
21 21 /**
22 22 * Initialize the default set of notification widgets.
23 23 *
24 24 * @method init_notification_widgets
25 25 */
26 26 NotebookNotificationArea.prototype.init_notification_widgets = function () {
27 27 this.init_kernel_notification_widget();
28 28 this.init_notebook_notification_widget();
29 29 };
30 30
31 31 /**
32 32 * Initialize the notification widget for kernel status messages.
33 33 *
34 34 * @method init_kernel_notification_widget
35 35 */
36 36 NotebookNotificationArea.prototype.init_kernel_notification_widget = function () {
37 37 var that = this;
38 38 var knw = this.new_notification_widget('kernel');
39 39 var $kernel_ind_icon = $("#kernel_indicator_icon");
40 40 var $modal_ind_icon = $("#modal_indicator");
41 var $readonly_ind_icon = $('#readonly-indicator');
41 42 var $body = $('body');
42 43
44 // Listen for the notebook loaded event. Set readonly indicator.
45 this.events.on('notebook_loaded.Notebook', function() {
46 if (that.notebook.writable) {
47 $readonly_ind_icon.hide();
48 } else {
49 $readonly_ind_icon.show();
50 }
51 });
52
43 53 // Command/Edit mode
44 54 this.events.on('edit_mode.Notebook', function () {
45 55 that.save_widget.update_document_title();
46 56 $body.addClass('edit_mode');
47 57 $body.removeClass('command_mode');
48 58 $modal_ind_icon.attr('title','Edit Mode');
49 59 });
50 60
51 61 this.events.on('command_mode.Notebook', function () {
52 62 that.save_widget.update_document_title();
53 63 $body.removeClass('edit_mode');
54 64 $body.addClass('command_mode');
55 65 $modal_ind_icon.attr('title','Command Mode');
56 66 });
57 67
58 68 // Implicitly start off in Command mode, switching to Edit mode will trigger event
59 69 $modal_ind_icon.addClass('modal_indicator').attr('title','Command Mode');
60 70 $body.addClass('command_mode');
61 71
62 72 // Kernel events
63 73
64 74 // this can be either kernel_created.Kernel or kernel_created.Session
65 75 this.events.on('kernel_created.Kernel kernel_created.Session', function () {
66 76 knw.info("Kernel Created", 500);
67 77 });
68 78
69 79 this.events.on('kernel_reconnecting.Kernel', function () {
70 80 knw.warning("Connecting to kernel");
71 81 });
72 82
73 83 this.events.on('kernel_connection_dead.Kernel', function (evt, info) {
74 84 knw.danger("Not Connected", undefined, function () {
75 85 // schedule reconnect a short time in the future, don't reconnect immediately
76 86 setTimeout($.proxy(info.kernel.reconnect, info.kernel), 500);
77 87 }, {title: 'click to reconnect'});
78 88 });
79 89
80 90 this.events.on('kernel_connected.Kernel', function () {
81 91 knw.info("Connected", 500);
82 92 });
83 93
84 94 this.events.on('kernel_restarting.Kernel', function () {
85 95 that.save_widget.update_document_title();
86 96 knw.set_message("Restarting kernel", 2000);
87 97 });
88 98
89 99 this.events.on('kernel_autorestarting.Kernel', function (evt, info) {
90 100 // Only show the dialog on the first restart attempt. This
91 101 // number gets tracked by the `Kernel` object and passed
92 102 // along here, because we don't want to show the user 5
93 103 // dialogs saying the same thing (which is the number of
94 104 // times it tries restarting).
95 105 if (info.attempt === 1) {
96 106
97 107 dialog.kernel_modal({
98 108 notebook: that.notebook,
99 109 keyboard_manager: that.keyboard_manager,
100 110 title: "Kernel Restarting",
101 111 body: "The kernel appears to have died. It will restart automatically.",
102 112 buttons: {
103 113 OK : {
104 114 class : "btn-primary"
105 115 }
106 116 }
107 117 });
108 118 }
109 119
110 120 that.save_widget.update_document_title();
111 121 knw.danger("Dead kernel");
112 122 $kernel_ind_icon.attr('class','kernel_dead_icon').attr('title','Kernel Dead');
113 123 });
114 124
115 125 this.events.on('kernel_interrupting.Kernel', function () {
116 126 knw.set_message("Interrupting kernel", 2000);
117 127 });
118 128
119 129 this.events.on('kernel_disconnected.Kernel', function () {
120 130 $kernel_ind_icon
121 131 .attr('class', 'kernel_disconnected_icon')
122 132 .attr('title', 'No Connection to Kernel');
123 133 });
124 134
125 135 this.events.on('kernel_connection_failed.Kernel', function (evt, info) {
126 136 // only show the dialog if this is the first failed
127 137 // connect attempt, because the kernel will continue
128 138 // trying to reconnect and we don't want to spam the user
129 139 // with messages
130 140 if (info.attempt === 1) {
131 141
132 142 var msg = "A connection to the notebook server could not be established." +
133 143 " The notebook will continue trying to reconnect, but" +
134 144 " until it does, you will NOT be able to run code. Check your" +
135 145 " network connection or notebook server configuration.";
136 146
137 147 dialog.kernel_modal({
138 148 title: "Connection failed",
139 149 body: msg,
140 150 keyboard_manager: that.keyboard_manager,
141 151 notebook: that.notebook,
142 152 buttons : {
143 153 "OK": {}
144 154 }
145 155 });
146 156 }
147 157 });
148 158
149 159 this.events.on('kernel_killed.Kernel kernel_killed.Session', function () {
150 160 that.save_widget.update_document_title();
151 161 knw.warning("No kernel");
152 162 $kernel_ind_icon.attr('class','kernel_busy_icon').attr('title','Kernel is not running');
153 163 });
154 164
155 165 this.events.on('kernel_dead.Kernel', function () {
156 166
157 167 var showMsg = function () {
158 168
159 169 var msg = 'The kernel has died, and the automatic restart has failed.' +
160 170 ' It is possible the kernel cannot be restarted.' +
161 171 ' If you are not able to restart the kernel, you will still be able to save' +
162 172 ' the notebook, but running code will no longer work until the notebook' +
163 173 ' is reopened.';
164 174
165 175 dialog.kernel_modal({
166 176 title: "Dead kernel",
167 177 body : msg,
168 178 keyboard_manager: that.keyboard_manager,
169 179 notebook: that.notebook,
170 180 buttons : {
171 181 "Manual Restart": {
172 182 class: "btn-danger",
173 183 click: function () {
174 184 that.notebook.start_session();
175 185 }
176 186 },
177 187 "Don't restart": {}
178 188 }
179 189 });
180 190
181 191 return false;
182 192 };
183 193
184 194 that.save_widget.update_document_title();
185 195 knw.danger("Dead kernel", undefined, showMsg);
186 196 $kernel_ind_icon.attr('class','kernel_dead_icon').attr('title','Kernel Dead');
187 197
188 198 showMsg();
189 199 });
190 200
191 201 this.events.on("no_kernel.Kernel", function (evt, data) {
192 202 $("#kernel_indicator").find('.kernel_indicator_name').text("No Kernel");
193 203 });
194 204
195 205 this.events.on('kernel_dead.Session', function (evt, info) {
196 206 var full = info.xhr.responseJSON.message;
197 207 var short = info.xhr.responseJSON.short_message || 'Kernel error';
198 208 var traceback = info.xhr.responseJSON.traceback;
199 209
200 210 var showMsg = function () {
201 211 var msg = $('<div/>').append($('<p/>').text(full));
202 212 var cm, cm_elem, cm_open;
203 213
204 214 if (traceback) {
205 215 cm_elem = $('<div/>')
206 216 .css('margin-top', '1em')
207 217 .css('padding', '1em')
208 218 .addClass('output_scroll');
209 219 msg.append(cm_elem);
210 220 cm = CodeMirror(cm_elem.get(0), {
211 221 mode: "python",
212 222 readOnly : true
213 223 });
214 224 cm.setValue(traceback);
215 225 cm_open = $.proxy(cm.refresh, cm);
216 226 }
217 227
218 228 dialog.kernel_modal({
219 229 title: "Failed to start the kernel",
220 230 body : msg,
221 231 keyboard_manager: that.keyboard_manager,
222 232 notebook: that.notebook,
223 233 open: cm_open,
224 234 buttons : {
225 235 "Ok": { class: 'btn-primary' }
226 236 }
227 237 });
228 238
229 239 return false;
230 240 };
231 241
232 242 that.save_widget.update_document_title();
233 243 $kernel_ind_icon.attr('class','kernel_dead_icon').attr('title','Kernel Dead');
234 244 knw.danger(short, undefined, showMsg);
235 245 });
236 246
237 247 this.events.on('kernel_starting.Kernel kernel_created.Session', function () {
238 248 window.document.title='(Starting) '+window.document.title;
239 249 $kernel_ind_icon.attr('class','kernel_busy_icon').attr('title','Kernel Busy');
240 250 knw.set_message("Kernel starting, please wait...");
241 251 });
242 252
243 253 this.events.on('kernel_ready.Kernel', function () {
244 254 that.save_widget.update_document_title();
245 255 $kernel_ind_icon.attr('class','kernel_idle_icon').attr('title','Kernel Idle');
246 256 knw.info("Kernel ready", 500);
247 257 });
248 258
249 259 this.events.on('kernel_idle.Kernel', function () {
250 260 that.save_widget.update_document_title();
251 261 $kernel_ind_icon.attr('class','kernel_idle_icon').attr('title','Kernel Idle');
252 262 });
253 263
254 264 this.events.on('kernel_busy.Kernel', function () {
255 265 window.document.title='(Busy) '+window.document.title;
256 266 $kernel_ind_icon.attr('class','kernel_busy_icon').attr('title','Kernel Busy');
257 267 });
258 268
259 269 this.events.on('spec_match_found.Kernel', function (evt, data) {
260 270 that.widget('kernelspec').info("Using kernel: " + data.found.spec.display_name, 3000, undefined, {
261 271 title: "Only candidate for language: " + data.selected.language + " was " + data.found.spec.display_name
262 272 });
263 273 });
264 274
265 275
266 276 // Start the kernel indicator in the busy state, and send a kernel_info request.
267 277 // When the kernel_info reply arrives, the kernel is idle.
268 278 $kernel_ind_icon.attr('class','kernel_busy_icon').attr('title','Kernel Busy');
269 279 };
270 280
271 281 /**
272 282 * Initialize the notification widget for notebook status messages.
273 283 *
274 284 * @method init_notebook_notification_widget
275 285 */
276 286 NotebookNotificationArea.prototype.init_notebook_notification_widget = function () {
277 287 var nnw = this.new_notification_widget('notebook');
278 288
279 289 // Notebook events
280 290 this.events.on('notebook_loading.Notebook', function () {
281 291 nnw.set_message("Loading notebook",500);
282 292 });
283 293 this.events.on('notebook_loaded.Notebook', function () {
284 294 nnw.set_message("Notebook loaded",500);
285 295 });
286 296 this.events.on('notebook_saving.Notebook', function () {
287 297 nnw.set_message("Saving notebook",500);
288 298 });
289 299 this.events.on('notebook_saved.Notebook', function () {
290 300 nnw.set_message("Notebook saved",2000);
291 301 });
292 302 this.events.on('notebook_save_failed.Notebook', function (evt, error) {
293 303 nnw.warning(error.message || "Notebook save failed");
294 304 });
295 305 this.events.on('notebook_copy_failed.Notebook', function (evt, error) {
296 306 nnw.warning(error.message || "Notebook copy failed");
297 307 });
298 308
299 309 // Checkpoint events
300 310 this.events.on('checkpoint_created.Notebook', function (evt, data) {
301 311 var msg = "Checkpoint created";
302 312 if (data.last_modified) {
303 313 var d = new Date(data.last_modified);
304 314 msg = msg + ": " + moment(d).format("HH:mm:ss");
305 315 }
306 316 nnw.set_message(msg, 2000);
307 317 });
308 318 this.events.on('checkpoint_failed.Notebook', function () {
309 319 nnw.warning("Checkpoint failed");
310 320 });
311 321 this.events.on('checkpoint_deleted.Notebook', function () {
312 322 nnw.set_message("Checkpoint deleted", 500);
313 323 });
314 324 this.events.on('checkpoint_delete_failed.Notebook', function () {
315 325 nnw.warning("Checkpoint delete failed");
316 326 });
317 327 this.events.on('checkpoint_restoring.Notebook', function () {
318 328 nnw.set_message("Restoring to checkpoint...", 500);
319 329 });
320 330 this.events.on('checkpoint_restore_failed.Notebook', function () {
321 331 nnw.warning("Checkpoint restore failed");
322 332 });
323 333
324 334 // Autosave events
325 335 this.events.on('autosave_disabled.Notebook', function () {
326 336 nnw.set_message("Autosave disabled", 2000);
327 337 });
328 338 this.events.on('autosave_enabled.Notebook', function (evt, interval) {
329 339 nnw.set_message("Saving every " + interval / 1000 + "s", 1000);
330 340 });
331 341 };
332 342
333 343 // Backwards compatibility.
334 344 IPython.NotificationArea = NotebookNotificationArea;
335 345
336 346 return {'NotebookNotificationArea': NotebookNotificationArea};
337 347 });
@@ -1,61 +1,71 b''
1 1 #notification_area {
2 2 .pull-right();
3 3 z-index: 10;
4 4 }
5 5
6 6 .indicator_area {
7 7 .pull-right();
8 8 color: @navbar-default-link-color;
9 9 margin-left: 5px;
10 10 margin-right: 5px;
11 11 width: 11px;
12 12 z-index: 10;
13 13 text-align: center;
14 14 width: auto;
15 15 }
16 16
17 17 #kernel_indicator {
18 18 .indicator_area();
19 19
20 20 border-left: 1px solid;
21 21
22 22 .kernel_indicator_name {
23 23 padding-left: 5px;
24 24 padding-right: 5px;
25 25 }
26 26 }
27 27
28 28 #modal_indicator {
29 29 .pull-right();
30 30 .indicator_area();
31 31 }
32 32
33 #readonly-indicator {
34 .pull-right();
35 .indicator_area();
36
37 margin-top: 2px;
38 margin-bottom: 0px;
39 margin-left: 0px;
40 margin-right: 0px;
41 }
42
33 43 .modal_indicator:before {
34 44 .fa-fw();
35 45 }
36 46
37 47 .edit_mode .modal_indicator:before {
38 48 .icon(@fa-var-pencil);
39 49 }
40 50
41 51 .command_mode .modal_indicator:before {
42 52 .icon(' ');
43 53 }
44 54
45 55 .kernel_idle_icon:before {
46 56 .icon(@fa-var-circle-o);
47 57 }
48 58
49 59 .kernel_busy_icon:before {
50 60 .icon(@fa-var-circle);
51 61 }
52 62
53 63 .kernel_dead_icon:before {
54 64 .icon(@fa-var-bomb);
55 65 }
56 66
57 67 .kernel_disconnected_icon:before {
58 68 .icon(@fa-var-chain-broken);
59 69 }
60 70
61 71
@@ -1,321 +1,327 b''
1 1 {% extends "page.html" %}
2 2
3 3 {% block stylesheet %}
4 4
5 5 {% if mathjax_url %}
6 6 <script type="text/javascript" src="{{mathjax_url}}?config=TeX-AMS_HTML-full&delayStartupUntil=configured" charset="utf-8"></script>
7 7 {% endif %}
8 8 <script type="text/javascript">
9 9 // MathJax disabled, set as null to distingish from *missing* MathJax,
10 10 // where it will be undefined, and should prompt a dialog later.
11 11 window.mathjax_url = "{{mathjax_url}}";
12 12 </script>
13 13
14 14 <link rel="stylesheet" href="{{ static_url("components/bootstrap-tour/build/css/bootstrap-tour.min.css") }}" type="text/css" />
15 15 <link rel="stylesheet" href="{{ static_url("components/codemirror/lib/codemirror.css") }}">
16 16
17 17 {{super()}}
18 18
19 19 <link rel="stylesheet" href="{{ static_url("notebook/css/override.css") }}" type="text/css" />
20 20 <link rel="stylesheet" href="" id='kernel-css' type="text/css" />
21 21
22 22 {% endblock %}
23 23
24 24 {% block bodyclasses %}notebook_app {{super()}}{% endblock %}
25 25
26 26 {% block params %}
27 27
28 28 data-project="{{project}}"
29 29 data-base-url="{{base_url}}"
30 30 data-ws-url="{{ws_url}}"
31 31 data-notebook-name="{{notebook_name}}"
32 32 data-notebook-path="{{notebook_path}}"
33 33
34 34 {% endblock %}
35 35
36 36
37 37 {% block headercontainer %}
38 38
39 39
40 40 <span id="save_widget" class="pull-left save_widget">
41 41 <span id="notebook_name" class="filename"></span>
42 42 <span class="checkpoint_status"></span>
43 43 <span class="autosave_status"></span>
44 44 </span>
45 45
46 46 <span id="kernel_logo_widget">
47 47 <img class="current_kernel_logo" src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7"/>
48 48 </span>
49 49
50 50 {% endblock headercontainer %}
51 51
52 52 {% block header %}
53 53 <div id="menubar-container" class="container">
54 54 <div id="menubar">
55 55 <div id="menus" class="navbar navbar-default" role="navigation">
56 56 <div class="container-fluid">
57 57 <button type="button" class="btn btn-default navbar-btn navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
58 58 <i class="fa fa-bars"></i>
59 59 <span class="navbar-text">Menu</span>
60 60 </button>
61 61 <p id="kernel_indicator" class="navbar-text indicator_area">
62 62 <span class="kernel_indicator_name">Kernel</span>
63 63 <i id="kernel_indicator_icon"></i>
64 64 </p>
65 <i id="readonly-indicator" class="navbar-text">
66 <span class="fa-stack">
67 <i class="fa fa-save fa-stack-1x"></i>
68 <i class="fa fa-ban fa-stack-2x text-danger"></i>
69 </span>
70 </i>
65 71 <i id="modal_indicator" class="navbar-text"></i>
66 72 <span id="notification_area"></span>
67 73 <div class="navbar-collapse collapse">
68 74 <ul class="nav navbar-nav">
69 75 <li class="dropdown"><a href="#" class="dropdown-toggle" data-toggle="dropdown">File</a>
70 76 <ul id="file_menu" class="dropdown-menu">
71 77 <li id="new_notebook" class="dropdown-submenu">
72 78 <a href="#">New Notebook</a>
73 79 <ul class="dropdown-menu" id="menu-new-notebook-submenu"></ul>
74 80 </li>
75 81 <li id="open_notebook"
76 82 title="Opens a new window with the Dashboard view">
77 83 <a href="#">Open...</a></li>
78 84 <!-- <hr/> -->
79 85 <li class="divider"></li>
80 86 <li id="copy_notebook"
81 87 title="Open a copy of this notebook's contents and start a new kernel">
82 88 <a href="#">Make a Copy...</a></li>
83 89 <li id="rename_notebook"><a href="#">Rename...</a></li>
84 90 <li id="save_checkpoint"><a href="#">Save and Checkpoint</a></li>
85 91 <!-- <hr/> -->
86 92 <li class="divider"></li>
87 93 <li id="restore_checkpoint" class="dropdown-submenu"><a href="#">Revert to Checkpoint</a>
88 94 <ul class="dropdown-menu">
89 95 <li><a href="#"></a></li>
90 96 <li><a href="#"></a></li>
91 97 <li><a href="#"></a></li>
92 98 <li><a href="#"></a></li>
93 99 <li><a href="#"></a></li>
94 100 </ul>
95 101 </li>
96 102 <li class="divider"></li>
97 103 <li id="print_preview"><a href="#">Print Preview</a></li>
98 104 <li class="dropdown-submenu"><a href="#">Download as</a>
99 105 <ul class="dropdown-menu">
100 106 <li id="download_ipynb"><a href="#">IPython Notebook (.ipynb)</a></li>
101 107 <li id="download_script"><a href="#">Script</a></li>
102 108 <li id="download_html"><a href="#">HTML (.html)</a></li>
103 109 <li id="download_rst"><a href="#">reST (.rst)</a></li>
104 110 <li id="download_pdf"><a href="#">PDF (.pdf)</a></li>
105 111 </ul>
106 112 </li>
107 113 <li class="divider"></li>
108 114 <li id="trust_notebook"
109 115 title="Trust the output of this notebook">
110 116 <a href="#" >Trust Notebook</a></li>
111 117 <li class="divider"></li>
112 118 <li id="kill_and_exit"
113 119 title="Shutdown this notebook's kernel, and close this window">
114 120 <a href="#" >Close and halt</a></li>
115 121 </ul>
116 122 </li>
117 123 <li class="dropdown"><a href="#" class="dropdown-toggle" data-toggle="dropdown">Edit</a>
118 124 <ul id="edit_menu" class="dropdown-menu">
119 125 <li id="cut_cell"><a href="#">Cut Cell</a></li>
120 126 <li id="copy_cell"><a href="#">Copy Cell</a></li>
121 127 <li id="paste_cell_above" class="disabled"><a href="#">Paste Cell Above</a></li>
122 128 <li id="paste_cell_below" class="disabled"><a href="#">Paste Cell Below</a></li>
123 129 <li id="paste_cell_replace" class="disabled"><a href="#">Paste Cell &amp; Replace</a></li>
124 130 <li id="delete_cell"><a href="#">Delete Cell</a></li>
125 131 <li id="undelete_cell" class="disabled"><a href="#">Undo Delete Cell</a></li>
126 132 <li class="divider"></li>
127 133 <li id="split_cell"><a href="#">Split Cell</a></li>
128 134 <li id="merge_cell_above"><a href="#">Merge Cell Above</a></li>
129 135 <li id="merge_cell_below"><a href="#">Merge Cell Below</a></li>
130 136 <li class="divider"></li>
131 137 <li id="move_cell_up"><a href="#">Move Cell Up</a></li>
132 138 <li id="move_cell_down"><a href="#">Move Cell Down</a></li>
133 139 <li class="divider"></li>
134 140 <li id="edit_nb_metadata"><a href="#">Edit Notebook Metadata</a></li>
135 141 </ul>
136 142 </li>
137 143 <li class="dropdown"><a href="#" class="dropdown-toggle" data-toggle="dropdown">View</a>
138 144 <ul id="view_menu" class="dropdown-menu">
139 145 <li id="toggle_header"
140 146 title="Show/Hide the IPython Notebook logo and notebook title (above menu bar)">
141 147 <a href="#">Toggle Header</a></li>
142 148 <li id="toggle_toolbar"
143 149 title="Show/Hide the action icons (below menu bar)">
144 150 <a href="#">Toggle Toolbar</a></li>
145 151 </ul>
146 152 </li>
147 153 <li class="dropdown"><a href="#" class="dropdown-toggle" data-toggle="dropdown">Insert</a>
148 154 <ul id="insert_menu" class="dropdown-menu">
149 155 <li id="insert_cell_above"
150 156 title="Insert an empty Code cell above the currently active cell">
151 157 <a href="#">Insert Cell Above</a></li>
152 158 <li id="insert_cell_below"
153 159 title="Insert an empty Code cell below the currently active cell">
154 160 <a href="#">Insert Cell Below</a></li>
155 161 </ul>
156 162 </li>
157 163 <li class="dropdown"><a href="#" class="dropdown-toggle" data-toggle="dropdown">Cell</a>
158 164 <ul id="cell_menu" class="dropdown-menu">
159 165 <li id="run_cell" title="Run this cell, and move cursor to the next one">
160 166 <a href="#">Run</a></li>
161 167 <li id="run_cell_select_below" title="Run this cell, select below">
162 168 <a href="#">Run and Select Below</a></li>
163 169 <li id="run_cell_insert_below" title="Run this cell, insert below">
164 170 <a href="#">Run and Insert Below</a></li>
165 171 <li id="run_all_cells" title="Run all cells in the notebook">
166 172 <a href="#">Run All</a></li>
167 173 <li id="run_all_cells_above" title="Run all cells above (but not including) this cell">
168 174 <a href="#">Run All Above</a></li>
169 175 <li id="run_all_cells_below" title="Run this cell and all cells below it">
170 176 <a href="#">Run All Below</a></li>
171 177 <li class="divider"></li>
172 178 <li id="change_cell_type" class="dropdown-submenu"
173 179 title="All cells in the notebook have a cell type. By default, new cells are created as 'Code' cells">
174 180 <a href="#">Cell Type</a>
175 181 <ul class="dropdown-menu">
176 182 <li id="to_code"
177 183 title="Contents will be sent to the kernel for execution, and output will display in the footer of cell">
178 184 <a href="#">Code</a></li>
179 185 <li id="to_markdown"
180 186 title="Contents will be rendered as HTML and serve as explanatory text">
181 187 <a href="#">Markdown</a></li>
182 188 <li id="to_raw"
183 189 title="Contents will pass through nbconvert unmodified">
184 190 <a href="#">Raw NBConvert</a></li>
185 191 </ul>
186 192 </li>
187 193 <li class="divider"></li>
188 194 <li id="current_outputs" class="dropdown-submenu"><a href="#">Current Output</a>
189 195 <ul class="dropdown-menu">
190 196 <li id="toggle_current_output"
191 197 title="Hide/Show the output of the current cell">
192 198 <a href="#">Toggle</a>
193 199 </li>
194 200 <li id="toggle_current_output_scroll"
195 201 title="Scroll the output of the current cell">
196 202 <a href="#">Toggle Scrolling</a>
197 203 </li>
198 204 <li id="clear_current_output"
199 205 title="Clear the output of the current cell">
200 206 <a href="#">Clear</a>
201 207 </li>
202 208 </ul>
203 209 </li>
204 210 <li id="all_outputs" class="dropdown-submenu"><a href="#">All Output</a>
205 211 <ul class="dropdown-menu">
206 212 <li id="toggle_all_output"
207 213 title="Hide/Show the output of all cells">
208 214 <a href="#">Toggle</a>
209 215 </li>
210 216 <li id="toggle_all_output_scroll"
211 217 title="Scroll the output of all cells">
212 218 <a href="#">Toggle Scrolling</a>
213 219 </li>
214 220 <li id="clear_all_output"
215 221 title="Clear the output of all cells">
216 222 <a href="#">Clear</a>
217 223 </li>
218 224 </ul>
219 225 </li>
220 226 </ul>
221 227 </li>
222 228 <li class="dropdown"><a href="#" class="dropdown-toggle" data-toggle="dropdown">Kernel</a>
223 229 <ul id="kernel_menu" class="dropdown-menu">
224 230 <li id="int_kernel"
225 231 title="Send KeyboardInterrupt (CTRL-C) to the Kernel">
226 232 <a href="#">Interrupt</a>
227 233 </li>
228 234 <li id="restart_kernel"
229 235 title="Restart the Kernel">
230 236 <a href="#">Restart</a>
231 237 </li>
232 238 <li id="reconnect_kernel"
233 239 title="Reconnect to the Kernel">
234 240 <a href="#">Reconnect</a>
235 241 </li>
236 242 <li class="divider"></li>
237 243 <li id="menu-change-kernel" class="dropdown-submenu">
238 244 <a href="#">Change kernel</a>
239 245 <ul class="dropdown-menu" id="menu-change-kernel-submenu"></ul>
240 246 </li>
241 247 </ul>
242 248 </li>
243 249 <li class="dropdown"><a href="#" class="dropdown-toggle" data-toggle="dropdown">Help</a>
244 250 <ul id="help_menu" class="dropdown-menu">
245 251 <li id="notebook_tour" title="A quick tour of the notebook user interface"><a href="#">User Interface Tour</a></li>
246 252 <li id="keyboard_shortcuts" title="Opens a tooltip with all keyboard shortcuts"><a href="#">Keyboard Shortcuts</a></li>
247 253 <li class="divider"></li>
248 254 {% set
249 255 sections = (
250 256 (
251 257 ("http://nbviewer.ipython.org/github/ipython/ipython/blob/3.x/examples/Notebook/Index.ipynb", "Notebook Help", True),
252 258 ("https://help.github.com/articles/markdown-basics/","Markdown",True),
253 259 ),
254 260 )
255 261 %}
256 262
257 263 {% for helplinks in sections %}
258 264 {% for link in helplinks %}
259 265 <li><a href="{{link[0]}}" {{'target="_blank" title="Opens in a new window"' if link[2]}}>
260 266 {{'<i class="fa fa-external-link menu-icon pull-right"></i>' if link[2]}}
261 267 {{link[1]}}
262 268 </a></li>
263 269 {% endfor %}
264 270 {% if not loop.last %}
265 271 <li class="divider"></li>
266 272 {% endif %}
267 273 {% endfor %}
268 274 <li class="divider"></li>
269 275 <li title="About IPython Notebook"><a id="notebook_about" href="#">About</a></li>
270 276 </ul>
271 277 </li>
272 278 </ul>
273 279 </div>
274 280 </div>
275 281 </div>
276 282 </div>
277 283
278 284 <div id="maintoolbar" class="navbar">
279 285 <div class="toolbar-inner navbar-inner navbar-nobg">
280 286 <div id="maintoolbar-container" class="container"></div>
281 287 </div>
282 288 </div>
283 289 </div>
284 290
285 291 <div class="lower-header-bar"></div>
286 292 {% endblock header %}
287 293
288 294 {% block site %}
289 295
290 296 <div id="ipython-main-app">
291 297 <div id="notebook_panel">
292 298 <div id="notebook"></div>
293 299 <div id='tooltip' class='ipython_tooltip' style='display:none'></div>
294 300 </div>
295 301 </div>
296 302
297 303
298 304 {% endblock %}
299 305
300 306 {% block after_site %}
301 307
302 308 <div id="pager">
303 309 <div id="pager-contents">
304 310 <div id="pager-container" class="container"></div>
305 311 </div>
306 312 <div id='pager-button-area'></div>
307 313 </div>
308 314
309 315 {% endblock %}
310 316
311 317 {% block script %}
312 318 {{super()}}
313 319 <script type="text/javascript">
314 320 sys_info = {{sys_info}};
315 321 </script>
316 322
317 323 <script src="{{ static_url("components/text-encoding/lib/encoding.js") }}" charset="utf-8"></script>
318 324
319 325 <script src="{{ static_url("notebook/js/main.js") }}" charset="utf-8"></script>
320 326
321 327 {% endblock %}
General Comments 0
You need to be logged in to leave comments. Login now