1(function ($) { 2// START jQuery 3 4Drupal.vfas = Drupal.vfas || {}; 5 6Drupal.behaviors.vfas = function(context) { 7 $.each(Drupal.settings.vfas, function(form_id, settings) { 8 $('form#'+form_id+':not(.vfas-processed)', context).each(function() { 9 // Build the exceptions list. 10 var self = this; 11 var exceptions; 12 if (settings.exceptions) { 13 exceptions = ':not('+settings.exceptions+')'; 14 } 15 else { 16 exceptions = ''; 17 } 18 $(self).addClass('vfas-processed'); 19 // Hide the submit button. 20 $('input:submit.form-submit', self).hide(); 21 // Auto-submit changes to inputs. 22 $('div.views-exposed-widget input:checkbox'+exceptions+', div.views-exposed-widget input:radio'+exceptions, self).click(function() { 23 $('div.views-exposed-widget input:checkbox'+exceptions+', div.views-exposed-widget input:radio'+exceptions, self).unbind('click'); 24 $('div.views-exposed-widget input:checkbox:not(:checked)'+exceptions+', div.views-exposed-widget input:radio:not(:checked)'+exceptions).attr("disabled", true); ; 25 $(self).submit(); 26 }); 27 $('div.views-exposed-widget select'+exceptions, self).change(function() { 28 $('div.views-exposed-widget select'+exceptions, self).unbind('change'); 29 $('div.views-exposed-widget select:not(:selected)'+exceptions).attr("disabled", true); 30 $(self).submit(); 31 }); 32 // Auto-submit keyups after a delay. 33 var autoSubmitTimer = 0;
34 var autoSubmitDelay = 1000; 35 $('div.views-exposed-widget input'+exceptions, self).keyup(function() { 36 if (autoSubmitTimer) { 37 clearTimeout(autoSubmitTimer); 38 } 39 autoSubmitTimer = setTimeout(function() { 40 $(self).submit(); 41 }, autoSubmitDelay); 42 }); 43 44 // Re-focus form field after auto-submit. 45 var refocus = $('#edit-views-exposed-form-focused-field', self).val(); 46 if (refocus) { 47 $('#'+refocus, self).focus().val($('#'+refocus, self).val()); 48 } 49 // Store the ID of the currently focused field in our hidden field. 50 $('input', self).focus(function() { 51 $('#edit-views-exposed-form-focused-field', self).val($(this).attr('id')); 52 }); 53 // Clear value of our hidden field when user deselects the form. 54 $('input', self).blur(function() { 55 $('#edit-views-exposed-form-focused-field', self).val(); 56 }); 57 }); 58 }); 59} 60 61// END jQuery 62})(jQuery); 63
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.