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

« back to all changes in this revision

Viewing changes to www/media/common/util.js

  • Committer: mattgiuca
  • Date: 2008-02-28 05:19:08 UTC
  • Revision ID: svn-v3-trunk0:2b9c9e99-6f39-0410-b283-7f802c844ae2:trunk:602
util.js: Added shallow_copy_object function.
fileservice: Removed temp code causing return=contents to be the default.
    Now return=listing is the default, so you will not get file contents
    unless you explicitly say "return=contents".
browser: Moved the code to handle a dir listing somewhat from listing.js
    to browser.js, and applies to all returns. Now even non-dir files have a
    listing - all files have a file_listing and current_file global variable,
    which means the correct processing can now be done on files and dirs.
    For non-dir files, it now makes a SECOND Ajax request to get the contents,
    which it then handles in the way it always has (in the text editor or
    a binary form).
    (Suggested by Tom Conway).

Show diffs side-by-side

added added

removed removed

Lines of Context:
519
519
    arr.splice(j, i-j);
520
520
}
521
521
 
 
522
/** Shallow-clones an object */
 
523
function shallow_clone_object(obj)
 
524
{
 
525
    o = {};
 
526
    for (k in obj)
 
527
        o[k] = obj[k];
 
528
    return o;
 
529
}
 
530
 
522
531
/** Returns a new XMLHttpRequest object, in a somewhat browser-agnostic
523
532
 * fashion.
524
533
 */