1(function ($, window, undefined) { 2 3 $.widget("ui.wtrAutocomplete", { 4 5 version: "1.0", 6 7 options: { 8 url: 'default.html' 9 }, 10 11 _create: function () { 12 this.init(); 13 }, 14 15 init: function(){ 16 17 var _self = this; 18 $( this.element ).autocomplete({ 19 20 source: function( request, response ) { 21 _self.fetchData(_self.options.url, request, response); 22 }, 23 24 minLength: 2, 25 26 select: function( event, ui ) { 27 event.preventDefault(); 28 var locationId = ui.item.value; 29 var callingURL = _self.options.url + "?locationId=" + locationId; 30 window.location.href = callingURL; 31 }, 32 33 // setzt das Label wieder in das Textfeld. 34 // Ansonsten wird bei der Auswahl einer Loction die locationId im Textfeld angezeigt. 35 focus: function(event, ui) { 36 event.preventDefault(); 37 $(_self.element).val(ui.item.label); 38 }, 39 40 open: function() { 41 $( this ).removeClass( "ui-corner-all" ).addClass( "ui-corner-top" ); 42 }, 43 44 close: function() { 45 $( this ).removeClass( "ui-corner-top" ).addClass( "ui-corner-all" ); 46 } 47 48 }); // autocomplete() end 49 50 }, // init() end 51 52 fetchData: function(url, request, response) { 53 54 $.ajax({ 55 56 url: url + "services/rest/autocomplete/" + request.term + "/", 57 type: "GET", 58 crossDomain: true, 59 dataType: "json", 60 61 data: { 62 q: request.term 63 }, 64 65 success: function( data ) { 66 response( data.items.slice(0,10)); 67 }, 68 69 error: function (xhr, ajaxOptions, thrownError) { 70 71 } 72 }); 73 } 74 }); 75 76})(jQuery,window); 77 78// Beim laden der Seite, das Text-Inputfield der PLZ-Suche leeren 79$( document ).ready(function() { 80 $(".plz-suche").val(""); 81});
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.