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

« back to all changes in this revision

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

  • Committer: chadnickbok
  • Date: 2009-01-19 22:56:46 UTC
  • Revision ID: svn-v3-trunk0:2b9c9e99-6f39-0410-b283-7f802c844ae2:trunk:1170
This commit fixes issue #10 and part of issue #9

There are now two options for moving files with their
svn history intact; svn move and svn copy. These
use the svn commands to move the files, allowing students
to move and rename files without their histories being
lost.

This commit also shows the svn status of a dir, if it is
the 'head' of an svn repository.

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