From 13961fca9a953e6c34a329136a4d893bf8362648 Mon Sep 17 00:00:00 2001 From: erickson Date: Fri, 18 Nov 2005 20:08:15 +0000 Subject: [PATCH] xul user is now shoved into the opac user's slot when in xul added event on rdetail page to handle xul record details rendering git-svn-id: svn://svn.open-ils.org/ILS/trunk@2086 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- Open-ILS/web/opac/common/js/RemoteRequest.js | 21 ++++++++------------ Open-ILS/web/opac/common/js/config.js | 1 + Open-ILS/web/opac/common/js/init.js | 2 +- Open-ILS/web/opac/common/js/opac_utils.js | 3 +++ Open-ILS/web/opac/skin/default/js/rdetail.js | 5 +++-- 5 files changed, 16 insertions(+), 16 deletions(-) diff --git a/Open-ILS/web/opac/common/js/RemoteRequest.js b/Open-ILS/web/opac/common/js/RemoteRequest.js index d14c5f22a7..6bfe179fd3 100644 --- a/Open-ILS/web/opac/common/js/RemoteRequest.js +++ b/Open-ILS/web/opac/common/js/RemoteRequest.js @@ -147,28 +147,23 @@ RemoteRequest.prototype.send = function(blocking) { var url = location.protocol + "//" + location.host + "/" + XML_HTTP_GATEWAY; if(isXUL()) { - if(this.secure) + if(this.secure || url.match(/^https:/) ) url = "https://" + XML_HTTP_SERVER + "/" + XML_HTTP_GATEWAY; else url = "http://" + XML_HTTP_SERVER + "/" + XML_HTTP_GATEWAY; } var data = null; - - if( this.type == 'GET' ) { - url += "?" + this.param_string; - } - + if( this.type == 'GET' ) url += "?" + this.param_string; try { - dump( 'Remote Request URL: ' + url + '\n'); - } catch(E){} - - if(blocking) { - this.xmlhttp.open(this.type, url, false); - } else { - this.xmlhttp.open(this.type, url, true); + if(blocking) this.xmlhttp.open(this.type, url, false); + else this.xmlhttp.open(this.type, url, true); + + } catch(E) { + alert("Fatal error opening XMLHTTPRequest for URL:\n" + url + '\n'); + return; } diff --git a/Open-ILS/web/opac/common/js/config.js b/Open-ILS/web/opac/common/js/config.js index a932290684..6b12a8d265 100644 --- a/Open-ILS/web/opac/common/js/config.js +++ b/Open-ILS/web/opac/common/js/config.js @@ -260,6 +260,7 @@ createEvt("rdetail", "recordDrawn"); /* f() : the record has been drawn */ createEvt("common", "loggedIn"); /* f() : user has just logged in */ createEvt('result', 'zeroHits'); createEvt('result', 'lowHits'); +createEvt('rdetail', 'recordRetrieved'); /* we are about to draw the rdetail page */ diff --git a/Open-ILS/web/opac/common/js/init.js b/Open-ILS/web/opac/common/js/init.js index 0c3055aec9..0c330bf0cb 100644 --- a/Open-ILS/web/opac/common/js/init.js +++ b/Open-ILS/web/opac/common/js/init.js @@ -14,7 +14,7 @@ try{ attachEvt("common", "unload", cleanRemoteRequests);} catch(e){} function init() { runEvt('common','init'); runEvt("common", "run"); - checkUserSkin(); + //checkUserSkin(); G.ui.common.now_searching.appendChild(text(findOrgUnit(getLocation()).name())); } diff --git a/Open-ILS/web/opac/common/js/opac_utils.js b/Open-ILS/web/opac/common/js/opac_utils.js index 9aa2a3f25c..adff0a4338 100644 --- a/Open-ILS/web/opac/common/js/opac_utils.js +++ b/Open-ILS/web/opac/common/js/opac_utils.js @@ -229,8 +229,11 @@ var cookie = new cookieObject("ses", 1, "/", COOKIE_SES); function grabUser(ses, force) { if(!ses) ses = cookie.get(COOKIE_SES); + try{if(!ses && isXUL()) ses = xulG['auth_ses'][0];}catch(e){} if(!ses) return false; + //alert(ses); + if(!force) if(G.user && G.user.session == ses) return G.user; diff --git a/Open-ILS/web/opac/skin/default/js/rdetail.js b/Open-ILS/web/opac/skin/default/js/rdetail.js index 1493f5be66..de4ff47d1e 100644 --- a/Open-ILS/web/opac/skin/default/js/rdetail.js +++ b/Open-ILS/web/opac/skin/default/js/rdetail.js @@ -15,6 +15,7 @@ var numStatuses = null; function rdetailDraw() { + copyRowParent = G.ui.rdetail.cp_info_row.parentNode; copyRow = copyRowParent.removeChild(G.ui.rdetail.cp_info_row); statusRow = G.ui.rdetail.cp_status.parentNode; @@ -29,8 +30,6 @@ function rdetailDraw() { if(getLocation() == globalOrgTree.id()) hideMe(G.ui.rdetail.cp_info_all); - - var req = new Request(FETCH_RMODS, getRid()); req.callback(_rdetailDraw); req.send(); @@ -82,6 +81,8 @@ function rdetailShowAllCopies() { function _rdetailDraw(r) { record = r.getResultObject(); + runEvt('rdetail', 'recordRetrieved', record.doc_id()); + G.ui.rdetail.title.appendChild(text(record.title())); buildSearchLink(STYPE_AUTHOR, record.author(), G.ui.rdetail.author); G.ui.rdetail.isbn.appendChild(text(cleanISBN(record.isbn()))); -- 2.43.2