##// END OF EJS Templates
Fix bugs with this and that
Jessica B. Hamrick -
Show More
@@ -94,8 +94,8 b' define(['
94 that.send_input_reply(data);
94 that.send_input_reply(data);
95 });
95 });
96
96
97 var record_status = function (evt) {
97 var record_status = function (evt, info) {
98 console.log('Kernel: ' + evt.type + ' (' + that.id + ')');
98 console.log('Kernel: ' + evt.type + ' (' + info.kernel.id + ')');
99 };
99 };
100
100
101 this.events.on('kernel_created.Kernel', record_status);
101 this.events.on('kernel_created.Kernel', record_status);
@@ -397,7 +397,7 b' define(['
397 // get kernel info so we know what state the kernel is in
397 // get kernel info so we know what state the kernel is in
398 var that = this;
398 var that = this;
399 this.kernel_info(function () {
399 this.kernel_info(function () {
400 that.events.trigger('kernel_ready.Kernel', {kernel: this});
400 that.events.trigger('kernel_ready.Kernel', {kernel: that});
401 });
401 });
402 };
402 };
403
403
@@ -451,7 +451,7 b' define(['
451 that.get_info(function () {
451 that.get_info(function () {
452 that._ws_closed(ws_host_url, false);
452 that._ws_closed(ws_host_url, false);
453 }, function () {
453 }, function () {
454 that.events.trigger('kernel_dead.Kernel', {kernel: this});
454 that.events.trigger('kernel_dead.Kernel', {kernel: that});
455 that._kernel_dead();
455 that._kernel_dead();
456 });
456 });
457 }
457 }
@@ -539,7 +539,7 b' define(['
539 var that = this;
539 var that = this;
540 var close = function (c) {
540 var close = function (c) {
541 return function () {
541 return function () {
542 if (that.channels[c].readyState === WebSocket.CLOSED) {
542 if (that.channels[c] && that.channels[c].readyState === WebSocket.CLOSED) {
543 that.channels[c] = null;
543 that.channels[c] = null;
544 }
544 }
545 };
545 };
@@ -715,7 +715,7 b' define(['
715 content.allow_stdin = true;
715 content.allow_stdin = true;
716 }
716 }
717 $.extend(true, content, options);
717 $.extend(true, content, options);
718 this.events.trigger('execution_request.Kernel', {kernel: this, content:content});
718 this.events.trigger('execution_request.Kernel', {kernel: this, content: content});
719 return this.send_shell_message("execute_request", content, callbacks);
719 return this.send_shell_message("execute_request", content, callbacks);
720 };
720 };
721
721
@@ -753,7 +753,7 b' define(['
753 var content = {
753 var content = {
754 value : input
754 value : input
755 };
755 };
756 this.events.trigger('input_reply.Kernel', {kernel: this, content:content});
756 this.events.trigger('input_reply.Kernel', {kernel: this, content: content});
757 var msg = this._get_msg("input_reply", content);
757 var msg = this._get_msg("input_reply", content);
758 this.channels.stdin.send(JSON.stringify(msg));
758 this.channels.stdin.send(JSON.stringify(msg));
759 return msg.header.msg_id;
759 return msg.header.msg_id;
@@ -854,7 +854,7 b' define(['
854 */
854 */
855 Kernel.prototype._handle_shell_reply = function (e) {
855 Kernel.prototype._handle_shell_reply = function (e) {
856 var reply = $.parseJSON(e.data);
856 var reply = $.parseJSON(e.data);
857 this.events.trigger('shell_reply.Kernel', {kernel: this, reply:reply});
857 this.events.trigger('shell_reply.Kernel', {kernel: this, reply: reply});
858 var content = reply.content;
858 var content = reply.content;
859 var metadata = reply.metadata;
859 var metadata = reply.metadata;
860 var parent_id = reply.parent_header.msg_id;
860 var parent_id = reply.parent_header.msg_id;
@@ -50,8 +50,8 b' define(['
50
50
51 Session.prototype.bind_events = function () {
51 Session.prototype.bind_events = function () {
52 var that = this;
52 var that = this;
53 var record_status = function (evt) {
53 var record_status = function (evt, info) {
54 console.log('Session: ' + evt.type + ' (' + that.id + ')');
54 console.log('Session: ' + evt.type + ' (' + info.session.id + ')');
55 };
55 };
56
56
57 this.events.on('kernel_created.Session', record_status);
57 this.events.on('kernel_created.Session', record_status);
General Comments 0
You need to be logged in to leave comments. Login now