Still trying to get the Jupyter modal dialog to execute a Jupyter.notebook.session.restart() -- if that is possible.
I *believe* I found the modal dialog: - https://github.com/jupyter-attic/jupyter-js-filebrowser/pull/13 - https://github.com/jupyter-attic/jupyter-js-filebrowser/issues/12 - https://github.com/phosphorjs/phosphor-dialog ...however github linked API is missing. - http://phosphorjs.github.io/phosphor-dialog/api/ On Sunday, November 13, 2016 at 9:47:24 AM UTC-8, Jeremy Douglass wrote: > > I have a follow-up question. > > Now that we are successfully halting notebooks when they finish running. > The "No Kernel" message is subtle; in order to better inform users that > their notebook is halted (and should either be closed or restarted) I am > using a modal popup as per "Dialog popup in Jupyter notebook" ( > http://stefaanlippens.net/jupyter-notebook-dialog.html) that says > "NOTEBOOK HALTED" and offers a "Restart Kernel" button. > > Currently, the %%javascript cell successfully halts the notebook and > displays the popup. > > I would like to have the dialog button trigger a kernel restart with > Jupyter.notebook.session.restart(). That command works fine in a > %%javascript cell on its own and correctly restarts the kernel. However, > adding that command to the dialog button does nothing. I am not a > Javascript programmer, and may be making a very basic error. Any > suggestions? > > This is the cell at the end of a notebook that halts the kernel and > displays the restart dialog: > > %%javascript > require( > ["base/js/dialog"], > function(dialog) { > dialog.modal({ > title: 'Notebook halted!', > body: 'This notebook is no longer running; the kernel has > been halted. To continue working, restart the kernel.', > buttons: { > 'Kernel restart': { > function(){Jupyter.notebook.session.restart();} } > } > }); > } > ); > Jupyter.notebook.session.delete(); > > > > On Thursday, November 10, 2016 at 1:21:38 PM UTC-8, Peter Parente wrote: >> >> Thanks for writing back letting others know it worked, Jeremy! >> >> Pete >> > -- You received this message because you are subscribed to the Google Groups "Project Jupyter" group. To unsubscribe from this group and stop receiving emails from it, send an email to jupyter+unsubscr...@googlegroups.com. To post to this group, send email to jupyter@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/jupyter/9b65b94e-a5e1-4a44-9193-c2ebace8ac6b%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.