Show More
@@ -92,12 +92,12 b' define([' | |||||
92 |
|
92 | |||
93 | CommManager.prototype.comm_close = function(msg) { |
|
93 | CommManager.prototype.comm_close = function(msg) { | |
94 | var content = msg.content; |
|
94 | var content = msg.content; | |
95 |
if ( |
|
95 | if (this.comms[content.comm_id] === undefined) { | |
96 | console.error('Comm promise not found for comm id ' + content.comm_id); |
|
96 | console.error('Comm promise not found for comm id ' + content.comm_id); | |
97 | return; |
|
97 | return; | |
98 | } |
|
98 | } | |
99 |
|
99 | |||
100 | this.comms[content.comm_id].then(function(comm) { |
|
100 | this.comms[content.comm_id] = this.comms[content.comm_id].then(function(comm) { | |
101 | this.unregister_comm(comm); |
|
101 | this.unregister_comm(comm); | |
102 | try { |
|
102 | try { | |
103 | comm.handle_close(msg); |
|
103 | comm.handle_close(msg); | |
@@ -109,12 +109,12 b' define([' | |||||
109 |
|
109 | |||
110 | CommManager.prototype.comm_msg = function(msg) { |
|
110 | CommManager.prototype.comm_msg = function(msg) { | |
111 | var content = msg.content; |
|
111 | var content = msg.content; | |
112 |
if ( |
|
112 | if (this.comms[content.comm_id] === undefined) { | |
113 | console.error('Comm promise not found for comm id ' + content.comm_id); |
|
113 | console.error('Comm promise not found for comm id ' + content.comm_id); | |
114 | return; |
|
114 | return; | |
115 | } |
|
115 | } | |
116 |
|
116 | |||
117 | this.comms[content.comm_id].then(function(comm) { |
|
117 | this.comms[content.comm_id] = this.comms[content.comm_id].then(function(comm) { | |
118 | try { |
|
118 | try { | |
119 | comm.handle_msg(msg); |
|
119 | comm.handle_msg(msg); | |
120 | } catch (e) { |
|
120 | } catch (e) { | |
@@ -174,7 +174,7 b' define([' | |||||
174 |
|
174 | |||
175 | // methods for handling incoming messages |
|
175 | // methods for handling incoming messages | |
176 |
|
176 | |||
177 |
Comm.prototype. |
|
177 | Comm.prototype._callback = function (key, msg) { | |
178 | var callback = this['_' + key + '_callback']; |
|
178 | var callback = this['_' + key + '_callback']; | |
179 | if (callback) { |
|
179 | if (callback) { | |
180 | try { |
|
180 | try { | |
@@ -186,11 +186,11 b' define([' | |||||
186 | }; |
|
186 | }; | |
187 |
|
187 | |||
188 | Comm.prototype.handle_msg = function (msg) { |
|
188 | Comm.prototype.handle_msg = function (msg) { | |
189 |
th |
|
189 | this._callback('msg', msg); | |
190 | }; |
|
190 | }; | |
191 |
|
191 | |||
192 | Comm.prototype.handle_close = function (msg) { |
|
192 | Comm.prototype.handle_close = function (msg) { | |
193 |
this. |
|
193 | this._callback('close', msg); | |
194 | }; |
|
194 | }; | |
195 |
|
195 | |||
196 | // For backwards compatability. |
|
196 | // For backwards compatability. |
@@ -186,7 +186,7 b' define([' | |||||
186 | return this.create_model({ |
|
186 | return this.create_model({ | |
187 | model_name: msg.content.data.model_name, |
|
187 | model_name: msg.content.data.model_name, | |
188 | model_module: msg.content.data.model_module, |
|
188 | model_module: msg.content.data.model_module, | |
189 |
comm: comm}).catch( |
|
189 | comm: comm}).catch(utils.reject("Couldn't create a model.")); | |
190 | }; |
|
190 | }; | |
191 |
|
191 | |||
192 | WidgetManager.prototype.create_model = function (options) { |
|
192 | WidgetManager.prototype.create_model = function (options) { |
@@ -150,7 +150,7 b' define([' | |||||
150 | this.$label.hide(); |
|
150 | this.$label.hide(); | |
151 | } else { |
|
151 | } else { | |
152 | this.$label.text(description); |
|
152 | this.$label.text(description); | |
153 |
|
|
153 | MathJax.Hub.Queue(["Typeset",MathJax.Hub,this.$label.get(0)]); | |
154 | this.$label.show(); |
|
154 | this.$label.show(); | |
155 | } |
|
155 | } | |
156 |
|
156 | |||
@@ -308,7 +308,7 b' define([' | |||||
308 | this.$label.hide(); |
|
308 | this.$label.hide(); | |
309 | } else { |
|
309 | } else { | |
310 | this.$label.text(description); |
|
310 | this.$label.text(description); | |
311 |
|
|
311 | MathJax.Hub.Queue(["Typeset",MathJax.Hub,this.$label.get(0)]); | |
312 | this.$label.show(); |
|
312 | this.$label.show(); | |
313 | } |
|
313 | } | |
314 | } |
|
314 | } | |
@@ -416,7 +416,7 b' define([' | |||||
416 | this.$label.hide(); |
|
416 | this.$label.hide(); | |
417 | } else { |
|
417 | } else { | |
418 | this.$label.text(description); |
|
418 | this.$label.text(description); | |
419 |
|
|
419 | MathJax.Hub.Queue(["Typeset",MathJax.Hub,this.$label.get(0)]); | |
420 | this.$label.show(); |
|
420 | this.$label.show(); | |
421 | } |
|
421 | } | |
422 | return ProgressView.__super__.update.apply(this); |
|
422 | return ProgressView.__super__.update.apply(this); |
@@ -94,7 +94,7 b' define([' | |||||
94 | this.$label.hide(); |
|
94 | this.$label.hide(); | |
95 | } else { |
|
95 | } else { | |
96 | this.$label.text(description); |
|
96 | this.$label.text(description); | |
97 |
|
|
97 | MathJax.Hub.Queue(["Typeset",MathJax.Hub,this.$label.get(0)]); | |
98 | this.$label.show(); |
|
98 | this.$label.show(); | |
99 | } |
|
99 | } | |
100 | } |
|
100 | } | |
@@ -219,7 +219,7 b' define([' | |||||
219 | this.$label.hide(); |
|
219 | this.$label.hide(); | |
220 | } else { |
|
220 | } else { | |
221 | this.$label.text(description); |
|
221 | this.$label.text(description); | |
222 |
|
|
222 | MathJax.Hub.Queue(["Typeset",MathJax.Hub,this.$label.get(0)]); | |
223 | this.$label.show(); |
|
223 | this.$label.show(); | |
224 | } |
|
224 | } | |
225 | } |
|
225 | } | |
@@ -326,7 +326,7 b' define([' | |||||
326 | this.$label.hide(); |
|
326 | this.$label.hide(); | |
327 | } else { |
|
327 | } else { | |
328 | this.$label.text(description); |
|
328 | this.$label.text(description); | |
329 |
|
|
329 | MathJax.Hub.Queue(["Typeset",MathJax.Hub,this.$label.get(0)]); | |
330 | this.$label.show(); |
|
330 | this.$label.show(); | |
331 | } |
|
331 | } | |
332 | } |
|
332 | } | |
@@ -441,7 +441,7 b' define([' | |||||
441 | this.$label.hide(); |
|
441 | this.$label.hide(); | |
442 | } else { |
|
442 | } else { | |
443 | this.$label.text(description); |
|
443 | this.$label.text(description); | |
444 |
|
|
444 | MathJax.Hub.Queue(["Typeset",MathJax.Hub,this.$label.get(0)]); | |
445 | this.$label.show(); |
|
445 | this.$label.show(); | |
446 | } |
|
446 | } | |
447 | } |
|
447 | } |
@@ -101,7 +101,7 b' define([' | |||||
101 | this.$label.hide(); |
|
101 | this.$label.hide(); | |
102 | } else { |
|
102 | } else { | |
103 | this.$label.text(description); |
|
103 | this.$label.text(description); | |
104 |
|
|
104 | MathJax.Hub.Queue(["Typeset",MathJax.Hub,this.$label.get(0)]); | |
105 | this.$label.show(); |
|
105 | this.$label.show(); | |
106 | } |
|
106 | } | |
107 | } |
|
107 | } | |
@@ -177,7 +177,7 b' define([' | |||||
177 | this.$label.hide(); |
|
177 | this.$label.hide(); | |
178 | } else { |
|
178 | } else { | |
179 | this.$label.text(description); |
|
179 | this.$label.text(description); | |
180 |
|
|
180 | MathJax.Hub.Queue(["Typeset",MathJax.Hub,this.$label.get(0)]); | |
181 | this.$label.show(); |
|
181 | this.$label.show(); | |
182 | } |
|
182 | } | |
183 | } |
|
183 | } |
@@ -131,7 +131,7 b' casper.notebook_test(function () {' | |||||
131 | multiset.model_id = this.get_output_cell(index).text.trim(); |
|
131 | multiset.model_id = this.get_output_cell(index).text.trim(); | |
132 | }); |
|
132 | }); | |
133 |
|
133 | |||
134 |
this.wait_for_widget(multiset); |
|
134 | this.wait_for_widget(multiset); | |
135 |
|
135 | |||
136 | index = this.append_cell( |
|
136 | index = this.append_cell( | |
137 | 'print("%d%d%d" % (multiset.a, multiset.b, multiset.c))'); |
|
137 | 'print("%d%d%d" % (multiset.a, multiset.b, multiset.c))'); |
General Comments 0
You need to be logged in to leave comments.
Login now