~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-01-14 01:59:00 UTC
  • Revision ID: svn-v3-trunk0:2b9c9e99-6f39-0410-b283-7f802c844ae2:trunk:222
browser.js:
    Edit mode no longer switches to browser mode in a directory.
    Instead, it creates a new file for editing in that directory, and goes to
    the editor environment.

Show diffs side-by-side

added added

removed removed

Lines of Context:
60
60
 
61
61
/* Mapping SVN status to icons, just the file's basename */
62
62
svn_icons = {
63
 
    "unversioned": null,
 
63
    "unversioned": "unversioned.png",
64
64
    "normal": "normal.png",
65
65
    "added": "added.png",
66
66
    "missing": "missing.png",
81
81
    "conflicted": "Permanent file (conflicted)",
82
82
};
83
83
 
84
 
default_svn_icon = null;
 
84
default_svn_icon = "modified.png";
85
85
default_svn_nice = "Unknown status";
86
86
 
87
87
svn_icons_path = "media/images/svn";
186
186
{
187
187
    /* TODO: Set location bar to "path" */
188
188
    current_path = path;
 
189
    settitle(path);
189
190
 
190
191
    /* Clear away the existing page contents */
191
192
    clearpage();
320
321
    }
321
322
}
322
323
 
 
324
function settitle(path)
 
325
{
 
326
    document.title = path_basename(path) + " - IVLE";
 
327
}
 
328
 
323
329
/*** HANDLERS for different types of responses (such as dir listing, file,
324
330
 * etc). */
325
331
 
341
347
    var href_path = make_path(this_app);
342
348
    var nav_path = "";
343
349
 
344
 
    /* Also set the document title */
345
 
    document.title = path_basename(path) + " - IVLE";
346
350
    /* Create all of the paths */
347
351
    for each (var dir in path.split("/"))
348
352
    {
380
384
/** Given an svnstatus, returns the path to the icon.
381
385
 * \param type String, svn status.
382
386
 * \return Path to the icon. Has applied make_path, so it is relative to site
383
 
 * root. May return null to indicate no SVN icon.
 
387
 * root.
384
388
 */
385
389
function svnstatus_to_icon(svnstatus)
386
390
{
389
393
        filename = svn_icons[svnstatus];
390
394
    else
391
395
        filename = default_svn_icon;
392
 
    if (filename == null) return null;
393
396
    return make_path(path_join(svn_icons_path, filename));
394
397
}
395
398
 
412
415
    var div = document.createElement("div");
413
416
    files.appendChild(div);
414
417
    div.setAttribute("class", "padding");
415
 
    var download_link = app_path(download_app, path);
 
418
    var download_link = make_path(path_join(download_app, path));
416
419
    var par1 = dom_make_text_elem("p",
417
420
        "The file " + path + " is a binary file. To download this file, " +
418
421
        "click the following link:");