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

« back to all changes in this revision

Viewing changes to ivle/webapp/filesystem/browser/media/browser.js

  • Committer: William Grant
  • Date: 2009-04-07 03:48:23 UTC
  • mfrom: (1165.1.46 submissions)
  • Revision ID: grantw@unimelb.edu.au-20090407034823-snd6wa5p6otzq073
Allow students to submit projects from personal or group repositories.

Show diffs side-by-side

added added

removed removed

Lines of Context:
781
781
    /* Log should be available for revisions as well. */
782
782
    set_action_state("svnlog", single_versioned_path, true);
783
783
 
 
784
    single_ivle_versioned_path = (
 
785
         (
 
786
          (numsel == 1 && (stat = file_listing[selected_files[0]])) ||
 
787
          (numsel == 0 && (stat = current_file))
 
788
         ) && stat.svnstatus != "unversioned"
 
789
           && stat.svnurl
 
790
           && stat.svnurl.substr(0, svn_base.length) == svn_base);
 
791
    set_action_state(["submit"], single_ivle_versioned_path);
 
792
 
784
793
    /* There is currently nothing on the More Actions menu of use
785
794
     * when the current file is not a directory. Hence, just remove
786
795
     * it entirely.
838
847
        window.open(public_app_path("~" + current_path, filename), 'share')
839
848
        break;
840
849
    case "submit":
841
 
        // TODO
842
 
        alert("Not yet implemented: Submit");
 
850
        if (selected_files.length == 1)
 
851
            stat = file_listing[selected_files[0]];
 
852
        else
 
853
            stat = current_file;
 
854
        path = stat.svnurl.substr(svn_base.length);
 
855
 
 
856
        /* The working copy might not have an up-to-date version of the
 
857
         * directory. While submitting like this could yield unexpected
 
858
         * results, we should really submit the latest revision to minimise
 
859
         * terrible mistakes - so we run off and ask fileservice for the
 
860
         * latest revision.*/
 
861
        $.post(app_path(service_app, current_path),
 
862
            {"action": "svnrepostat", "path": path},
 
863
            function(result)
 
864
            {
 
865
                window.location = path_join(app_path('+submit'), path) + '?revision=' + result.svnrevision;
 
866
            },
 
867
            "json");
 
868
 
843
869
        break;
844
870
    case "rename":
845
871
        action_rename(filename);