~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-16 00:39:26 UTC
  • Revision ID: svn-v3-trunk0:2b9c9e99-6f39-0410-b283-7f802c844ae2:trunk:881
browser.js: Support svndiff and svnlog for versioned directories. Also
            drop the requirement for a diffed file to have changes, as
            we otherwise don't work on directories.

Show diffs side-by-side

added added

removed removed

Lines of Context:
704
704
     * files selected. */
705
705
    set_action_state(["svnadd", "svnrevert", "svncommit"], numsel >= 1 && current_file.svnstatus);
706
706
 
707
 
    /* Diff and log only support one path at the moment. */
708
 
    single_versioned_path = (numsel == 1 &&
709
 
                             (svnst = file_listing[selected_files[0]].svnstatus) &&
710
 
                             svnst != "unversioned");
711
 
    set_action_state("svnlog", single_versioned_path);
712
 
    set_action_state("svndiff", single_versioned_path && svnst != "normal");
 
707
    /* Diff and log only support one path at the moment, so we must have 0 or 1
 
708
     * versioned files selected. If 0, the directory must be versioned. */
 
709
    single_versioned_path = (
 
710
         (
 
711
          (numsel == 1 && (svnst = file_listing[selected_files[0]].svnstatus)) ||
 
712
          (numsel == 0 && (svnst = current_file.svnstatus))
 
713
         ) && svnst != "unversioned");
 
714
    set_action_state(["svnlog", "svndiff"], single_versioned_path);
713
715
 
714
716
    /* current_path == username: We are at the top level */
715
717
    set_action_state("svncheckout", current_path == username);
806
808
        action_revert(selected_files);
807
809
        break;
808
810
    case "svndiff":
809
 
        window.location = path_join(app_path('diff'), current_path, selected_files[0]);
 
811
        window.location = path_join(app_path('diff'), current_path, selected_files[0] || '');
810
812
        break;
811
813
    case "svncommit":
812
814
        action_commit(selected_files);
813
815
        break;
814
816
    case "svnlog":
815
 
        window.location = path_join(app_path('svnlog'), current_path, selected_files[0]);
 
817
        window.location = path_join(app_path('svnlog'), current_path, selected_files[0] || '');
816
818
        break;
817
819
    case "svncheckout":
818
820
        action_checkout();