Skip to content
Browse files

Add 'Shutdown notebooks' to file menu within notebook view.

  • Loading branch information...
1 parent 9a1794e commit a00d8c2f05fff71e5a25486b09f0b17488428b47 @takluyver committed
View
1 IPython/frontend/html/notebook/static/js/menubar.js
@@ -67,6 +67,7 @@ var IPython = (function (IPython) {
this.element.find('button#print_notebook').click(function () {
IPython.print_widget.print_notebook();
});
+ this.element.find('#shutdown_server').click(confirm_shutdown);
// Edit
this.element.find('#cut_cell').click(function () {
IPython.notebook.cut_cell();
View
6 IPython/frontend/html/notebook/static/js/projectdashboardmain.js
@@ -10,7 +10,7 @@
//============================================================================
-confirm_shutdown = function (e) {
+confirm_shutdown = function () {
var dialog = $('<div/>');
dialog.html('Do you want to shut down the notebook server? ' +
'You will lose any unsaved work and all running kernels.');
@@ -61,7 +61,9 @@ $(document).ready(function () {
$('div#header').css('display','block');
$('div#main_app').css('display','block');
- $('#shutdown').button().click(confirm_shutdown);
+ $('#shutdown').button().click(function(e) {
+ confirm_shutdown();
+ });
});
View
3 IPython/frontend/html/notebook/templates/notebook.html
@@ -77,6 +77,8 @@
</li>
<hr/>
<li id="print_notebook"><a href="/{{notebook_id}}/print" target="_blank">Print View</a></li>
+ <hr/>
+ <li id="shutdown_server"><a href="#">Shutdown Notebooks</a></li>
</ul>
</li>
<li><a href="#">Edit</a>
@@ -221,6 +223,7 @@
<script src="{{ static_url("js/toolbar.js") }}" type="text/javascript" charset="utf-8"></script>
<script src="{{ static_url("js/notebook.js") }}" type="text/javascript" charset="utf-8"></script>
<script src="{{ static_url("js/notebookmain.js") }}" type="text/javascript" charset="utf-8"></script>
+<script src="{{ static_url("js/projectdashboardmain.js") }}" type="text/javascript" charset="utf-8"></script>
</body>

0 comments on commit a00d8c2

Please sign in to comment.
Something went wrong with that request. Please try again.