@@ -43,7 +43,7 @@ var _labViewer = null; // for View mode
4343
4444
4545function executeCode ( forceStartingInstr , forceRawInputLst ) {
46- $ ( '#loadingPane' ) . html ( 'Please wait ... executing Python code .' ) . show ( ) ;
46+ $ ( '#loadingPane' ) . html ( 'Executing code ... takes up to 10 seconds .' ) . show ( ) ;
4747
4848 if ( forceRawInputLst !== undefined ) {
4949 rawInputLst = forceRawInputLst ; // UGLY global across modules, FIXME
@@ -56,6 +56,16 @@ function executeCode(forceStartingInstr, forceRawInputLst) {
5656 else if ( $ ( '#pythonVersionSelector' ) . val ( ) == '3' ) {
5757 backend_script = python3_backend_script ;
5858 }
59+ else if ( $ ( '#pythonVersionSelector' ) . val ( ) == 'js' ) {
60+ backend_script = js_backend_script ;
61+ }
62+ else if ( $ ( '#pythonVersionSelector' ) . val ( ) == 'ts' ) {
63+ backend_script = ts_backend_script ;
64+ }
65+ else if ( $ ( '#pythonVersionSelector' ) . val ( ) == 'java' ) {
66+ backend_script = java_backend_script ;
67+ }
68+ assert ( backend_script ) ;
5969
6070 var backendOptionsObj = { cumulative_mode : ( $ ( '#cumulativeModeSelector' ) . val ( ) == 'true' ) ,
6171 heap_primitives : ( $ ( '#heapPrimitivesSelector' ) . val ( ) == 'true' ) ,
@@ -179,12 +189,7 @@ function officeMixEnterEditMode() {
179189
180190 // set configuration on every code edit and option toggle, to
181191 // set the 'dirty bit' on the enclosing PPT file
182- if ( useCodeMirror ) {
183- pyInputCodeMirror . on ( "change" , saveCurrentConfiguration ) ;
184- }
185- else {
186- pyInputAceEditor . getSession ( ) . on ( "change" , saveCurrentConfiguration ) ;
187- }
192+ pyInputAceEditor . getSession ( ) . on ( "change" , saveCurrentConfiguration ) ;
188193 $ ( 'select' ) . change ( saveCurrentConfiguration ) ;
189194
190195 $ ( "#toggleModebtn" ) . html ( "Visualize code" ) . show ( ) ;
@@ -202,7 +207,13 @@ function saveCurrentConfiguration() {
202207
203208
204209$ ( document ) . ready ( function ( ) {
205- console . log ( "HALLO opt-office-mix.js!!!" ) ;
210+ // make sure that this file is included *after* opt-frontend-common.js so
211+ // that these definitions override those in opt-frontend-common.js
212+ //
213+ // use https endpoints since Mix requires https:
214+ JS_JSONP_ENDPOINT = 'https://cokapi.com:8001/exec_js_jsonp' ;
215+ TS_JSONP_ENDPOINT = 'https://cokapi.com:8001/exec_ts_jsonp' ;
216+ JAVA_JSONP_ENDPOINT = 'https://cokapi.com:8001/exec_java_jsonp' ;
206217
207218 // DON'T switch into office mix view mode ... this is just a "Preview"
208219 // that's only relevant in Edit mode
@@ -243,21 +254,7 @@ $(document).ready(function() {
243254 } ) ;
244255
245256
246- if ( useCodeMirror ) {
247- pyInputCodeMirror = CodeMirror ( document . getElementById ( 'codeInputPane' ) , {
248- mode : 'python' ,
249- lineNumbers : true ,
250- tabSize : 4 ,
251- indentUnit : 4 ,
252- // convert tab into four spaces:
253- extraKeys : { Tab : function ( cm ) { cm . replaceSelection ( " " , "end" ) ; } }
254- } ) ;
255-
256- pyInputCodeMirror . setSize ( null , '300px' ) ;
257- }
258- else {
259- initAceEditor ( 300 ) ;
260- }
257+ initAceEditor ( 300 ) ;
261258
262259 // no frills footer
263260 $ ( "#footer" ) . css ( "margin-top" , "0px" )
0 commit comments