galaxy-dist commit def13f052a4a: Restored the function to stop the edit samples form from getting submitted when return key is pressed. This is needed in this form as the barcode scanner (when in keyboard emulation mode) may send a return key appended to the scanned barcode string.
# HG changeset patch -- Bitbucket.org # Project galaxy-dist # URL http://bitbucket.org/galaxy/galaxy-dist/overview # User rc # Date 1289853524 18000 # Node ID def13f052a4a22c46ec5be6481ad874ceb734799 # Parent 02f6c9dae26e9aef40a44bc151ed07b457715839 Restored the function to stop the edit samples form from getting submitted when return key is pressed. This is needed in this form as the barcode scanner (when in keyboard emulation mode) may send a return key appended to the scanned barcode string. --- a/scripts/galaxy_messaging/server/amqp_consumer.py +++ b/scripts/galaxy_messaging/server/amqp_consumer.py @@ -68,7 +68,7 @@ def update_sample_state( message ): api_key = get_value(dom, 'api_key') log.debug('Barcode: ' + barcode) log.debug('State: ' + state) - log.debug('api_key: ' + api_key) + log.debug('API Key: ' + api_key) # validate if not barcode or not state or not api_key: log.debug( 'Incomplete sample_state_update message received. Sample barcode, desired state and user API key is required.' ) --- a/templates/requests/common/edit_samples.mako +++ b/templates/requests/common/edit_samples.mako @@ -14,6 +14,18 @@ ${common_javascripts()} </%def> +<script type="text/javascript"> + // This function stops the form from getting submitted when return key is pressed + // This is needed in this form as the barcode scanner (when in keyboard emulation mode) + // may send a return key appended to the scanned barcode string. + function stopRKey(evt) { + var evt = (evt) ? evt : ((event) ? event : null); + var node = (evt.target) ? evt.target : ((evt.srcElement) ? evt.srcElement : null); + if ((evt.keyCode == 13) && (node.type=="text")) {return false;} + } + document.onkeypress = stopRKey +</script> + <% from galaxy.web.framework.helpers import time_ago
participants (1)
-
commits-noreply@bitbucket.org