@ -127,25 +127,36 @@ define([
} ,
mode : 'ipython' ,
theme : 'ipython' ,
matchBrackets : true
}
} ;
CodeCell . config _defaults = {
matchBrackets : true ,
autoCloseBrackets : true
} ,
highlight _modes : {
'magic_javascript' : { 'reg' : [ /^%%javascript/ ] } ,
'magic_perl' : { 'reg' : [ /^%%perl/ ] } ,
'magic_ruby' : { 'reg' : [ /^%%ruby/ ] } ,
'magic_python' : { 'reg' : [ /^%%python3?/ ] } ,
'magic_shell' : { 'reg' : [ /^%%bash/ ] } ,
'magic_r' : { 'reg' : [ /^%%R/ ] } ,
'magic_text/x-cython' : { 'reg' : [ /^%%cython/ ] } ,
'magic_javascript' : { 'reg' : [ '^%%javascript' ] } ,
'magic_perl' : { 'reg' : [ '^%%perl' ] } ,
'magic_ruby' : { 'reg' : [ '^%%ruby' ] } ,
'magic_python' : { 'reg' : [ '^%%python3?' ] } ,
'magic_shell' : { 'reg' : [ '^%%bash' ] } ,
'magic_r' : { 'reg' : [ '^%%R' ] } ,
'magic_text/x-cython' : { 'reg' : [ '^%%cython' ] } ,
} ,
} ;
CodeCell . config _defaults = CodeCell . options _default ;
CodeCell . msg _cells = { } ;
CodeCell . prototype = Object . create ( Cell . prototype ) ;
/ * *
* @ private
* Update the current state of the config file in the profile with current config .
* * /
CodeCell . prototype . _fill _config _with _current = function ( ) {
var keys = [ 'cm_config' , 'highlight_modes' ] ;
for ( var i in keys ) {
this . class _config . set ( keys [ i ] , this . class _config . get _sync ( keys [ i ] ) ) ;
}
}
/** @method create_element */
CodeCell . prototype . create _element = function ( ) {
@ -163,7 +174,7 @@ define([
notebook : this . notebook } ) ;
inner _cell . append ( this . celltoolbar . element ) ;
var input _area = $ ( '<div/>' ) . addClass ( 'input_area' ) ;
this . code _mirror = new CodeMirror ( input _area . get ( 0 ) , this . c m_config ) ;
this . code _mirror = new CodeMirror ( input _area . get ( 0 ) , this . c lass_config . get _sync ( 'cm_config' ) ) ;
// In case of bugs that put the keyboard manager into an inconsistent state,
// ensure KM is enabled when CodeMirror is focused:
this . code _mirror . on ( 'focus' , function ( ) {