95
function action_publish(files)
97
do_action("svnpublish", current_path, {"path":files});
101
function action_unpublish(files)
103
do_action("svnunpublish", current_path, {"path":files});
95
107
function action_commit(files)
97
109
/* Get a commit log from the user */
149
161
sidepanel.appendChild(p);
150
162
p = dom_make_text_elem("p", filetype_nice);
151
163
sidepanel.appendChild(p);
164
var mini_icons = document.createElement("p");
165
sidepanel.appendChild(mini_icons);
152
167
if (under_subversion)
154
p = document.createElement("p");
155
var icon = svnstatus_to_icon(file.svnstatus);
169
icon = svnstatus_to_icon(file.svnstatus);
157
p.appendChild(dom_make_img(icon, icon_size, icon_size,
171
mini_icons.appendChild(dom_make_img(icon, icon_size, icon_size,
158
172
svnstatus_to_string(file.svnstatus)));
159
sidepanel.appendChild(p);
160
173
p = dom_make_text_elem("p", svnstatus_to_string(file.svnstatus));
161
174
sidepanel.appendChild(p);
176
if ("published" in file && file.published)
178
icon = make_path(path_join(published_icon));
181
if (mini_icons.childNodes.length > 0)
182
mini_icons.appendChild(document.createTextNode(" "));
183
mini_icons.appendChild(dom_make_img(icon, icon_size, icon_size,
184
"Published directory"));
186
p = dom_make_text_elem("p", "Published directory");
187
p.setAttribute("title",
188
"Anybody on the web can view the files in this directory.");
189
sidepanel.appendChild(p);
191
/* If we never wrote any mini-icons, remove this element */
192
if (mini_icons.childNodes.length == 0)
193
sidepanel.removeChild(mini_icons);
163
194
if ("size" in file)
165
196
p = dom_make_text_elem("p", "Size: " + nice_filesize(file.size));
190
221
p = dom_make_text_elem("h3", "Actions");
191
222
sidepanel.appendChild(p);
226
/* Publish/unpublish */
227
if (selected_files.length == 0)
231
if ("published" in file && file.published)
233
p = dom_make_link_elem("p", "Unpublish",
234
"Make it so this directory cannot be seen by anyone but you",
236
"return action_unpublish(" + repr(path) + ")");
237
sidepanel.appendChild(p);
241
p = dom_make_link_elem("p", "Publish",
242
"Make it so this directory can be seen by anyone on the web",
244
"return action_publish(" + repr(path) + ")");
245
sidepanel.appendChild(p);
193
249
if (selected_files.length <= 1)
195
251
var handler_type = null;
242
298
sidepanel.appendChild(p);
244
p = dom_make_link_elem("p", "Rename",
245
"Change the name of this file", null,
246
"return action_rename(" + repr(filename) + ")");
247
sidepanel.appendChild(p);
300
if (selected_files.length > 0)
301
{ /* Can't rename if we're in it */
302
p = dom_make_link_elem("p", "Rename",
303
"Change the name of this file", null,
304
"return action_rename(" + repr(filename) + ")");
305
sidepanel.appendChild(p);
261
320
/* Common actions */
262
p = dom_make_link_elem("p", "Delete",
263
"Delete the selected files", null,
264
"return action_remove(selected_files)");
265
sidepanel.appendChild(p);
266
p = dom_make_link_elem("p", "Cut",
267
"Prepare to move the selected files to another directory", null,
268
"return action_cut(selected_files)");
269
sidepanel.appendChild(p);
270
p = dom_make_link_elem("p", "Copy",
271
"Prepare to copy the selected files to another directory", null,
272
"return action_copy(selected_files)");
273
sidepanel.appendChild(p);
321
if (selected_files.length > 0)
323
p = dom_make_link_elem("p", "Delete",
324
"Delete the selected files", null,
325
"return action_remove(selected_files)");
326
sidepanel.appendChild(p);
327
p = dom_make_link_elem("p", "Cut",
328
"Prepare to move the selected files to another directory", null,
329
"return action_cut(selected_files)");
330
sidepanel.appendChild(p);
331
p = dom_make_link_elem("p", "Copy",
332
"Prepare to copy the selected files to another directory", null,
333
"return action_copy(selected_files)");
334
sidepanel.appendChild(p);
274
336
p = dom_make_link_elem("p", "Paste",
275
337
"Paste the copied or cut files to the current directory", null,
276
338
"return action_paste()");