PageSourceSearch

https://www.free-ebooks.net/resources/js/min/1786338625/help.js

js free-ebooks.net collected 2026-10-01 09:26:42 UTC 6,719 bytes, 22 lines download raw bytes

1(function($){$.fn.autoComplete=function(options){var o=$.extend({},$.fn.autoComplete.defaults,options);if(typeof options=='string'){this.each(function(){var that=$(this);if(options=='destroy'){$(window).off('resize.autocomplete',that.updateSC);that.off('blur.autocomplete focus.autocomplete keydown.autocomplete keyup.autocomplete');if(that.data('autocomplete'))
2that.attr('autocomplete',that.data('autocomplete'));else
3that.removeAttr('autocomplete');$(that.data('sc')).remove();that.removeData('sc').removeData('autocomplete');}});return this;}
4return this.each(function(){var that=$(this);that.sc=$('<div class="autocomplete-suggestions '+o.menuClass+'"></div>');that.data('sc',that.sc).data('autocomplete',that.attr('autocomplete'));that.attr('autocomplete','off');that.cache={};that.last_val='';that.updateSC=function(resize,next){that.sc.css({top:that.offset().top+that.outerHeight(),left:that.offset().left,width:that.outerWidth()});if(!resize){that.sc.show();if(!that.sc.maxHeight)that.sc.maxHeight=parseInt(that.sc.css('max-height'));if(!that.sc.suggestionHeight)that.sc.suggestionHeight=$('.autocomplete-suggestion',that.sc).first().outerHeight();if(that.sc.suggestionHeight)
5if(!next)that.sc.scrollTop(0);else{var scrTop=that.sc.scrollTop(),selTop=next.offset().top-that.sc.offset().top;if(selTop+that.sc.suggestionHeight-that.sc.maxHeight>0)
6that.sc.scrollTop(selTop+that.sc.suggestionHeight+scrTop-that.sc.maxHeight);else if(selTop<0)
7that.sc.scrollTop(selTop+scrTop);}}}
8$(window).on('resize.autocomplete',that.updateSC);that.sc.appendTo('body');that.sc.on('mouseleave','.autocomplete-suggestion',function(){$('.autocomplete-suggestion.selected').removeClass('selected');});that.sc.on('mouseenter','.autocomplete-suggestion',function(){$('.autocomplete-suggestion.selected').removeClass('selected');$(this).addClass('selected');});that.sc.on('mousedown','.autocomplete-suggestion',function(e){var item=$(this),v=item.data('val');if(v||item.hasClass('autocomplete-suggestion')){that.val(v);o.onSelect(e,v,item);that.sc.hide();}});that.on('blur.autocomplete',function(){try{over_sb=$('.autocomplete-suggestions:hover').length;}catch(e){over_sb=0;}
9if(!over_sb){that.last_val=that.val();that.sc.hide();setTimeout(function(){that.sc.hide();},350);}else if(!that.is(':focus'))setTimeout(function(){that.focus();},20);});if(!o.minChars)that.on('focus.autocomplete',function(){that.last_val='\n';that.trigger('keyup.autocomplete');});function suggest(data){var val=that.val();that.cache[val]=data;if(data.length&&val.length>=o.minChars){var s='';for(var i=0;i<data.length;i++)s+=o.renderItem(data[i],val);that.sc.html(s);that.updateSC(0);}
10else
11that.sc.hide();}
12that.on('keydown.autocomplete',function(e){if((e.which==40||e.which==38)&&that.sc.html()){var next,sel=$('.autocomplete-suggestion.selected',that.sc);if(!sel.length){next=(e.which==40)?$('.autocomplete-suggestion',that.sc).first():$('.autocomplete-suggestion',that.sc).last();that.val(next.addClass('selected').data('val'));}else{next=(e.which==40)?sel.next('.autocomplete-suggestion'):sel.prev('.autocomplete-suggestion');if(next.length){sel.removeClass('selected');that.val(next.addClass('selected').data('val'));}
13else{sel.removeClass('selected');that.val(that.last_val);next=0;}}
14that.updateSC(0,next);return false;}
15else if(e.which==27)that.val(that.last_val).sc.hide();else if(e.which==13||e.which==9){var sel=$('.autocomplete-suggestion.selected',that.sc);if(sel.length&&that.sc.is(':visible')){o.onSelect(e,sel.data('val'),sel);setTimeout(function(){that.sc.hide();},20);}}});that.on('keyup.autocomplete',function(e){if(!~$.inArray(e.which,[13,27,35,36,37,38,39,40])){var val=that.val();if(val.length>=o.minChars){if(val!=that.last_val){that.last_val=val;clearTimeout(that.timer);if(o.cache){if(val in that.cache){suggest(that.cache[val]);return;}
16for(var i=1;i<val.length-o.minChars;i++){var part=val.slice(0,val.length-i);if(part in that.cache&&!that.cache[part].length){suggest([]);return;}}}
17that.timer=setTimeout(function(){o.source(val,suggest)},o.delay);}}else{that.last_val=val;that.sc.hide();}}});});}
18$.fn.autoComplete.defaults={source:0,minChars:3,delay:150,cache:1,menuClass:'',renderItem:function(item,search){search=search.replace(/[-\/\\^$*+?.()|[\]{}]/g,'\\$&');var re=new RegExp("("+search.split(' ').join('|')+")","gi");return'<div class="autocomplete-suggestion" data-val="'+item+'">'+item.replace(re,"<b>$1</b>")+'</div>';},onSelect:function(e,term,item){}};}(jQuery));$('input[name="q"]').autoComplete({source:function(term,response){$.getJSON('/help-ajax-test.php',{q:term},function(data){response(data);});}});$('.embedVid').on('click',function(e){e.preventDefault();var vidNum=$(this).attr('href').split('=');var n=vidNum[1].indexOf('&');vidNum[1]=vidNum[1].substring(0,n!=-1?n:vidNum[1].length);if($('#darkScreen').length<1){$('body').prepend('<div id="darkScreen"></div>');}
19if($('#previewOnscreen').length<1){$('body').prepend('<div id="previewOnscreen"><div class="container"><div class="row mt52"><div class="col-sm-12"><img src="/resources/img/logo-darkscreen.png" alt="Free-eBooks.net" /></div><div class="col-sm-12 tar"><span id="closePreview">Close</span></div></div><div class="white"></div></div></div>');}
20$('#previewOnscreen .white').html('<center><iframe width="640" height="360" src="//www.youtube.com/embed/'+vidNum[1]+'?autoplay=1" frameborder="0" allowfullscreen></iframe></center>');$('#darkScreen').fadeTo('fast',0.84);$('#previewOnscreen').fadeIn('fast').css("left",Math.max(0,(($(window).width()-$('#previewOnscreen').outerWidth())/2))+"px");lastPos=$('html').scrollTop();if(lastPos==0){lastPos=$('body').scrollTop();}
21$('html, body').animate({scrollTop:0},'fast');});$('.no.question').on('click',function(e){e.preventDefault();$.getJSON('/ajax.php?cmd=faq_vote_helpful&vote=no&faq_id='+$('#faqQuestionID').val(),function(data){$('#support-ticket').show();});});$('.open-ticket').on('click',function(e){$('#support-ticket').show();});$('.yes.question').on('click',function(e){e.preventDefault();$.getJSON('/ajax.php?cmd=faq_vote_helpful&vote=yes&faq_id='+$('#faqQuestionID').val(),function(data){$('.yes.question').text('Thanks!');setTimeout(function(){window.location.href='/help';},1000);});});$('#cancel-ticket').on('click',function(e){e.preventDefault();$('#support-ticket form')[0].reset();$('#support-ticket').hide();});$('#help-browse-categories .category span').on('click',function(e){e.preventDefault();window.location=$(this).next().attr('href');});if(window.location.hash=='#open-ticket'||window.location.hash=='#support-ticket'){$('#support-ticket').show();$('html, body').animate({scrollTop:$("#support-ticket").offset().top},'fast');}
22function showST(){$('#support-ticket').show();}

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.