@ -252,8 +252,7 @@ var IPython = (function (IPython) {
json . evalue = content . evalue ;
json . traceback = content . traceback ;
}
// append with dynamic=true
this . append _output ( json , true ) ;
this . append _output ( json ) ;
} ;
OutputArea . mime _map = {
@ -288,8 +287,7 @@ var IPython = (function (IPython) {
} ;
OutputArea . prototype . append _output = function ( json , dynamic ) {
// If dynamic is true, javascript output will be eval'd.
OutputArea . prototype . append _output = function ( json ) {
this . expand ( ) ;
// Clear the output if clear is queued.
var needs _height _reset = false ;
@ -299,11 +297,11 @@ var IPython = (function (IPython) {
}
if ( json . output _type === 'pyout' ) {
this . append _pyout ( json , dynamic );
this . append _pyout ( json );
} else if ( json . output _type === 'pyerr' ) {
this . append _pyerr ( json ) ;
} else if ( json . output _type === 'display_data' ) {
this . append _display _data ( json , dynamic );
this . append _display _data ( json );
} else if ( json . output _type === 'stream' ) {
this . append _stream ( json ) ;
}
@ -414,13 +412,13 @@ var IPython = (function (IPython) {
} ;
OutputArea . prototype . append _pyout = function ( json , dynamic ) {
OutputArea . prototype . append _pyout = function ( json ) {
var n = json . prompt _number || ' ' ;
var toinsert = this . create _output _area ( ) ;
if ( this . prompt _area ) {
toinsert . find ( 'div.prompt' ) . addClass ( 'output_prompt' ) . html ( 'Out[' + n + ']:' ) ;
}
this . append _mime _type ( json , toinsert , dynamic );
this . append _mime _type ( json , toinsert );
this . _safe _append ( toinsert ) ;
// If we just output latex, typeset it.
if ( ( json . latex !== undefined ) || ( json . html !== undefined ) ) {
@ -481,9 +479,9 @@ var IPython = (function (IPython) {
} ;
OutputArea . prototype . append _display _data = function ( json , dynamic ) {
OutputArea . prototype . append _display _data = function ( json ) {
var toinsert = this . create _output _area ( ) ;
if ( this . append _mime _type ( json , toinsert , dynamic )) {
if ( this . append _mime _type ( json , toinsert )) {
this . _safe _append ( toinsert ) ;
// If we just output latex, typeset it.
if ( ( json . latex !== undefined ) || ( json . html !== undefined ) ) {
@ -502,23 +500,16 @@ var IPython = (function (IPython) {
'text/plain'
] ;
OutputArea . prototype . append _mime _type = function ( json , element , dynamic ) {
OutputArea . prototype . append _mime _type = function ( json , element ) {
for ( var type _i in OutputArea . display _order ) {
var type = OutputArea . display _order [ type _i ] ;
if ( json [ type ] !== undefined ) {
md = json . metadata || { } ;
if ( type == 'javascript' ) {
if ( dynamic ) {
this . append _javascript ( json . javascript , md , element , dynamic ) ;
return true ;
}
} else {
var append = OutputArea . append _map [ type ] ;
if ( append !== undefined ) {
append . apply ( this , [ json [ type ] , md , element ] ) ;
return true ;
}
var append = OutputArea . append _map [ type ] ;
if ( append !== undefined ) {
md = json . metadata || { } ;
append . apply ( this , [ json [ type ] , md , element ] ) ;
return true ;
}
}
}
@ -755,6 +746,14 @@ var IPython = (function (IPython) {
// TODO: remove this when we update to nbformat 4
var len = outputs . length ;
var data ;
// We don't want to display javascript on load, so remove it from the
// display order for the duration of this function call, but be sure to
// put it back in there so incoming messages that contain javascript
// representations get displayed
var js _index = OutputArea . display _order . indexOf ( 'application/javascript' ) ;
OutputArea . display _order . splice ( js _index , 1 ) ;
for ( var i = 0 ; i < len ; i ++ ) {
data = outputs [ i ] ;
var msg _type = data . output _type ;
@ -764,9 +763,11 @@ var IPython = (function (IPython) {
data . metadata = this . rename _keys ( data . metadata , OutputArea . mime _map _r ) ;
}
// append with dynamic=false.
this . append _output ( data , false ) ;
this . append _output ( data ) ;
}
// reinsert javascript into display order, see note above
OutputArea . display _order . splice ( js _index , 0 , 'application/javascript' ) ;
} ;