@@ -49,8 +49,6 @@ var _lastSavedAppState = undefined; // nasty global
4949
5050
5151function executeCode ( forceStartingInstr , forceRawInputLst ) {
52- $ ( '#loadingPane' ) . html ( 'Executing code ... takes up to 10 seconds.' ) . show ( ) ;
53-
5452 if ( forceRawInputLst !== undefined ) {
5553 rawInputLst = forceRawInputLst ; // UGLY global across modules, FIXME
5654 }
@@ -103,9 +101,9 @@ function executeCode(forceStartingInstr, forceRawInputLst) {
103101
104102function officeMixFinishSuccessfulExecution ( ) {
105103 updateAppDisplayForMix ( 'display' ) ; // do this first
106- $ ( '#loadingPane' ) . hide ( ) ;
107104
108- $ ( "#vizBtn" ) . hide ( ) ;
105+ $ ( "#executeBtn" ) . attr ( 'disabled' , false ) ;
106+ $ ( "#executeBtn" ) . hide ( ) ;
109107
110108 if ( _savedCurInstr !== undefined ) {
111109 myVisualizer . renderStep ( _savedCurInstr ) ;
@@ -145,16 +143,6 @@ function getConfigurationFromData(dat) {
145143}
146144
147145
148- // override setFronendError in opt-frontend-common.js
149- // NB: this file must be included AFTER opt-frontend-common.js
150- function setFronendError ( lines ) {
151- var errorStr = lines . map ( htmlspecialchars ) . join ( '<br/>' ) ;
152- $ ( '#loadingPane' ) . html ( errorStr ) . show ( ) ;
153- //$("#frontendErrorOutput").html(errorStr);
154- //$("#frontendErrorOutput").show();
155- }
156-
157-
158146// a wrapper for getAppState() that caches the value of the current
159147// execution trace if we're in display mode
160148function getAppStateWithTraceCache ( ) {
@@ -175,7 +163,8 @@ function getAppStateWithTraceCache() {
175163
176164function enterOPTEditCodeMode ( ) {
177165 updateAppDisplayForMix ( 'edit' ) ;
178- $ ( "#vizBtn" ) . html ( "Visualize Execution" ) . show ( ) ;
166+ $ ( "#executeBtn" ) . html ( "Visualize Execution" ) . show ( ) ;
167+ $ ( "#executeBtn" ) . attr ( 'disabled' , false ) ;
179168
180169 // https://groups.google.com/forum/#!msg/ace-discuss/TQHqey_NkBg/q9x_tLrvsXoJ
181170 pyInputAceEditor . resize ( ) ; // weird hack that's necessary to refresh the editor's latest text values. #weird
@@ -374,7 +363,7 @@ function mixLazyExecuteCode() {
374363 officeMixFinishSuccessfulExecution ( ) ;
375364 } else {
376365 // cache miss
377- executeCodeFromScratch ( ) ; // ends with officeMixFinishSuccessfulExecution
366+ executeCodeFromScratch ( ) ; // ends with officeMixFinishSuccessfulExecution or handleUncaughtExceptionFunc
378367 }
379368}
380369
@@ -390,7 +379,7 @@ $(document).ready(function() {
390379
391380 $ ( '#pythonVersionSelector' ) . change ( setAceMode ) ;
392381
393- $ ( "#vizBtn " ) . click ( function ( ) {
382+ $ ( "#executeBtn " ) . click ( function ( ) {
394383 mixLazyExecuteCode ( ) ;
395384 } ) ;
396385
0 commit comments