numerous small style changes
authorerickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Mon, 12 Sep 2005 20:45:58 +0000 (20:45 +0000)
committererickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Mon, 12 Sep 2005 20:45:58 +0000 (20:45 +0000)
first round of copy count column labels
author links on record detail page
print relevancy on mresult pages
moved text size picker to top/right

git-svn-id: svn://svn.open-ils.org/ILS/trunk@1819 dcc99617-32d9-48b4-a31d-7c20da2025e4

23 files changed:
Open-ILS/web/opac/common/css/mediumfont.css
Open-ILS/web/opac/common/js/Cookie.js
Open-ILS/web/opac/common/js/config.js
Open-ILS/web/opac/common/js/init.js
Open-ILS/web/opac/common/js/md5.js
Open-ILS/web/opac/common/js/opac_utils.js
Open-ILS/web/opac/skin/default/css/layout.css
Open-ILS/web/opac/skin/default/js/mresult.js
Open-ILS/web/opac/skin/default/js/rdetail.js
Open-ILS/web/opac/skin/default/js/result_common.js
Open-ILS/web/opac/skin/default/js/rresult.js
Open-ILS/web/opac/skin/default/js/search_bar.js
Open-ILS/web/opac/skin/default/xml/advanced.xml
Open-ILS/web/opac/skin/default/xml/index.xml
Open-ILS/web/opac/skin/default/xml/mresult.xml
Open-ILS/web/opac/skin/default/xml/myopac.xml
Open-ILS/web/opac/skin/default/xml/orgtree.xml
Open-ILS/web/opac/skin/default/xml/rdetail.xml
Open-ILS/web/opac/skin/default/xml/result_common.xml
Open-ILS/web/opac/skin/default/xml/result_table.xml
Open-ILS/web/opac/skin/default/xml/rresult.xml
Open-ILS/web/opac/skin/default/xml/searchbar.xml
Open-ILS/web/opac/theme/default/css/colors.css

index 08f4210..44e8d4f 100644 (file)
@@ -10,10 +10,10 @@ body table tr td    { font-size: inherit; }
 .sidebar_extra_item { font-size: 9pt; }
 .searchbar_tag { font-size: 9pt; } 
 #offset_start { font-weight: 600; font-size: 9pt;}
-#offset_end { font-weight: 600;  font-size; 9pt;}
-#result_count { font-weight: 600;  font-size; 9pt;} 
-.nav_link_active { font-weight: 600; font-size; 9pt;}
-.copy_count_cell { font-size: 80%; font-size; 9pt; }
+#offset_end { font-weight: 600;  font-size: 9pt;}
+#result_count { font-weight: 600;  font-size: 9pt;} 
+.nav_link_active { font-weight: 600; font-size: 9pt;}
+.copy_count_cell { font-size: 8pt; }
 
 #rdetail_copy_info_table { font-size: 9pt; }
 .rdetail_copy_nav_link { font-weight: normal; font-size: 9pt; }
index 8d4e6e3..3b00acf 100644 (file)
@@ -1,5 +1,4 @@
 /*
-
 DISCLAIMER: THESE JAVASCRIPT FUNCTIONS ARE SUPPLIED 'AS IS', WITH 
 NO WARRANTY EXPRESSED OR IMPLIED. YOU USE THEM AT YOUR OWN RISK. 
 PAUL STEPHENS DOES NOT ACCEPT ANY LIABILITY FOR 
@@ -29,7 +28,7 @@ this.accessPath = accessPath
 this.rawValue = ""
 this.fields = new Array()
 this.fieldnames = new Array() 
-if (arguments.length > 3) { // field name(s) specified
+if (arguments.length > 3) { 
   j = 0
   for (i = 3; i < arguments.length; i++) {
     this.fieldnames[j] = arguments[i]    
@@ -38,9 +37,7 @@ if (arguments.length > 3) { // field name(s) specified
   this.fields.length = this.fieldnames.length 
 }
 this.read = ucRead
-
 this.write = ucWrite
-
 this.remove = ucDelete
 this.get = ucFieldGet
 this.put = ucFieldPut
@@ -48,7 +45,6 @@ this.namepos = ucNamePos
 this.read()
 }
 
-
 function ucFieldGet(fieldname) {
 var i = this.namepos(fieldname)
 if (i >=0) {
@@ -57,19 +53,15 @@ if (i >=0) {
   return "BadFieldName!"
 }
 }
-
 function ucFieldPut (fieldname, fieldval) {
 var i = this.namepos(fieldname)
-
 if(i < 0) {
        i = this.fieldnames.length;
        this.fieldnames[i] = fieldname;
 }
-
 this.fields[i] = fieldval
 return true
 }
-
 function ucNamePos(fieldname) {
 var i 
 for (i = 0; i < this.fieldnames.length; i++) {
@@ -79,44 +71,29 @@ for (i = 0; i < this.fieldnames.length; i++) {
 }
 return -1
 }
-
-
 function ucWrite() {      
   var cookietext = this.name + "=" 
-
-// concatenate array elements into cookie string
-// Special case - single-field cookie, so write without # terminator
 if (this.fields.length == 1) {
   cookietext += escape(this.fields[0])
-  } else { // multi-field cookie
+  } else { 
     for (i= 0; i < this.fields.length; i++) {
       cookietext += escape(this.fields[i]) + this.fieldSeparator }
   }
-
-
-// Set expiry parameter, if specified
     if (this.expires != null) {  
-      if (typeof(this.expires) == "number") { // Expiry period in days specified  
+      if (typeof(this.expires) == "number") { 
         var today=new Date()     
         var expiredate = new Date()      
         expiredate.setTime(today.getTime() + 1000*60*60*24*this.expires)
         cookietext += "; expires=" + expiredate.toGMTString()
-      } else { // assume it's a date object
+      } else { 
         cookietext +=  "; expires=" + this.expires.toGMTString()
-      } // end of typeof(this.expires) if
-    } // end of this.expires != null if 
-   
-// add path, if specified
+      } 
+    } 
    if (this.accessPath != null) {
    cookietext += "; PATH="+this.accessPath }
-
-// write cookie
-   // alert("writing "+cookietext)
    document.cookie = cookietext 
    return null  
 }
-
-
 function ucRead() {
   var search = this.name + "="                       
   var CookieString = document.cookie            
@@ -128,27 +105,20 @@ function ucRead() {
     if (offset != -1) {                         
       offset += search.length                   
       end = CookieString.indexOf(";", offset)   
-      if (end == -1) {  // cookie is last item in the string, so no terminator                        
+      if (end == -1) {  
        end = CookieString.length }              
       this.rawValue = CookieString.substring(offset, end)                                   
       this.found = true 
       } 
     }
-   
 if (this.rawValue != null) { // unpack into fields
-
   var sl = this.rawValue.length
   var startidx = 0
   var endidx = 0
   var i = 0
-
-// Special case - single-field cookies written by other functions,
-// so without a '#' terminator
-
 if (this.rawValue.substr(sl-1, 1) != this.fieldSeparator) {
   this.fields[0] = unescape(this.rawValue)
-  } else { // separate fields
-
+  } else { 
   do  
   {
    endidx = this.rawValue.indexOf(this.fieldSeparator, startidx)
@@ -159,15 +129,11 @@ if (this.rawValue.substr(sl-1, 1) != this.fieldSeparator) {
   }
   while (endidx !=-1 & endidx != (this.rawValue.length -1));
 }
-} // end of unpack into fields if block
+} 
   return this.found
-} // end of function
-
-
+} 
 function ucDelete() {
   this.expires = -10
   this.write()
   return this.read()
 }
-
-
index 49e47c3..f6b47c2 100644 (file)
@@ -12,6 +12,7 @@ var PARAM_HITCOUNT    = "hitcount";   /* hits per page */
 var PARAM_MRID                 = "mrid";               /* metarecord id */
 var PARAM_RID                  = "rid";                        /* record id */
 var PARAM_ORIGLOC              = "orgloc"              /* the original location */
