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

« back to all changes in this revision

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

  • Committer: mattgiuca
  • Date: 2008-02-28 07:45:50 UTC
  • Revision ID: svn-v3-trunk0:2b9c9e99-6f39-0410-b283-7f802c844ae2:trunk:607
browser/browser.js: All the actions in "more actions" now actually take
effect.
    (Added handler for each action).
    (EXCEPT for those that weren't implemented in the first place - these
    still need to be implemented, along with Select All and None).

Show diffs side-by-side

added added

removed removed

Lines of Context:
623
623
    /* Reset to "More actions..." */
624
624
    moreactions.selectedIndex = 0;
625
625
 
 
626
    /* If 0 files selected, filename is the name of the current dir.
 
627
     * If 1 file selected, filename is that file.
 
628
     */
 
629
    if (selected_files.length == 0)
 
630
        filename = path_basename(current_path);
 
631
    else if (selected_files.length == 1)
 
632
        filename = selected_files[0];
 
633
    else
 
634
        filename = null;
 
635
 
626
636
    /* Now handle the selected action */
627
 
    alert("Action: " + selectedaction);
628
 
    /* TODO */
 
637
    switch(selectedaction)
 
638
    {
 
639
    case "publish":
 
640
        action_publish(selected_files);
 
641
        break;
 
642
    case "unpublish":
 
643
        action_unpublish(selected_files);
 
644
        break;
 
645
    case "share":
 
646
        // TODO
 
647
        alert("Not yet implemented: Sharing files");
 
648
        break;
 
649
    case "submit":
 
650
        // TODO
 
651
        alert("Not yet implemented: Submit");
 
652
        break;
 
653
    case "rename":
 
654
        action_rename(filename);
 
655
        break;
 
656
    case "delete":
 
657
        action_remove(selected_files);
 
658
        break;
 
659
    case "copy":
 
660
        action_copy(selected_files);
 
661
        break;
 
662
    case "cut":
 
663
        action_cut(selected_files);
 
664
        break;
 
665
    case "paste":
 
666
        action_paste();
 
667
        break;
 
668
    case "newfile":
 
669
        // TODO
 
670
        alert("Not yet implemented: New File");
 
671
        break;
 
672
    case "mkdir":
 
673
        action_mkdir();
 
674
        break;
 
675
    case "upload":
 
676
        show_uploadpanel(true);
 
677
        break;
 
678
    case "svnadd":
 
679
        action_add(selected_files);
 
680
        break;
 
681
    case "svnrevert":
 
682
        action_revert(selected_files);
 
683
        break;
 
684
    case "svncommit":
 
685
        action_commit(selected_files);
 
686
        break;
 
687
    }
629
688
}
630
689
 
631
690
/** Called when the page loads initially.