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

« back to all changes in this revision

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

  • Committer: drtomc
  • Date: 2008-02-29 00:46:15 UTC
  • Revision ID: svn-v3-trunk0:2b9c9e99-6f39-0410-b283-7f802c844ae2:trunk:618
console: Get rid of all the extra pre elements.
         Now we just use spans inside a single pre.
         Also got rid of the spurious 2 spaces at the start of the first line.

Show diffs side-by-side

added added

removed removed

Lines of Context:
230
230
        var graytimer = setTimeout("GLOBAL_inputbox.setAttribute(\"class\", "
231
231
            + "\"disabled\");", 100);
232
232
    }
 
233
    var output = document.getElementById("console_output");
 
234
    {
 
235
        var span = document.createElement("span");
 
236
        span.setAttribute("class", "inputMsg");
 
237
        span.appendChild(document.createTextNode(inputline + "\n"));
 
238
        output.appendChild(span);
 
239
    }
233
240
    var args = {"key": server_key, "text":inputline};
234
241
    var callback = function(xhr)
235
242
        {
245
252
{
246
253
    var res = JSON.parse(responseText);
247
254
    var output = document.getElementById("console_output");
248
 
    if (inputline)
249
 
    {
250
 
        var pre = document.createElement("pre");
251
 
        pre.setAttribute("class", "inputMsg");
252
 
        pre.appendChild(document.createTextNode(inputline + "\n"));
253
 
        output.appendChild(pre);
254
 
    }
255
255
    if (res.hasOwnProperty('okay'))
256
256
    {
257
257
        // Success!
258
258
        if (res.okay)
259
259
        {
260
 
            var pre = document.createElement("pre");
261
 
            pre.setAttribute("class", "outputMsg");
262
 
            pre.appendChild(document.createTextNode(res.okay + "\n"));
263
 
            output.appendChild(pre);
 
260
            output.appendChild(document.createTextNode(res.okay + "\n"));
 
261
            output.appendChild(span);
264
262
        }
265
263
        // set the prompt to >>>
266
264
        var prompt = document.getElementById("console_prompt");
270
268
    {
271
269
        // Failure!
272
270
        // print out the error message (res.exc)
273
 
        var pre = document.createElement("pre");
274
 
        pre.setAttribute("class", "errorMsg");
275
 
        pre.appendChild(document.createTextNode(res.exc));
276
 
        output.appendChild(pre);
 
271
        var span = document.createElement("span");
 
272
        span.setAttribute("class", "errorMsg");
 
273
        span.appendChild(document.createTextNode(res.exc + "\n"));
 
274
        output.appendChild(span);
277
275
    }
278
276
    else if (res.hasOwnProperty('more'))
279
277
    {
285
283
    {
286
284
        if (res.output.length > 0)
287
285
        {
288
 
            var pre = document.createElement("pre");
289
 
            pre.setAttribute("class", "outputMsg");
290
 
            pre.appendChild(document.createTextNode(res.output));
291
 
            output.appendChild(pre);
 
286
            output.appendChild(document.createTextNode(res.output));
292
287
        }
293
288
        var callback = function(xhr)
294
289
            {