43
43
"application/x-javascript" : "text",
44
44
"application/javascript" : "text",
45
45
"application/json" : "text",
46
"application/xml" : "text",
46
"application/xml" : "text"
49
49
/* Mapping MIME types to icons, just the file's basename */
51
51
"text/directory": "dir.png",
52
"text/x-python": "py.png",
52
"text/x-python": "py.png"
55
55
default_type_icon = "txt.png";
66
66
"missing": "missing.png",
67
67
"deleted": "deleted.png",
68
68
"modified": "modified.png",
69
"revision": "revision.png"
71
72
/* Mapping SVN status to "nice" strings */
79
80
"modified": "Permanent file (modified)",
80
81
"merged": "Permanent file (merged)",
81
82
"conflicted": "Permanent file (conflicted)",
83
"revision": "Past Permanent file (revision)"
84
86
default_svn_icon = null;
120
122
* Defaults to "application/x-www-form-urlencoded".
121
123
* "multipart/form-data" is recommended for large uploads.
123
function do_action(action, path, args, content_type)
125
function do_action(action, path, args, content_type, ignore_response)
125
127
args.action = action;
128
/* Callback action, when the server returns */
129
var callback = function(response)
131
/* Check for action errors reported by the server, and report them
133
var error = response.getResponseHeader("X-IVLE-Action-Error");
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);
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
130
error = response.getResponseHeader("X-IVLE-Action-Error");
132
alert("Error: " + error.toString() + ".");
133
/* Now read the response and set up the page accordingly */
134
handle_response(path, response);
141
ajax_call(callback, service_app, path, args, "POST", content_type);
137
144
/** Calls the server using Ajax, requesting a directory listing. This should
147
154
function navigate(path, editmode)
156
callback = function(response)
158
/* Read the response and set up the page accordingly */
159
handle_response(path, response, editmode);
161
/* Get any query strings */
162
url = parse_url(window.location.href);
149
164
/* Call the server and request the listing. This mutates the server. */
150
response = ajax_call(service_app, path, null, "GET");
151
/* Now read the response and set up the page accordingly */
152
handle_response(path, response, editmode);
165
ajax_call(callback, service_app, path, url.args, "GET");
155
168
/** Determines the "handler type" from a MIME type.