551
551
update_selection();
554
/** Initialises the DOM elements required to present a dir listing,
554
/** Initialises the DOM elements required to present files window,
555
555
* assuming that clear_page has just been called or the page just
556
556
* loaded for the first time.
558
function setup_for_dir_listing(listing, subjects)
558
function setup_for_listing()
560
560
var filesbody = document.getElementById("filesbody");
573
573
var filetablediv = document.createElement("div");
574
574
filetable.appendChild(filetablediv);
575
575
filetablediv.setAttribute("id", "filetablediv");
576
/* Do the home listing */
577
if (subjects != null)
578
home_listing(listing, subjects);
578
/* 2 nested divs, so we can set the width exactly and have padding inside
580
var sidepanel_outer = document.createElement("div");
581
middle.appendChild(sidepanel_outer);
582
sidepanel_outer.setAttribute("id", "sidepanel_outer");
583
var sidepanel = document.createElement("div");
584
sidepanel_outer.appendChild(sidepanel);
585
sidepanel.setAttribute("id", "sidepanel");
587
/* Now after the table "middle", there is a status bar */
588
var statusbar_outer = document.createElement("div");
589
filesbody.appendChild(statusbar_outer);
590
statusbar_outer.setAttribute("id", "statusbar_outer");
591
var statusbar = document.createElement("div");
592
statusbar_outer.appendChild(statusbar);
593
statusbar.setAttribute("id", "statusbar");
596
/** Sets up the DOM elements required to present a directory liisting.
598
function setup_dir_listing()
600
var filesbody = document.getElementById("filesbody");
601
var filetable = document.getElementById("filetable");
602
var filetablediv = document.getElementById("filetablediv");
579
604
/* A nested table within this div - the actual files listing */
580
605
var filetabletable = document.createElement("table");
581
606
filetablediv.appendChild(filetabletable);
607
632
var filetabletbody = document.createElement("tbody");
608
633
filetabletable.appendChild(filetabletbody);
609
634
filetabletbody.setAttribute("id", "files");
612
/* 2 nested divs, so we can set the width exactly and have padding inside
614
var sidepanel_outer = document.createElement("div");
615
middle.appendChild(sidepanel_outer);
616
sidepanel_outer.setAttribute("id", "sidepanel_outer");
617
var sidepanel = document.createElement("div");
618
sidepanel_outer.appendChild(sidepanel);
619
sidepanel.setAttribute("id", "sidepanel");
621
/* Now after the table "middle", there is a status bar */
622
var statusbar_outer = document.createElement("div");
623
filesbody.appendChild(statusbar_outer);
624
statusbar_outer.setAttribute("id", "statusbar_outer");
625
var statusbar = document.createElement("div");
626
statusbar_outer.appendChild(statusbar);
627
statusbar.setAttribute("id", "statusbar");
630
637
/** Presents the directory listing.
632
function handle_dir_listing(path, listing, subjects)
639
function handle_dir_listing(path, listing)
641
/* Add the DOM elements for the file listing */
634
644
var row_toggle = 1;
635
/* Nav through the top-level of the JSON to the actual listing object. */
636
var listing = listing.listing;
638
646
/* Is this dir under svn? */
639
647
var under_subversion = ("svnstatus" in current_file) && (current_file.svnstatus != "unversioned");