[open-ils-commits] r8075 - in trunk/Open-ILS/web/opac: common/js
locale/en-US skin/default/js skin/default/xml/myopac
svn at svn.open-ils.org
svn at svn.open-ils.org
Fri Nov 16 12:01:58 EST 2007
Author: erickson
Date: 2007-11-16 11:44:59 -0500 (Fri, 16 Nov 2007)
New Revision: 8075
Modified:
trunk/Open-ILS/web/opac/common/js/config.js
trunk/Open-ILS/web/opac/common/js/opac_utils.js
trunk/Open-ILS/web/opac/locale/en-US/opac.dtd
trunk/Open-ILS/web/opac/skin/default/js/adv_global.js
trunk/Open-ILS/web/opac/skin/default/js/mresult.js
trunk/Open-ILS/web/opac/skin/default/js/myopac.js
trunk/Open-ILS/web/opac/skin/default/js/rresult.js
trunk/Open-ILS/web/opac/skin/default/xml/myopac/myopac_holds.xml
Log:
Storing the compiled search blob in a cookie. That cookie is used to populate
the advanced search widgets. (This means we don't have to re-parse the query syntax
in the OPAC).
Removed the hold cancel option from the edit column since Cancel is an
option in the new hold actions dropdown.
Modified: trunk/Open-ILS/web/opac/common/js/config.js
===================================================================
--- trunk/Open-ILS/web/opac/common/js/config.js 2007-11-16 13:59:51 UTC (rev 8074)
+++ trunk/Open-ILS/web/opac/common/js/config.js 2007-11-16 16:44:59 UTC (rev 8075)
@@ -82,6 +82,7 @@
var COOKIE_FONT = "fnt";
var COOKIE_SKIN = "skin";
var COOKIE_RIDS = "rids"; /* list of record ids */
+var COOKIE_SEARCH = 'sr';
/* pages */
var MRESULT = "mresult";
Modified: trunk/Open-ILS/web/opac/common/js/opac_utils.js
===================================================================
--- trunk/Open-ILS/web/opac/common/js/opac_utils.js 2007-11-16 13:59:51 UTC (rev 8074)
+++ trunk/Open-ILS/web/opac/common/js/opac_utils.js 2007-11-16 16:44:59 UTC (rev 8075)
@@ -201,6 +201,10 @@
scaleFonts(font);
if(font) FONTSIZE = font;
SKIN = cookieManager.read(COOKIE_SKIN);
+ if(findCurrentPage() == HOME)
+ cookieManager.remove(COOKIE_SEARCH);
+
+
}
/* URL param accessors */
@@ -708,6 +712,7 @@
cookieManager.remove(COOKIE_RIDS);
cookieManager.remove(COOKIE_SES);
cookieManager.remove(COOKIE_SKIN);
+ cookieManager.remove(COOKIE_SEARCH);
checkUserSkin("default");
COUNT = 10;
Modified: trunk/Open-ILS/web/opac/locale/en-US/opac.dtd
===================================================================
--- trunk/Open-ILS/web/opac/locale/en-US/opac.dtd 2007-11-16 13:59:51 UTC (rev 8074)
+++ trunk/Open-ILS/web/opac/locale/en-US/opac.dtd 2007-11-16 16:44:59 UTC (rev 8075)
@@ -201,7 +201,7 @@
================================================================= -->
<!ENTITY myopac.holds.formats "Formats">
<!ENTITY myopac.holds.location "Pickup Location">
-<!ENTITY myopac.holds.edit.cancel "Edit/Cancel">
+<!ENTITY myopac.holds.edit "Edit">
<!ENTITY myopac.holds.status.none "You have no items on hold at this time">
<!ENTITY myopac.holds.status.waiting "Waiting for copy">
<!ENTITY myopac.holds.status.intransit "In Transit">
Modified: trunk/Open-ILS/web/opac/skin/default/js/adv_global.js
===================================================================
--- trunk/Open-ILS/web/opac/skin/default/js/adv_global.js 2007-11-16 13:59:51 UTC (rev 8074)
+++ trunk/Open-ILS/web/opac/skin/default/js/adv_global.js 2007-11-16 16:44:59 UTC (rev 8075)
@@ -43,8 +43,42 @@
if(getAvail())
$('opac.result.limit2avail').checked = true;
+
+ initSearchBoxes();
}
+function initSearchBoxes() {
+ /* loads the compiled search from the search cookie
+ and sets the widgets accordingly */
+
+ search = cookieManager.read(COOKIE_SEARCH);
+ if(!search) return;
+ _debug("loaded compiled search cookie: " + search);
+
+ search = JSON2js(search);
+ if(!search) return;
+
+ var types = getObjectKeys(search.searches);
+
+ /* pre-add the needed rows */
+ while($('adv_global_tbody').getElementsByTagName('tr').length - 1 < types.length)
+ advAddGblRow();
+
+ var rows = $('adv_global_tbody').getElementsByTagName('tr');
+ for(var t = 0; t < types.length; t++) {
+ var row = rows[t];
+ setSelector($n(row, 'type'), types[t]);
+ var term = search.searches[types[t]].term;
+
+ /* if this is a single -<term> search, set the selector to nocontains */
+ if(match = term.match(/^-(\w+)$/)) {
+ term = match[1];
+ setSelector($n(row, 'contains'), 'nocontains');
+ }
+ $n(row, 'term').value = term;
+ }
+}
+
function advAddGblRow() {
var tbody = $("adv_global_tbody");
var newrow = $("adv_global_trow").cloneNode(true);
Modified: trunk/Open-ILS/web/opac/skin/default/js/mresult.js
===================================================================
--- trunk/Open-ILS/web/opac/skin/default/js/mresult.js 2007-11-16 13:59:51 UTC (rev 8074)
+++ trunk/Open-ILS/web/opac/skin/default/js/mresult.js 2007-11-16 16:44:59 UTC (rev 8075)
@@ -51,6 +51,7 @@
if( getOffset() == 0 ) HITCOUNT = res.count;
runEvt('result', 'hitCountReceived');
}
+ cookieManager.write(COOKIE_SEARCH, js2JSON(res.compiled_search), -1);
runEvt('result', 'idsReceived', res.ids);
}
Modified: trunk/Open-ILS/web/opac/skin/default/js/myopac.js
===================================================================
--- trunk/Open-ILS/web/opac/skin/default/js/myopac.js 2007-11-16 13:59:51 UTC (rev 8074)
+++ trunk/Open-ILS/web/opac/skin/default/js/myopac.js 2007-11-16 16:44:59 UTC (rev 8075)
@@ -336,9 +336,6 @@
tbody.appendChild(row);
- $n(row,'myopac_holds_cancel_link').setAttribute(
- 'href','javascript:myOPACCancelHold("'+ h.id()+'");');
-
$n(row,'myopac_holds_edit_link').setAttribute(
'href','javascript:myOPACEditHold("'+ h.id()+'");');
@@ -378,15 +375,6 @@
}
-function myOPACCancelHold(holdid) {
- if( confirm($('myopac_holds_cancel_verify').innerHTML) ) {
- holdsCancel(holdid);
- holdsTemplateRow = null
- myOPACShowHolds();
- }
-}
-
-
function myOPACDrawHoldStatus(hold) {
var req = new Request(FETCH_HOLD_STATUS, G.user.session, hold.id() );
req.callback(myOShowHoldStatus);
@@ -464,7 +452,6 @@
if(copy) $n(row, 'copy').appendChild(text(copy.barcode()));
}
- /*var form = $("myopac_holds_form_" + hold.id() + '_' + record.doc_id());*/
var form = $("myopac_holds_form_" + hold.id());
if(form) {
Modified: trunk/Open-ILS/web/opac/skin/default/js/rresult.js
===================================================================
--- trunk/Open-ILS/web/opac/skin/default/js/rresult.js 2007-11-16 13:59:51 UTC (rev 8074)
+++ trunk/Open-ILS/web/opac/skin/default/js/rresult.js 2007-11-16 16:44:59 UTC (rev 8075)
@@ -299,6 +299,8 @@
for( var i = 0; i != result.ids.length; i++ )
ids.push(result.ids[i][0]);
}
+
+ cookieManager.write(COOKIE_SEARCH, js2JSON(result.compiled_search), -1);
_rresultHandleIds( ids, result.count );
}
Modified: trunk/Open-ILS/web/opac/skin/default/xml/myopac/myopac_holds.xml
===================================================================
--- trunk/Open-ILS/web/opac/skin/default/xml/myopac/myopac_holds.xml 2007-11-16 13:59:51 UTC (rev 8074)
+++ trunk/Open-ILS/web/opac/skin/default/xml/myopac/myopac_holds.xml 2007-11-16 16:44:59 UTC (rev 8075)
@@ -43,7 +43,7 @@
onclick='myopacSelectNoneHolds();' class='classic_link' href='javascript:void(0);'>&common.none;</a>)
</td>
- <td>&myopac.holds.edit.cancel;</td>
+ <td>&myopac.holds.edit;</td>
</tr>
</thead>
@@ -88,10 +88,7 @@
<td name='myopac_holds_cancel' style='border-left: 3px solid #E0E0E0; border-right: 3px solid #E0E0E0;'>
<a href='javascript:void(0);'
name='myopac_holds_edit_link' class='classic_link'>&myopac.holds.edit;</a>
- <a href='javascript:void(0);'
- name='myopac_holds_cancel_link' class='classic_link'>&myopac.holds.cancel;</a>
</td>
-
</tr>
</tbody>
</table>
More information about the open-ils-commits
mailing list