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

« back to all changes in this revision

Viewing changes to ivle/webapp/console/media/console.js

  • Committer: William Grant
  • Date: 2009-02-23 13:56:10 UTC
  • mto: (1100.1.8 new-ui)
  • mto: This revision was merged to the branch mainline in revision 1119.
  • Revision ID: grantw@unimelb.edu.au-20090223135610-pnrfdl3vm2ijl5rs
Disable the console input textbox properly, and don't set the colour
manually.

Show diffs side-by-side

added added

removed removed

Lines of Context:
256
256
    {
257
257
        var inputline = inputbox;
258
258
        inputbox = null;
259
 
        var graytimer = null;
260
259
    }
261
260
    else
262
261
    {
263
262
        GLOBAL_inputbox = inputbox;     /* For timer */
264
263
        var inputline = inputbox.value + "\n";
265
 
        var graytimer = setTimeout("GLOBAL_inputbox.setAttribute(\"class\", "
266
 
            + "\"disabled\");", 100);
267
264
    }
268
265
    var output = document.getElementById("console_output");
269
266
    {
283
280
    var args = {"ivle.op": "chat", "kind": which, "key": server_key, "text":inputline};
284
281
    var callback = function(xhr)
285
282
        {
286
 
            console_response(inputbox, graytimer, inputline, xhr.responseText);
 
283
            console_response(inputbox, inputline, xhr.responseText);
287
284
        }
288
285
    /* Disable the text box */
289
286
    if (inputbox != null)
291
288
    ajax_call(callback, "console", "service", args, "POST");
292
289
}
293
290
 
294
 
function console_response(inputbox, graytimer, inputline, responseText)
 
291
function console_response(inputbox, inputline, responseText)
295
292
{
296
293
    try
297
294
    {
350
347
        }
351
348
        var callback = function(xhr)
352
349
            {
353
 
                console_response(inputbox, graytimer,
354
 
                                 null, xhr.responseText);
 
350
                console_response(inputbox, null, xhr.responseText);
355
351
            }
356
352
        if (interrupted)
357
353
        {
383
379
    if (inputbox != null)
384
380
    {
385
381
        /* Re-enable the text box */
386
 
        clearTimeout(graytimer);
387
382
        inputbox.removeAttribute("disabled");
388
 
        inputbox.removeAttribute("class");
389
383
        interrupted = false;
390
384
    }
391
385