~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-27 00:00:38 UTC
  • Revision ID: svn-v3-trunk0:2b9c9e99-6f39-0410-b283-7f802c844ae2:trunk:594
Added to doc/setup/faq.txt: sessions directory.

Show diffs side-by-side

added added

removed removed

Lines of Context:
65
65
    "added": "added.png",
66
66
    "missing": "missing.png",
67
67
    "deleted": "deleted.png",
68
 
    "modified": "modified.png"
 
68
    "modified": "modified.png",
 
69
    "revision": "revision.png"
69
70
};
70
71
 
71
72
/* Mapping SVN status to "nice" strings */
78
79
    "replaced": "Permanent file (replaced)",
79
80
    "modified": "Permanent file (modified)",
80
81
    "merged": "Permanent file (merged)",
81
 
    "conflicted": "Permanent file (conflicted)"
 
82
    "conflicted": "Permanent file (conflicted)",
 
83
    "revision": "Past Permanent file (revision)"
82
84
};
83
85
 
84
86
default_svn_icon = null;
123
125
function do_action(action, path, args, content_type, ignore_response)
124
126
{
125
127
    args.action = action;
 
128
    /* Callback action, when the server returns */
 
129
    var callback = function(response)
 
130
        {
 
131
            /* Check for action errors reported by the server, and report them
 
132
             * to the user */
 
133
            var error = response.getResponseHeader("X-IVLE-Action-Error");
 
134
            if (error != null)
 
135
                alert("Error: " + error.toString() + ".");
 
136
            /* Now read the response and set up the page accordingly */
 
137
            if (ignore_response != true)
 
138
                handle_response(path, response);
 
139
        }
126
140
    /* Call the server and perform the action. This mutates the server. */
127
 
    response = ajax_call(service_app, path, args, "POST", content_type);
128
 
    /* Check for action errors reported by the server, and report them to the
129
 
     * user */
130
 
    error = response.getResponseHeader("X-IVLE-Action-Error");
131
 
    if (error != null)
132
 
        alert("Error: " + error.toString() + ".");
133
 
    /* Now read the response and set up the page accordingly */
134
 
    if (ignore_response != true)
135
 
        handle_response(path, response);
 
141
    ajax_call(callback, service_app, path, args, "POST", content_type);
136
142
}
137
143
 
138
144
/** Calls the server using Ajax, requesting a directory listing. This should
147
153
 */
148
154
function navigate(path, editmode)
149
155
{
 
156
    callback = function(response)
 
157
        {
 
158
            /* Read the response and set up the page accordingly */
 
159
            handle_response(path, response, editmode);
 
160
        }
 
161
    /* Get any query strings */
 
162
    url = parse_url(window.location.href);
 
163
    
150
164
    /* Call the server and request the listing. This mutates the server. */
151
 
    response = ajax_call(service_app, path, null, "GET");
152
 
    /* Now read the response and set up the page accordingly */
153
 
    handle_response(path, response, editmode);
 
165
    ajax_call(callback, service_app, path, url.args, "GET");
154
166
}
155
167
 
156
168
/** Determines the "handler type" from a MIME type.