// $Id: vbo_barcode_select.js,v 1.1.2.1 2010/11/16 14:46:03 kreynen Exp $ Drupal.behaviors.vbo_barcode_select = function(context) { var barcode = $('
'); var input = $(''); input.keydown(function(e) { var selectedBarcode = $(this).val(); var selector = 'table.views-table tbody tr td.' + Drupal.settings.vbo_barcode_select ; var found = false; // Check for matching barcodes on ENTER/RETURN. if (e.keyCode == 13) { // Ignore blank barcodes. if (selectedBarcode != '') { $(selector).each(function() { var td = $(this); var tr = td.parents('tr'); var text = td.text(); var img = td.find('img'); if ( (text == selectedBarcode) || ( (text == '') && (img.length > 0) && (img.attr('alt') == selectedBarcode) ) ) { // Select the VBO checkbox on match. tr.find('input.vbo-select').attr('checked', 'checked'); found = true; } // if }); if (!found) { vboBarCodeSelectShowAlert('Barcode nicht gefunden.'); $(this).select() } // if $(this).select() } // if return false; } // if }); input.appendTo(barcode); barcode.insertBefore('.views-node-selector') } // function function vboBarCodeSelectShowAlert(message) { $(' ' + message + '') .insertAfter('#vbo-barcode-select input') .fadeOut(3500, function() { $(this).remove(); }); } vboBarCodeSelectShowAlert // $Id: views_bulk_operations.js,v 1.1.4.19 2010/09/15 17:23:35 kratib Exp $