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

« back to all changes in this revision

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

ivle.webapp.groups: Remove most of the view code; the template now accesses
    the objects directly. Also fix a few double-encodings and typos.

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