@ -512,8 +512,7 @@ var IPython = (function (IPython) {
var i = this . index _or _selected ( index ) ;
var source _element = this . cell _elements ( ) . eq ( i ) ;
var source _cell = source _element . data ( "cell" ) ;
if ( source _cell instanceof IPython . HTMLCell ||
source _cell instanceof IPython . MarkdownCell ) {
if ( ! ( source _cell instanceof IPython . CodeCell ) ) {
this . insert _code _cell _below ( i ) ;
var target _cell = this . cells ( ) [ i + 1 ] ;
var text = source _cell . get _text ( ) ;
@ -534,27 +533,23 @@ var IPython = (function (IPython) {
var source _element = this . cell _elements ( ) . eq ( i ) ;
var source _cell = source _element . data ( "cell" ) ;
var target _cell = null ;
if ( source _cell instanceof IPython . CodeCell ) {
this . insert _markdown _cell _below ( i ) ;
target _cell = this . cells ( ) [ i + 1 ] ;
var text = source _cell . get _text ( ) ;
} else if ( source _cell instanceof IPython . HTMLCell ) {
if ( ! ( source _cell instanceof IPython . MarkdownCell ) ) {
this . insert _markdown _cell _below ( i ) ;
target _cell = this . cells ( ) [ i + 1 ] ;
var text = source _cell . get _text ( ) ;
if ( text === source _cell . placeholder ) {
text = target _cell . placeholder ;
} ;
if ( target _cell !== null ) {
if ( text === "" ) { text = target _cell . placeholder ; } ;
// The edit must come before the set_text.
target _cell . edit ( ) ;
target _cell . set _text ( text ) ;
source _element . remove ( ) ;
target _cell . select ( ) ;
}
}
if ( target _cell !== null ) {
if ( text === "" ) { text = target _cell . placeholder ; } ;
// The edit must come before the set_text.
target _cell . edit ( ) ;
target _cell . set _text ( text ) ;
source _element . remove ( ) ;
target _cell . select ( ) ;
}
this . dirty = true ;
this . dirty = true ;
} ;
} ;
@ -564,25 +559,23 @@ var IPython = (function (IPython) {
var source _element = this . cell _elements ( ) . eq ( i ) ;
var source _cell = source _element . data ( "cell" ) ;
var target _cell = null ;
if ( source _cell instanceof IPython . CodeCell ) {
this . insert _html _cell _below ( i ) ;
target _cell = this . cells ( ) [ i + 1 ] ;
var text = source _cell . get _text ( ) ;
} else if ( source _cell instanceof IPython . MarkdownCell ) {
if ( ! ( source _cell instanceof IPython . HTMLCell ) ) {
this . insert _html _cell _below ( i ) ;
target _cell = this . cells ( ) [ i + 1 ] ;
var text = source _cell . get _text ( ) ;
if ( text === source _cell . placeholder ) {
text = target _cell . placeholder ;
} ;
if ( target _cell !== null ) {
if ( text === "" ) { text = target _cell . placeholder ; } ;
// The edit must come before the set_text.
target _cell . edit ( ) ;
target _cell . set _text ( text ) ;
source _element . remove ( ) ;
target _cell . select ( ) ;
}
}
if ( target _cell !== null ) {
if ( text === "" ) { text = target _cell . placeholder ; } ;
target _cell . set _text ( text ) ;
source _element . remove ( ) ;
target _cell . edit ( ) ;
}
this . dirty = true ;
this . dirty = true ;
} ;
} ;
@ -629,14 +622,12 @@ var IPython = (function (IPython) {
var cell _data = this . clipboard ;
if ( cell _data . cell _type == 'code' ) {
new _cell = this . insert _code _cell _above ( ) ;
new _cell . fromJSON ( cell _data ) ;
} else if ( cell _data . cell _type === 'html' ) {
new _cell = this . insert _html _cell _above ( ) ;
new _cell . fromJSON ( cell _data ) ;
} else if ( cell _data . cell _type === 'markdown' ) {
new _cell = this . insert _markdown _cell _above ( ) ;
new _cell . fromJSON ( cell _data ) ;
} ;
new _cell . fromJSON ( cell _data ) ;
this . select _next ( ) ;
this . delete _cell ( ) ;
} ;
@ -648,14 +639,12 @@ var IPython = (function (IPython) {
var cell _data = this . clipboard ;
if ( cell _data . cell _type == 'code' ) {
new _cell = this . insert _code _cell _above ( ) ;
new _cell . fromJSON ( cell _data ) ;
} else if ( cell _data . cell _type === 'html' ) {
new _cell = this . insert _html _cell _above ( ) ;
new _cell . fromJSON ( cell _data ) ;
} else if ( cell _data . cell _type === 'markdown' ) {
new _cell = this . insert _markdown _cell _above ( ) ;
new _cell . fromJSON ( cell _data ) ;
} ;
new _cell . fromJSON ( cell _data ) ;
} ;
} ;
@ -665,14 +654,12 @@ var IPython = (function (IPython) {
var cell _data = this . clipboard ;
if ( cell _data . cell _type == 'code' ) {
new _cell = this . insert _code _cell _below ( ) ;
new _cell . fromJSON ( cell _data ) ;
} else if ( cell _data . cell _type === 'html' ) {
new _cell = this . insert _html _cell _below ( ) ;
new _cell . fromJSON ( cell _data ) ;
} else if ( cell _data . cell _type === 'markdown' ) {
new _cell = this . insert _markdown _cell _below ( ) ;
new _cell . fromJSON ( cell _data ) ;
} ;
new _cell . fromJSON ( cell _data ) ;
} ;
} ;