xul user is now shoved into the opac user's slot when in xul
authorerickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Fri, 18 Nov 2005 20:08:15 +0000 (20:08 +0000)
committererickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Fri, 18 Nov 2005 20:08:15 +0000 (20:08 +0000)
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
Open-ILS/web/opac/common/js/config.js
Open-ILS/web/opac/common/js/init.js
Open-ILS/web/opac/common/js/opac_utils.js
Open-ILS/web/opac/skin/default/js/rdetail.js

index d14c5f2..6bfe179 100644 (file)
@@ -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;
        }
 
 
index a932290..6b12a8d 100644 (file)
@@ -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 */
 
 
 
index 0c3055a..0c330bf 100644 (file)
@@ -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()));
 }
 
index 9aa2a3f..adff0a4 100644 (file)
@@ -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;
index 1493f5b..de4ff47 100644 (file)
@@ -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())));