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

« back to all changes in this revision

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

  • Committer: wagrant
  • Date: 2008-08-19 12:49:58 UTC
  • Revision ID: svn-v3-trunk0:2b9c9e99-6f39-0410-b283-7f802c844ae2:trunk:1031
Example worksheets: Fix the element names in worksheet 1 to be actually
                    correct. Also fix the first exercise so it too
                    functions properly.

Show diffs side-by-side

added added

removed removed

Lines of Context:
545
545
    }
546
546
}
547
547
 
548
 
/* Updates the list of available actions based on files selected */
549
548
function update_actions()
550
549
{
551
550
    var file;
552
551
    var numsel = selected_files.length;
553
 
    var svn_selection = false;
554
 
    
555
 
    if (numsel > 0)
556
 
    {
557
 
        svn_selection = true;
558
 
        for (var i = 0; i < selected_files.length; i++){
559
 
            if (file_listing[selected_files[i]]["svnstatus"] == "unversioned")
560
 
            {
561
 
                svn_selection = false;        
562
 
            }
563
 
        }
564
 
    }
565
 
    
566
552
    if (numsel <= 1)
567
553
    {
568
554
        if (numsel == 0)
633
619
     */
634
620
    var run = document.getElementById("act_run");
635
621
     
636
 
    if (numsel <= 1 && !file.isdir && file.type == "text/x-python" 
637
 
            && current_file.svnstatus != 'revision')
 
622
    if (!file.isdir && file.type == "text/x-python" && numsel <= 1
 
623
        && current_file.svnstatus != 'revision')
638
624
    {
639
625
        if (numsel == 0)
640
626
        {
717
703
    var pubcond = numsel <= 1 && file.isdir;
718
704
    if (pubcond)
719
705
    {
 
706
        /* TODO: Work out of file is svn'd */
720
707
        /* If this dir is already published, call it "Unpublish" */
721
708
        if (file.published)
722
709
        {
755
742
    /* Subversion actions */
756
743
    /* These are only useful if we are in a versioned directory and have some
757
744
     * files selected. */
758
 
    set_action_state(["svnadd",], numsel >= 1 && current_file.svnstatus);
759
 
    /* And these are only usefull is ALL the selected files are versioned */
760
 
    set_action_state(["svnremove", "svnrevert", "svncommit", "svncopy", 
761
 
            "svncut"], numsel >= 1 && current_file.svnstatus && svn_selection);
762
 
    
 
745
    set_action_state(["svnadd", "svnremove", "svnrevert", "svncommit"], numsel >= 1 && current_file.svnstatus);
 
746
 
763
747
    /* Diff, log and update only support one path at the moment, so we must
764
748
     * have 0 or 1 versioned files selected. If 0, the directory must be
765
749
     * versioned. */
885
869
    case "svnlog":
886
870
        window.location = path_join(app_path('svnlog'), current_path, selected_files[0] || '');
887
871
        break;
888
 
    case "svncopy":
889
 
        action_svncopy(selected_files);
890
 
        break;
891
 
    case "svncut":
892
 
        action_svncut(selected_files);
893
 
        break;
894
872
    }
895
873
}
896
874