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

« back to all changes in this revision

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

  • Committer: mattgiuca
  • Date: 2008-01-14 01:40:49 UTC
  • Revision ID: svn-v3-trunk0:2b9c9e99-6f39-0410-b283-7f802c844ae2:trunk:220
browser: Removed 3 buttons which didn't do anything.
    Split editor handler into editor.js.

Show diffs side-by-side

added added

removed removed

Lines of Context:
396
396
        return default_svn_nice;
397
397
}
398
398
 
399
 
/** Presents the text editor.
400
 
 */
401
 
function handle_text(path, text, handler_type)
402
 
{
403
 
    /* Create a textarea with the text in it
404
 
     * (The makings of a primitive editor).
405
 
     */
406
 
 
407
 
    setmode(true);
408
 
    var files = document.getElementById("filesbody");
409
 
    var div = document.createElement("div");
410
 
    files.appendChild(div);
411
 
    div.setAttribute("class", "padding");
412
 
    /* First, print a warning message if this is not actually a text file.
413
 
     */
414
 
    if (handler_type != "text")
415
 
    {
416
 
        var warn = dom_make_text_elem("p",
417
 
            "Warning: You are editing a binary " +
418
 
            "file, which explains any strange characters you may see. If " +
419
 
            "you save this file, you could corrupt it.");
420
 
        div.appendChild(warn);
421
 
    }
422
 
    var txt_elem = dom_make_text_elem("textarea",
423
 
        text.toString())
424
 
    div.appendChild(txt_elem);
425
 
    txt_elem.setAttribute("id", "editbox");
426
 
    /* TODO: Make CSS height: 100% work */
427
 
    txt_elem.setAttribute("rows", "20");
428
 
}
429
 
 
430
399
/** Displays a download link to the binary file.
431
400
 */
432
401
function handle_binary(path)