1 2$( function() { 3 4 // alert('hier in instanstsearch') 5 6 $.widget( "custom.instantsearch", $.ui.autocomplete, { 7 _create: function() { 8 this._super(); 9 this.widget().menu( "option", "items", "> :not(.ui-autocomplete-category)" ); 10 }, 11 _renderMenu: function( ul, items ) { 12 var that = this, 13 currentCategory = "", 14 formEl = $(that.element[0]).parents("form").attr("id"); 15 buttonPos = $(that.element[0]).data("buttonPos"); 16 17 $.each( items, function( index, item ) { 18 var li; 19 20 if ( item.category != currentCategory ) { 21 ul.append( "<li class='ui-autocomplete-category'>" + item.category + "</li>" ); 22 currentCategory = item.category; 23 } 24 li = that._renderItemData( ul, item ); 25 26 if ( item.category ) { 27 li.attr( "aria-label", item.category + " : " + item.label ); 28 } 29 }); 30 31 ul.addClass("instantsearch"); 32 33 /* 34 classes on li or a elements get removed from jquery ui while rendering 35 loop over all items to add the classes after rendering 36 */ 37 var menu_items = $( ul ).find( "li:not(.ui-autocomplete-category)" ); 38 $.each( items, function( index, item ) { 39 $(menu_items[index]).addClass( item.class ); 40 }); 41 42 var searchBtn = "<li class='more-results'><a href='javascript:$(\"#" + formEl + "\" ).submit()' title='Ergebnisse detailiert anzeigen'>Ergebnisse detailiert anzeigen</a></li>"; 43 if (buttonPos == "first") 44 ul.prepend( searchBtn ); 45 else 46 ul.append( searchBtn ); 47 48 }, 49 _renderItem: function( ul, item ) { 50 51 var target = "_self"; 52 var item_label = item.label; 53 var title = item.label; 54 var cssclass = (item.class ? item.class : ""); 55 56 if(item.link_typ == "extern"){ 57 target = "_blank"; 58 if(item.showExtLinkIcon == 1){ 59 item_label += ' <span class=\"image_wrapper extlinkicon\" style=\"max-width: 24px; width: 100%\"><span class=\"svg_wrapper svg_1\" style=\"width: 24px; height: 24px\"><svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\">\r\n<defs>\r\n <style type=\"text/css\">\r\n <![CDATA[\r\n .sys_icon_c1 {fill:#000000}\r\n ]]>\r\n </style>\r\n </defs>\r\n<path class=\"sys_icon_c1\" d=\"M21 13v10h-21v-19h12v2h-10v15h17v-8h2zm3-12h-10.988l4.035 4-6.977 7.07 2.828 2.828 6.977-7.07 4.125 4.172v-11z\"/>\r\n</svg></span></span>'; 60 } 61 if(item.showExtLinkTxt == 1){ 62 title += ' [Externer Link]'; 63 } 64 }else if(item.link_typ == "serviceportal"){ 65 target = "_blank"; 66 item_label += ' <span class=\"image_wrapper servicePortal_link_icon\" style=\"max-width: 24px; width: 100%\"><span class=\"svg_wrapper svg_1\" style=\"width: 24px; height: 24px\"><svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\">\r\n<defs>\r\n <style type=\"text/css\">\r\n <![CDATA[\r\n .sys_icon_c1 {fill:#000000}\r\n ]]>\r\n </style>\r\n </defs>\r\n<path class=\"sys_icon_c1\" d=\"M21 13v10h-21v-19h12v2h-10v15h17v-8h2zm3-12h-10.988l4.035 4-6.977 7.07 2.828 2.828 6.977-7.07 4.125 4.172v-11z\"/>\r\n</svg></span></span>'; 67 } else if(item.link.match(/http.*/)){ 68 target = "_blank"; 69 if(item.showExtLinkIcon == 1){ 70 item_label += ' <span class=\"image_wrapper extlinkicon\" style=\"max-width: 24px; width: 100%\"><span class=\"svg_wrapper svg_1\" style=\"width: 24px; height: 24px\"><svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\">\r\n<defs>\r\n <style type=\"text/css\">\r\n <![CDATA[\r\n .sys_icon_c1 {fill:#000000}\r\n ]]>\r\n </style>\r\n </defs>\r\n<path class=\"sys_icon_c1\" d=\"M21 13v10h-21v-19h12v2h-10v15h17v-8h2zm3-12h-10.988l4.035 4-6.977 7.07 2.828 2.828 6.977-7.07 4.125 4.172v-11z\"/>\r\n</svg></span></span>'; 71 } 72 if(item.showExtLinkTxt == 1){ 73 title += ' [Externer Link]'; 74 } 75 } 76 77 return $( "<li>" ) 78 .attr( "data-value", item.value ) 79 .attr( "data-link", item.link ) 80 .append( 81 $("<a>") 82 .attr("href", item.link) 83 .attr("title", title) 84 .attr("target", target) 85 .append( item_label ) 86 ) 87 .appendTo( ul ) 88 } 89 }); 90});
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.