[open-ils-commits] r18889 - in trunk/Open-ILS/web/opac: common/js skin/default/js (erickson)
svn at svn.open-ils.org
svn at svn.open-ils.org
Tue Nov 30 16:00:06 EST 2010
Author: erickson
Date: 2010-11-30 16:00:01 -0500 (Tue, 30 Nov 2010)
New Revision: 18889
Modified:
trunk/Open-ILS/web/opac/common/js/config.js
trunk/Open-ILS/web/opac/skin/default/js/mresult.js
trunk/Open-ILS/web/opac/skin/default/js/rdetail.js
trunk/Open-ILS/web/opac/skin/default/js/result_common.js
trunk/Open-ILS/web/opac/skin/default/js/rresult.js
trunk/Open-ILS/web/opac/skin/default/js/sidebar.js
Log:
quicker login+ssl-jump handling by showing immediately instaed of waiting on page contents to load
Modified: trunk/Open-ILS/web/opac/common/js/config.js
===================================================================
--- trunk/Open-ILS/web/opac/common/js/config.js 2010-11-30 20:50:48 UTC (rev 18888)
+++ trunk/Open-ILS/web/opac/common/js/config.js 2010-11-30 21:00:01 UTC (rev 18889)
@@ -433,6 +433,7 @@
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 */
Modified: trunk/Open-ILS/web/opac/skin/default/js/mresult.js
===================================================================
--- trunk/Open-ILS/web/opac/skin/default/js/mresult.js 2010-11-30 20:50:48 UTC (rev 18888)
+++ trunk/Open-ILS/web/opac/skin/default/js/mresult.js 2010-11-30 21:00:01 UTC (rev 18889)
@@ -24,6 +24,13 @@
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));
@@ -121,5 +128,14 @@
}
+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'});
+}
Modified: trunk/Open-ILS/web/opac/skin/default/js/rdetail.js
===================================================================
--- trunk/Open-ILS/web/opac/skin/default/js/rdetail.js 2010-11-30 20:50:48 UTC (rev 18888)
+++ trunk/Open-ILS/web/opac/skin/default/js/rdetail.js 2010-11-30 21:00:01 UTC (rev 18889)
@@ -7,16 +7,6 @@
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;
@@ -56,6 +46,11 @@
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");
@@ -117,8 +112,23 @@
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);
Modified: trunk/Open-ILS/web/opac/skin/default/js/result_common.js
===================================================================
--- trunk/Open-ILS/web/opac/skin/default/js/result_common.js 2010-11-30 20:50:48 UTC (rev 18888)
+++ trunk/Open-ILS/web/opac/skin/default/js/result_common.js 2010-11-30 21:00:01 UTC (rev 18889)
@@ -16,17 +16,6 @@
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 );
Modified: trunk/Open-ILS/web/opac/skin/default/js/rresult.js
===================================================================
--- trunk/Open-ILS/web/opac/skin/default/js/rresult.js 2010-11-30 20:50:48 UTC (rev 18888)
+++ trunk/Open-ILS/web/opac/skin/default/js/rresult.js 2010-11-30 21:00:01 UTC (rev 18889)
@@ -31,6 +31,13 @@
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('|'));
@@ -329,4 +336,13 @@
}
+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'});
+}
Modified: trunk/Open-ILS/web/opac/skin/default/js/sidebar.js
===================================================================
--- trunk/Open-ILS/web/opac/skin/default/js/sidebar.js 2010-11-30 20:50:48 UTC (rev 18888)
+++ trunk/Open-ILS/web/opac/skin/default/js/sidebar.js 2010-11-30 21:00:01 UTC (rev 18889)
@@ -157,18 +157,18 @@
}
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){}
-// }
+ G.ui.login.cancel.onclick = function(evt) {
+ G.ui.login.form.setAttribute('action',
+ 'javascript:showCanvas();runEvt("common", "loginCanceled");');
+ };
-// 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();'); };
+ if(findCurrentPage() == MYOPAC) {
+ G.ui.login.cancel.onclick = function(evt) {
+ G.ui.login.form.setAttribute('action','javascript:goHome();'); };
+ }
}
function setSidebarLinks() {
More information about the open-ils-commits
mailing list