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

« back to all changes in this revision

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

  • Committer: mattgiuca
  • Date: 2008-01-14 01:36:43 UTC
  • Revision ID: svn-v3-trunk0:2b9c9e99-6f39-0410-b283-7f802c844ae2:trunk:219
Browser.js: Added handlers for subversion actions.

Show diffs side-by-side

added added

removed removed

Lines of Context:
38
38
 
39
39
function action_rename(fromfilename)
40
40
{
41
 
    tofilename = prompt("Rename file \"" + fromfilename + "\" to?");
 
41
    var tofilename = prompt("Rename file \"" + fromfilename + "\" to?");
42
42
    if (tofilename == null) return;
43
43
    do_action("move", current_path, {"from":fromfilename, "to":tofilename});
44
44
    return false;
68
68
    return false;
69
69
}
70
70
 
 
71
function action_add(files)
 
72
{
 
73
    do_action("svnadd", current_path, {"path":files});
 
74
    return false;
 
75
}
 
76
 
 
77
function action_revert(files)
 
78
{
 
79
    do_action("svnrevert", current_path, {"path":files});
 
80
    return false;
 
81
}
 
82
 
 
83
function action_commit(files)
 
84
{
 
85
    /* Get a commit log from the user */
 
86
    var logmsg = prompt("Enter commit log:");
 
87
    do_action("svncommit", current_path, {"path":files, "logmsg": logmsg});
 
88
    return false;
 
89
}
 
90
 
71
91
/** END ACTIONS **/
72
92
 
73
93
/** Updates the side-panel. Expects selected_files reflects the current
240
260
 
241
261
    if (under_subversion)
242
262
    {
 
263
        /* TODO: Only show relevant links */
243
264
        p = dom_make_text_elem("h3", "Subversion");
244
265
        sidepanel.appendChild(p);
245
 
        /*
246
 
     <p><a href="">Commit</a></p>
247
 
     <p><a href="">Update</a></p>
248
 
         */
 
266
 
 
267
        /* TODO: if any selected files are unversioned */
 
268
        p = dom_make_link_elem("p", "Add",
 
269
            "Schedule the selected temporary files to be added permanently",
 
270
            null,
 
271
            "return action_add(selected_files)");
 
272
        sidepanel.appendChild(p);
 
273
        p = dom_make_link_elem("p", "Revert",
 
274
            "Restore the selected files back to their last committed state",
 
275
            null,
 
276
            "return action_revert(selected_files)");
 
277
        sidepanel.appendChild(p);
 
278
        /* TODO: Update */
 
279
        p = dom_make_link_elem("p", "Commit",
 
280
            "Commit any changes to the permanent repository",
 
281
            null,
 
282
            "return action_commit(selected_files)");
 
283
        sidepanel.appendChild(p);
249
284
    }
250
285
 
251
286
}