~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-23 02:42:54 UTC
  • Revision ID: svn-v3-trunk0:2b9c9e99-6f39-0410-b283-7f802c844ae2:trunk:935
userdb: Large changes:
 - Split out semesters into their own table.
 - Give semesters and enrolments an active flag.
   + Enrolments cannot be active if their semester is not.
 - Introduce the project set concept, to link groups to projects.
   + Groups and projects now reference a project set, not an offering.

Also update the DB access code to respect the group changes.

<FONT COLOR="red"><BLINK>

  ** WARNING: This migration will destroy all groups, enrolments and
              offerings. **

</BLINK></FONT>

Show diffs side-by-side

added added

removed removed

Lines of Context:
241
241
        return;
242
242
    }
243
243
 
244
 
    var subjects = null;
245
 
    var top_level_dir = path==username;
246
 
    if (top_level_dir)
247
 
    {
248
 
        var req = ajax_call(null, "userservice", "get_enrolments", null, "GET")
249
 
        subjects = decode_response(req);
250
 
    }
251
 
 
252
 
 
253
244
    /* This will always return a listing, whether it is a dir or a file.
254
245
     */
255
246
    var listing = response.responseText;
307
298
    var isdir = response.getResponseHeader("X-IVLE-Return") == "Dir";
308
299
    if (isdir)
309
300
    {
310
 
        setup_for_listing();
311
 
        home_listing(listing, subjects, path);
 
301
        handle_dir_listing(path, listing);
312
302
    }
313
303
    else
314
304
    {
545
535
    }
546
536
}
547
537
 
548
 
/* Updates the list of available actions based on files selected */
549
538
function update_actions()
550
539
{
551
540
    var file;
552
541
    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
542
    if (numsel <= 1)
567
543
    {
568
544
        if (numsel == 0)
633
609
     */
634
610
    var run = document.getElementById("act_run");
635
611
     
636
 
    if (numsel <= 1 && !file.isdir && file.type == "text/x-python" 
637
 
            && current_file.svnstatus != 'revision')
 
612
    if (!file.isdir && file.type == "text/x-python" && numsel <= 1
 
613
        && current_file.svnstatus != 'revision')
638
614
    {
639
615
        if (numsel == 0)
640
616
        {
717
693
    var pubcond = numsel <= 1 && file.isdir;
718
694
    if (pubcond)
719
695
    {
 
696
        /* TODO: Work out of file is svn'd */
720
697
        /* If this dir is already published, call it "Unpublish" */
721
698
        if (file.published)
722
699
        {
755
732
    /* Subversion actions */
756
733
    /* These are only useful if we are in a versioned directory and have some
757
734
     * 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
 
    
 
735
    set_action_state(["svnadd", "svnremove", "svnrevert", "svncommit"], numsel >= 1 && current_file.svnstatus);
 
736
 
763
737
    /* Diff, log and update only support one path at the moment, so we must
764
738
     * have 0 or 1 versioned files selected. If 0, the directory must be
765
739
     * versioned. */
776
750
    /* Log should be available for revisions as well. */
777
751
    set_action_state("svnlog", single_versioned_path, true);
778
752
 
 
753
    /* current_path == username: We are at the top level */
 
754
    set_action_state("svncheckout", current_path == username);
 
755
 
779
756
    /* There is currently nothing on the More Actions menu of use
780
757
     * when the current file is not a directory. Hence, just remove
781
758
     * it entirely.
885
862
    case "svnlog":
886
863
        window.location = path_join(app_path('svnlog'), current_path, selected_files[0] || '');
887
864
        break;
888
 
    case "svncopy":
889
 
        action_svncopy(selected_files);
890
 
        break;
891
 
    case "svncut":
892
 
        action_svncut(selected_files);
 
865
    case "svncheckout":
 
866
        action_checkout();
893
867
        break;
894
868
    }
895
869
}