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

« back to all changes in this revision

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

  • Committer: dcoles
  • Date: 2008-07-15 06:17:22 UTC
  • Revision ID: svn-v3-trunk0:2b9c9e99-6f39-0410-b283-7f802c844ae2:trunk:873
Filebrowser: Clean up the javascript code a bit.

Show diffs side-by-side

added added

removed removed

Lines of Context:
587
587
     */
588
588
    var run = document.getElementById("act_run");
589
589
     
590
 
    if (numsel == 0 && !file.isdir && file.type == "text/x-python")
591
 
    {
592
 
        // In the edit window
593
 
        run.setAttribute("class", "choice");
594
 
        localpath = app_path('home',current_path);
595
 
        run.setAttribute("onclick", "runfile('" + localpath + "')");
596
 
    }
597
 
    else if (numsel == 1 && !file.isdir && file.type == "text/x-python")
598
 
    {
599
 
        // In the browser window
600
 
        run.setAttribute("class", "choice");
601
 
        localpath = app_path('home',current_path,filename);
 
590
    if (!file.isdir && file.type == "text/x-python" && numsel <= 1)
 
591
    {
 
592
        if (numsel == 0)
 
593
        {
 
594
            // In the edit window
 
595
            var localpath = path_join('/home', current_path);
 
596
        }
 
597
        else
 
598
        {
 
599
            // In the browser window
 
600
            var localpath = path_join('/home', current_path, filename);
 
601
        }
 
602
        run.setAttribute("class", "choice");
602
603
        run.setAttribute("onclick", "runfile('" + localpath + "')");
603
604
    }
604
605
    else