1/** 2 * The Controller. Controller responds to user actions and 3 * invokes changes on the model. 4 */ 5function OptionFacetController() { 6 var _this = this; 7 8 this.init = function () { 9 _this.initToggle(); 10 _this.initFilter(); 11 }; 12 13 this.initToggle = function () { 14 15 jQuery('.tx-solr-facet-hidden').hide(); 16 jQuery('a.tx-solr-facet-show-all').click(function() { 17 if (jQuery(this).parent().siblings('.tx-solr-facet-hidden:visible').length == 0) { 18 jQuery(this).parent().siblings('.tx-solr-facet-hidden').show(); 19 jQuery(this).text(jQuery(this).data('label-less')); 20 } else { 21 jQuery(this).parent().siblings('.tx-solr-facet-hidden').hide(); 22 jQuery(this).text(jQuery(this).data('label-more')); 23 } 24 25 return false; 26 }); 27 } 28 29 this.initFilter = function () { 30 filterableFacets = jQuery(".facet-filter-box").closest('.facet'); 31 filterableFacets.each( 32 function () { 33 var searchBox = jQuery(this).find('.facet-filter-box'); 34 var searchItems = jQuery(this).find('.facet-filter-item'); 35 searchBox.on("keyup", function() { 36 var value = searchBox.val().toLowerCase(); 37 searchItems.each(function() { 38 var filteredItem = jQuery(this); 39 filteredItem.toggle(filteredItem.text().toLowerCase().indexOf(value) > -1) 40 }); 41 }); 42 } 43 ); 44 } 45} 46 47jQuery(document).ready(function () { 48 var optionsController = new OptionFacetController(); 49 optionsController.init(); 50 51 jQuery("body").on("tx_solr_updated", function() { 52 optionsController.init(); 53 }); 54});
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.