From: erickson Date: Wed, 29 Oct 2008 17:12:53 +0000 (+0000) Subject: put vandelay queue actions into dropdown to clean up. queue filters auto-refresh... X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=8e3078dcd91acb20aa3101a62f2e57a90259740e;p=Evergreen.git put vandelay queue actions into dropdown to clean up. queue filters auto-refresh. added some utility methods git-svn-id: svn://svn.open-ils.org/ILS/branches/rel_1_4@10975 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- diff --git a/Open-ILS/web/js/dojo/openils/Util.js b/Open-ILS/web/js/dojo/openils/Util.js index 4ce9cffa71..904caa5f1a 100644 --- a/Open-ILS/web/js/dojo/openils/Util.js +++ b/Open-ILS/web/js/dojo/openils/Util.js @@ -54,6 +54,45 @@ if(!dojo._hasResource["openils.Util"]) { }; /** + * Given a HTML select object, returns the currently selected value + */ + openils.Util.selectorValue = function(sel) { + if(!sel) return null; + var idx = sel.selectedIndex; + if(idx < 0) return null; + var o = sel.options[idx]; + var v = o.value; + if(v == null) v = o.innerHTML; + return v; + } + + /** + * Returns the character code of the provided (or current window) event + */ + openils.Util.getCharCode = function(evt) { + evt = (evt) ? evt : ((window.event) ? event : null); + if(evt) { + return (evt.charCode ? evt.charCode : + ((evt.which) ? evt.which : evt.keyCode )); + } else { return -1; } + } + + + /** + * Registers a handler for when the Enter key is pressed while + * the provided DOM node has focus. + */ + openils.Util.registerEnterHandler = function(domNode, func) { + if(!(domNode && func)) return; + domNode.onkeydown = function(evt) { + var code = openils.Util.getCharCode(evt); + if(code == 13 || code == 3) + func(); + } + } + + + /** * Parses opensrf response objects to see if they contain * data and/or an ILS event. This only calls request.recv() * once, so in a streaming context, it's necessary to loop on diff --git a/Open-ILS/web/opac/locale/en-US/vandelay.dtd b/Open-ILS/web/opac/locale/en-US/vandelay.dtd index fd266416d3..8429fde93d 100644 --- a/Open-ILS/web/opac/locale/en-US/vandelay.dtd +++ b/Open-ILS/web/opac/locale/en-US/vandelay.dtd @@ -100,3 +100,4 @@ + diff --git a/Open-ILS/web/vandelay/inc/queue.xml b/Open-ILS/web/vandelay/inc/queue.xml index 00e5722492..68947744ba 100644 --- a/Open-ILS/web/vandelay/inc/queue.xml +++ b/Open-ILS/web/vandelay/inc/queue.xml @@ -54,46 +54,55 @@ diff --git a/Open-ILS/web/vandelay/vandelay.js b/Open-ILS/web/vandelay/vandelay.js index b7a32f7536..14b0636468 100644 --- a/Open-ILS/web/vandelay/vandelay.js +++ b/Open-ILS/web/vandelay/vandelay.js @@ -35,6 +35,7 @@ dojo.require("fieldmapper.dojoData"); dojo.require('openils.CGI'); dojo.require('openils.User'); dojo.require('openils.Event'); +dojo.require('openils.Util'); dojo.require('openils.MarcXPathParser'); dojo.require('openils.GridColumnPicker'); @@ -84,6 +85,9 @@ function vlInit() { var initNeeded = 4; // how many async responses do we need before we're init'd var initCount = 0; // how many async reponses we've received + openils.Util.registerEnterHandler( + vlQueueDisplayPage.domNode, function(){retrieveQueuedRecords();}); + function checkInitDone() { initCount++; if(initCount == initNeeded) @@ -282,11 +286,17 @@ function retrieveQueuedRecords(type, queueId, onload) { selectableGridRecords = {}; resetVlQueueGridLayout(); + if(!type) type = currentType; + if(!queueId) queueId = currentQueueId; + if(!onload) onload = handleRetrieveRecords; + var method = 'open-ils.vandelay.'+type+'_queue.records.retrieve.atomic'; if(vlQueueGridShowMatches.checked) method = method.replace('records', 'records.matches'); - var limit = parseInt(vlQueueDisplayLimit.getValue()); + //var limit = parseInt(vlQueueDisplayLimit.getValue()); + var sel = dojo.byId('vl-queue-display-limit-selector'); + var limit = parseInt(sel.options[sel.selectedIndex].value); var offset = limit * parseInt(vlQueueDisplayPage.getValue()-1); var params = [authtoken, queueId, {clear_marc: 1, offset: offset, limit: limit}]; diff --git a/Open-ILS/web/vandelay/vandelay.xml b/Open-ILS/web/vandelay/vandelay.xml index dbbfa63f2b..7de894dc61 100644 --- a/Open-ILS/web/vandelay/vandelay.xml +++ b/Open-ILS/web/vandelay/vandelay.xml @@ -22,7 +22,7 @@ &vandelay.vandelay; - +
- - - + + - + - - - -
- - - - - - -
&vandelay.limit.to.collision.matches;
&vandelay.limit.to.non.imported;
-
- - + &vandelay.limit.to.collision.matches; + + + + + &vandelay.limit.to.non.imported; + + + + + &vandelay.results.per.page; + + - - - - - - + + + &vandelay.page; +