PageSourceSearch

https://www.iemuk.com/wp-content/themes/toolset-classifieds/dist/scripts/scripts.min.js

js iemuk.com collected 2026-09-30 14:45:46 UTC 17,604 bytes, 1 lines download raw bytes

1/* scripts.min.js 1.0.0 | Metropolis | WebTeam */function fixWidth(){var container=jQuery(".myzebra-rich-editor-container"),containerHolder=jQuery(".cred-field-post_content");container.css({"min-width":containerHolder.width()+"px","max-width":containerHolder.width()+"px"})}function fixWidthGallery(){var gallerySlider=jQuery(".gallery"),galleryItems=jQuery(".gallery li.touchcarousel-item"),gallerySlidePadding=20;galleryItems.css({"max-width":gallerySlider.width()-2+"px"});var galleryMaxHeight=0,galleryContainerWidth=0,resizedItem=[];if(galleryItems.each(function(index){jQuery(this).find("img").height()>galleryMaxHeight&&(galleryMaxHeight=jQuery(this).find("img").height()),resizedItem[index]=jQuery(this).width(),galleryContainerWidth+=resizedItem[index]+gallerySlidePadding}),galleryMaxHeight+=gallerySlidePadding,galleryContainerWidth+=1,gallerySlider.css({"max-height":galleryMaxHeight+"px"}),jQuery("#gallery-wrapper .touchcarousel-container").css({width:galleryContainerWidth}),void 0!==jQuery("#gallery-wrapper").data("touchCarousel")){jQuery("#gallery-wrapper").data("touchCarousel")._f=galleryContainerWidth,jQuery("#gallery-wrapper").data("touchCarousel")._h1=galleryContainerWidth;var newPosX=0;jQuery("#gallery-wrapper").data("touchCarousel").items.forEach(function(item,index){item.posX=newPosX,newPosX+=resizedItem[index]+gallerySlidePadding,item.width=resizedItem[index]+gallerySlidePadding})}}function createGallery(sliderID){var sliderID=sliderID;gallerySliderInstance=jQuery(sliderID).removeClass("static").touchCarousel({snapToItems:!0,pagingNavControls:!1,itemsPerMove:1,loopItems:!1,directionNav:!0,directionNavAutoHide:!1,autoplay:!1,keyboardNav:!1,dragUsingMouse:!0,transitionSpeed:400,itemFallbackWidth:300,scrollbar:!0,scrollbarAutoHide:!1,scrollbarTheme:"dark"}),fixWidthGallery()}function mbm_close_validation_message(){jQuery(".myzebra-message").hide()}function mbm_get_validation_message_markup(top,left){return'<div class="MyZebra_Form_error_message" id="MyZebra_Form_error_message_cred_form_6555_1_wpcf-d-customer-first-name" style="opacity: 0.9; top: '+top+"px; left: "+left+'px; height: 41px;"><div class="myzebra-message">This Field is required<a href="javascript:mbm_close_validation_message()" class="myzebra-close">x</a></div><div class="myzebra-arrow" style="left: 53.5px;"></div></div>'}jQuery(function($){var body=$("body"),_window=$(window);if($(function(){if(body.is(".sidebar")){var sidebar=$("#secondary .widget-area"),secondary=0==sidebar.length?-40:sidebar.height(),margin=$("#tertiary .widget-area").height()-$("#content").height()-secondary;margin>0&&_window.innerWidth()>999&&$("#colophon").css("margin-top",margin+"px")}}),function(){jQuery("section #content").css({"min-height":jQuery("#tertiary").height()+50}),jQuery("article.single").css({"min-height":jQuery(".companyBriefInfo").height()+50})}(),function(){var button,menu,nav=jQuery("#site-navigation");if(nav&&(button=nav.find(".menu-toggle"))){if(!(menu=nav.find(".nav-menu"))||!menu.children().length)return void button.hide();jQuery(".menu-toggle").on("click",function(){nav.toggleClass("toggled-on")})}}(),_window.on("hashchange",function(){var element=document.getElementById(location.hash.substring(1));element&&(/^(?:a|select|input|button|textarea)$/i.test(element.tagName)||(element.tabIndex=-1),element.focus())}),$.isFunction($.fn.masonry)){var columnWidth=body.is(".sidebar")?228:245;$("#secondary .widget-area").masonry({itemSelector:".widget",columnWidth:columnWidth,gutterWidth:20,isRTL:body.is(".rtl")})}}),function($){$(document).ready(function(){function resizeWindow(e){var newWindowWidth=jQuery(window).width();newWindowWidth<dekstop[0]?jQuery("#header").append(jQuery("#masthead .brand-info .logo, .sidebar-inner .widget-area .widget.gform_widget")):newWindowWidth>=dekstop[0]&&(jQuery(".brand-info").prepend(jQuery("#header .logo")),jQuery(".sidebar-inner .widget-area").prepend(jQuery("#header .widget.gform_widget")))}if(!$(".home").length){$(".searchField input").on("click",function(){$("#header .widget.gform_widget").addClass("infocus")}),$(document).on("click",function(event){$(event.target).closest("#header .widget.gform_widget").length||$("#header .widget.gform_widget.infocus").removeClass("infocus")});var dekstop=Array(931,null);resizeWindow();$(window).on("resize",resizeWindow)}$(".advanced-search").click(function(){$("i",this).toggleClass("fa-angle-up fa-angle-down"),$(".widget.gform_widget .hidden-element").toggle()});var editor=$(".myzebra-wysiwyg");if(0!==editor.length){editor.cleditor({width:"100%",height:"100%",controls:"bold italic underline | bullets numbering link | cut copy paste pastetext | undo redo"}).cleditor("refresh"),fixWidth();var doit;$(window).on("resize",function(){clearTimeout(doit),doit=setTimeout(fixWidth,100)})}if(0!==jQuery(".gallery").length){var resizeGallery;$(window).on("resize",function(){clearTimeout(resizeGallery),resizeGallery=setTimeout(fixWidthGallery,200)})}var contactSellerBtns=$(".contact-seller-btn");contactSellerBtns.length>0&&contactSellerBtns.each(function(){$(this).click(function(){$(this);return $.fancybox({padding:0,width:900,height:750,href:homeUrl+"/new-message-embed?subject="+encodeURIComponent($(this).data("listing-title"))+"&guid="+encodeURIComponent($(this).data("listing-permalink"))+"&sid="+encodeURIComponent($(this).data("c
1ompany-id")),type:"iframe"}),!1})}),$(".digital-edition-widget-content .fancybox-iframe, .digital-edition .fancybox-iframe").on("click",function(event){if($(window).width()<=700){var url=$(this).attr("href");window.open(url),setTimeout(function(){$.fancybox.close()},1e3)}})})}(jQuery),jQuery(function(){function imagePreview(parentDiv){var oImage=parentDiv.find("#itemImage")[0],oFile=parentDiv.find(".myzebra-file")[0].files[0];if(oFile){var oReader=new FileReader;oReader.readAsDataURL(oFile),oReader.onload=function(e){oImage.src=e.target.result}}else{var oFile=parentDiv.find(".myzebra-file-text .myzebra-file")[0].value;oImage.src=oFile}jQuery(oImage).removeClass("imgEmpty")}var $=jQuery;$(document).ready(function(){function check_if_in_view(){var window_height=$window.height(),window_top_position=$window.scrollTop(),window_bottom_position=window_top_position+window_height;$.each($animation_elements,function(){var $element=$(this),element_height=$element.outerHeight(),element_top_position=$element.offset().top;element_top_position+element_height>=window_top_position&&element_top_position<=window_bottom_position?$element.addClass("in-view"):$element.removeClass("in-view")})}var profile_persona_box=$("#account_persona"),profile_persona_other_area=$(".persona-other"),profile_persona_other_input=$("#account_persona_other");"Other"==profile_persona_box.val()?profile_persona_other_area.show():(profile_persona_other_area.hide(),profile_persona_other_input.val("")),profile_persona_box.change(function(){"Other"==$(this).val()?profile_persona_other_area.show():(profile_persona_other_area.hide(),profile_persona_other_input.val(""))});var persona_ele=$("#cred_form_6555_1_d-customer-company-type"),peronsa_other_area=$(".cred-field-d-customer-specify-company-type"),persona_other_ele=$("#cred_form_6555_1_d-customer-specify-company-type"),ele_pos=persona_other_ele.offset(),w=window.innerWidth;if(void 0!==ele_pos){var ele_top=ele_pos.top-41,ele_left=w>643?ele_pos.left-60:2;persona_other_ele.focusout(function(){if("Other"==persona_ele.val()&&""==persona_other_ele.val()){var validation_message_markup=mbm_get_validation_message_markup(ele_top,ele_left);$("body").append(validation_message_markup)}}),$("#cred_form_6555_1_form_submit_1").click(function(event){if("Other"==persona_ele.val()&&""==persona_other_ele.val()){event.preventDefault();var validation_message_markup=mbm_get_validation_message_markup(ele_top,ele_left);$("body").append(validation_message_markup)}})}"Other"==persona_ele.val()?peronsa_other_area.show():(peronsa_other_area.hide(),persona_other_ele.val("")),persona_ele.change(function(){"Other"==$(this).val()?peronsa_other_area.show():(peronsa_other_area.hide(),persona_other_ele.val(""))}),$("#input_1_1").each(function(){"~"===$(this).val()&&$(this).val("")}
1);var cat=$(".category select"),subcat=$(".subcategory select").first(),oldVal=subcat.val(),mainCat=cat.val();$(".subcategory select").each(function(){$(this).attr("disabled","disabled"),$(this).empty().append('<option value selected="selected">Any Subcategory</option>')}),mainCat>0&&$.ajax({url:"/wp-admin/admin-ajax.php",type:"POST",data:"action=get_subcategory_ajax_call&categoryId="+mainCat,success:function(results){$(".subcategory select").each(function(){$(this).removeAttr("disabled"),$(this).append(results),""!==oldVal&&$(this).val(oldVal)})}}),$("#digitalMagazine .subscribe-digital-mag li.gchoice_8_1 input").prop("disabled","disabled"),$("#gform_2").live("submit",function(){$("#digitalMagazine .subscribe-digital-mag li.gchoice_8_1 input").removeProp("disabled")});var $animation_elements=$(".animation-element"),$window=$(window);$window.on("scroll resize",check_if_in_view),$window.trigger("scroll")}),imageFrame='<div class="imgFrame"><div class="imgHolder"><span class="align-helper"></span><img id="itemImage" alt="Upload Image" class="imgEmpty" src="/wp-content/themes/toolset-classifieds/images/uploadPlaceHolder.jpg"></div></div>',jQuery(".itemImages .myzebra-repeatable-field").append(imageFrame),jQuery(".itemImages .myzebra-repeatable-field").on("DOMNodeInserted",function(e){jQuery(e.target).is(".myzebra-repeatable-field")&&jQuery(e.target).find("#itemImage")&&(jQuery(e.target).find(".imgFrame").remove(),jQuery(e.target).append(imageFrame)),jQuery(e.target).is(".myzebra-file-text-close")&&(parentDiv=jQuery(e.target).parent().parent(),imagePreview(parentDiv))}),jQuery(".itemImages .myzebra-repeatable-field").on("DOMNodeRemoved",function(e){jQuery(e.target).is(".myzebra-file-text")&&(jQuery(e.target).parent().find(".imgFrame").remove(),jQuery(e.target).parent().append(imageFrame))}),jQuery(".searchField input").attr("placeholder","Search Products & Services"),jQuery(".postcode input").attr("placeholder","Postcode"),jQuery(".subscription .first-name input").attr("placeholder","First Name"),jQuery(".subscription .last-name input").attr("placeholder","Last Name"),jQuery(".subscription .email input").attr("placeholder","Email Address"),jQuery(".subscription .email-confirm input").attr("placeholder","Confirm Email Address"),jQuery(function(){jQuery(".itm-activate").click(function(){var itemID=jQuery(this).attr("item-id");jQuery.ajax({url:"/wp-admin/admin-ajax.php",type:"POST",data:"action=add_sqs_ajax_call&activate="+itemID,success:function(results){jQuery("#basket-qty").html(results),jQuery("[stid="+itemID+"]").html("In your basket"),jQuery("[item-id="+itemID+"]").hide()}})})}),jQuery(function(){jQuery(".item-duration").change(function(){var itemID=jQuery(this).attr("item-id"),iDuration=jQuery(this).val();jQuery.ajax({url:"/wp-admin/admin-ajax.php",type:"POST",data:"action=iemuk_calculate_ajax_call&item="+itemID+"&duration="+iDuration,success:function(results){jQuery("#final-price").html(results)}})})}),jQuery(function(){jQuery("li.category select").change(function(){var mainCat=jQuery("li.category select").val();jQuery("li.subcategory select").each(function(){jQuery(this).attr("disabled","disabled"),jQuery(this).empty().append('<option value selected="selected">Loading...</option>')}),mainCat>0?jQuery.ajax({url:"/wp-admin/admin-ajax.php",type:"POST",data:"action=get_subcategory_ajax_call&categoryId="+mainCat,success:function(results){jQuery(".subcategory select").empty().append('<option value selected="selected">Any Subcategory</option>').each(function(){jQuery(this).removeAttr("disabled"),jQuery(this).append(results)})}}):jQuery(".subcategory select").empty().append('<option value selected="selected">Any Subcategory</option>')})}),menuItem=jQuery(".nav-menu > li"),menuItemHeight=menuItem.height(),menuItem.hoverIntent(function(){menuItemThis=jQuery(this),jQuery("ul",menuItemThis).first().css({"margin-top":menuItemThis.position().top+menuItemHeight,display:"block"})},function(){menuItemThis=jQuery(this),jQuery("ul",menuItemThis).first().css({display:"none"})}),jQuery(function(){jQuery('a[href="#digitalMagazine"]').addClass("fancybox-inline")}),jQuery(".show-by-year .loading").hide(),jQuery(".year-"+(new Date).getFullYear()).show(),jQuery(".show-by-year select").change(function(event){var activeYear=jQuery(this).val();jQuery(".magazine-single.backissue").hide(),jQuery(".year-"+activeYear).show()}),jQuery(".magazine-single.backissue").hide(),jQuery(".year-"+(new Date).getFullYear()).show()}),function($){$(document).ready(function(){function doSubmit(e){if(e.stopPropagation(),e.preventDefault(),""!==$("#input_1_1").val()||""!==$("#input_1_2").val()||""!==$("#input_1_4").val()||""!==$("#input_1_3").val()&&""!==$("#input_1_5").val()){var searchQuery=buildSearchQuery();null!==searchQuery&&(top.location.href=searchQuery)}return!1}function buildSearchQuery(){var searchString=$("#input_1_1").val(),category=$("#input_1_2").val(),subCategory=$("#input_1_9").val(),listingType=$("#input_1_10").val(),postCode=$("#input_1_3").val(),distance=$("#input_1_5").val(),latitude=$("#input_1_6").val(),longitude=$("#input_1_7").val(),sortCriteria=$("#input_1_8").val();return void 0!==searchString&&void 0!==category&&void 0!==subCategory&&void 0!==listingType&&void 0!==postCode&&void 0!==distance&&void 0!==latitude&&void 0!==longitude?"/?s="+searchString+"&c="+category+"&sc="+subCategory+"&la="+latitude+"&lo="+longitude+"&d="+distance+"&pc="+postCode+"&lt="+listingType+"&sort_criteria="+sortCriteria:null}function setupSortDirections(){var sortDirectionSelector=$("#sort_direction_id");"relevance"===sortCriteriaSelector.val()?sortDirectionSelector.html('<option value="ascending">Least relevant first</option><option value="descending" selected="selected">Most relevant first</option>'):"distance"===sortCriteriaSelector.val()&&sortDirectionSelector.html('<option value="ascending" selected="selected">Nearest first</option><option value="descending">Farthest first</option>'),""!==iemuk_sort_direction&&sortDirectionSelector.val(iemuk_sort_direction)}function watchElement(elem,callback){elem.data("oldVal",elem.val()),elem.bind("propertychange keyup input paste",function(event){elem.data("oldVal")!=elem.val()&&(elem.data("oldVal",elem.val()),callback(elem.val()))})}function setLatLongFor(postcode,callback){retrieveLatLongFor(postcode,function(err,lat,long){!0===err?($("#input_1_5").prop("disabled",!0),$("#input_1_8").val("relevance"),$("#input_1_6").val(""),$("#input_1_7").val(""),callback(!1)):($("#input_1_6").val(lat),$("#input_1_7").val(long),callback(!0))})}function polishCode(code){return code.toLowerCase().replace(" ","")}function retrieveLatLongFor(postcode,callback){geocoder.geocode({address:postcode,componentRestrictions:{country:"uk"}},function(results,status){if(results.length>0){var found=!1;for(var i in results[0].address_components){for(var j in results[0].address_components[i].types)if("postal_code"===results[0].address_components[i].types[j]&&polishCode(results[0].address_components[i].short_name)===polishCode(postcode)){found=!0;break}if(found)break}
1callback(!found,results[0].geometry.location.lat(),results[0].geometry.location.lng())}else callback(!0)})}var geocoder=new google.maps.Geocoder;$(".widget").has(".gform_wrapper").addClass("gform_widget"),$("#input_1_5").prop("disabled",!0),$("#input_1_8").val("relevance"),void 0!==$("#input_1_3").val()&&$("#input_1_3").val().length>2&&setLatLongFor($("#input_1_3").val(),function(existingPostcode){$("#input_1_5").prop("disabled",!existingPostcode),$("#input_1_8").val(existingPostcode?"distance":"relevance")}),watchElement($("#input_1_3"),function(val){val.length>2?setLatLongFor($("#input_1_3").val(),function(existingPostcode){$("#input_1_5").prop("disabled",!existingPostcode),$("#input_1_8").val(existingPostcode?"distance":"relevance")}):($("#input_1_5").prop("disabled",!0),$("#input_1_8").val("relevance"))}),$("#gform_1").submit(doSubmit),$("#gform_submit_button_1").click(doSubmit);var sortCriteriaSelector=$("#sort_criteria_id");sortCriteriaSelector.change(function(){setupSortDirections()}),setupSortDirections()})}(jQuery),function($){$.fn.hoverIntent=function(handlerIn,handlerOut,selector){var cfg={interval:100,sensitivity:7,timeout:0};cfg="object"==typeof handlerIn?$.extend(cfg,handlerIn):$.isFunction(handlerOut)?$.extend(cfg,{over:handlerIn,out:handlerOut,selector:selector}):$.extend(cfg,{over:handlerIn,out:handlerIn,selector:handlerOut});var cX,cY,pX,pY,track=function(ev){cX=ev.pageX,cY=ev.pageY},compare=function(ev,ob){if(ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t),Math.abs(pX-cX)+Math.abs(pY-cY)<cfg.sensitivity)return $(ob).off("mousemove.hoverIntent",track),ob.hoverIntent_s=1,cfg.over.apply(ob,[ev]);pX=cX,pY=cY,ob.hoverIntent_t=setTimeout(function(){compare(ev,ob)},cfg.interval)},delay=function(ev,ob){return ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t),ob.hoverIntent_s=0,cfg.out.apply(ob,[ev])},handleHover=function(e){var ev=jQuery.extend({},e),ob=this;ob.hoverIntent_t&&(ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t)),"mouseenter"==e.type?(pX=ev.pageX,pY=ev.pageY,$(ob).on("mousemove.hoverIntent",track),1!=ob.hoverIntent_s&&(ob.hoverIntent_t=setTimeout(function(){compare(ev,ob)},cfg.interval))):($(ob).off("mousemove.hoverIntent",track),1==ob.hoverIntent_s&&(ob.hoverIntent_t=setTimeout(function(){delay(ev,ob)},cfg.timeout)))};return this.on({"mouseenter.hoverIntent":handleHover,"mouseleave.hoverIntent":handleHover},cfg.selector)}}(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.