Show More
@@ -552,19 +552,22 b' var IPython = (function (IPython) {' | |||||
552 | }; |
|
552 | }; | |
553 |
|
553 | |||
554 |
|
554 | |||
555 |
OutputArea.prototype.append_javascript = function (js, md, |
|
555 | OutputArea.prototype.append_javascript = function (js, md, element) { | |
556 | // We just eval the JS code, element appears in the local scope. |
|
556 | // We just eval the JS code, element appears in the local scope. | |
557 | var type = 'application/javascript'; |
|
557 | var type = 'application/javascript'; | |
558 |
var |
|
558 | var toinsert = this.create_output_subarea(md, "output_javascript", type); | |
559 |
IPython.keyboard_manager.register_events( |
|
559 | IPython.keyboard_manager.register_events(toinsert); | |
560 |
|
|
560 | element.append(toinsert); | |
|
561 | //backward compat, js should be eval'ed in a context where `container` is defined. | |||
|
562 | var container = element; | |||
|
563 | container.show = function(){console.log('Warning "container.show()" is deprecated.')}; | |||
561 | try { |
|
564 | try { | |
562 | eval(js); |
|
565 | eval(js); | |
563 | } catch(err) { |
|
566 | } catch(err) { | |
564 | console.log(err); |
|
567 | console.log(err); | |
565 |
this._append_javascript_error(err, |
|
568 | this._append_javascript_error(err, toinsert); | |
566 | } |
|
569 | } | |
567 |
return |
|
570 | return toinsert; | |
568 | }; |
|
571 | }; | |
569 |
|
572 | |||
570 |
|
573 |
General Comments 0
You need to be logged in to leave comments.
Login now