PageSourceSearch

https://www.felsberg.de/city_info/include/lib/search/instantsearch.js.cfm?region_id=452

js felsberg.de collected 2026-10-02 18:18:34 UTC 3,719 bytes, 90 lines download raw bytes

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: 16px; width: 100%\"><span class=\"svg_wrapper svg_1\"  style=\"width: 16px; height: 16px\"><svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"16\" height=\"16\" viewBox=\"0 0 16 16\">\n<defs>\n  <style type=\"text/css\">\n    <![CDATA[\n      .sys_icon_c1 { fill: rgba(0,0,0,1); }\n    ]]>\n  </style>\n</defs>\t \n<path class=\"sys_icon_c1\" d=\"M11 13h-8v-8h4.5l2-2h-8.5v12h12v-8.5l-2 2v4.5z\"></path>\n<path class=\"sys_icon_c1\" d=\"M16 0h-6.5l2.5 2.5-7.5 7.5 1.5 1.5 7.5-7.5 2.5 2.5v-6.5z\"></path>\n</svg>\n</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 += ' ';
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: 16px; width: 100%\"><span class=\"svg_wrapper svg_1\"  style=\"width: 16px; height: 16px\"><svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"16\" height=\"16\" viewBox=\"0 0 16 16\">\n<defs>\n  <style type=\"text/css\">\n    <![CDATA[\n      .sys_icon_c1 { fill: rgba(0,0,0,1); }\n    ]]>\n  </style>\n</defs>\t \n<path class=\"sys_icon_c1\" d=\"M11 13h-8v-8h4.5l2-2h-8.5v12h12v-8.5l-2 2v4.5z\"></path>\n<path class=\"sys_icon_c1\" d=\"M16 0h-6.5l2.5 2.5-7.5 7.5 1.5 1.5 7.5-7.5 2.5 2.5v-6.5z\"></path>\n</svg>\n</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.