##// END OF EJS Templates
Use codemirror for error messages
Jessica B. Hamrick -
Show More
@@ -188,28 +188,35 define([
188 var full = status.responseJSON.message;
188 var full = status.responseJSON.message;
189 var short = status.responseJSON.short_message || 'Kernel error';
189 var short = status.responseJSON.short_message || 'Kernel error';
190 var traceback = status.responseJSON.traceback;
190 var traceback = status.responseJSON.traceback;
191 var msg = $('<div/>');
192
193 msg.append($('<p/>').text(full));
194 if (traceback) {
195 msg.append($('<textarea/>')
196 .attr('rows', '13')
197 .attr('cols', '80')
198 .attr('readonly', 'true')
199 .css('margin-top', '1em')
200 .text(traceback));
201 }
202
191
203 var showMsg = function () {
192 var showMsg = function () {
193 var msg = $('<div/>').append($('<p/>').text(full));
194 var cm, cm_elem;
195
196 if (traceback) {
197 cm_elem = $('<div/>')
198 .css('margin-top', '1em')
199 .css('padding', '1em')
200 .addClass('output_scroll');
201 msg.append(cm_elem);
202 cm = CodeMirror(cm_elem.get(0), {
203 mode: "python",
204 readOnly : true
205 });
206 cm.setValue(traceback);
207 }
208
204 dialog.modal({
209 dialog.modal({
205 title: "Failed to start the kernel",
210 title: "Failed to start the kernel",
206 body : msg,
211 body : msg,
207 keyboard_manager: that.keyboard_manager,
212 keyboard_manager: that.keyboard_manager,
208 notebook: that.notebook,
213 notebook: that.notebook,
214 open: $.proxy(cm.refresh, cm),
209 buttons : {
215 buttons : {
210 "Ok": { class: 'btn-primary' }
216 "Ok": { class: 'btn-primary' }
211 }
217 }
212 });
218 });
219
213 return false;
220 return false;
214 };
221 };
215
222
General Comments 0
You need to be logged in to leave comments. Login now