Skip to content

Commit d94ff91

Browse files
committed
bam
1 parent 2a66553 commit d94ff91

2 files changed

Lines changed: 13 additions & 1 deletion

File tree

‎v3/js/opt-frontend-common.js‎

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,9 @@ var useCodeMirror = false; // true -> use CodeMirror, false -> use Ace
124124
var prevExecutionExceptionObjLst = [];
125125

126126

127-
var codeopticonSocketIO = undefined; // socket.io instance -- OPTIONAL: not all frontends use it
127+
// OPTIONAL for Codeopticon - not all frontends use these:
128+
var codeopticonSocketIO = undefined; // socket.io instance
129+
var codeopticonSession = undefined;
128130

129131
// From http://stackoverflow.com/a/8809472
130132
function generateUUID(){
@@ -1077,6 +1079,10 @@ function parseQueryString() {
10771079
rawInputLst = [];
10781080
}
10791081

1082+
if (queryStrOptions.codeopticonSession) {
1083+
codeopticonSession = queryStrOptions.codeopticonSession; // GLOBAL!
1084+
}
1085+
10801086
if (queryStrOptions.testCasesLst) {
10811087
$("#createTestsLink").hide();
10821088
initTestcasesPane('#testCasesPane');
@@ -1110,6 +1116,7 @@ function getQueryStringOptions() {
11101116
heapPrimitives: $.bbq.getState('heapPrimitives'),
11111117
textReferences: $.bbq.getState('textReferences'),
11121118
rawInputLst: ril ? $.parseJSON(ril) : undefined,
1119+
codeopticonSession: $.bbq.getState('codeopticon'),
11131120
testCasesLst: testCasesLstJSON ? $.parseJSON(testCasesLstJSON) : undefined
11141121
};
11151122
}

‎v3/js/opt-frontend.js‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -633,6 +633,11 @@ function chatBoxToggled(visible) {
633633
}
634634

635635
function initCodeopticon() {
636+
// only initialize if you have a valid session ID
637+
if (!codeopticonSession) {
638+
return;
639+
}
640+
636641
// connect on-demand in logEventCodeopticon(), not here
637642
//codeopticonSocketIO = io('http://104.237.139.253:5000/userlog'); // PRODUCTION_PORT
638643
//codeopticonSocketIO = io('http://104.237.139.253:5001/userlog'); // DEBUG_PORT

0 commit comments

Comments
 (0)