File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -175,7 +175,12 @@ function officeMixEnterEditMode(firstTime) {
175175
176176 // set configuration on every code edit and option toggle, to
177177 // set the 'dirty bit' on the enclosing PPT file
178- pyInputCodeMirror . on ( "change" , saveCurrentConfiguration ) ;
178+ if ( useCodeMirror ) {
179+ pyInputCodeMirror . on ( "change" , saveCurrentConfiguration ) ;
180+ }
181+ else {
182+ pyInputAceEditor . getSession ( ) . on ( "change" , saveCurrentConfiguration ) ;
183+ }
179184 $ ( 'select' ) . change ( saveCurrentConfiguration ) ;
180185 }
181186 }
@@ -234,16 +239,21 @@ $(document).ready(function() {
234239 } ) ;
235240
236241
237- pyInputCodeMirror = CodeMirror ( document . getElementById ( 'codeInputPane' ) , {
238- mode : 'python' ,
239- lineNumbers : true ,
240- tabSize : 4 ,
241- indentUnit : 4 ,
242- // convert tab into four spaces:
243- extraKeys : { Tab : function ( cm ) { cm . replaceSelection ( " " , "end" ) ; } }
244- } ) ;
242+ if ( useCodeMirror ) {
243+ pyInputCodeMirror = CodeMirror ( document . getElementById ( 'codeInputPane' ) , {
244+ mode : 'python' ,
245+ lineNumbers : true ,
246+ tabSize : 4 ,
247+ indentUnit : 4 ,
248+ // convert tab into four spaces:
249+ extraKeys : { Tab : function ( cm ) { cm . replaceSelection ( " " , "end" ) ; } }
250+ } ) ;
245251
246- pyInputCodeMirror . setSize ( null , '350px' ) ;
252+ pyInputCodeMirror . setSize ( null , '350px' ) ;
253+ }
254+ else {
255+ initAceEditor ( 350 ) ;
256+ }
247257
248258 $ ( window ) . resize ( redrawConnectors ) ;
249259
You can’t perform that action at this time.
0 commit comments