From 1b19227221078937cce84ad78a2393441e26edb9 Mon Sep 17 00:00:00 2001 From: erickson Date: Mon, 12 Sep 2005 20:45:58 +0000 Subject: [PATCH] numerous small style changes 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 --- Open-ILS/web/opac/common/css/mediumfont.css | 8 +- Open-ILS/web/opac/common/js/Cookie.js | 54 +++-------- Open-ILS/web/opac/common/js/config.js | 8 +- Open-ILS/web/opac/common/js/init.js | 2 +- Open-ILS/web/opac/common/js/md5.js | 51 ----------- Open-ILS/web/opac/common/js/opac_utils.js | 33 ++----- Open-ILS/web/opac/skin/default/css/layout.css | 15 +++- Open-ILS/web/opac/skin/default/js/mresult.js | 14 +-- Open-ILS/web/opac/skin/default/js/rdetail.js | 4 +- .../web/opac/skin/default/js/result_common.js | 49 +++++++--- Open-ILS/web/opac/skin/default/js/rresult.js | 5 +- .../web/opac/skin/default/js/search_bar.js | 7 +- .../web/opac/skin/default/xml/advanced.xml | 26 ++++-- Open-ILS/web/opac/skin/default/xml/index.xml | 26 ++++-- .../web/opac/skin/default/xml/mresult.xml | 25 ++++-- Open-ILS/web/opac/skin/default/xml/myopac.xml | 25 ++++-- .../web/opac/skin/default/xml/orgtree.xml | 3 +- .../web/opac/skin/default/xml/rdetail.xml | 65 ++++++++------ .../opac/skin/default/xml/result_common.xml | 17 ++-- .../opac/skin/default/xml/result_table.xml | 89 +++++++++++++++++-- .../web/opac/skin/default/xml/rresult.xml | 26 ++++-- .../web/opac/skin/default/xml/searchbar.xml | 2 +- .../web/opac/theme/default/css/colors.css | 8 ++ 23 files changed, 324 insertions(+), 238 deletions(-) diff --git a/Open-ILS/web/opac/common/css/mediumfont.css b/Open-ILS/web/opac/common/css/mediumfont.css index 08f4210af4..44e8d4fdc5 100644 --- a/Open-ILS/web/opac/common/css/mediumfont.css +++ b/Open-ILS/web/opac/common/css/mediumfont.css @@ -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; } diff --git a/Open-ILS/web/opac/common/js/Cookie.js b/Open-ILS/web/opac/common/js/Cookie.js index 8d4e6e30c8..3b00acfafc 100644 --- a/Open-ILS/web/opac/common/js/Cookie.js +++ b/Open-ILS/web/opac/common/js/Cookie.js @@ -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() } - - diff --git a/Open-ILS/web/opac/common/js/config.js b/Open-ILS/web/opac/common/js/config.js index 49e47c35af..f6b47c2c5f 100644 --- a/Open-ILS/web/opac/common/js/config.js +++ b/Open-ILS/web/opac/common/js/config.js @@ -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*/ diff --git a/Open-ILS/web/opac/common/js/init.js b/Open-ILS/web/opac/common/js/init.js index 8fff2fc203..3fad7c8c5f 100644 --- a/Open-ILS/web/opac/common/js/init.js +++ b/Open-ILS/web/opac/common/js/init.js @@ -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())); diff --git a/Open-ILS/web/opac/common/js/md5.js b/Open-ILS/web/opac/common/js/md5.js index 46d2aab7d1..7f4a69460f 100644 --- a/Open-ILS/web/opac/common/js/md5.js +++ b/Open-ILS/web/opac/common/js/md5.js @@ -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+/"; diff --git a/Open-ILS/web/opac/common/js/opac_utils.js b/Open-ILS/web/opac/common/js/opac_utils.js index a5eb727779..87b2c63235 100644 --- a/Open-ILS/web/opac/common/js/opac_utils.js +++ b/Open-ILS/web/opac/common/js/opac_utils.js @@ -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; diff --git a/Open-ILS/web/opac/skin/default/css/layout.css b/Open-ILS/web/opac/skin/default/css/layout.css index 1f9215ad83..b617152e86 100644 --- a/Open-ILS/web/opac/skin/default/css/layout.css +++ b/Open-ILS/web/opac/skin/default/css/layout.css @@ -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; } diff --git a/Open-ILS/web/opac/skin/default/js/mresult.js b/Open-ILS/web/opac/skin/default/js/mresult.js index f632e3b18d..8d667e49fa 100644 --- a/Open-ILS/web/opac/skin/default/js/mresult.js +++ b/Open-ILS/web/opac/skin/default/js/mresult.js @@ -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; diff --git a/Open-ILS/web/opac/skin/default/js/rdetail.js b/Open-ILS/web/opac/skin/default/js/rdetail.js index beee5fe645..d6ee3ce07a 100644 --- a/Open-ILS/web/opac/skin/default/js/rdetail.js +++ b/Open-ILS/web/opac/skin/default/js/rdetail.js @@ -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"); } diff --git a/Open-ILS/web/opac/skin/default/js/result_common.js b/Open-ILS/web/opac/skin/default/js/result_common.js index 4811ce347e..b5ab8092c7 100644 --- a/Open-ILS/web/opac/skin/default/js/result_common.js +++ b/Open-ILS/web/opac/skin/default/js/result_common.js @@ -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++; } } diff --git a/Open-ILS/web/opac/skin/default/js/rresult.js b/Open-ILS/web/opac/skin/default/js/rresult.js index 995e4530d9..78a3d69678 100644 --- a/Open-ILS/web/opac/skin/default/js/rresult.js +++ b/Open-ILS/web/opac/skin/default/js/rresult.js @@ -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; diff --git a/Open-ILS/web/opac/skin/default/js/search_bar.js b/Open-ILS/web/opac/skin/default/js/search_bar.js index cdba7f2620..671ed80ba8 100644 --- a/Open-ILS/web/opac/skin/default/js/search_bar.js +++ b/Open-ILS/web/opac/skin/default/js/search_bar.js @@ -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(); } diff --git a/Open-ILS/web/opac/skin/default/xml/advanced.xml b/Open-ILS/web/opac/skin/default/xml/advanced.xml index 68d051093f..81fb753671 100644 --- a/Open-ILS/web/opac/skin/default/xml/advanced.xml +++ b/Open-ILS/web/opac/skin/default/xml/advanced.xml @@ -13,13 +13,25 @@ - -
- - - -
Advanced Search Goes Here
-
+ + + + + + + +
+ + + +
+ + + +
Advanced Search Goes Here
+
+
+ diff --git a/Open-ILS/web/opac/skin/default/xml/index.xml b/Open-ILS/web/opac/skin/default/xml/index.xml index 07b4903484..a55c6eef32 100644 --- a/Open-ILS/web/opac/skin/default/xml/index.xml +++ b/Open-ILS/web/opac/skin/default/xml/index.xml @@ -10,13 +10,25 @@ - -
- - - -
Home is here, show something interesting...
-
+ + + + + + + +
+ + + +
+ + + +
Home is here, show something interesting...
+
+
+ diff --git a/Open-ILS/web/opac/skin/default/xml/mresult.xml b/Open-ILS/web/opac/skin/default/xml/mresult.xml index 4223b5153b..5b0538597c 100644 --- a/Open-ILS/web/opac/skin/default/xml/mresult.xml +++ b/Open-ILS/web/opac/skin/default/xml/mresult.xml @@ -13,13 +13,24 @@ - -
- - - - -
+ + + + + + + +
+ + + +
+ + + + +
+
diff --git a/Open-ILS/web/opac/skin/default/xml/myopac.xml b/Open-ILS/web/opac/skin/default/xml/myopac.xml index 214430c119..8eeb799b7b 100644 --- a/Open-ILS/web/opac/skin/default/xml/myopac.xml +++ b/Open-ILS/web/opac/skin/default/xml/myopac.xml @@ -10,13 +10,24 @@ - -
- - - -
My OPAC Goes Here
-
+ + + + + + + +
+ + + +
+ + + +
My OPAC Goes Here
+
+
diff --git a/Open-ILS/web/opac/skin/default/xml/orgtree.xml b/Open-ILS/web/opac/skin/default/xml/orgtree.xml index f6925781c1..787c2943f6 100644 --- a/Open-ILS/web/opac/skin/default/xml/orgtree.xml +++ b/Open-ILS/web/opac/skin/default/xml/orgtree.xml @@ -6,7 +6,8 @@
+
diff --git a/Open-ILS/web/opac/skin/default/xml/rdetail.xml b/Open-ILS/web/opac/skin/default/xml/rdetail.xml index fdf748297f..abca55495e 100644 --- a/Open-ILS/web/opac/skin/default/xml/rdetail.xml +++ b/Open-ILS/web/opac/skin/default/xml/rdetail.xml @@ -16,35 +16,44 @@ config.ids.rdetail.view_marc = "rdetail_view_marc"; + - - - -
- - - - - - -
- - - - - - - -
- &rdetail.detailMain.headerLabel; - - &rdetail.detailMain.viewMarc; -
- -

