Show More
@@ -1,72 +1,80 b'' | |||||
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 | 'base/js/utils', |
|
7 | 'base/js/utils', | |
8 | ], function(IPython, $, utils) { |
|
8 | ], function(IPython, $, utils) { | |
9 | "use strict"; |
|
9 | "use strict"; | |
10 |
|
10 | |||
11 | var KernelSelector = function(selector, notebook) { |
|
11 | var KernelSelector = function(selector, notebook) { | |
12 | this.selector = selector; |
|
12 | this.selector = selector; | |
13 | this.notebook = notebook; |
|
13 | this.notebook = notebook; | |
14 | this.events = notebook.events; |
|
14 | this.events = notebook.events; | |
15 | this.current_selection = notebook.default_kernel_name; |
|
15 | this.current_selection = notebook.default_kernel_name; | |
16 | this.kernelspecs = {}; |
|
16 | this.kernelspecs = {}; | |
17 | if (this.selector !== undefined) { |
|
17 | if (this.selector !== undefined) { | |
18 | this.element = $(selector); |
|
18 | this.element = $(selector); | |
19 | this.request_kernelspecs(); |
|
19 | this.request_kernelspecs(); | |
20 | } |
|
20 | } | |
21 | this.bind_events(); |
|
21 | this.bind_events(); | |
22 | }; |
|
22 | }; | |
23 |
|
23 | |||
24 | KernelSelector.prototype.request_kernelspecs = function() { |
|
24 | KernelSelector.prototype.request_kernelspecs = function() { | |
25 | var url = utils.url_join_encode(this.notebook.base_url, 'api/kernelspecs'); |
|
25 | var url = utils.url_join_encode(this.notebook.base_url, 'api/kernelspecs'); | |
26 | $.ajax(url, {success: $.proxy(this.got_kernelspecs, this)}); |
|
26 | $.ajax(url, {success: $.proxy(this.got_kernelspecs, this)}); | |
27 | }; |
|
27 | }; | |
28 |
|
28 | |||
29 | KernelSelector.prototype.got_kernelspecs = function(data, status, xhr) { |
|
29 | KernelSelector.prototype.got_kernelspecs = function(data, status, xhr) { | |
30 | this.kernelspecs = {}; |
|
30 | this.kernelspecs = {}; | |
31 | var menu = this.element.find("#kernel_selector"); |
|
31 | var menu = this.element.find("#kernel_selector"); | |
|
32 | var change_kernel_submenu = $("#menu-change-kernel-submenu"); | |||
|
33 | console.log(change_kernel_submenu); | |||
32 | for (var i = 0; i < data.length; i++) { |
|
34 | for (var i = 0; i < data.length; i++) { | |
33 | var ks = data[i]; |
|
35 | var ks = data[i]; | |
34 | this.kernelspecs[ks.name] = ks; |
|
36 | this.kernelspecs[ks.name] = ks; | |
35 | var ksentry = $("<li>").attr("id", "kernel-" +ks.name).append($('<a>') |
|
37 | var ksentry = $("<li>").attr("id", "kernel-" +ks.name).append($('<a>') | |
36 | .attr('href', '#') |
|
38 | .attr('href', '#') | |
37 | .click($.proxy(this.change_kernel, this, ks.name)) |
|
39 | .click($.proxy(this.change_kernel, this, ks.name)) | |
38 | .text(ks.display_name)); |
|
40 | .text(ks.display_name)); | |
39 | menu.append(ksentry); |
|
41 | menu.append(ksentry); | |
|
42 | ||||
|
43 | var ks_submenu_entry = $("<li>").attr("id", "kernel-submenu-"+ks.name).append($('<a>') | |||
|
44 | .attr('href', '#') | |||
|
45 | .click($.proxy(this.change_kernel, this, ks.name)) | |||
|
46 | .text(ks.display_name)); | |||
|
47 | change_kernel_submenu.append(ks_submenu_entry); | |||
40 | } |
|
48 | } | |
41 | }; |
|
49 | }; | |
42 |
|
50 | |||
43 | KernelSelector.prototype.change_kernel = function(kernel_name) { |
|
51 | KernelSelector.prototype.change_kernel = function(kernel_name) { | |
44 | if (kernel_name === this.current_selection) { |
|
52 | if (kernel_name === this.current_selection) { | |
45 | return; |
|
53 | return; | |
46 | } |
|
54 | } | |
47 | var ks = this.kernelspecs[kernel_name]; |
|
55 | var ks = this.kernelspecs[kernel_name]; | |
48 | this.events.trigger('spec_changed.Kernel', ks); |
|
56 | this.events.trigger('spec_changed.Kernel', ks); | |
49 | this.notebook.session.delete(); |
|
57 | this.notebook.session.delete(); | |
50 | this.notebook.start_session(kernel_name); |
|
58 | this.notebook.start_session(kernel_name); | |
51 | }; |
|
59 | }; | |
52 |
|
60 | |||
53 | KernelSelector.prototype.bind_events = function() { |
|
61 | KernelSelector.prototype.bind_events = function() { | |
54 | var that = this; |
|
62 | var that = this; | |
55 | this.events.on('spec_changed.Kernel', function(event, data) { |
|
63 | this.events.on('spec_changed.Kernel', function(event, data) { | |
56 | that.current_selection = data.name; |
|
64 | that.current_selection = data.name; | |
57 | that.element.find("#current_kernel_spec").find('.kernel_name').text(data.display_name); |
|
65 | that.element.find("#current_kernel_spec").find('.kernel_name').text(data.display_name); | |
58 | }); |
|
66 | }); | |
59 |
|
67 | |||
60 | this.events.on('started.Session', function(events, session) { |
|
68 | this.events.on('started.Session', function(events, session) { | |
61 | if (session.kernel_name !== that.current_selection) { |
|
69 | if (session.kernel_name !== that.current_selection) { | |
62 | // If we created a 'python' session, we only know if it's Python |
|
70 | // If we created a 'python' session, we only know if it's Python | |
63 | // 3 or 2 on the server's reply, so we fire the event again to |
|
71 | // 3 or 2 on the server's reply, so we fire the event again to | |
64 | // set things up. |
|
72 | // set things up. | |
65 | var ks = that.kernelspecs[session.kernel_name]; |
|
73 | var ks = that.kernelspecs[session.kernel_name]; | |
66 | that.events.trigger('spec_changed.Kernel', ks); |
|
74 | that.events.trigger('spec_changed.Kernel', ks); | |
67 | } |
|
75 | } | |
68 | }); |
|
76 | }); | |
69 | }; |
|
77 | }; | |
70 |
|
78 | |||
71 | return {'KernelSelector': KernelSelector}; |
|
79 | return {'KernelSelector': KernelSelector}; | |
72 | }); |
|
80 | }); |
@@ -1,331 +1,336 b'' | |||||
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 |
|
20 | |||
21 | {% endblock %} |
|
21 | {% endblock %} | |
22 |
|
22 | |||
23 | {% block params %} |
|
23 | {% block params %} | |
24 |
|
24 | |||
25 | data-project="{{project}}" |
|
25 | data-project="{{project}}" | |
26 | data-base-url="{{base_url}}" |
|
26 | data-base-url="{{base_url}}" | |
27 | data-ws-url="{{ws_url}}" |
|
27 | data-ws-url="{{ws_url}}" | |
28 | data-notebook-name="{{notebook_name}}" |
|
28 | data-notebook-name="{{notebook_name}}" | |
29 | data-notebook-path="{{notebook_path}}" |
|
29 | data-notebook-path="{{notebook_path}}" | |
30 | class="notebook_app" |
|
30 | class="notebook_app" | |
31 |
|
31 | |||
32 | {% endblock %} |
|
32 | {% endblock %} | |
33 |
|
33 | |||
34 |
|
34 | |||
35 | {% block header %} |
|
35 | {% block header %} | |
36 |
|
36 | |||
37 |
|
37 | |||
38 | <span id="save_widget" class="nav pull-left"> |
|
38 | <span id="save_widget" class="nav pull-left"> | |
39 | <span id="notebook_name"></span> |
|
39 | <span id="notebook_name"></span> | |
40 | <span id="checkpoint_status"></span> |
|
40 | <span id="checkpoint_status"></span> | |
41 | <span id="autosave_status"></span> |
|
41 | <span id="autosave_status"></span> | |
42 | </span> |
|
42 | </span> | |
43 |
|
43 | |||
44 | <span id="kernel_selector_widget" class="pull-right dropdown"> |
|
44 | <span id="kernel_selector_widget" class="pull-right dropdown"> | |
45 | <button href="#" class="dropdown-toggle" data-toggle="dropdown" type='button' id="current_kernel_spec"> |
|
45 | <button href="#" class="dropdown-toggle" data-toggle="dropdown" type='button' id="current_kernel_spec"> | |
46 | <span class='kernel_name'>Python</span> |
|
46 | <span class='kernel_name'>Python</span> | |
47 | <span class="caret"></span> |
|
47 | <span class="caret"></span> | |
48 | </button> |
|
48 | </button> | |
49 | <ul id="kernel_selector" class="dropdown-menu"> |
|
49 | <ul id="kernel_selector" class="dropdown-menu"> | |
50 | </ul> |
|
50 | </ul> | |
51 | </span> |
|
51 | </span> | |
52 |
|
52 | |||
53 | {% endblock %} |
|
53 | {% endblock %} | |
54 |
|
54 | |||
55 |
|
55 | |||
56 | {% block site %} |
|
56 | {% block site %} | |
57 |
|
57 | |||
58 | <div id="menubar-container" class="container"> |
|
58 | <div id="menubar-container" class="container"> | |
59 | <div id="menubar"> |
|
59 | <div id="menubar"> | |
60 | <div id="menus" class="navbar navbar-default" role="navigation"> |
|
60 | <div id="menus" class="navbar navbar-default" role="navigation"> | |
61 | <div class="container-fluid"> |
|
61 | <div class="container-fluid"> | |
62 | <ul class="nav navbar-nav"> |
|
62 | <ul class="nav navbar-nav"> | |
63 | <li class="dropdown"><a href="#" class="dropdown-toggle" data-toggle="dropdown">File</a> |
|
63 | <li class="dropdown"><a href="#" class="dropdown-toggle" data-toggle="dropdown">File</a> | |
64 | <ul id="file_menu" class="dropdown-menu"> |
|
64 | <ul id="file_menu" class="dropdown-menu"> | |
65 | <li id="new_notebook" |
|
65 | <li id="new_notebook" | |
66 | title="Make a new notebook (Opens a new window)"> |
|
66 | title="Make a new notebook (Opens a new window)"> | |
67 | <a href="#">New</a></li> |
|
67 | <a href="#">New</a></li> | |
68 | <li id="open_notebook" |
|
68 | <li id="open_notebook" | |
69 | title="Opens a new window with the Dashboard view"> |
|
69 | title="Opens a new window with the Dashboard view"> | |
70 | <a href="#">Open...</a></li> |
|
70 | <a href="#">Open...</a></li> | |
71 | <!-- <hr/> --> |
|
71 | <!-- <hr/> --> | |
72 | <li class="divider"></li> |
|
72 | <li class="divider"></li> | |
73 | <li id="copy_notebook" |
|
73 | <li id="copy_notebook" | |
74 | title="Open a copy of this notebook's contents and start a new kernel"> |
|
74 | title="Open a copy of this notebook's contents and start a new kernel"> | |
75 | <a href="#">Make a Copy...</a></li> |
|
75 | <a href="#">Make a Copy...</a></li> | |
76 | <li id="rename_notebook"><a href="#">Rename...</a></li> |
|
76 | <li id="rename_notebook"><a href="#">Rename...</a></li> | |
77 | <li id="save_checkpoint"><a href="#">Save and Checkpoint</a></li> |
|
77 | <li id="save_checkpoint"><a href="#">Save and Checkpoint</a></li> | |
78 | <!-- <hr/> --> |
|
78 | <!-- <hr/> --> | |
79 | <li class="divider"></li> |
|
79 | <li class="divider"></li> | |
80 | <li id="restore_checkpoint" class="dropdown-submenu"><a href="#">Revert to Checkpoint</a> |
|
80 | <li id="restore_checkpoint" class="dropdown-submenu"><a href="#">Revert to Checkpoint</a> | |
81 | <ul class="dropdown-menu"> |
|
81 | <ul class="dropdown-menu"> | |
82 | <li><a href="#"></a></li> |
|
82 | <li><a href="#"></a></li> | |
83 | <li><a href="#"></a></li> |
|
83 | <li><a href="#"></a></li> | |
84 | <li><a href="#"></a></li> |
|
84 | <li><a href="#"></a></li> | |
85 | <li><a href="#"></a></li> |
|
85 | <li><a href="#"></a></li> | |
86 | <li><a href="#"></a></li> |
|
86 | <li><a href="#"></a></li> | |
87 | </ul> |
|
87 | </ul> | |
88 | </li> |
|
88 | </li> | |
89 | <li class="divider"></li> |
|
89 | <li class="divider"></li> | |
90 | <li id="print_preview"><a href="#">Print Preview</a></li> |
|
90 | <li id="print_preview"><a href="#">Print Preview</a></li> | |
91 | <li class="dropdown-submenu"><a href="#">Download as</a> |
|
91 | <li class="dropdown-submenu"><a href="#">Download as</a> | |
92 | <ul class="dropdown-menu"> |
|
92 | <ul class="dropdown-menu"> | |
93 | <li id="download_ipynb"><a href="#">IPython Notebook (.ipynb)</a></li> |
|
93 | <li id="download_ipynb"><a href="#">IPython Notebook (.ipynb)</a></li> | |
94 | <li id="download_py"><a href="#">Python (.py)</a></li> |
|
94 | <li id="download_py"><a href="#">Python (.py)</a></li> | |
95 | <li id="download_html"><a href="#">HTML (.html)</a></li> |
|
95 | <li id="download_html"><a href="#">HTML (.html)</a></li> | |
96 | <li id="download_rst"><a href="#">reST (.rst)</a></li> |
|
96 | <li id="download_rst"><a href="#">reST (.rst)</a></li> | |
97 | <li id="download_pdf"><a href="#">PDF (.pdf)</a></li> |
|
97 | <li id="download_pdf"><a href="#">PDF (.pdf)</a></li> | |
98 | </ul> |
|
98 | </ul> | |
99 | </li> |
|
99 | </li> | |
100 | <li class="divider"></li> |
|
100 | <li class="divider"></li> | |
101 | <li id="trust_notebook" |
|
101 | <li id="trust_notebook" | |
102 | title="Trust the output of this notebook"> |
|
102 | title="Trust the output of this notebook"> | |
103 | <a href="#" >Trust Notebook</a></li> |
|
103 | <a href="#" >Trust Notebook</a></li> | |
104 | <li class="divider"></li> |
|
104 | <li class="divider"></li> | |
105 | <li id="kill_and_exit" |
|
105 | <li id="kill_and_exit" | |
106 | title="Shutdown this notebook's kernel, and close this window"> |
|
106 | title="Shutdown this notebook's kernel, and close this window"> | |
107 | <a href="#" >Close and halt</a></li> |
|
107 | <a href="#" >Close and halt</a></li> | |
108 | </ul> |
|
108 | </ul> | |
109 | </li> |
|
109 | </li> | |
110 | <li class="dropdown"><a href="#" class="dropdown-toggle" data-toggle="dropdown">Edit</a> |
|
110 | <li class="dropdown"><a href="#" class="dropdown-toggle" data-toggle="dropdown">Edit</a> | |
111 | <ul id="edit_menu" class="dropdown-menu"> |
|
111 | <ul id="edit_menu" class="dropdown-menu"> | |
112 | <li id="cut_cell"><a href="#">Cut Cell</a></li> |
|
112 | <li id="cut_cell"><a href="#">Cut Cell</a></li> | |
113 | <li id="copy_cell"><a href="#">Copy Cell</a></li> |
|
113 | <li id="copy_cell"><a href="#">Copy Cell</a></li> | |
114 | <li id="paste_cell_above" class="disabled"><a href="#">Paste Cell Above</a></li> |
|
114 | <li id="paste_cell_above" class="disabled"><a href="#">Paste Cell Above</a></li> | |
115 | <li id="paste_cell_below" class="disabled"><a href="#">Paste Cell Below</a></li> |
|
115 | <li id="paste_cell_below" class="disabled"><a href="#">Paste Cell Below</a></li> | |
116 | <li id="paste_cell_replace" class="disabled"><a href="#">Paste Cell & Replace</a></li> |
|
116 | <li id="paste_cell_replace" class="disabled"><a href="#">Paste Cell & Replace</a></li> | |
117 | <li id="delete_cell"><a href="#">Delete Cell</a></li> |
|
117 | <li id="delete_cell"><a href="#">Delete Cell</a></li> | |
118 | <li id="undelete_cell" class="disabled"><a href="#">Undo Delete Cell</a></li> |
|
118 | <li id="undelete_cell" class="disabled"><a href="#">Undo Delete Cell</a></li> | |
119 | <li class="divider"></li> |
|
119 | <li class="divider"></li> | |
120 | <li id="split_cell"><a href="#">Split Cell</a></li> |
|
120 | <li id="split_cell"><a href="#">Split Cell</a></li> | |
121 | <li id="merge_cell_above"><a href="#">Merge Cell Above</a></li> |
|
121 | <li id="merge_cell_above"><a href="#">Merge Cell Above</a></li> | |
122 | <li id="merge_cell_below"><a href="#">Merge Cell Below</a></li> |
|
122 | <li id="merge_cell_below"><a href="#">Merge Cell Below</a></li> | |
123 | <li class="divider"></li> |
|
123 | <li class="divider"></li> | |
124 | <li id="move_cell_up"><a href="#">Move Cell Up</a></li> |
|
124 | <li id="move_cell_up"><a href="#">Move Cell Up</a></li> | |
125 | <li id="move_cell_down"><a href="#">Move Cell Down</a></li> |
|
125 | <li id="move_cell_down"><a href="#">Move Cell Down</a></li> | |
126 | <li class="divider"></li> |
|
126 | <li class="divider"></li> | |
127 | <li id="edit_nb_metadata"><a href="#">Edit Notebook Metadata</a></li> |
|
127 | <li id="edit_nb_metadata"><a href="#">Edit Notebook Metadata</a></li> | |
128 | </ul> |
|
128 | </ul> | |
129 | </li> |
|
129 | </li> | |
130 | <li class="dropdown"><a href="#" class="dropdown-toggle" data-toggle="dropdown">View</a> |
|
130 | <li class="dropdown"><a href="#" class="dropdown-toggle" data-toggle="dropdown">View</a> | |
131 | <ul id="view_menu" class="dropdown-menu"> |
|
131 | <ul id="view_menu" class="dropdown-menu"> | |
132 | <li id="toggle_header" |
|
132 | <li id="toggle_header" | |
133 | title="Show/Hide the IPython Notebook logo and notebook title (above menu bar)"> |
|
133 | title="Show/Hide the IPython Notebook logo and notebook title (above menu bar)"> | |
134 | <a href="#">Toggle Header</a></li> |
|
134 | <a href="#">Toggle Header</a></li> | |
135 | <li id="toggle_toolbar" |
|
135 | <li id="toggle_toolbar" | |
136 | title="Show/Hide the action icons (below menu bar)"> |
|
136 | title="Show/Hide the action icons (below menu bar)"> | |
137 | <a href="#">Toggle Toolbar</a></li> |
|
137 | <a href="#">Toggle Toolbar</a></li> | |
138 | </ul> |
|
138 | </ul> | |
139 | </li> |
|
139 | </li> | |
140 | <li class="dropdown"><a href="#" class="dropdown-toggle" data-toggle="dropdown">Insert</a> |
|
140 | <li class="dropdown"><a href="#" class="dropdown-toggle" data-toggle="dropdown">Insert</a> | |
141 | <ul id="insert_menu" class="dropdown-menu"> |
|
141 | <ul id="insert_menu" class="dropdown-menu"> | |
142 | <li id="insert_cell_above" |
|
142 | <li id="insert_cell_above" | |
143 | title="Insert an empty Code cell above the currently active cell"> |
|
143 | title="Insert an empty Code cell above the currently active cell"> | |
144 | <a href="#">Insert Cell Above</a></li> |
|
144 | <a href="#">Insert Cell Above</a></li> | |
145 | <li id="insert_cell_below" |
|
145 | <li id="insert_cell_below" | |
146 | title="Insert an empty Code cell below the currently active cell"> |
|
146 | title="Insert an empty Code cell below the currently active cell"> | |
147 | <a href="#">Insert Cell Below</a></li> |
|
147 | <a href="#">Insert Cell Below</a></li> | |
148 | </ul> |
|
148 | </ul> | |
149 | </li> |
|
149 | </li> | |
150 | <li class="dropdown"><a href="#" class="dropdown-toggle" data-toggle="dropdown">Cell</a> |
|
150 | <li class="dropdown"><a href="#" class="dropdown-toggle" data-toggle="dropdown">Cell</a> | |
151 | <ul id="cell_menu" class="dropdown-menu"> |
|
151 | <ul id="cell_menu" class="dropdown-menu"> | |
152 | <li id="run_cell" title="Run this cell, and move cursor to the next one"> |
|
152 | <li id="run_cell" title="Run this cell, and move cursor to the next one"> | |
153 | <a href="#">Run</a></li> |
|
153 | <a href="#">Run</a></li> | |
154 | <li id="run_cell_select_below" title="Run this cell, select below"> |
|
154 | <li id="run_cell_select_below" title="Run this cell, select below"> | |
155 | <a href="#">Run and Select Below</a></li> |
|
155 | <a href="#">Run and Select Below</a></li> | |
156 | <li id="run_cell_insert_below" title="Run this cell, insert below"> |
|
156 | <li id="run_cell_insert_below" title="Run this cell, insert below"> | |
157 | <a href="#">Run and Insert Below</a></li> |
|
157 | <a href="#">Run and Insert Below</a></li> | |
158 | <li id="run_all_cells" title="Run all cells in the notebook"> |
|
158 | <li id="run_all_cells" title="Run all cells in the notebook"> | |
159 | <a href="#">Run All</a></li> |
|
159 | <a href="#">Run All</a></li> | |
160 | <li id="run_all_cells_above" title="Run all cells above (but not including) this cell"> |
|
160 | <li id="run_all_cells_above" title="Run all cells above (but not including) this cell"> | |
161 | <a href="#">Run All Above</a></li> |
|
161 | <a href="#">Run All Above</a></li> | |
162 | <li id="run_all_cells_below" title="Run this cell and all cells below it"> |
|
162 | <li id="run_all_cells_below" title="Run this cell and all cells below it"> | |
163 | <a href="#">Run All Below</a></li> |
|
163 | <a href="#">Run All Below</a></li> | |
164 | <li class="divider"></li> |
|
164 | <li class="divider"></li> | |
165 | <li id="change_cell_type" class="dropdown-submenu" |
|
165 | <li id="change_cell_type" class="dropdown-submenu" | |
166 | title="All cells in the notebook have a cell type. By default, new cells are created as 'Code' cells"> |
|
166 | title="All cells in the notebook have a cell type. By default, new cells are created as 'Code' cells"> | |
167 | <a href="#">Cell Type</a> |
|
167 | <a href="#">Cell Type</a> | |
168 | <ul class="dropdown-menu"> |
|
168 | <ul class="dropdown-menu"> | |
169 | <li id="to_code" |
|
169 | <li id="to_code" | |
170 | title="Contents will be sent to the kernel for execution, and output will display in the footer of cell"> |
|
170 | title="Contents will be sent to the kernel for execution, and output will display in the footer of cell"> | |
171 | <a href="#">Code</a></li> |
|
171 | <a href="#">Code</a></li> | |
172 | <li id="to_markdown" |
|
172 | <li id="to_markdown" | |
173 | title="Contents will be rendered as HTML and serve as explanatory text"> |
|
173 | title="Contents will be rendered as HTML and serve as explanatory text"> | |
174 | <a href="#">Markdown</a></li> |
|
174 | <a href="#">Markdown</a></li> | |
175 | <li id="to_raw" |
|
175 | <li id="to_raw" | |
176 | title="Contents will pass through nbconvert unmodified"> |
|
176 | title="Contents will pass through nbconvert unmodified"> | |
177 | <a href="#">Raw NBConvert</a></li> |
|
177 | <a href="#">Raw NBConvert</a></li> | |
178 | <li id="to_heading1"><a href="#">Heading 1</a></li> |
|
178 | <li id="to_heading1"><a href="#">Heading 1</a></li> | |
179 | <li id="to_heading2"><a href="#">Heading 2</a></li> |
|
179 | <li id="to_heading2"><a href="#">Heading 2</a></li> | |
180 | <li id="to_heading3"><a href="#">Heading 3</a></li> |
|
180 | <li id="to_heading3"><a href="#">Heading 3</a></li> | |
181 | <li id="to_heading4"><a href="#">Heading 4</a></li> |
|
181 | <li id="to_heading4"><a href="#">Heading 4</a></li> | |
182 | <li id="to_heading5"><a href="#">Heading 5</a></li> |
|
182 | <li id="to_heading5"><a href="#">Heading 5</a></li> | |
183 | <li id="to_heading6"><a href="#">Heading 6</a></li> |
|
183 | <li id="to_heading6"><a href="#">Heading 6</a></li> | |
184 | </ul> |
|
184 | </ul> | |
185 | </li> |
|
185 | </li> | |
186 | <li class="divider"></li> |
|
186 | <li class="divider"></li> | |
187 | <li id="current_outputs" class="dropdown-submenu"><a href="#">Current Output</a> |
|
187 | <li id="current_outputs" class="dropdown-submenu"><a href="#">Current Output</a> | |
188 | <ul class="dropdown-menu"> |
|
188 | <ul class="dropdown-menu"> | |
189 | <li id="toggle_current_output" |
|
189 | <li id="toggle_current_output" | |
190 | title="Hide/Show the output of the current cell"> |
|
190 | title="Hide/Show the output of the current cell"> | |
191 | <a href="#">Toggle</a> |
|
191 | <a href="#">Toggle</a> | |
192 | </li> |
|
192 | </li> | |
193 | <li id="toggle_current_output_scroll" |
|
193 | <li id="toggle_current_output_scroll" | |
194 | title="Scroll the output of the current cell"> |
|
194 | title="Scroll the output of the current cell"> | |
195 | <a href="#">Toggle Scrolling</a> |
|
195 | <a href="#">Toggle Scrolling</a> | |
196 | </li> |
|
196 | </li> | |
197 | <li id="clear_current_output" |
|
197 | <li id="clear_current_output" | |
198 | title="Clear the output of the current cell"> |
|
198 | title="Clear the output of the current cell"> | |
199 | <a href="#">Clear</a> |
|
199 | <a href="#">Clear</a> | |
200 | </li> |
|
200 | </li> | |
201 | </ul> |
|
201 | </ul> | |
202 | </li> |
|
202 | </li> | |
203 | <li id="all_outputs" class="dropdown-submenu"><a href="#">All Output</a> |
|
203 | <li id="all_outputs" class="dropdown-submenu"><a href="#">All Output</a> | |
204 | <ul class="dropdown-menu"> |
|
204 | <ul class="dropdown-menu"> | |
205 | <li id="toggle_all_output" |
|
205 | <li id="toggle_all_output" | |
206 | title="Hide/Show the output of all cells"> |
|
206 | title="Hide/Show the output of all cells"> | |
207 | <a href="#">Toggle</a> |
|
207 | <a href="#">Toggle</a> | |
208 | </li> |
|
208 | </li> | |
209 | <li id="toggle_all_output_scroll" |
|
209 | <li id="toggle_all_output_scroll" | |
210 | title="Scroll the output of all cells"> |
|
210 | title="Scroll the output of all cells"> | |
211 | <a href="#">Toggle Scrolling</a> |
|
211 | <a href="#">Toggle Scrolling</a> | |
212 | </li> |
|
212 | </li> | |
213 | <li id="clear_all_output" |
|
213 | <li id="clear_all_output" | |
214 | title="Clear the output of all cells"> |
|
214 | title="Clear the output of all cells"> | |
215 | <a href="#">Clear</a> |
|
215 | <a href="#">Clear</a> | |
216 | </li> |
|
216 | </li> | |
217 | </ul> |
|
217 | </ul> | |
218 | </li> |
|
218 | </li> | |
219 | </ul> |
|
219 | </ul> | |
220 | </li> |
|
220 | </li> | |
221 | <li class="dropdown"><a href="#" class="dropdown-toggle" data-toggle="dropdown">Kernel</a> |
|
221 | <li class="dropdown"><a href="#" class="dropdown-toggle" data-toggle="dropdown">Kernel</a> | |
222 | <ul id="kernel_menu" class="dropdown-menu"> |
|
222 | <ul id="kernel_menu" class="dropdown-menu"> | |
223 | <li id="int_kernel" |
|
223 | <li id="int_kernel" | |
224 | title="Send KeyboardInterrupt (CTRL-C) to the Kernel"> |
|
224 | title="Send KeyboardInterrupt (CTRL-C) to the Kernel"> | |
225 | <a href="#">Interrupt</a></li> |
|
225 | <a href="#">Interrupt</a></li> | |
226 | <li id="restart_kernel" |
|
226 | <li id="restart_kernel" | |
227 | title="Restart the Kernel"> |
|
227 | title="Restart the Kernel"> | |
228 | <a href="#">Restart</a></li> |
|
228 | <a href="#">Restart</a></li> | |
|
229 | <li class="divider"></li> | |||
|
230 | <li id="menu-change-kernel" class="dropdown-submenu"> | |||
|
231 | <a href="#">Change kernel</a> | |||
|
232 | <ul class="dropdown-menu" id="menu-change-kernel-submenu"></ul> | |||
|
233 | </li> | |||
229 | </ul> |
|
234 | </ul> | |
230 | </li> |
|
235 | </li> | |
231 | <li class="dropdown"><a href="#" class="dropdown-toggle" data-toggle="dropdown">Help</a> |
|
236 | <li class="dropdown"><a href="#" class="dropdown-toggle" data-toggle="dropdown">Help</a> | |
232 | <ul id="help_menu" class="dropdown-menu"> |
|
237 | <ul id="help_menu" class="dropdown-menu"> | |
233 | <li id="notebook_tour" title="A quick tour of the notebook user interface"><a href="#">User Interface Tour</a></li> |
|
238 | <li id="notebook_tour" title="A quick tour of the notebook user interface"><a href="#">User Interface Tour</a></li> | |
234 | <li id="keyboard_shortcuts" title="Opens a tooltip with all keyboard shortcuts"><a href="#">Keyboard Shortcuts</a></li> |
|
239 | <li id="keyboard_shortcuts" title="Opens a tooltip with all keyboard shortcuts"><a href="#">Keyboard Shortcuts</a></li> | |
235 | <li class="divider"></li> |
|
240 | <li class="divider"></li> | |
236 | {% set |
|
241 | {% set | |
237 | sections = ( |
|
242 | sections = ( | |
238 | ( |
|
243 | ( | |
239 | ("http://ipython.org/documentation.html","IPython Help",True), |
|
244 | ("http://ipython.org/documentation.html","IPython Help",True), | |
240 | ("http://nbviewer.ipython.org/github/ipython/ipython/tree/2.x/examples/Index.ipynb", "Notebook Help", True), |
|
245 | ("http://nbviewer.ipython.org/github/ipython/ipython/tree/2.x/examples/Index.ipynb", "Notebook Help", True), | |
241 | ),( |
|
246 | ),( | |
242 | ("http://docs.python.org","Python",True), |
|
247 | ("http://docs.python.org","Python",True), | |
243 | ("http://help.github.com/articles/github-flavored-markdown","Markdown",True), |
|
248 | ("http://help.github.com/articles/github-flavored-markdown","Markdown",True), | |
244 | ("http://docs.scipy.org/doc/numpy/reference/","NumPy",True), |
|
249 | ("http://docs.scipy.org/doc/numpy/reference/","NumPy",True), | |
245 | ("http://docs.scipy.org/doc/scipy/reference/","SciPy",True), |
|
250 | ("http://docs.scipy.org/doc/scipy/reference/","SciPy",True), | |
246 | ("http://matplotlib.org/contents.html","Matplotlib",True), |
|
251 | ("http://matplotlib.org/contents.html","Matplotlib",True), | |
247 | ("http://docs.sympy.org/latest/index.html","SymPy",True), |
|
252 | ("http://docs.sympy.org/latest/index.html","SymPy",True), | |
248 | ("http://pandas.pydata.org/pandas-docs/stable/","pandas", True) |
|
253 | ("http://pandas.pydata.org/pandas-docs/stable/","pandas", True) | |
249 | ) |
|
254 | ) | |
250 | ) |
|
255 | ) | |
251 | %} |
|
256 | %} | |
252 |
|
257 | |||
253 | {% for helplinks in sections %} |
|
258 | {% for helplinks in sections %} | |
254 | {% for link in helplinks %} |
|
259 | {% for link in helplinks %} | |
255 | <li><a href="{{link[0]}}" {{'target="_blank" title="Opens in a new window"' if link[2]}}> |
|
260 | <li><a href="{{link[0]}}" {{'target="_blank" title="Opens in a new window"' if link[2]}}> | |
256 | {{'<i class="icon-external-link menu-icon pull-right"></i>' if link[2]}} |
|
261 | {{'<i class="icon-external-link menu-icon pull-right"></i>' if link[2]}} | |
257 | {{link[1]}} |
|
262 | {{link[1]}} | |
258 | </a></li> |
|
263 | </a></li> | |
259 | {% endfor %} |
|
264 | {% endfor %} | |
260 | {% if not loop.last %} |
|
265 | {% if not loop.last %} | |
261 | <li class="divider"></li> |
|
266 | <li class="divider"></li> | |
262 | {% endif %} |
|
267 | {% endif %} | |
263 | {% endfor %} |
|
268 | {% endfor %} | |
264 | </li> |
|
269 | </li> | |
265 | </ul> |
|
270 | </ul> | |
266 | </li> |
|
271 | </li> | |
267 | </ul> |
|
272 | </ul> | |
268 | <ul class="nav navbar-nav navbar-right"> |
|
273 | <ul class="nav navbar-nav navbar-right"> | |
269 | <div id="kernel_indicator"> |
|
274 | <div id="kernel_indicator"> | |
270 | <i id="kernel_indicator_icon"></i> |
|
275 | <i id="kernel_indicator_icon"></i> | |
271 | </div> |
|
276 | </div> | |
272 | <div id="modal_indicator"> |
|
277 | <div id="modal_indicator"> | |
273 | <i id="modal_indicator_icon"></i> |
|
278 | <i id="modal_indicator_icon"></i> | |
274 | </div> |
|
279 | </div> | |
275 | <div id="notification_area"></div> |
|
280 | <div id="notification_area"></div> | |
276 | </ul> |
|
281 | </ul> | |
277 | </div> |
|
282 | </div> | |
278 | </div> |
|
283 | </div> | |
279 | </div> |
|
284 | </div> | |
280 | <div id="maintoolbar" class="navbar"> |
|
285 | <div id="maintoolbar" class="navbar"> | |
281 | <div class="toolbar-inner navbar-inner navbar-nobg"> |
|
286 | <div class="toolbar-inner navbar-inner navbar-nobg"> | |
282 | <div id="maintoolbar-container" class="container"></div> |
|
287 | <div id="maintoolbar-container" class="container"></div> | |
283 | </div> |
|
288 | </div> | |
284 | </div> |
|
289 | </div> | |
285 | </div> |
|
290 | </div> | |
286 |
|
291 | |||
287 | <div id="ipython-main-app"> |
|
292 | <div id="ipython-main-app"> | |
288 |
|
293 | |||
289 | <div id="notebook_panel"> |
|
294 | <div id="notebook_panel"> | |
290 | <div id="notebook"></div> |
|
295 | <div id="notebook"></div> | |
291 | <div id="pager_splitter"></div> |
|
296 | <div id="pager_splitter"></div> | |
292 | <div id="pager"> |
|
297 | <div id="pager"> | |
293 | <div id='pager_button_area'> |
|
298 | <div id='pager_button_area'> | |
294 | </div> |
|
299 | </div> | |
295 | <div id="pager-container" class="container"></div> |
|
300 | <div id="pager-container" class="container"></div> | |
296 | </div> |
|
301 | </div> | |
297 | </div> |
|
302 | </div> | |
298 |
|
303 | |||
299 | </div> |
|
304 | </div> | |
300 | <div id='tooltip' class='ipython_tooltip' style='display:none'></div> |
|
305 | <div id='tooltip' class='ipython_tooltip' style='display:none'></div> | |
301 |
|
306 | |||
302 |
|
307 | |||
303 | {% endblock %} |
|
308 | {% endblock %} | |
304 |
|
309 | |||
305 |
|
310 | |||
306 | {% block script %} |
|
311 | {% block script %} | |
307 | {{super()}} |
|
312 | {{super()}} | |
308 |
|
313 | |||
309 | <script src="{{ static_url("components/codemirror/lib/codemirror.js") }}" charset="utf-8"></script> |
|
314 | <script src="{{ static_url("components/codemirror/lib/codemirror.js") }}" charset="utf-8"></script> | |
310 | <script type="text/javascript"> |
|
315 | <script type="text/javascript"> | |
311 | CodeMirror.modeURL = "{{ static_url("components/codemirror/mode/%N/%N.js", include_version=False) }}"; |
|
316 | CodeMirror.modeURL = "{{ static_url("components/codemirror/mode/%N/%N.js", include_version=False) }}"; | |
312 | </script> |
|
317 | </script> | |
313 | <script src="{{ static_url("components/codemirror/addon/mode/loadmode.js") }}" charset="utf-8"></script> |
|
318 | <script src="{{ static_url("components/codemirror/addon/mode/loadmode.js") }}" charset="utf-8"></script> | |
314 | <script src="{{ static_url("components/codemirror/addon/mode/multiplex.js") }}" charset="utf-8"></script> |
|
319 | <script src="{{ static_url("components/codemirror/addon/mode/multiplex.js") }}" charset="utf-8"></script> | |
315 | <script src="{{ static_url("components/codemirror/addon/mode/overlay.js") }}" charset="utf-8"></script> |
|
320 | <script src="{{ static_url("components/codemirror/addon/mode/overlay.js") }}" charset="utf-8"></script> | |
316 | <script src="{{ static_url("components/codemirror/addon/edit/matchbrackets.js") }}" charset="utf-8"></script> |
|
321 | <script src="{{ static_url("components/codemirror/addon/edit/matchbrackets.js") }}" charset="utf-8"></script> | |
317 | <script src="{{ static_url("components/codemirror/addon/edit/closebrackets.js") }}" charset="utf-8"></script> |
|
322 | <script src="{{ static_url("components/codemirror/addon/edit/closebrackets.js") }}" charset="utf-8"></script> | |
318 | <script src="{{ static_url("components/codemirror/addon/comment/comment.js") }}" charset="utf-8"></script> |
|
323 | <script src="{{ static_url("components/codemirror/addon/comment/comment.js") }}" charset="utf-8"></script> | |
319 | <script src="{{ static_url("components/codemirror/mode/htmlmixed/htmlmixed.js") }}" charset="utf-8"></script> |
|
324 | <script src="{{ static_url("components/codemirror/mode/htmlmixed/htmlmixed.js") }}" charset="utf-8"></script> | |
320 | <script src="{{ static_url("components/codemirror/mode/xml/xml.js") }}" charset="utf-8"></script> |
|
325 | <script src="{{ static_url("components/codemirror/mode/xml/xml.js") }}" charset="utf-8"></script> | |
321 | <script src="{{ static_url("components/codemirror/mode/javascript/javascript.js") }}" charset="utf-8"></script> |
|
326 | <script src="{{ static_url("components/codemirror/mode/javascript/javascript.js") }}" charset="utf-8"></script> | |
322 | <script src="{{ static_url("components/codemirror/mode/css/css.js") }}" charset="utf-8"></script> |
|
327 | <script src="{{ static_url("components/codemirror/mode/css/css.js") }}" charset="utf-8"></script> | |
323 | <script src="{{ static_url("components/codemirror/mode/rst/rst.js") }}" charset="utf-8"></script> |
|
328 | <script src="{{ static_url("components/codemirror/mode/rst/rst.js") }}" charset="utf-8"></script> | |
324 | <script src="{{ static_url("components/codemirror/mode/markdown/markdown.js") }}" charset="utf-8"></script> |
|
329 | <script src="{{ static_url("components/codemirror/mode/markdown/markdown.js") }}" charset="utf-8"></script> | |
325 | <script src="{{ static_url("components/codemirror/mode/python/python.js") }}" charset="utf-8"></script> |
|
330 | <script src="{{ static_url("components/codemirror/mode/python/python.js") }}" charset="utf-8"></script> | |
326 | <script src="{{ static_url("notebook/js/codemirror-ipython.js") }}" charset="utf-8"></script> |
|
331 | <script src="{{ static_url("notebook/js/codemirror-ipython.js") }}" charset="utf-8"></script> | |
327 | <script src="{{ static_url("notebook/js/codemirror-ipythongfm.js") }}" charset="utf-8"></script> |
|
332 | <script src="{{ static_url("notebook/js/codemirror-ipythongfm.js") }}" charset="utf-8"></script> | |
328 |
|
333 | |||
329 | <script src="{{ static_url("notebook/js/main.js") }}" charset="utf-8"></script> |
|
334 | <script src="{{ static_url("notebook/js/main.js") }}" charset="utf-8"></script> | |
330 |
|
335 | |||
331 | {% endblock %} |
|
336 | {% endblock %} |
General Comments 0
You need to be logged in to leave comments.
Login now