82
82
path = path_join("/home", tmp_path.join('/'));
84
ajax_call(callback1, "console", "service", {"ivle.op": "start", "cwd": path}, "POST");
84
ajax_call(callback1, "consoleservice", "start", {"startdir": path}, "POST");
88
88
// No current_path - let the server decide
89
ajax_call(callback1, "console", "service", {"ivle.op": "start"}, "POST");
89
ajax_call(callback1, "consoleservice", "start", {}, "POST");
255
255
if (typeof(inputbox) == "string")
257
var inputline = inputbox + "\n";
257
var inputline = inputbox;
259
var graytimer = null;
262
/* Disable the text box */
263
inputbox.setAttribute("disabled", "disabled");
265
var inputline = inputbox.value + "\n";
263
GLOBAL_inputbox = inputbox; /* For timer */
264
var inputline = inputbox.value;
265
var graytimer = setTimeout("GLOBAL_inputbox.setAttribute(\"class\", "
266
+ "\"disabled\");", 100);
267
268
var output = document.getElementById("console_output");
269
270
// Print ">>>" span
270
271
var span = document.createElement("span");
271
272
span.setAttribute("class", "inputPrompt");
272
span.appendChild(document.createTextNode(
273
document.getElementById("console_prompt").firstChild.nodeValue)
273
span.appendChild(document.createTextNode(">>> "));
275
274
output.appendChild(span);
276
275
// Print input line itself in a span
277
276
var span = document.createElement("span");
278
277
span.setAttribute("class", "inputMsg");
279
span.appendChild(document.createTextNode(inputline));
278
span.appendChild(document.createTextNode(inputline + "\n"));
280
279
output.appendChild(span);
282
var args = {"ivle.op": "chat", "kind": which, "key": server_key, "text":inputline};
281
var args = {"key": server_key, "text":inputline};
283
282
var callback = function(xhr)
285
console_response(inputbox, inputline, xhr.responseText);
284
console_response(inputbox, graytimer, inputline, xhr.responseText);
287
ajax_call(callback, "console", "service", args, "POST");
286
/* Disable the text box */
287
if (inputbox != null)
288
inputbox.setAttribute("disabled", "disabled");
289
ajax_call(callback, "consoleservice", which, args, "POST");
290
function console_response(inputbox, inputline, responseText)
292
function console_response(inputbox, graytimer, inputline, responseText)
357
360
var kind = "chat";
359
var args = {"ivle.op": "chat", "kind": kind, "key": server_key, "text":''};
360
ajax_call(callback, "console", "service", args, "POST");
362
var args = {"key": server_key, "text":''};
363
ajax_call(callback, "consoleservice", kind, args, "POST");
362
365
// Open up the console so we can see the output
363
366
// FIXME: do we need to maximize here?
466
xhr = ajax_call(null, "console", "service", {"ivle.op": "chat", "kind": "terminate", "key": server_key}, "POST");
467
console_response(null, null, xhr.responseText);
471
xhr = ajax_call(null, "consoleservice", "restart", {"key": server_key}, "POST");
472
console_response(null, null, null, xhr.responseText);