~azzar1/unity/add-show-desktop-key

« back to all changes in this revision

Viewing changes to www/media/console/console.js

Port ivle.webapp.filesystem.{diff,svnlog}'s media to the new framework.

Show diffs side-by-side

added added

removed removed

Lines of Context:
81
81
            tmp_path.pop();
82
82
            path = path_join("/home", tmp_path.join('/'));
83
83
        }
84
 
        ajax_call(callback1, "consoleservice", "start", {"startdir": path}, "POST");
 
84
        ajax_call(callback1, "console", "service", {"ivle.op": "start", "cwd": path}, "POST");
85
85
    }
86
86
    else
87
87
    {
88
88
        // No current_path - let the server decide
89
 
        ajax_call(callback1, "consoleservice", "start", {}, "POST");
 
89
        ajax_call(callback1, "console", "service", {"ivle.op": "start"}, "POST");
90
90
    }
91
91
}
92
92
 
270
270
        // Print ">>>" span
271
271
        var span = document.createElement("span");
272
272
        span.setAttribute("class", "inputPrompt");
273
 
        span.appendChild(document.createTextNode(">>> "));
 
273
        span.appendChild(document.createTextNode(
 
274
              document.getElementById("console_prompt").firstChild.textContent)
 
275
                        );
274
276
        output.appendChild(span);
275
277
        // Print input line itself in a span
276
278
        var span = document.createElement("span");
278
280
        span.appendChild(document.createTextNode(inputline));
279
281
        output.appendChild(span);
280
282
    }
281
 
    var args = {"key": server_key, "text":inputline};
 
283
    var args = {"ivle.op": "chat", "kind": which, "key": server_key, "text":inputline};
282
284
    var callback = function(xhr)
283
285
        {
284
286
            console_response(inputbox, graytimer, inputline, xhr.responseText);
286
288
    /* Disable the text box */
287
289
    if (inputbox != null)
288
290
        inputbox.setAttribute("disabled", "disabled");
289
 
    ajax_call(callback, "consoleservice", which, args, "POST");
 
291
    ajax_call(callback, "console", "service", args, "POST");
290
292
}
291
293
 
292
294
function console_response(inputbox, graytimer, inputline, responseText)
359
361
        {
360
362
            var kind = "chat";
361
363
        }
362
 
        var args = {"key": server_key, "text":''};
363
 
        ajax_call(callback, "consoleservice", kind, args, "POST");
 
364
        var args = {"ivle.op": "chat", "kind": kind, "key": server_key, "text":''};
 
365
        ajax_call(callback, "console", "service", args, "POST");
364
366
 
365
367
        // Open up the console so we can see the output
366
368
        // FIXME: do we need to maximize here?
468
470
    }
469
471
    else
470
472
    {
471
 
        xhr = ajax_call(null, "consoleservice", "restart", {"key": server_key}, "POST");
 
473
        xhr = ajax_call(null, "console", "service", {"ivle.op": "chat", "kind": "terminate", "key": server_key}, "POST");
472
474
        console_response(null, null, null, xhr.responseText);
473
475
    }
474
476
}