From 18a575e02816622706f740e9938515869b58a375 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ale=C5=A1=20Smodi=C5=A1?= Date: Mon, 14 Sep 2015 14:52:30 +0200 Subject: Reimplemented communication with the server. * Using engine.io to use web sockets or long polling. * Changed to a single-page app. --- js/prolog.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'js/prolog.js') diff --git a/js/prolog.js b/js/prolog.js index 90b1b69..7ea8ce3 100644 --- a/js/prolog.js +++ b/js/prolog.js @@ -84,7 +84,7 @@ return {}; }; - var makeActivityHandler = function (editor) { + var makeActivityHandler = function (editor, problem_id) { var lastActivityMillis = Date.now(), deltaActivityMillis = function deltaActivityMillisFunc () { var now = Date.now(), @@ -98,7 +98,7 @@ var promise; ts = null; if (queue.length === 0) return Q(true); - promise = codeq.comms.sendActivity(queue, editor.getDoc().getValue()); + promise = codeq.comms.sendActivity(queue, editor.getDoc().getValue(), problem_id); queue.length = 0; return promise; }, @@ -147,7 +147,7 @@ jqConsole = $('#console'), jqHints = $('#info'), editor = CodeMirror(jqEditor[0], { cursorHeight: 0.85, lineNumbers: true, matchBrackets: true }), - activityHandler = makeActivityHandler(editor), + activityHandler = makeActivityHandler(editor, problem.id), /* controller = jqConsole.console({ promptLabel: '?- ', commandValidate: function (line) { -- cgit v1.2.1