File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -59,11 +59,19 @@ var ts_backend_script = 'web_exec_ts.py';
5959var java_backend_script = 'web_exec_java.py' ;
6060var ruby_backend_script = 'web_exec_ruby.py' ;
6161
62+ // this is customized to my own Linode server:
6263// these are the REAL endpoints, accessed via jsonp. code is in ../../v4-cokapi/
63- var JS_JSONP_ENDPOINT = 'http://104.237.139.253:3000/exec_js_jsonp' ; // for deployment
64- var TS_JSONP_ENDPOINT = 'http://104.237.139.253:3000/exec_ts_jsonp' ; // for deployment
65- var JAVA_JSONP_ENDPOINT = 'http://104.237.139.253:3000/exec_java_jsonp' ; // for deployment
66- var RUBY_JSONP_ENDPOINT = 'http://104.237.139.253:3000/exec_ruby_jsonp' ; // for deployment
64+ if ( window . location . protocol === 'https:' ) {
65+ var JS_JSONP_ENDPOINT = 'https://cokapi.com:8001/exec_js_jsonp' ;
66+ var TS_JSONP_ENDPOINT = 'https://cokapi.com:8001/exec_ts_jsonp' ;
67+ var JAVA_JSONP_ENDPOINT = 'https://cokapi.com:8001/exec_java_jsonp' ;
68+ var RUBY_JSONP_ENDPOINT = 'https://cokapi.com:8001/exec_ruby_jsonp' ;
69+ } else {
70+ var JS_JSONP_ENDPOINT = 'http://cokapi.com:3000/exec_js_jsonp' ; // for deployment
71+ var TS_JSONP_ENDPOINT = 'http://cokapi.com:3000/exec_ts_jsonp' ; // for deployment
72+ var JAVA_JSONP_ENDPOINT = 'http://cokapi.com:3000/exec_java_jsonp' ; // for deployment
73+ var RUBY_JSONP_ENDPOINT = 'http://cokapi.com:3000/exec_ruby_jsonp' ; // for deployment
74+ }
6775
6876var domain = "http://pythontutor.com/" ; // for deployment
6977
Original file line number Diff line number Diff line change @@ -372,14 +372,6 @@ function mixLazyExecuteCode() {
372372
373373
374374$ ( document ) . ready ( function ( ) {
375- // make sure that this file is included *after* opt-frontend-common.js so
376- // that these definitions override those in opt-frontend-common.js
377- //
378- // use https endpoints since Mix requires https:
379- JS_JSONP_ENDPOINT = 'https://cokapi.com:8001/exec_js_jsonp' ;
380- TS_JSONP_ENDPOINT = 'https://cokapi.com:8001/exec_ts_jsonp' ;
381- JAVA_JSONP_ENDPOINT = 'https://cokapi.com:8001/exec_java_jsonp' ;
382-
383375 $ ( '#pythonVersionSelector' ) . change ( setAceMode ) ;
384376
385377 $ ( "#executeBtn" ) . click ( function ( ) {
You can’t perform that action at this time.
0 commit comments