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

« back to all changes in this revision

Viewing changes to ivle/webapp/filesystem/browser/media/browser.js

  • Committer: William Grant
  • Date: 2009-12-07 04:22:22 UTC
  • Revision ID: grantw@unimelb.edu.au-20091207042222-lor5fixbzwniti3i
Revert client-side parts of r1333; reliance on the deprecated tab mechanism is to be avoided.

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
 */
22
22
 
23
23
/* Url names for apps */
 
24
this_app = "files";
24
25
edit_app = "edit";
25
26
service_app = "fileservice";
26
27
serve_app = "serve";
963
964
    navigate(path);
964
965
}
965
966
 
 
967
/** Gets the current path of the window */
 
968
function get_path() {
 
969
    var path = parse_url(window.location.href).path;
 
970
    /* Strip out root_dir + "/files" from the front of the path */
 
971
    var strip = make_path(this_app);
 
972
    if (path.substr(0, strip.length) == strip)
 
973
        path = path.substr(strip.length+1);
 
974
    else
 
975
    {
 
976
        /* See if this is an edit path */
 
977
        strip = make_path(edit_app);
 
978
        if (path.substr(0, strip.length) == strip)
 
979
        {
 
980
            path = path.substr(strip.length+1);
 
981
        }
 
982
    }
 
983
 
 
984
    if (path.length == 0)
 
985
    {
 
986
        /* Navigate to the user's home directory by default */
 
987
        /* TEMP? */
 
988
        path = username;
 
989
    }
 
990
 
 
991
    return path;
 
992
}