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

« back to all changes in this revision

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

ivle.studpath.url_to_jailpaths: Fix the doctest to use new paths.

Show diffs side-by-side

added added

removed removed

Lines of Context:
55
55
default_type_icon = "txt.png";
56
56
 
57
57
/* Relative to IVLE root */
58
 
type_icons_path = "+media/ivle.webapp.core/images/mime";
59
 
type_icons_path_large = "+media/ivle.webapp.core/images/mime/large";
 
58
type_icons_path = "media/images/mime";
 
59
type_icons_path_large = "media/images/mime/large";
60
60
 
61
61
/* Mapping SVN status to icons, just the file's basename */
62
62
svn_icons = {
87
87
default_svn_icon = null;
88
88
default_svn_nice = "Unknown status";
89
89
 
90
 
svn_icons_path = "+media/ivle.webapp.core/images/svn";
 
90
svn_icons_path = "media/images/svn";
91
91
 
92
 
published_icon = "+media/ivle.webapp.core/images/interface/published.png";
 
92
published_icon = "media/images/interface/published.png";
93
93
 
94
94
/* List of MIME types considered "executable" by the system.
95
95
 * Executable files offer a "run" link, implying that the "serve"
144
144
            /* Check for action errors reported by the server, and report them
145
145
             * to the user */
146
146
            var error = response.getResponseHeader("X-IVLE-Action-Error");
147
 
            if (error != null && error != "")
 
147
            if (error != null)
148
148
                /* Note: This header (in particular) comes URI-encoded, to
149
149
                 * allow multi-line error messages. Decode */
150
150
                alert("Error: " + decodeURIComponent(error.toString()) + ".");
728
728
            publish.setAttribute("value", "unpublish");
729
729
            publish.setAttribute("title" ,"Make it so this directory "
730
730
                + "can not be seen by anyone on the web");
731
 
            publish.firstChild.nodeValue = "Unpublish";
 
731
            publish.textContent = "Unpublish";
732
732
        } else {
733
733
            publish.setAttribute("value", "publish");
734
734
            publish.setAttribute("title","Make it so this directory "
735
735
                + "can be seen by anyone on the web");
736
 
            publish.firstChild.nodeValue = "Publish";
 
736
            publish.textContent = "Publish";
737
737
        }
738
738
    }
739
739
    set_action_state(["publish", "submit"], pubcond);
760
760
    /* Subversion actions */
761
761
    /* These are only useful if we are in a versioned directory and have some
762
762
     * files selected. */
763
 
    set_action_state(["svnadd"], numsel >= 1 && current_file.svnstatus);
 
763
    set_action_state(["svnadd",], numsel >= 1 && current_file.svnstatus);
764
764
    /* And these are only usefull is ALL the selected files are versioned */
765
765
    set_action_state(["svnremove", "svnrevert", "svncommit", "svncopy", 
766
766
            "svncut"], numsel >= 1 && current_file.svnstatus && svn_selection);
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
 
 
793
784
    /* There is currently nothing on the More Actions menu of use
794
785
     * when the current file is not a directory. Hence, just remove
795
786
     * it entirely.
844
835
        action_unpublish(selected_files);
845
836
        break;
846
837
    case "share":
847
 
        window.open(public_app_path("~" + current_path, filename), 'share')
 
838
        //alert("Not yet implemented: Sharing files");
 
839
        window.open(public_app_path(serve_app, current_path, filename), 'share')
848
840
        break;
849
841
    case "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
 
 
 
842
        // TODO
 
843
        alert("Not yet implemented: Submit");
869
844
        break;
870
845
    case "rename":
871
846
        action_rename(filename);