1jQuery(document).on('mouseover', '.bapf_sfilter.bapf_rtnstrs ul li label', function(e) { 2 if( jQuery(this).parents('.bapf_rtnstrs').is('.bapf_rtnstrs_asc') ) { 3 jQuery(this).parents('li').first().prevAll('li').find('i').removeClass('fa-star-o').removeClass('fa-star').addClass('fa-star'); 4 jQuery(this).parents('li').first().nextAll('li').find('i').removeClass('fa-star-o').removeClass('fa-star').addClass('fa-star-o'); 5 jQuery(this).find('i').removeClass('fa-star-o').removeClass('fa-star').addClass('fa-star'); 6 } else { 7 jQuery(this).parents('li').first().nextAll('li').find('i').removeClass('fa-star-o').removeClass('fa-star').addClass('fa-star'); 8 jQuery(this).parents('li').first().prevAll('li').find('i').removeClass('fa-star-o').removeClass('fa-star').addClass('fa-star-o'); 9 jQuery(this).find('i').removeClass('fa-star-o').removeClass('fa-star').addClass('fa-star'); 10 } 11}); 12jQuery(document).on('mouseout', '.bapf_sfilter.bapf_rtnstrs.bapf_rtnstrs_asc ul li label', function(e) { 13 if( jQuery(this).parents('.bapf_rtnstrs').is('.bapf_rtnstrs_asc') ) { 14 jQuery(this).parents('.bapf_rtnstrs').find('input').next().find('.fa').removeClass('fa-star-o').removeClass('fa-star'); 15 jQuery(this).parents('.bapf_rtnstrs').find('input:checked').next().find('.fa').addClass('fa-star'); 16 jQuery(this).parents('.bapf_rtnstrs').find('input').not(':checked').next().find('.fa').addClass('fa-star-o'); 17 } else { 18 jQuery(this).parents('.bapf_rtnstrs').find('input').next().find('.fa').removeClass('fa-star-o').removeClass('fa-star'); 19 jQuery(this).parents('.bapf_rtnstrs').find('input:checked').next().find('.fa').addClass('fa-star'); 20 jQuery(this).parents('.bapf_rtnstrs').find('input').not(':checked').next().find('.fa').addClass('fa-star-o'); 21 } 22}); 23 24bapf_change_rtnstrs_before = function(this_element, taxonomy, value, $checked) { 25 var $this = jQuery(this_element); 26 var $parent = $this.parents('.bapf_sfilter'); 27 if( $parent.is('.bapf_rtnstrs') ) { 28 if( $parent.is('.bapf_asradio') ) { 29 if( $parent.is('.bapf_rtnstrs_asc') ) { 30 var $other_checked = jQuery($this).parents('li').first().next('li').find('input').prop('checked'); 31 if( $other_checked && ! $checked ) { 32 jQuery($this).prop('checked', true); 33 $checked = true; 34 } 35 } else { 36 var $other_checked = jQuery($this).parents('li').first().prev('li').find('input').prop('checked'); 37 if( $other_checked && ! $checked ) { 38 jQuery($this).prop('checked', true); 39 $checked = true; 40 } 41 } 42 } 43 } 44} 45bapf_change_rtnstrs = function(this_element, taxonomy, value, $checked) { 46 var $this = jQuery(this_element); 47 var $parent = $this.parents('.bapf_sfilter'); 48 if( $parent.is('.bapf_rtnstrs') ) { 49 if( $parent.is('.bapf_asradio') ) { 50 if( jQuery($this).prop('checked') ) { 51 if( $parent.is('.bapf_rtnstrs_asc') ) { 52 jQuery($this).parents('li').first().prevAll('li').find('input').prop('checked', true); 53 } else { 54 jQuery($this).parents('li').first().nextAll('li').find('input').prop('checked', true); 55 } 56 } 57 } else { 58 if( $parent.is('.bapf_rtnstrs_asc') ) { 59 var $other_checked = jQuery($this).parents('li').first().next('li').find('input').prop('checked'); 60 if( $other_checked && ! $checked ) { 61 jQuery($this).parents('li').first().nextAll('li').find('input').prop('checked', false); 62 jQuery($this).prop('checked', true); 63 $checked = true; 64 } 65 jQuery($this).parents('li').first().prevAll('li').find('input').prop('checked', $checked); 66 } else { 67 var $other_checked = jQuery($this).parents('li').first().prev('li').find('input').prop('checked');
68 if( $other_checked && ! $checked ) { 69 jQuery($this).parents('li').first().prevAll('li').find('input').prop('checked', false); 70 jQuery($this).prop('checked', true); 71 $checked = true; 72 } 73 jQuery($this).parents('li').first().nextAll('li').find('input').prop('checked', $checked); 74 } 75 } 76 jQuery($this).parents('.bapf_rtnstrs').find('input:checked').next().find('.fa').addClass('fa-star'); 77 jQuery($this).parents('.bapf_rtnstrs').find('input').not(':checked').next().find('.fa').addClass('fa-star-o'); 78 } 79 return $this; 80} 81bapf_grab_single_rtnstrs = function(single_data, element, selected_filters, grab_single) { 82 if( jQuery(element).is('.bapf_rtnstrs') ) { 83 var values = []; 84 if( grab_single ) { 85 var $elements = element; 86 } else { 87 var taxonomy = element.data('taxonomy'); 88 var $elements = jQuery('.bapf_sfilter[data-taxonomy="'+taxonomy+'"]'); 89 $elements = braapf_filter_mobile_desktop_filters($elements); 90 } 91 var checked = $elements.find('input:checked:not(:disabled)'); 92 if (jQuery(element).is('.bapf_asradio') ) { 93 if( checked.length > 0 ) { 94 if( jQuery(element).is('.bapf_rtnstrs_asc') ) { 95 var $this = $elements.find('input:checked:not(:disabled)').last(); 96 values.push({value:$this.val(), html:$this.data('name')}); 97 } else { 98 var $this = $elements.find('input:checked:not(:disabled)').first(); 99 values.push({value:$this.val(), html:$this.data('name')}); 100 } 101 single_data.values = values; 102 } 103 } else { 104 if( checked.length > 0 ) { 105 if( jQuery(element).is('.bapf_rtnstrs_asc') ) { 106 single_data.type = 'rtnstrs_asc'; 107 } else { 108 single_data.type = 'rtnstrs'; 109 } 110 } 111 } 112 } 113 return single_data; 114} 115bapf_sfa_taxonomy_rtnstrs = function(taxonomy) { 116 if( typeof (taxonomy.type) != 'undefined' && (taxonomy.type == 'rtnstrs' || taxonomy.type == 'rtnstrs_asc') ) { 117 if( taxonomy.type == 'rtnstrs_asc' ) { 118 element_set = taxonomy.values[taxonomy.values.length - 1]; 119 } else { 120 element_set = taxonomy.values[0]; 121 } 122 taxonomy.values = [element_set]; 123 } 124 return taxonomy; 125} 126function braapf_unselect_rtnstrs () { 127 jQuery(document).off('braapf_unselect', '.bapf_sfilter.bapf_rtnstrs', braapf_unselect_rtnstrs); 128 jQuery(this).trigger('braapf_unselect', false); 129 jQuery(document).on('braapf_unselect', '.bapf_sfilter.bapf_rtnstrs', braapf_unselect_rtnstrs); 130} 131function bapf_rtnstrs_filters_init() { 132 berocket_add_filter('input_ckbox_changed', bapf_change_rtnstrs_before, 1); 133 berocket_add_filter('input_ckbox_changed', bapf_change_rtnstrs, 1000); 134 berocket_add_filter('grab_single_filter_default', bapf_grab_single_rtnstrs); 135 berocket_add_filter('default_selected_filters_area_single_taxonomy', bapf_sfa_taxonomy_rtnstrs); 136} 137jQuery(document).on('braapf_unselect', '.bapf_sfilter.bapf_rtnstrs', braapf_unselect_rtnstrs); 138if ( typeof(berocket_add_filter) == 'function' ) { 139 bapf_rtnstrs_filters_init() 140} else { 141 jQuery(document).on('berocket_hooks_ready', bapf_rtnstrs_filters_init); 142}
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.