~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 04:13:04 UTC
  • Revision ID: svn-v3-trunk0:2b9c9e99-6f39-0410-b283-7f802c844ae2:trunk:595
browser: Removed the browser.js ability to generate path links at the top.
    This is now done on the server side (since the client no longer navigates
    around).
    New topbar (work in progress) - now starts by the server generating the
    path links.
    Added trailing slash if it's a directory, which should fix the difficulty
    in realising a single path segment is actually a path (spotted by sb).

Show diffs side-by-side

added added

removed removed

Lines of Context:
204
204
 
205
205
    /* Clear away the existing page contents */
206
206
    clearpage();
207
 
    /* Display the path at the top, for navigation */
208
 
    presentpath(path);
209
207
 
210
208
    /* Check the status, and if not 200, read the error and handle this as an
211
209
     * error. */
280
278
 */
281
279
function clearpage()
282
280
{
283
 
    dom_removechildren(document.getElementById("path"));
284
281
    dom_removechildren(document.getElementById("filesbody"));
285
282
}
286
283
 
348
345
    files.appendChild(txt_elem);
349
346
}
350
347
 
351
 
/** Presents a path list (address bar inside the page) for clicking.
352
 
 */
353
 
function presentpath(path)
354
 
{
355
 
    var dom_path = document.getElementById("path");
356
 
    var href_path = make_path(this_app);
357
 
    var nav_path = "";
358
 
    var dir;
359
 
 
360
 
    /* Also set the document title */
361
 
    document.title = path_basename(path) + " - IVLE";
362
 
    /* Create all of the paths */
363
 
    var pathlist = path.split("/");
364
 
    for (var i=0; i<pathlist.length; i++)
365
 
    {
366
 
        dir = pathlist[i];
367
 
        if (dir == "") continue;
368
 
        /* Make an 'a' element */
369
 
        href_path = path_join(href_path, dir);
370
 
        nav_path = path_join(nav_path, dir);
371
 
        var link = dom_make_link_elem("a", dir, "Navigate to " + nav_path,
372
 
                href_path/*, "navigate(" + repr(href_path) + ")"*/);
373
 
        dom_path.appendChild(link);
374
 
        dom_path.appendChild(document.createTextNode("/"));
375
 
    }
376
 
    dom_path.removeChild(dom_path.lastChild);
377
 
}
378
 
 
379
348
/** Given a mime type, returns the path to the icon.
380
349
 * \param type String, Mime type.
381
350
 * \param sizelarge Boolean, optional.