~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-03-10 10:46:55 UTC
  • Revision ID: svn-v3-trunk0:2b9c9e99-6f39-0410-b283-7f802c844ae2:trunk:683
browser/listing.js: When the "rename" dialog comes up, the default text is
the old name.

Show diffs side-by-side

added added

removed removed

Lines of Context:
487
487
    /* Available if exactly one file is selected,
488
488
     * and it is a Python file.
489
489
     */
490
 
    var run = document.getElementById("act_run");
491
 
     
492
 
    if (numsel == 0 && !file.isdir && file.type == "text/x-python")
493
 
    {
494
 
        // In the edit window
495
 
        run.setAttribute("class", "choice");
496
 
        localpath = app_path('home',current_path);
497
 
        run.setAttribute("onclick", "runfile('" + localpath + "')");
498
 
    }
499
 
    else if (numsel == 1 && !file.isdir && file.type == "text/x-python")
500
 
    {
501
 
        // In the browser window
502
 
        run.setAttribute("class", "choice");
503
 
        localpath = app_path('home',current_path,filename);
504
 
        run.setAttribute("onclick", "runfile('" + localpath + "')");
505
 
    }
506
 
    else
507
 
    {
508
 
        run.setAttribute("class", "disabled");
509
 
        run.removeAttribute("onclick");
510
 
    }
 
490
    /* TODO */
511
491
 
512
492
    /* Download */
513
493
    /* Always available.
743
723
    }
744
724
}
745
725
 
746
 
/** User clicks "Run" button.
747
 
 * Do an Ajax call and print the test output.
748
 
 */
749
 
function runfile(localpath)
750
 
{
751
 
    /* Dump the entire file to the console */
752
 
    var callback = function()
753
 
    {
754
 
        console_enter_line("execfile('" + localpath + "')", "block");
755
 
    }
756
 
    start_server(callback)
757
 
    return;
758
 
}
759
 
 
760
726
/** Called when the page loads initially.
761
727
 */
762
728
window.onload = function()
788
754
    }
789
755
 
790
756
    navigate(path);
791
 
 
792
 
    /* Set up the console plugin to display as a popup window */
793
 
    console_init(true);
794
757
}