~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-07-08 07:09:17 UTC
  • Revision ID: svn-v3-trunk0:2b9c9e99-6f39-0410-b283-7f802c844ae2:trunk:832
Add svnlog to the file actions dropdown.

Show diffs side-by-side

added added

removed removed

Lines of Context:
728
728
    var svndiff = document.getElementById("act_svndiff");
729
729
    var svnrevert = document.getElementById("act_svnrevert");
730
730
    var svncommit = document.getElementById("act_svncommit");
 
731
    var svnlog = document.getElementById("act_svnlog");
731
732
    /* These are only useful if we are in a versioned directory and have some
732
733
     * files selected. */
733
734
    if (numsel >= 1 && current_file.svnstatus)
749
750
        svncommit.setAttribute("disabled", "disabled");
750
751
    }
751
752
 
752
 
    /* Diff only supports one path at the moment. */
 
753
    /* Diff and log only support one path at the moment. */
753
754
    if (numsel == 1)
754
755
    {
755
756
        svnst = file_listing[selected_files[0]].svnstatus;
756
757
 
757
 
        /* Diff also doesn't like unversioned paths, and diffs on unchanged
 
758
        /* Diff and log also don't like unversioned paths, and diffs on unchanged
758
759
         * files are pointless. */
759
 
        if (svnst && svnst != "unversioned" && svnst != "normal")
 
760
        if (svnst && svnst != "unversioned")
760
761
        {
761
 
            svndiff.setAttribute("class", "choice");
762
 
            svndiff.removeAttribute("disabled");
 
762
            if (svnst != "normal")
 
763
            {
 
764
                svndiff.setAttribute("class", "choice");
 
765
                svndiff.removeAttribute("disabled");
 
766
            }
 
767
            else
 
768
            {
 
769
                svndiff.setAttribute("class", "disabled");
 
770
                svndiff.setAttribute("disabled", "disabled");
 
771
            }
 
772
        
 
773
            svnlog.setAttribute("class", "choice");
 
774
            svnlog.removeAttribute("disabled");
763
775
        }
764
776
    }
765
777
    else
766
778
    {
767
779
        svndiff.setAttribute("class", "disabled");
768
780
        svndiff.setAttribute("disabled", "disabled");
 
781
        svnlog.setAttribute("class", "disabled");
 
782
        svnlog.setAttribute("disabled", "disabled");
769
783
    }
770
784
 
771
785
    var svncheckout = document.getElementById("act_svncheckout");
869
883
    case "svncommit":
870
884
        action_commit(selected_files);
871
885
        break;
 
886
    case "svnlog":
 
887
        window.location = path_join(app_path('svnlog'), current_path, selected_files[0]);
 
888
        break;
872
889
    case "svncheckout":
873
890
        action_checkout();
874
891
        break;