PageSourceSearch

https://selfcare.tiscali.it/scripts/bootstrap-typeahead.js

js tiscali.it collected 2026-09-24 08:51:48 UTC 8,043 bytes, 1 lines download raw bytes

1!function(a){var b=function(e,d){var c=a.fn.typeahead.defaults;if(d.scrollBar){d.items=100;d.menu='<ul class="typeahead dropdown-menu" style="max-height:220px;overflow:auto;"></ul>'}var f=this;f.$element=a(e);f.options=a.extend({},a.fn.typeahead.defaults,d);f.$menu=a(f.options.menu).insertAfter(f.$element);f.eventSupported=f.options.eventSupported||f.eventSupported;f.grepper=f.options.grepper||f.grepper;f.highlighter=f.options.highlighter||f.highlighter;f.lookup=f.options.lookup||f.lookup;f.matcher=f.options.matcher||f.matcher;f.render=f.options.render||f.render;f.onSelect=f.options.onSelect||null;f.sorter=f.options.sorter||f.sorter;f.source=f.options.source||f.source;f.displayField=f.options.displayField||f.displayField;f.valueField=f.options.valueField||f.valueField;if(f.options.ajax){var g=f.options.ajax;if(typeof g==="string"){f.ajax=a.extend({},a.fn.typeahead.defaults.ajax,{url:g})}else{if(typeof g.displayField==="string"){f.displayField=f.options.displayField=g.displayField}if(typeof g.valueField==="string"){f.valueField=f.options.valueField=g.valueField}f.ajax=a.extend({},a.fn.typeahead.defaults.ajax,g)}if(!f.ajax.url){f.ajax=null}f.query=""}else{f.source=f.options.source;f.ajax=null}f.shown=false;f.listen()};b.prototype={constructor:b,eventSupported:function(c){var d=(c in this.$element);if(!d){this.$element.setAttribute(c,"return;");d=typeof this.$element[c]==="function"}return d},select:function(){var d=this.$menu.find(".active");var c=d.attr("data-value");var e=this.$menu.find(".active a").text();if(this.options.onSelect){this.options.onSelect({value:c,text:e})}this.$element.val(this.updater(e)).change();return this.hide()},updater:function(c){return c},show:function(){var d=a.extend({},this.$element.position(),{height:this.$element[0].offsetHeight});this.$menu.css({top:d.top+d.height,left:d.left});if(this.options.alignWidth){var c=a(this.$element[0]).outerWidth();this.$menu.css({width:c})}this.$menu.show();this.shown=true;return this},hide:function(){this.$menu.hide();this.shown=false;return this},ajaxLookup:function(){var d=a.trim(this.$element.val());if(d===this.query){return this}this.query=d;if(this.ajax.timerId){clearTimeout(this.ajax.timerId);this.ajax.timerId=null}if(!d||d.length<this.ajax.triggerLength){if(this.ajax.xhr){this.ajax.xhr.abort();this.ajax.xhr=null;this.ajaxToggleLoadClass(false)}return this.shown?this.hide():this}function c(){this.ajaxToggleLoadClass(true);if(this.ajax.xhr){this.ajax.xhr.abort()}var e=this.ajax.preDispatch?this.ajax.preDispatch(d):{query:d};this.ajax.xhr=a.ajax({url:this.ajax.url,data:e,success:a.proxy(this.ajaxSource,this),type:this.ajax.method||"get",dataType:"json"});this.ajax.timerId=null}this.ajax.timerId=setTimeout(a.proxy(c,this),this.ajax.timeout);return this},ajaxSource:function(e){this.ajaxToggleLoadClass(false);var d=this,c;if(!d.ajax.xhr){return}if(d.ajax.preProcess){e=d.ajax.preProcess(e)}d.ajax.data=e;c=d.grepper(d.ajax.data)||[];if(!c.length){return d.shown?d.hide():d}d.ajax.xhr=null;return d.render(c.slice(0,d.options.items)).show()},ajaxToggleLoadClass:function(c){if(!this.ajax.loadingClass){return}this.$element.toggleClass(this.ajax.loadingClass,c)},lookup:function(e){var d=this,c;if(d.ajax){d.ajaxer()}else{d.query=d.$element.val();if(!d.query){return d.shown?d.hide():d}c=d.grepper(d.source);if(!c){return d.shown?d.hide():d}if(c.length==0){c[0]={id:-21,name:""}}return d.render(c.slice(0,d.options.items)).show()}},matcher:function(c){return ~c.toLowerCase().indexOf(this.query.toLowerCase())},sorter:function(e){if(!this.options.ajax){var f=[],d=[],c=[],g;while(g=e.shift()){if(!g.toLowerCase().indexOf(this.query.toLowerCase())){f.push(g)}else{if(~g.indexOf(this.query)){d.push(g)}else{c.push(g)}}}return f.concat(d,c)}else{return e}},highlighter:function(c){var d=this.query.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&");return c.replace(new RegExp("("+d+")","ig"),function(e,f){return"<strong>"+f+"</strong>"})},render:function(d){var e=this,f,c=typeof e.options.displayField==="string";d=a(d).map(function(g,h){if(typeof h==="object"){f=c?h[e.options.displayField]:e.options.displayField(h);g=a(e.options.item).attr("data-value",h[e.options.valueField])}else{f=h;g=a(e.options.item).attr("data-value",h)}g.find("a").html(e.highlighter(f));return g[0]});d.first().addClass("active");this.$menu.html(d);return this}
1,grepper:function(f){var e=this,d,g,c=typeof e.options.displayField==="string";if(c&&f&&f.length){if(f[0].hasOwnProperty(e.options.displayField)){d=a.grep(f,function(h){g=c?h[e.options.displayField]:e.options.displayField(h);return e.matcher(g)})}else{if(typeof f[0]==="string"){d=a.grep(f,function(h){return e.matcher(h)})}else{return null}}}else{return null}return this.sorter(d)},next:function(e){var f=this.$menu.find(".active").removeClass("active"),d=f.next();if(!d.length){d=a(this.$menu.find("li")[0])}if(this.options.scrollBar){var c=this.$menu.children("li").index(d);if(c%8==0){this.$menu.scrollTop(c*26)}}d.addClass("active")},prev:function(f){var g=this.$menu.find(".active").removeClass("active"),e=g.prev();if(!e.length){e=this.$menu.find("li").last()}if(this.options.scrollBar){var h=this.$menu.children("li");var d=h.length-1;var c=h.index(e);if((d-c)%8==0){this.$menu.scrollTop((c-7)*26)}}e.addClass("active")},listen:function(){this.$element.on("focus",a.proxy(this.focus,this)).on("blur",a.proxy(this.blur,this)).on("keypress",a.proxy(this.keypress,this)).on("keyup",a.proxy(this.keyup,this));if(this.eventSupported("keydown")){this.$element.on("keydown",a.proxy(this.keydown,this))}this.$menu.on("click",a.proxy(this.click,this)).on("mouseenter","li",a.proxy(this.mouseenter,this)).on("mouseleave","li",a.proxy(this.mouseleave,this))},move:function(c){if(!this.shown){return}switch(c.keyCode){case 9:case 13:case 27:c.preventDefault();break;case 38:c.preventDefault();this.prev();break;case 40:c.preventDefault();this.next();break}c.stopPropagation()},keydown:function(c){this.suppressKeyPressRepeat=~a.inArray(c.keyCode,[40,38,9,13,27]);this.move(c)},keypress:function(c){if(this.suppressKeyPressRepeat){return}this.move(c)},keyup:function(c){switch(c.keyCode){case 40:case 38:case 16:case 17:case 18:break;case 9:case 13:if(!this.shown){return}this.select();break;case 27:if(!this.shown){return}this.hide();break;default:if(this.ajax){this.ajaxLookup()}else{this.lookup()}}c.stopPropagation();c.preventDefault()},focus:function(c){this.focused=true},blur:function(c){this.focused=false;if(!this.mousedover&&this.shown){this.hide()}},click:function(c){c.stopPropagation();c.preventDefault();this.select();this.$element.focus()},mouseenter:function(c){this.mousedover=true;this.$menu.find(".active").removeClass("active");a(c.currentTarget).addClass("active")},mouseleave:function(c){this.mousedover=false;if(!this.focused&&this.shown){this.hide()}},destroy:function(){this.$element.off("focus",a.proxy(this.focus,this)).off("blur",a.proxy(this.blur,this)).off("keypress",a.proxy(this.keypress,this)).off("keyup",a.proxy(this.keyup,this));if(this.eventSupported("keydown")){this.$element.off("keydown",a.proxy(this.keydown,this))}this.$menu.off("click",a.proxy(this.click,this)).off("mouseenter","li",a.proxy(this.mouseenter,this)).off("mouseleave","li",a.proxy(this.mouseleave,this));this.$element.removeData("typeahead")}};a.fn.typeahead=function(c){return this.each(function(){var f=a(this),e=f.data("typeahead"),d=typeof c==="object"&&c;if(!e){f.data("typeahead",(e=new b(this,d)))}
1if(typeof c==="string"){e[c]()}})};a.fn.typeahead.defaults={source:[],items:10,scrollBar:false,alignWidth:true,menu:'<ul class="typeahead dropdown-menu"></ul>',item:'<li><a href="#"></a></li>',valueField:"id",displayField:"name",onSelect:function(){},ajax:{url:null,timeout:300,method:"get",triggerLength:1,loadingClass:null,preDispatch:null,preProcess:null}};a.fn.typeahead.Constructor=b;a(function(){a("body").on("focus.typeahead.data-api",'[data-provide="typeahead"]',function(d){var c=a(this);if(c.data("typeahead")){return}d.preventDefault();c.typeahead(c.data())})})}(window.jQuery);

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.