diff --git a/elements/urth-core-behaviors/execution-complete-behavior.html b/elements/urth-core-behaviors/execution-complete-behavior.html index a3fb028a..e060fedc 100644 --- a/elements/urth-core-behaviors/execution-complete-behavior.html +++ b/elements/urth-core-behaviors/execution-complete-behavior.html @@ -16,7 +16,7 @@ console.debug("Registering _onExecutionComplete for Execute Reply messages."); this.__replyCallback = this._onExecutionComplete.bind(this); - IPython.notebook.kernel.widget_manager.notebook.events.on( + IPython.notebook.events.on( 'shell_reply.Kernel', this.__replyCallback ); }, @@ -24,7 +24,7 @@ detached: function() { console.debug("Unregistering _onExecutionComplete for Execute Reply messages."); if (this.__replyCallback){ - IPython.notebook.kernel.widget_manager.notebook.events.off( + IPython.notebook.events.off( 'shell_reply.Kernel', this.__replyCallback ); } diff --git a/etc/examples/standalone/index.html b/etc/examples/standalone/index.html index f6dc1e0e..95e794fd 100644 --- a/etc/examples/standalone/index.html +++ b/etc/examples/standalone/index.html @@ -40,6 +40,10 @@
diff --git a/etc/examples/standalone/src/index.js b/etc/examples/standalone/src/index.js index 28a8f285..55570c82 100644 --- a/etc/examples/standalone/src/index.js +++ b/etc/examples/standalone/src/index.js @@ -52,6 +52,10 @@ document.addEventListener("DOMContentLoaded", function(event) { // Run backend code to create the widgets. You could also create the // widgets in the frontend, like the other /web/ examples demonstrate. - kernel.execute({ code: code }); + var execPromise = kernel.execute({ code: code }); + execPromise.onReply = function(){ + IPython.notebook.events.trigger('shell_reply.Kernel'); + } + }); }); diff --git a/etc/examples/standalone/widget_code.json b/etc/examples/standalone/widget_code.json index e95cd3f7..f56afa1c 100644 --- a/etc/examples/standalone/widget_code.json +++ b/etc/examples/standalone/widget_code.json @@ -1,4 +1,8 @@ [ "from urth.widgets.widget_channels import channel", - "channel('a').set('msg', 'Hello from kernel')" + "def hello(name):", + " return 'Hello ' + name", + "channel('a').set('isready', True)" ] + +