createEvt("rdetail", "recordDrawn"); /* f() : the record has been drawn */
createEvt("common", "loggedIn"); /* f() : user has just logged in */
+createEvt("common", "loginCanceled"); /* f() : user has just logged in */
createEvt('result', 'zeroHits');
createEvt('result', 'lowHits');
createEvt('rdetail', 'recordRetrieved'); /* we are about to draw the rdetail page */
swapCanvas($('loading_alt'));
table = G.ui.result.main_table;
+ var holdTarget = new CGI().param('hold_target');
+ if(holdTarget != null) {
+ mresultHandlePlaceHold(holdTarget);
+ return;
+ }
+
+
while( table.parentNode.rows.length <= (getDisplayCount() + 1) )
table.appendChild(G.ui.result.row_template.cloneNode(true));
}
+function mresultHandlePlaceHold(target) {
+ function reload() {
+ location.href = location.href.replace(/&hold_target=\d+/, '');
+ }
+ attachEvt("common", "holdUpdated", reload);
+ attachEvt("common", "holdUpdateCanceled", reload);
+ attachEvt("common", "loginCanceled", reload);
+ holdsDrawEditor({record:target, type: 'M'});
+}
attachEvt("rdetail", "recordDrawn", rdetailBuildInfoRows);
attachEvt("rdetail", "recordDrawn", rdetailGetPageIds);
-G.evt.rdetail.recordDrawn.push(
- function(){
- if(new CGI().param('place_hold')) {
- // This will force the login dialog to display if the user is not logged in
- holdsDrawEditor({record:record.doc_id(), type: 'T'});
- }
- }
-);
-
-
/* Per-skin configuration settings */
var rdetailLocalOnly = true;
var rdetailShowLocal = true;
var mfhdDetails = [];
var orgHiding = false;
+if(location.href.match(/&place_hold=1/)) {
+ // prevent load flicker between canvases
+ hideMe(dojo.byId('canvas_main'));
+}
+
/* serials are currently the only use of Dojo strings in the OPAC */
if (rdetailDisplaySerialHoldings) {
dojo.require("dijit.Menu");
goTo(buildOPACLink(args));
}
+function rdetailHandlePlaceHold() {
+ function reload() {
+ location.href = location.href.replace(/&place_hold=1/, '');
+ }
+ attachEvt("common", "holdUpdated", reload);
+ attachEvt("common", "holdUpdateCanceled", reload);
+ attachEvt("common", "loginCanceled", reload);
+ holdsDrawEditor({record:getRid(), type: 'T'});
+}
+
function rdetailDraw() {
+ if(new CGI().param('place_hold')) {
+ rdetailHandlePlaceHold();
+ return;
+ }
+
detachAllEvt('common','depthChanged');
detachAllEvt('common','locationUpdated');
attachEvt('common','depthChanged', rdetailReload);
G.evt.result.copyCountsReceived.push(resultDisplayCopyCounts);
G.evt.result.allRecordsReceived.push( function(){unHideMe($('result_info_2'))}, fetchGoogleBooksLink, fetchChiliFreshReviews);
- G.evt.result.allRecordsReceived.push(
- function(){
- var cgi = new CGI();
- var hold_target = cgi.param('hold_target');
- if(hold_target) {
- // This will force the login dialog to display if the user is not logged in
- holdsDrawEditor({record:hold_target, type: (findCurrentPage() == MRESULT) ? 'M' : 'T'});
- }
- }
- );
-
attachEvt('result','lowHits',resultLowHits);
attachEvt('result','zeroHits',resultZeroHits);
attachEvt( "common", "locationUpdated", resultSBSubmit );
function rresultCollectIds() {
var ids;
+
+ var holdTarget = new CGI().param('hold_target');
+ if(holdTarget != null) {
+ rresultHandlePlaceHold(holdTarget);
+ return;
+ }
+
var rtype = getRtype();
if (rtype && rtype.indexOf('|') > -1)
rtype = rtype.substring(0,rtype.indexOf('|'));
}
+function rresultHandlePlaceHold(target) {
+ function reload() {
+ location.href = location.href.replace(/&hold_target=\d+/, '');
+ }
+ attachEvt("common", "holdUpdated", reload);
+ attachEvt("common", "holdUpdateCanceled", reload);
+ attachEvt("common", "loginCanceled", reload);
+ holdsDrawEditor({record:target, type: 'T'});
+}
}
function initLogin() {
+ swapCanvas(G.ui.login.box);
+ try{G.ui.login.username.focus();} catch(e) {}
-// if(loginBoxVisible) {
-// showCanvas();
-// } else {
- swapCanvas(G.ui.login.box);
- try{G.ui.login.username.focus();}catch(e){}
-// }
-
-// loginBoxVisible = !loginBoxVisible;
- G.ui.login.cancel.onclick = function(evt) { G.ui.login.form.setAttribute('action','javascript:showCanvas();'); };
- if(findCurrentPage() == MYOPAC)
- G.ui.login.cancel.onclick = function(evt) { G.ui.login.form.setAttribute('action','javascript:goHome();'); };
+ G.ui.login.cancel.onclick = function(evt) {
+ G.ui.login.form.setAttribute('action',
+ 'javascript:showCanvas();runEvt("common", "loginCanceled");');
+ };
+
+ if(findCurrentPage() == MYOPAC) {
+ G.ui.login.cancel.onclick = function(evt) {
+ G.ui.login.form.setAttribute('action','javascript:goHome();'); };
+ }
}
function setSidebarLinks() {