this.sidebarBox = getById("record_sidebar_box");
+ this.sidebarBox.appendChild(this.buildNavBox());
+ this.sidebarBox.appendChild(elem("br"));
if(!this.hitsPerPage)
this.hitsPerPage = 10; /* how many hits are displayed per page */
var marcd = elem( "div", { style: "float:right" } );
marcd.appendChild(marcb);
- author_cell.appendChild(marcd);
+ //author_cell.appendChild(marcd);
+ //misc_row.insertCell(misc_row.cells.length).appendChild(marcd);
+ c.appendChild(marcd);
+
}
AbstractRecordResultPage.prototype.noHits = function() {
var hcell = getById("hit_count_cell");
- hcell.appendChild(createAppElement("br"));
+ //hcell.appendChild(createAppElement("br"));
hcell.appendChild(createAppTextNode("0 hits were returned for you search"));
}
var hcell2 = getById("hit_count_cell_2");
hideMe(hcell2);
- var ident = "Titles";
- if(instanceOf(this, MRResultPage))
- ident = "Title Groups";
-
- hcell.appendChild(
- createAppTextNode( "Displaying " + ident + " " +
- ( parseInt(i) + 1 ) + " to " + max + " of " + this.hitCount));
-
- hcell.appendChild(createAppTextNode(" "));
- hcell.appendChild(createAppTextNode(" "));
- hcell.appendChild(createAppTextNode(" "));
+ if(hcell) {
- /*
- var div = createAppElement("div");
- div.appendChild(createAppTextNode("."));
- div.setAttribute("style", "color:#FFF;float:left;width:10px;border:1px solid black;position:relative");
- hcell.appendChild(div);
- */
-
- hcell.appendChild(prev);
- var span = createAppElement("span");
- span.appendChild(createAppTextNode(" ... "));
- hcell.appendChild(span);
- hcell.appendChild(next);
-
- hcell2.innerHTML = hcell.innerHTML;
+ var ident = "Titles";
+ if(instanceOf(this, MRResultPage))
+ ident = "Title Groups";
+
+ hcell.appendChild(
+ createAppTextNode( "Displaying " + ident + " " +
+ ( parseInt(i) + 1 ) + " to " + max + " of " + this.hitCount));
+
+ hcell.appendChild(createAppTextNode(" "));
+ hcell.appendChild(createAppTextNode(" "));
+ hcell.appendChild(createAppTextNode(" "));
+
+ hcell.appendChild(prev);
+ var span = createAppElement("span");
+ span.appendChild(createAppTextNode(" ... "));
+ hcell.appendChild(span);
+ hcell.appendChild(next);
+
+ hcell2.innerHTML = hcell.innerHTML;
+
+ }
}
if( isXUL() && globalAppFrame )
globalAppFrame.document.body.style.background = "#FFF";
+ getDocument().body.onunload = cleanIEMemory;
var page_name = globalPageTarget;
offsetx = parseInt(offsetx) + 8;
}
+
+ debug("TREE OFFSET y: " + offsety + " x: " + offsetx );
+
this.treeContainerBox.style.position = "absolute";
this.treeContainerBox.style.top = offsety;
this.treeContainerBox.style.left = offsetx;
orgunit = globalSelectedLocation;
else { orgunit = globalLocation; }
+ this.searchingCell.innerHTML =
+ "Now Searching <span class='breadcrumb_label'>" + orgunit.name() + "</span>";
+
+ this.resetRange();
+ return;
+
+
+
+
var arr = orgNodeTrail(orgunit);
this.searchingCell.innerHTML = "";
}
this.searchRange.selectedIndex = selectedOption;
- this.searchRange.options[selectedOption].selected = true;
+ var opt = this.searchRange.options[selectedOption];
+ if(opt) opt.selected = true;
if(this.searchRange.options.length == 1 )
hideMe(this.searchRange.parentNode);
var obj = this;
debug("Setting onclick for selector");
+
+ var obj = this;
this.searchRange.onchange = function() {
var location = globalSelectedLocation;
Page.prototype.buildNavBox = function() {
Page.navBox = new Box();
Page.navBox.init("Navigate", false, false);
- var table = elem("table", {className:"main_nav_table"});
+ var table = elem("table");
+ add_css_class(table, "main_nav_table");
- var arr = new Array();
+ var arr = [];
+
+ /* location tree */
+ var loc = elem("a",
+ {id:"location_nav_link", href:"javascript:void(0);"}, null, "Change Search Location");
+
+ loc.onclick = function(evt) {
+ globalPage.locationTree.toggle(getById("location_nav_link"));
+ }
+ arr.push(loc);
+
+ arr.push(elem("a", {href:'?target=advanced_search'}, null, "Advanced Search"));
+ arr.push(elem("a", {href:'?target=my_opac'}, null, "My OPAC"));
+ arr.push(elem("a", {href:'?target=about'}, null, "About PINES"));
+ arr.push(this.buildDeepLink());
+
+ if(UserSession.instance().verifySession()) {
+ arr.push(elem("a", {href:"?target=logout"}, null, "Logout"));
+ }
- arr.push(elem("a", {href:'?target=advanced_search'}, "Advanced Search"));
- arr.push(elem("a", {href:'?target=my_opac'}, "My OPAC"));
- arr.push(elem("a", {href:'?target=about'}, "About PINES"));
for( var i in arr ) {
var row = table.insertRow(table.rows.length);
add_css_class(row, "main_nav_row");
var cell = row.insertCell(row.cells.length);
add_css_class(cell, "main_nav_cell");
+ cell.appendChild(arr[i]);
}
/* append to the page */
Page.navBox.addItem(table);
+ Page.navBox.finalize();
+
var location = getById("main_page_nav_box");
if(location)
location.appendChild(Page.navBox.getNode());
+
+ return Page.navBox.getNode();
}
+Page.prototype.buildDeepLink = function() {
+ try {
+ if(!globalAppFrame)
+ return elem("div");
+ } catch(E) { return elem("div"); }
+
+ var org = globalSelectedLocation;
+ if(org == null)
+ org = globalLocation;
+ org = org.id();
+
+ var depth = globalSearchDepth;
+
+ var string =globalAppFrame.location.href;
+ if(!string.match(/sub_frame/))
+ string += "&sub_frame=1"
+ if(!string.match(/location/))
+ string += "&location=" + org;
+ if(!string.match(/depth/))
+ string += "&depth=" + depth;
+
+ debug("Redirecting deep link to " + string );
+
+ var a = elem("a",
+ { href: string }, null, "Link to this page"
+ );
+
+ a.setAttribute("target", "_blank");
+ return a;
+}
this.fetchRecord(paramObj.__record); /* sets this.record */
this.viewMarc = getById("record_detail_view_marc");
+
+ this.buildNavBox();
}
function buildCustomOrgTree(org_node, root) {
- debug("performing custom org tree build");
var item;
if(root) {
for( var index in org_node.children()) {
var childorg = org_node.children()[index];
if( childorg != null ) {
- debug("Adding " + childorg.name() + " to org tree");
var tree_node = buildCustomOrgTree(childorg);
if(tree_node != null)
item.add(tree_node);
/* performs a new search */
RecordResultPage.prototype.doSearch = function() {
+ if(recordResultRedirect) {
+ /* if the user is just hitting the 'back' button */
+ recordResultRedirect = false;
+ history.back();
+ return;
+ }
+
debug( "Key Value Array \n" + js2JSON( paramObj ) );
this.page = parseInt(paramObj.__page);
}
} else {
recordResultRedirect = false;
+ history.back();
}
obj.collectRecords();
var tmpArray = new Array();
for( var x in RemoteRequest.pending ) {
if( RemoteRequest.pending[x] != null ) {
- if( RemoteRequest.pending[x].id != id )
- tmpArray.push(RemoteRequest.pending[x]);
+ var req = RemoteRequest.pending[x];
+ if( req.id != id )
+ tmpArray.push(req);
+ else {
+ debug("Cleaning " + req.id );
+ req.clean();
+ }
}
}
RemoteRequest.pending = tmpArray;
for( var x in RemoteRequest.pending ) {
if( RemoteRequest.pending[x] != null ) {
debug("Cancelling request...");
- RemoteRequest.pending[x].cancelled = true;
+ var req = RemoteRequest.pending[x];
+ req.cancelled = true;
+ req.clean();
}
}
}
alert("NEWER BROWSER");
}
+RemoteRequest.prototype.clean = function() {
+ this.xmlhttp.onreadystatechange = function(){};
+ this.callback = null;
+}
+
/* constructs our XMLHTTPRequest object */
RemoteRequest.prototype.buildXMLRequest = function() {
//alert("Exception: " + E);
throw E;
}
- }
+ }
/* on success, remove the request from the pending cache */
RemoteRequest.prunePending(object.id);
+function cleanIEMemory() {
+ var a = [ "a", "div", "span", "select", "option", "img", "body", "iframe", "frame"];
+ for( var index in a ) {
+ var nodes = getDocument().getElementsByTagName(a[index]);
+ for( var n = 0; n!= nodes.length; n++ ) {
+ var node = nodes[n];
+ node.onclick = null;
+ node.onchange = null;
+ node.onselect = null;
+ }
+ }
+}
+
+
+
+
+
+
+
function hideMe(obj) {
if(!obj) return;
if(!val) return "";
var newVal = '';
- val = val.split(' ');
+ try {val = val.split(' ');} catch(E) {return val;}
var reg = /\w/;
for( var c = 0; c < val.length; c++) {
return document;
}
+function getWindow() {
+ if(globalAppFrame)
+ return globalAppFrame;
+ return window;
+}
+
/* returns [x, y] coords of the mouse */
function getMousePos(e) {