- -
-
+ + + + + + + +
+ + + +
+ + + + + +
+ + + + + + + +
+ &rdetail.detailMain.headerLabel; + + &rdetail.detailMain.viewMarc; +
+ +

+ +
+
+
diff --git a/Open-ILS/web/opac/skin/default/xml/result_common.xml b/Open-ILS/web/opac/skin/default/xml/result_common.xml index 08b8aeda48..9489d229e1 100644 --- a/Open-ILS/web/opac/skin/default/xml/result_common.xml +++ b/Open-ILS/web/opac/skin/default/xml/result_common.xml @@ -31,12 +31,11 @@ + - +
Results @@ -50,19 +49,13 @@
- - - - Start - << - - >> - End + + Avaible copies / Total copies - + --> diff --git a/Open-ILS/web/opac/skin/default/xml/result_table.xml b/Open-ILS/web/opac/skin/default/xml/result_table.xml index 48ee8067a3..5b87f440e6 100644 --- a/Open-ILS/web/opac/skin/default/xml/result_table.xml +++ b/Open-ILS/web/opac/skin/default/xml/result_table.xml @@ -5,26 +5,94 @@
+ + + + + + + + + + + + + + + + + + + + + + + +
+
+ Results + + - + + of + + (page + + of + +
+
+ + + + - + + + + - + - +
- + - + - + - + diff --git a/Open-ILS/web/opac/skin/default/xml/rresult.xml b/Open-ILS/web/opac/skin/default/xml/rresult.xml index 0969fe32f7..6c83119f36 100644 --- a/Open-ILS/web/opac/skin/default/xml/rresult.xml +++ b/Open-ILS/web/opac/skin/default/xml/rresult.xml @@ -13,13 +13,25 @@ - -
- - - - -
+
@@ -33,11 +101,14 @@ +
+
@@ -45,7 +116,7 @@
@@ -92,6 +163,10 @@ + + Relevancy + +
+ + + + + + +
+ + + +
+ + + + +
+
+ diff --git a/Open-ILS/web/opac/skin/default/xml/searchbar.xml b/Open-ILS/web/opac/skin/default/xml/searchbar.xml index 861db2a3c4..a2f177a5bb 100644 --- a/Open-ILS/web/opac/skin/default/xml/searchbar.xml +++ b/Open-ILS/web/opac/skin/default/xml/searchbar.xml @@ -52,7 +52,7 @@ - diff --git a/Open-ILS/web/opac/theme/default/css/colors.css b/Open-ILS/web/opac/theme/default/css/colors.css index e214b2238e..72fdf0b1ca 100644 --- a/Open-ILS/web/opac/theme/default/css/colors.css +++ b/Open-ILS/web/opac/theme/default/css/colors.css @@ -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; } -- 2.43.2