1; 2(function($, window, document, undefined) { 3 var pluginName = "filterPublications"; 4 5 var Plugin = function(element) { 6 var text = ""; 7 var year = ""; 8 var category = ""; 9 var default_year = ""; 10 11 12 default_year = $("#tx_t3luhpublications_search_field_defaultyear_input").val(); 13 if (default_year > 0) { 14 filterTextYear(text, default_year,category,$(".tx-t3luhpublications")); 15 } 16 17 element.find("#tx_t3luhpublications_search_field_category_input").change(function () { 18 category = $(this).val(); 19 filterCategories(category,element); 20 filterTextYear(text, year,category,element); 21 }); 22 23 element.find("#tx_t3luhpublications_search_field_year_input").change(function () { 24 year = $(this).val(); 25 filterTextYear(text, year,category,element); 26 }); 27 28 element.find("#tx_t3luhpublications_search_field_input").keyup(function () { 29 text = $(this).val(); 30 filterTextYear(text, year,category,element); 31 32 }); 33 function filterCategories(category,element) { 34 if (category !== "") { 35 element.find(".category").hide(); 36 element.find(".category").next("ul").hide(); 37 element.find(".category").filter(function() { 38 return $(this).text() === category; 39 }).show(); 40 element.find(".category").filter(function() { 41 return $(this).text() === category; 42 }).next("ul").show(); 43 } 44 else { 45 element.find(".category").show(); 46 element.find(".category").next("ul").show(); 47 } 48 } 49 function filterTextYear(text, year,category,element) { 50 var liste = ''; 51 if (text !== "" || year !== "" || category !== "") { 52 liste= element.find("li.tx_t3luhpublication"); 53 liste.each(function( index, elementitem ) { 54 $( elementitem ).hide(); 55 content_text ="span"; 56 if (text!='' ){ 57 content_text = ":containsCI('" + text + "')"; 58 } 59 element_year = ""; 60 if ( year!='' ) { 61 element_year = $( this ).find("span.year" ).text(); 62 if ( element_year == "(" + year + "):"){ 63 $( elementitem ).has(content_text).show(); 64 } 65 } 66 else{ 67 $( elementitem ).has(content_text).show(); 68 } 69 70 }); 71 } else { 72 liste= element.find("li.tx_t3luhpublication"); 73 liste.each(function( index, elementitem) { 74 $( elementitem ).show(); 75 }); 76 } 77 var h2liste= element.find("div.tx_t3luhpublications").find("h2"); 78 h2liste.each(function( index, elementitem ) { 79 exist = IsElement(elementitem); 80 if ( exist === false) { 81 $(this).hide(); 82 } 83 else { 84 $(this).show(); 85 } 86 }); 87 88 }; 89 function IsElement(element){ 90 var result = false;
91 $(element).next().find('li').each(function(_index,_element){ 92 if ($(_element).is(':visible')){ 93 result = true; 94 } 95 }); 96 return result; 97 } 98 } 99 100 $.fn[pluginName] = function() { 101 return this.each(function(i, v) { 102 plugin = new Plugin($(this)); 103 }); 104 105 }; 106 107}(jQuery, window, document)); 108 109$(window).on('load', function(){ 110 $(".tx-t3luhpublications").filterPublications(); 111});
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.