+var PARAM_TOPRANK              = "toprank"             /* this highest ranking rank */
 
 /* URL param values (see comments above) */
 var TERM;  
@@ -25,6 +26,7 @@ var HITCOUNT;
 var RANKS; 
 var FONTSIZE;
 var ORIGLOC;
+var TOPRANK;
 
 /* cookie values */
 var SBEXTRAS; 
@@ -218,10 +220,12 @@ function attachEvt(scope, name, action) {
 createEvt("common", "init");                                           /* f() : what happens on page init */
 createEvt("common", "pageRendered");                   /* f() : what happens when the page is done (up to the skin to call this even)*/
 createEvt("common", "unload");                                 /* f() : what happens on window unload (clean memory, etc.)*/
+createEvt("common", "locationChanged");                /* f() : what happens when the location has changed */
+
 createEvt("common", "run");                                            /* f() : make the page do stuff */
-createEvt("mresult", "idsReceived");                   /* f(ids) */
-createEvt("rresult", "idsReceived");                   /* f(ids) */    
+createEvt("result", "idsReceived");                            /* f(ids) */
 createEvt("rresult", "recordDrawn");                   /* f(recordid, linkDOMNode) : after record is drawn, allow others (xul) to plugin actions */
+createEvt("result", "preCollectRecords");              /* f() we're about to go and grab the recs */
 
 createEvt("result", "hitCountReceived");               /* f() : display hit info, pagination, etc. */
 createEvt("result", "recordReceived");                 /* f(mvr, pagePosition, isMr) : display the record*/
index 8fff2fc..3fad7c8 100644 (file)
@@ -14,7 +14,7 @@ attachEvt("common", "unload", cleanRemoteRequests);
 
 function init() {
        runEvt('common','init');
-       setFontSize(getFontSize());
+       //setFontSize(getFontSize());
        runEvt("common", "run");
        checkUserSkin();
        G.ui.common.now_searching.appendChild(text(findOrgUnit(getLocation()).name()));
index 46d2aab..7f4a694 100644 (file)
@@ -7,36 +7,19 @@
  * See http://pajhome.org.uk/crypt/md5 for more info.
  */
 
-/*
- * Configurable variables. You may need to tweak these to be compatible with
- * the server-side, but the defaults work in most cases.
- */
 var hexcase = 0;  /* hex output format. 0 - lowercase; 1 - uppercase        */
 var b64pad  = ""; /* base-64 pad character. "=" for strict RFC compliance   */
 var chrsz   = 8;  /* bits per input character. 8 - ASCII; 16 - Unicode      */
-
-/*
- * These are the functions you'll usually want to call
- * They take string arguments and return either hex or base-64 encoded strings
- */
 function hex_md5(s){ return binl2hex(core_md5(str2binl(s), s.length * chrsz));}
 function b64_md5(s){ return binl2b64(core_md5(str2binl(s), s.length * chrsz));}
 function str_md5(s){ return binl2str(core_md5(str2binl(s), s.length * chrsz));}
 function hex_hmac_md5(key, data) { return binl2hex(core_hmac_md5(key, data)); }
 function b64_hmac_md5(key, data) { return binl2b64(core_hmac_md5(key, data)); }
 function str_hmac_md5(key, data) { return binl2str(core_hmac_md5(key, data)); }
-
-/*
- * Perform a simple self-test to see if the VM is working
- */
 function md5_vm_test()
 {
   return hex_md5("abc") == "900150983cd24fb0d6963f7d28e17f72";
 }
-
-/*
- * Calculate the MD5 of an array of little-endian words, and a bit length
- */
 function core_md5(x, len)
 {
   /* append padding */
@@ -131,10 +114,6 @@ function core_md5(x, len)
   return Array(a, b, c, d);
 
 }
-
-/*
- * These functions implement the four basic operations the algorithm uses.
- */
 function md5_cmn(q, a, b, x, s, t)
 {
   return safe_add(bit_rol(safe_add(safe_add(a, q), safe_add(x, t)), s),b);
@@ -155,10 +134,6 @@ function md5_ii(a, b, c, d, x, s, t)
 {
   return md5_cmn(c ^ (b | (~d)), a, b, x, s, t);
 }
-
-/*
- * Calculate the HMAC-MD5, of a key and some data
- */
 function core_hmac_md5(key, data)
 {
   var bkey = str2binl(key);
@@ -174,30 +149,16 @@ function core_hmac_md5(key, data)
   var hash = core_md5(ipad.concat(str2binl(data)), 512 + data.length * chrsz);
   return core_md5(opad.concat(hash), 512 + 128);
 }
-
-/*
- * Add integers, wrapping at 2^32. This uses 16-bit operations internally
- * to work around bugs in some JS interpreters.
- */
 function safe_add(x, y)
 {
   var lsw = (x & 0xFFFF) + (y & 0xFFFF);
   var msw = (x >> 16) + (y >> 16) + (lsw >> 16);
   return (msw << 16) | (lsw & 0xFFFF);
 }
-
-/*
- * Bitwise rotate a 32-bit number to the left.
- */
 function bit_rol(num, cnt)
 {
   return (num << cnt) | (num >>> (32 - cnt));
 }
-
-/*
- * Convert a string to an array of little-endian words
- * If chrsz is ASCII, characters >255 have their hi-byte silently ignored.
- */
 function str2binl(str)
 {
   var bin = Array();
@@ -206,10 +167,6 @@ function str2binl(str)
     bin[i>>5] |= (str.charCodeAt(i / chrsz) & mask) << (i%32);
   return bin;
 }
-
-/*
- * Convert an array of little-endian words to a string
- */
 function binl2str(bin)
 {
   var str = "";
@@ -218,10 +175,6 @@ function binl2str(bin)
     str += String.fromCharCode((bin[i>>5] >>> (i % 32)) & mask);
   return str;
 }
-
-/*
- * Convert an array of little-endian words to a hex string.
- */
 function binl2hex(binarray)
 {
   var hex_tab = hexcase ? "0123456789ABCDEF" : "0123456789abcdef";
@@ -233,10 +186,6 @@ function binl2hex(binarray)
   }
   return str;
 }
-
-/*
- * Convert an array of little-endian words to a base-64 string
- */
 function binl2b64(binarray)
 {
   var tab = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
index a5eb727..87b2c63 100644 (file)
@@ -1,5 +1,3 @@
-
-
 /* - Request ------------------------------------------------------------- */
 function Request(type) {
        var s = type.split(":");
@@ -12,7 +10,6 @@ function Request(type) {
 Request.prototype.callback = function(cal) { this.request.setCompleteCallback(cal); }
 Request.prototype.send         = function(block){this.request.send(block);}
 Request.prototype.result       = function(){return this.request.getResultObject();}
-/* ----------------------------------------------------------------------- */
 
 function showCanvas() {
        for( var x in G.ui.altcanvas ) {
@@ -57,7 +54,6 @@ function findCurrentPage() {
                        return p;
                }
        }
-
        return null;
 }
 
@@ -78,6 +74,7 @@ function initParams() {
        HITCOUNT        = parseInt(cgi.param(PARAM_HITCOUNT));
        MRID            = parseInt(cgi.param(PARAM_MRID));
        RID             = parseInt(cgi.param(PARAM_RID));
+       TOPRANK  = parseFloat(cgi.param(PARAM_TOPRANK));
 
        /* set up some sane defaults */
        if(isNaN(LOCATION))     LOCATION        = 1;
@@ -88,6 +85,7 @@ function initParams() {
        if(isNaN(MRID))         MRID            = 0;
        if(isNaN(RID))                  RID             = 0;
        if(isNaN(ORIGLOC))      ORIGLOC = 0;
+       if(isNaN(TOPRANK))      TOPRANK = 1;
 }
 
 function initCookies() {
@@ -109,15 +107,13 @@ function getHitCount(){return HITCOUNT;}
 function getMrid(){return MRID;};
 function getRid(){return RID;};
 function getOrigLocation(){return ORIGLOC;}
+function getTopRank(){return TOPRANK;}
 
 function getSearchBarExtras(){return SBEXTRAS;}
 function getFontSize(){return FONTSIZE;};
 function getSkin(){return SKIN;};
 
 
-
-/* builds an opac URL.  If no page is defined, the current page is used
-       if slim, then only everything after the ? is returned (no host portion) */
 function findBasePath() {
        var path = location.pathname;
        if(!path.match(/.*\.xml$/)) path += "index.xml"; 
@@ -164,6 +160,8 @@ function  buildOPACLink(args, slim, ssl) {
        string += _appendParam(HITCOUNT, PARAM_HITCOUNT, args, getHitCount, string);
        string += _appendParam(MRID,            PARAM_MRID, args, getMrid, string);
        string += _appendParam(RID,             PARAM_RID, args, getRid, string);
+       string += _appendParam(TOPRANK, PARAM_TOPRANK, args, getTopRank, string);
+
        return string.replace(/\&$/,'').replace(/\?\&/,"?");    
 }
 
@@ -174,17 +172,6 @@ function _appendParam( fieldVar, fieldName, overrideArgs, getFunc, string ) {
        return ret;
 }
 
-
-/*
-function EX(message) { this.init(message); }
-EX.prototype.init = function(message) { this.message = message; }
-EX.prototype.toString = function() { return "\n *** Exception Occured \n" + this.message; }  
-EXCommunication.prototype              = new EX();
-EXCommunication.prototype.constructor  = EXCommunication;
-EXCommunication.baseClass              = EX.prototype.constructor;
-function EXCommunication(message) { this.init("EXCommunication: " + message); }                          
-*/
-
 /* ----------------------------------------------------------------------- */
 function cleanISBN(isbn) {
    if(isbn) {
@@ -196,8 +183,6 @@ function cleanISBN(isbn) {
 }       
 
 
-
-
 /* builds a link that goes to the title listings for a metarecord */
 function buildTitleLink(rec, link) {
        if(!rec) return;
@@ -236,7 +221,6 @@ function buildSearchLink(type, string, linknode, trunc) {
 /* ----------------------------------------------------------------------- */
 /* user session handling */
 /* ----------------------------------------------------------------------- */
-
 /* session is the login session.  If no session is provided, we attempt
        to find one in the cookies.  If 'force' is true we retrieve the 
        user from the server even if there is already a global user present.
@@ -445,7 +429,7 @@ function buildOrgSelector() {
 
 function orgSelect(id) {
        showCanvas();
-       updateLoc(id, findOrgDepth(id));
+       runEvt("common", "locationChanged", id, findOrgDepth(id) );
 }
 
 var fontCookie = new cookieObject("fonts", 1, "/", COOKIE_FONT);
@@ -456,10 +440,6 @@ function setFontSize(size) {
 }
 
 
-/* ----------------------------------------------------------------------- */
-/* resource icon code */
-/* ----------------------------------------------------------------------- */
-
 var resourceFormats = [
    "text",
    "moving image",
@@ -530,7 +510,6 @@ function MARCFormatToMods(format) {
    return "text";
 }
 
-
 function setResourcePic( img, resource ) {
        img.setAttribute( "src", "../../../images/tor/" + resource + ".jpg");
        img.title = resource;
index 1f9215a..b617152 100644 (file)
@@ -10,12 +10,18 @@ table { border-collapse: collapse; }
 
 .encircled { border: 1px solid black; }
 
+#main_table { width: 100%; }
+#main_left_cell { width: 20%; vertical-align: top; }
+#main_right_cell { width: 80%; padding-left: 6px; vertical-align: top; }
+
 /*.vertical {writing-mode: tb-rl; filter: flipv fliph; }*/
 
 /* ---------------------------------------------------------------------- */
+/*
 .canvas { float:right; width: 79%; text-align: left;}
+*/
 #loading_div { width: 100%;}
-.logo { height: 65px; width: 180px; }*/
+.logo { height: 65px; width: 180px; }
 .org_tree { height: 500px; padding-left: 2px; padding-right: 2px; }            
 .org_link { padding-right: 15px; }
 #org_link_container { margin-bottom: 5px; padding-left: 4px; padding-bottom: 3px; padding-top: 3px; width: 100%; }
@@ -47,7 +53,7 @@ table { border-collapse: collapse; }
 
 #search_nav_links { width: 100%; }
 #result_info_box { text-align: left; }
-#next_prev_links { text-align: right; padding-left: 2px; padding-right: 2px;}
+#next_prev_links { padding-left: 2px; padding-right: 2px; text-align: left;}
 #goto_page_links { text-align: left; padding-left: 2px; padding-right: 2px;}
 
 #next_prev_links_dead {padding-left: 5px; padding-right: 5px;}
@@ -59,11 +65,12 @@ table { border-collapse: collapse; }
 .result_table_pic_header { width: 43px; }
 
 .result_table_row { text-align: left; }
-.result_table_subtable { width: 100%; border-collapse: collapse;}
+.result_table_subtable { width: 100%; border-collapse: collapse; vertical-align: top;}
 .result_table_subtbody { height: 100%; width: 100%; }
 .result_table_title_cell { text-align: left; }
 
-.copy_count_cell { width: 8%; text-align: center; padding: 0px; margin: 0px;}
+.copy_count_cell { width: 12%; vertical-align: middle; text-align: center; }
+.copy_count_div { text-align: center; vertical-align: middle; width:  4em; height: 100%; }
 
 .search_page_nav_link { margin-right: 5px; }
 
index f632e3b..8d667e4 100644 (file)
@@ -2,13 +2,12 @@ var records = {};
 var ranks = {};
 var onlyrecord = {};
 var table;
-var rowtemplate;
 var idsCookie = new cookieObject("ids", 1, "/", COOKIE_IDS);
 
 attachEvt("common", "unload", mresultUnload);
 attachEvt("common", "run", mresultDoSearch);
-attachEvt("mresult", "idsReceived", mresultSetRecords); 
-attachEvt("mresult", "idsReceived", mresultCollectRecords); 
+attachEvt("result", "idsReceived", mresultSetRecords); 
+attachEvt("result", "idsReceived", mresultCollectRecords); 
 
 
 function mresultUnload() { removeChildren(table); table = null;}
@@ -17,9 +16,8 @@ function mresultDoSearch() {
 
        table = G.ui.result.main_table;
 
-       hideMe(G.ui.result.row_template);
        while( table.parentNode.rows.length <= getDisplayCount() )  /* add an extra row so IE and safari won't complain */
-               hideMe(table.appendChild(G.ui.result.row_template.cloneNode(true)));
+               table.appendChild(G.ui.result.row_template.cloneNode(true));
 
        if(getOffset() == 0 || getHitCount() == null ) {
        //      mresultGetCount(); 
@@ -65,7 +63,7 @@ function mresultCollectIds(method) {
 
                var form = (getForm() == "all") ? null : getForm();
                var req = new Request(method, getStype(), getTerm(), 
-                       getLocation(), getDepth(), getDisplayCount() * 10, getOffset(), form );
+                       getLocation(), getDepth(), getDisplayCount() * 5, getOffset(), form );
                req.callback(mresultHandleMRIds);
                req.send();
        }
@@ -78,7 +76,7 @@ function mresultHandleMRIds(r) {
                HITCOUNT = res.count;
                runEvt('result', 'hitCountReceived');
        } 
-       runEvt('mresult', 'idsReceived', res.ids);
+       runEvt('result', 'idsReceived', res.ids);
 }
 
 function mresultSetRecords(idstruct) {
@@ -91,9 +89,11 @@ function mresultSetRecords(idstruct) {
        }
        idsCookie.put(COOKIE_IDS, js2JSON({ recs: records, ranks : ranks }) );
        idsCookie.write();
+       TOPRANK = ranks[getOffset()];
 }
 
 function mresultCollectRecords() {
+       runEvt("result", "preCollectRecords");
        var i = 0;
        for( var x = getOffset(); x!= getDisplayCount() + getOffset(); x++ ) {
                if(isNull(records[x])) break;
index beee5fe..d6ee3ce 100644 (file)
@@ -75,7 +75,7 @@ function _rdetailDraw(r) {
        record = r.getResultObject();
 
        G.ui.rdetail.title.appendChild(text(record.title()));
-       G.ui.rdetail.author.appendChild(text(record.author()));
+       buildSearchLink(STYPE_AUTHOR, record.author(), G.ui.rdetail.author);
        G.ui.rdetail.isbn.appendChild(text(cleanISBN(record.isbn())));
        G.ui.rdetail.edition.appendChild(text(record.edition()));
        G.ui.rdetail.pubdate.appendChild(text(record.pubdate()));
@@ -84,6 +84,8 @@ function _rdetailDraw(r) {
        setResourcePic( G.ui.rdetail.tor_pic, record.types_of_resource()[0]);
        G.ui.rdetail.abstr.appendChild(text(record.synopsis()));
 
+
+
        G.ui.rdetail.image.setAttribute("src", buildISBNSrc(cleanISBN(record.isbn())));
        runEvt("rdetail", "recordDrawn");
 }
index 4811ce3..b5ab809 100644 (file)
@@ -3,11 +3,13 @@ var recordsHandled = 0;
 var recordsCache = [];
 
 /* set up the event handlers */
-G.evt.result.hitCountReceived.push(resultSetHitInfo, resultPaginate);
+G.evt.result.hitCountReceived.push(resultSetHitInfo);
 G.evt.result.recordReceived.push(resultDisplayRecord, resultAddCopyCounts);
 G.evt.result.copyCountsReceived.push(resultDisplayCopyCounts);
 G.evt.result.allRecordsReceived.push(resultBuildCaches, resultDrawSubjects, resultDrawAuthors, resultDrawSeries);
 
+/* do this after we have ID's so the rank for mr pages will be correct */
+attachEvt("result", "preCollectRecords", resultPaginate);
 
 /* returns the last 'index' postion ocurring in this page */
 function resultFinalPageIndex() {
@@ -77,6 +79,15 @@ function resultDisplayRecord(rec, pos, is_mr) {
        hideMe(G.ui.common.loading);
 
        var r = table.rows[pos];
+       
+       try {
+               var rank = parseFloat(ranks[pos + getOffset()]);
+               rank = ( rank / getTopRank() ) * 100;
+               rank = parseInt(rank) + "%";
+               var relspan = findNodeByName(r, "relevancy_span");
+               relspan.appendChild(text(rank));
+               unHideMe(relspan.parentNode);
+       } catch(e){ }
 
        var pic = findNodeByName(r, config.names.result.item_jacket);
        pic.setAttribute("src", buildISBNSrc(cleanISBN(rec.isbn())));
@@ -96,9 +107,6 @@ function resultDisplayRecord(rec, pos, is_mr) {
 
        buildSearchLink(STYPE_AUTHOR, rec.author(), author_link);
 
-       findNodeByName(r, "result_table_title_cell").width = 
-               100 - (orgNodeTrail(findOrgUnit(getLocation())).length * 8) + "%";
-
        resultBuildFormatIcons( r, rec );
 
        unHideMe(r);
@@ -146,6 +154,8 @@ function resultPageIsDone(pos) {
                || recordsHandled + getOffset() == getHitCount());
 }
 
+var resultCCHeaderApplied = false;
+
 /* -------------------------------------------------------------------- */
 /* dynamically add the copy count rows based on the org type 'countsrow' 
        is the row into which we will add TD's to hold the copy counts 
@@ -162,9 +172,22 @@ function resultAddCopyCounts(rec, pagePosition) {
        var type = findOrgType(node.ou_type());
        ccell.id = "copy_count_cell_" + type.depth() + "_" + pagePosition;
        ccell.title = type.opac_label();
-       addCSSClass(ccell, config.css.result.cc_cell_even);
+       //addCSSClass(ccell, config.css.result.cc_cell_even);
 
        var lastcell = ccell;
+       var lastheadcell = null;
+
+       var cchead = null;
+       var ccheadcell = null;
+       if(!resultCCHeaderApplied) {
+               ccrow = getId('result_thead_row');
+               ccheadcell =  ccrow.removeChild(findNodeByName(ccrow, "result_thead_ccell"));
+               var t = ccheadcell.cloneNode(true);
+               lastheadcell = t;
+               t.appendChild(text(type.opac_label()));
+               ccrow.appendChild(t);
+               resultCCHeaderApplied = true;
+       }
 
        if(nodes[1]) {
 
@@ -176,10 +199,8 @@ function resultAddCopyCounts(rec, pagePosition) {
        
                        ccell = ccell.cloneNode(true);
 
-                       if((i % 2))
-                               removeCSSClass(ccell, "copy_count_cell_even");
-                       else
-                               addCSSClass(ccell, "copy_count_cell_even");
+                       //if((i % 2)) removeCSSClass(ccell, "copy_count_cell_even");
+                       //else addCSSClass(ccell, "copy_count_cell_even");
 
                        var node = nodes[x++];
                        var type = findOrgType(node.ou_type());
@@ -188,6 +209,13 @@ function resultAddCopyCounts(rec, pagePosition) {
                        ccell.title = type.opac_label();
                        countsrow.insertBefore(ccell, lastcell);
                        lastcell = ccell;
+
+                       if(ccheadcell) {
+                               var t = ccheadcell.cloneNode(true);
+                               t.appendChild(text(type.opac_label()));
+                               ccrow.insertBefore(t, lastheadcell);
+                               lastheadcell = t;
+                       }
                }
        }
 }
@@ -212,7 +240,8 @@ function resultDisplayCopyCounts(rec, pagePosition, copy_counts) {
        var i = 0;
        while(copy_counts[i] != null) {
                var cell = getId("copy_count_cell_" + i +"_" + pagePosition);
-               cell.appendChild(text(copy_counts[i].available + " / " + copy_counts[i].count));
+               var span = cell.getElementsByTagName("div")[0];
+               span.appendChild(text(copy_counts[i].available + " / " + copy_counts[i].count));
                i++;
        }
 }
index 995e453..78a3d69 100644 (file)
@@ -6,7 +6,7 @@ function rresultUnload() { removeChildren(table); table = null;}
 
 attachEvt("common", "unload", rresultUnload);
 attachEvt("common", "run", rresultDoSearch);
-attachEvt("rresult", "idsReceived", rresultCollectRecords); 
+attachEvt("result", "idsReceived", rresultCollectRecords); 
 attachEvt("result", "recordDrawn", rresultLaunchDrawn); 
 
 function rresultDoSearch() {
@@ -28,10 +28,11 @@ function rresultHandleRIds(r) {
        var res = r.getResultObject();
        HITCOUNT = parseInt(res.count);
        runEvt('result', 'hitCountReceived');
-       runEvt('rresult', 'idsReceived', res.ids);
+       runEvt('result', 'idsReceived', res.ids);
 }
 
 function rresultCollectRecords(ids) {
+       runEvt("result", "preCollectRecords");
        var x = 0;
        for( var i = getOffset(); i!= getDisplayCount() + getOffset(); i++ ) {
                if(ids[i] == null) break;
index cdba7f2..671ed80 100644 (file)
@@ -2,6 +2,8 @@ var searchBarExpanded = false;
 /* our search selector boxes */
 var _ts, _fs, _ds;
 
+attachEvt( "common", "locationChanged", updateLoc );
+
 
 G.evt.common.init.push(searchBarInit);
 
@@ -51,7 +53,9 @@ function depthSelectorChanged() {
        if( i == _ds.options.length - 1 ) {
                setSelector( _ds, getDepth() );
                _opacHandleLocationTagClick();
-       }
+
+       } else searchBarSubmit();
+
 }
 
 function buildLocationSelector() {
@@ -85,6 +89,7 @@ function updateLoc(location, depth) {
                setSelector(G.ui.searchbar.depth_selector, depth);
                newSearchDepth = depth;
        }
+       searchBarSubmit();
 }
 
 
index 68d0510..81fb753 100644 (file)
        </head>
 
        <body onload="init();">
-               <xi:include href="header.xml"/>
-               <div id='canvas' class='canvas'>
-                       <xi:include href="searchbar.xml"/>
-                       <xi:include href="statusbar.xml"/>
-                       <xi:include href="altcanvas.xml"/>
-                       <div id='canvas_main'>Advanced Search Goes Here</div>
-               </div>
+               <table width='100%'>
+                       <tbody>
+                               <tr>
+                                       <td id='main_left_cell'>
+                                               <xi:include href="logo.xml"/>
+                                               <xi:include href="sidebar.xml"/> 
+                                       </td>
+                                       <td id='main_right_cell'>
+                                               <div id='canvas' class='canvas'>
+                                               <xi:include href="searchbar.xml"/>
+                                               <xi:include href="statusbar.xml"/>
+                                               <xi:include href="altcanvas.xml"/>
+                                               <div id='canvas_main'>Advanced Search Goes Here</div>
+                                       </div>
+                                       </td>
+                               </tr>
+                       </tbody>
+               </table>
        </body>
 
+
 </html>
index 07b4903..a55c6ee 100644 (file)
        </head>
 
        <body onload="init();">
-               <xi:include href="header.xml"/> 
-               <div id='canvas' class='canvas'>
-                       <xi:include href="searchbar.xml"/>
-                       <xi:include href="statusbar.xml"/>
-                       <xi:include href="altcanvas.xml"/>
-                       <div id='canvas_main'>Home is here, show something interesting...</div>
-               </div>
+               <table width='100%'>
+                       <tbody>
+                               <tr>
+                                       <td id='main_left_cell'>
+                                               <xi:include href="logo.xml"/>
+                                               <xi:include href="sidebar.xml"/> 
+                                       </td>
+                                       <td id='main_right_cell'>
+                                               <div id='canvas' class='canvas'>
+                                               <xi:include href="searchbar.xml"/>
+                                               <xi:include href="statusbar.xml"/>
+                                               <xi:include href="altcanvas.xml"/>
+                                               <div id='canvas_main'>Home is here, show something interesting...</div>
+                                       </div>
+                                       </td>
+                               </tr>
+                       </tbody>
+               </table>
        </body>
 
+
 </html>
index 4223b51..5b05385 100644 (file)
        </head>
 
        <body onload="init();">
-               <xi:include href="header.xml"/> 
-               <div id='canvas' class='canvas'>
-                       <xi:include href="searchbar.xml"/>
-                       <xi:include href="statusbar.xml"/>
-                       <xi:include href="altcanvas.xml"/>
-                       <xi:include href="result_common.xml"/>
-               </div>
+               <table width='100%'>
+                       <tbody>
+                               <tr>
+                                       <td id='main_left_cell'>
+                                               <xi:include href="logo.xml"/>
+                                               <xi:include href="sidebar.xml"/> 
+                                       </td>
+                                       <td id='main_right_cell'>
+                                               <div id='canvas' class='canvas'>
+                                               <xi:include href="searchbar.xml"/>
+                                               <xi:include href="statusbar.xml"/>
+                                               <xi:include href="altcanvas.xml"/>
+                                               <xi:include href="result_common.xml"/>
+                                       </div>
+                                       </td>
+                               </tr>
+                       </tbody>
+               </table>
        </body>
 
 </html>
index 214430c..8eeb799 100644 (file)
        </head>
 
        <body onload="init();">
-               <xi:include href="header.xml"/> 
-               <div id='canvas' class='canvas'>
-                       <xi:include href="searchbar.xml"/>
-                       <xi:include href="statusbar.xml"/>
-                       <xi:include href="altcanvas.xml"/>
-                       <div id='canvas_main'>My OPAC Goes Here</div>
-               </div>
+               <table width='100%'>
+                       <tbody>
+                               <tr>
+                                       <td valign='top' width='20%'>
+                                               <xi:include href="logo.xml"/>
+                                               <xi:include href="sidebar.xml"/> 
+                                       </td>
+                                       <td style='padding-left: 6px;' valign='top' width='80%'>
+                                               <div id='canvas' class='canvas'>
+                                               <xi:include href="searchbar.xml"/>
+                                               <xi:include href="statusbar.xml"/>
+                                               <xi:include href="altcanvas.xml"/>
+                                               <div id='canvas_main'>My OPAC Goes Here</div>
+                                       </div>
+                                       </td>
+                               </tr>
+                       </tbody>
+               </table>
        </body>
 
 </html>
index f692578..787c294 100644 (file)
@@ -6,7 +6,8 @@
        <div id='org_link_container' class='color_1'>
                <span class='org_link'><a onclick='orgTreeSelector.openAll();' href='javascript:void(0);'>Expand All</a></span>
                <span class='org_link'><a onclick='orgTreeSelector.closeAll();' href='javascript:void(0);'>Collapse All</a></span>
-               <span class='org_link'><a onclick='showCanvas();' href='javascript:void(0);'> Close </a></span>
+               <span class='org_link'><a onclick='showCanvas();' href='javascript:void(0);'> Cancel </a></span>
        </div>
        <div id='org_tree' class='org_tree'> </div>
+       <br/>
 </div>
index fdf7482..abca554 100644 (file)
                config.ids.rdetail.view_marc = "rdetail_view_marc";
        </script>
 
+
        <body onload="init();">
-               <xi:include href="header.xml"/> 
-
-               
-               <div id='canvas' class='canvas'>
-
-                       <xi:include href="searchbar.xml"/>
-                       <xi:include href="statusbar.xml"/>
-                       <xi:include href="altcanvas.xml"/>
-                       <xi:include href="rdetail_altcanvas.xml"/>
-
-                       <div id='canvas_main'>
-                               <table class='rdetail_header color_1' width='100%'>
-                                       <tbody>
-                                               <tr>
-                                                       <td>
-                                                               <span>&rdetail.detailMain.headerLabel;</span>
-                                                       </td>
-                                                       <td align='right'>
-                                                               <a href="javascript:void(0);" id='rdetail_view_marc'>&rdetail.detailMain.viewMarc;</a>
-                                                       </td>
-                                               </tr>
-                                       </tbody>
-                               </table>
-                               <xi:include href="rdetail_summary.xml"/>
-                               <br/><br/>
-                               <xi:include href="rdetail_copyinfo.xml"/>
-                       </div>
-               </div>
+               <table id='main_table'>
+                       <tbody>
+                               <tr>
+                                       <td id='main_left_cell'>
+                                               <xi:include href="logo.xml"/>
+                                               <xi:include href="sidebar.xml"/> 
+                                       </td>
+                                       <td id='main_right_cell'>
+                                               <div id='canvas' class='canvas'>
+                                                       <xi:include href="searchbar.xml"/>
+                                                       <xi:include href="statusbar.xml"/>
+                                                       <xi:include href="altcanvas.xml"/>
+                                                       <xi:include href="rdetail_altcanvas.xml"/>
+       
+                                                       <div id='canvas_main'>
+                                                               <table style='margin-top: 10px;' class='rdetail_header color_1' width='100%'>
+                                                                       <tbody>
+                                                                               <tr>
+                                                                                       <td>
+                                                                                               <span>&rdetail.detailMain.headerLabel;</span>
+                                                                                       </td>
+                                                                                       <td align='right'>
+                                                                                               <a href="javascript:void(0);" id='rdetail_view_marc'>&rdetail.detailMain.viewMarc;</a>
+                                                                                       </td>
+                                                                               </tr>
+                                                                       </tbody>
+                                                               </table>
+                                                               <xi:include href="rdetail_summary.xml"/>
+                                                               <br/><br/>
+                                                               <xi:include href="rdetail_copyinfo.xml"/>
+                                                       </div>
+                                               </div>
+                                       </td>
+                               </tr>
+                       </tbody>
+               </table>
        </body>
 </html>
 
index 08b8aed..9489d22 100644 (file)
        </script>
 
 
+       <!--
        <table id='search_nav_links'>
                <tbody>
                        <tr>
-
-                               <!-- talk about the number of hits, etc. -->
-                               <td id='result_info_box'>
+                               <td valign='bottom' id='result_info_box'>
                                        <div class='hide_me' id='result_info_div'>
                                                <span> Results </span> 
                                                <span id='offset_start'> </span>
                                                <span id='num_pages'> </span>
                                        </div>
                                </td>
-                               
-                               <!-- simple next/prev type navigation links -->
-                               <td id='next_prev_links'>
-                                       <a class='search_page_nav_link' id='search_home_link' title="First results page">Start</a>
-                                       <a class='search_page_nav_link' id='prev_link' title='Previus page'> &lt;&lt; </a>
-                                       <span class='search_page_nav_link' id='page_numbers'> </span>
-                                       <a  class='search_page_nav_link' id='next_link' title='Next Page'> &gt;&gt; </a>
-                                       <a  class='search_page_nav_link' id='end_link' title="Last results page">End</a>
+                               <td style='text-align:right; padding-right: 10px;'>
+                                       <span> Avaible copies / Total copies </span>
                                </td>
-
                        </tr>
                </tbody>
        </table>
+       -->
 
        <!-- Load the result table -->
        <xi:include href="result_table.xml"/>
index 48ee806..5b87f44 100644 (file)
@@ -5,26 +5,94 @@
 
 <div id='result_table_div' xmlns:xi="http://www.w3.org/2001/XInclude">
 
+       <table id='search_nav_links'>
+               <tbody>
+                       <tr>
+                               <td valign='bottom' id='result_info_box'>
+                                       <!--
+                                       <div class='hide_me' id='result_info_div' style='font-size: 8pt;'>
+                                               <span> Results </span> 
+                                               <span id='offset_start'> </span>
+                                               <span> - </span>
+                                               <span id='offset_end'> </span>
+                                               <span> of </span>
+                                               <span id='result_count'> </span>
+                                               <span style='padding-left: 6px;'> (page </span>
+                                               <span id='current_page'> </span>
+                                               <span> of </span>
+                                               <span id='num_pages'> </span>
+                                       </div>
+                                       -->
+                               </td>
+                               <td width="36%" 
+                                       style='padding-bottom: 4px; text-align:center; border-bottom: 1px solid #A0A0A0;'>
+                                       <span style='font-size: 8pt;'> <b>Available copies / Total copies </b></span>
+                               </td>
+                       </tr>
+               </tbody>
+       </table>
+
+
+       <table id='result_thead' width='100%' style='margin-right: 16px;'>
+               <tbody>
+                       <tr id='result_thead_row'>
+
+                               <td style='vertical-align: middle;'  id='next_prev_links' valign='bottom'>
+                                       <a class='search_page_nav_link' id='search_home_link' title="First results page">Start</a>
+                                       <a class='search_page_nav_link' id='prev_link' title='Previus page'> &lt;&lt; </a>
+                                       <span class='search_page_nav_link' id='page_numbers'> </span>
+                                       <a  class='search_page_nav_link' id='next_link' title='Next Page'> &gt;&gt; </a>
+                                       <a  class='search_page_nav_link' id='end_link' title="Last results page">End</a>
+                               </td>
+
+                               <td align='left' style='padding-left: 10px;'>
+                                       <div class='hide_me' id='result_info_div' style='font-size: 9pt;'>
+                                               <span> Results </span> 
+                                               <span id='offset_start'> </span>
+                                               <span> - </span>
+                                               <span id='offset_end'> </span>
+                                               <span> of </span>
+                                               <span id='result_count'> </span>
+                                               <span style='padding-left: 6px;'> (page </span>
+                                               <span id='current_page'> </span>
+                                               <span> of </span>
+                                               <span id='num_pages'> </span>
+                                       </div>
+                               </td>
+
+
+                               <td> </td>
+                               <td style='font-size: 8pt; padding-top: 4px;' width='12%' align='center' name='result_thead_ccell'> </td>
+                       </tr>
+               </tbody>
+       </table>
+
+       
+
        <table id='res_table'> 
 
+
                <!-- for some reason, this is the only way i can force the cell widths -->
-               <thead><td class='result_table_pic_header'></td><td/></thead>
+               <thead id='result_thead'>
+                       <td class='result_table_pic_header'></td>
+                       <td> </td>
+               </thead>
 
                <tbody id='result_table'>
 
                        <!-- Template for displaying a search result.  This row template is cloned and inserted
                                        for each result returned -->
 
-                       <tr id='result_table_template'>
+                       <tr id='result_table_template' class='hide_me'>
 
                                <!-- Jacket image goes here -->
-                               <td width="10%" class='result_table_pic_header'><a><img name='item_jacket' class='result_table_pic'/></a></td>
+                               <td  class='result_table_pic_header'><a><img name='item_jacket' class='result_table_pic'/></a></td>
 
                                <td class='result_table_row'>
                                        <table class='result_table_subtable'>
                                                <tbody class='result_table_subtbody'>
 
-                                                       <tr name='counts_row'>
+                                                       <tr style='height: 1em' name='counts_row'>
 
                                                                <td class='result_table_title_cell' name='result_table_title_cell'>
                                                                        <a title="View titles for this record" name='item_title' class='search_link'> 
                                                                </td>
 
                                                                <!-- Copy this td for each copy count appended -->
-                                                               <td nowrap='nowrap' name="copy_count_cell" class='copy_count_cell' rowspan='3'> </td>
+                                                               <td align='center' valign='middle' nowrap='nowrap' 
+                                                                       name="copy_count_cell" class='copy_count_cell' rowspan='3'> 
+                                                                       <div  class='copy_count_div'> </div>
+                                                               </td>
 
                                                        </tr>
                
-                                                       <tr>
+                                                       <tr style='height: 1em' >
                                                                <td class='result_table_author_cell'>
                                                                        <a title="Perform an Author Search" name='item_author' class='search_link'> 
                                                                                <!-- Author goes here -->
                                                                </td>
                                                        </tr>
 
-                                                       <tr>
+                                                       <tr style='height:1em;' >
                                                                <td name='result_table_format_cell' class='result_table_format_cell'>
 
                                                                        <a name='text_link' class='search_link'> 
                                                                                <img src='../../../images/tor/three dimensional object.jpg' class='dim tor_pic'> </img>
                                                                        </a>
 
+                                                                       <span class='hide_me' style='color: #9999FF; padding-left: 10px; font-size: 7pt; font-weight: 300;'> 
+                                                                               <span>Relevancy </span><span name='relevancy_span'> </span>
+                                                                       </span>
+
                                                                </td>
                                                        </tr>
 
index 0969fe3..6c83119 100644 (file)
        </head>
 
        <body onload="init();">
-               <xi:include href="header.xml"/> 
-               <div id='canvas' class='canvas'>
-                       <xi:include href="searchbar.xml"/>
-                       <xi:include href="statusbar.xml"/>
-                       <xi:include href="altcanvas.xml"/>
-                       <xi:include href="result_common.xml"/>
-               </div>
+               <table width='100%'>
+                       <tbody>
+                               <tr>
+                                       <td id='main_left_cell'>
+                                               <xi:include href="logo.xml"/>
+                                               <xi:include href="sidebar.xml"/> 
+                                       </td>
+                                       <td id='main_right_cell'>
+                                               <div id='canvas' class='canvas'>
+                                               <xi:include href="searchbar.xml"/>
+                                               <xi:include href="statusbar.xml"/>
+                                               <xi:include href="altcanvas.xml"/>
+                                               <xi:include href="result_common.xml"/>
+                                       </div>
+                                       </td>
+                               </tr>
+                       </tbody>
+               </table>
        </body>
 
+
 </html>
index 861db2a..a2f177a 100644 (file)
@@ -52,7 +52,7 @@
                                        </span>
 
                                        <span style='padding-right:9px;'>
-                                       <select id='form_selector' style='width: 130px;' >
+                                       <select id='form_selector' >
                                                <option value='all'>All Formats</option>
                                                <option value='at'>Books</option>
                                                <option value='at-d'>Large Print Books</option>
index e214b22..72fdf0b 100644 (file)
@@ -16,7 +16,15 @@ body a:hover { color: red; text-decoration: underline;}
 .nav_link_active { text-decoration: underline; }
 .search_link { text-decoration: none; }
 .result_table_subtable { border-top: 1px solid #E0E0E0; }
+/*
 .copy_count_cell_even { border: 1px solid #E0E0E0; }
+*/
+/*
+.copy_count_cell_even { background: #E0F6E0; }
+*/
+
+.copy_count_div {      border-left: 2px solid #E0F6E0; border-right: 2px solid #E0F6E0;> 
+
 .rdetail_desc { border: 1px solid #A7EA9D; }
 .rdetail_item { border: 1px solid #A7EA9D; }
 #rdetail_details_table { border: 1px solid #A7EA9D; }