PageSourceSearch

https://ex-tools.ru/media/mod_pwebcontact/js/jquery.pwebcontact.min.js

js ex-tools.ru collected 2026-10-08 13:58:24 UTC 38,646 bytes, 130 lines download raw bytes

1var pwebBoxes=pwebBoxes||[];(function($){pwebContact=function(options){this.init(options);};pwebContact.prototype=(function(){var captcha={};return{constructor:pwebContact,defaults:{id:'',selector:'#pwebcontact',selectorClass:'.pwebcontact',debug:false,basePath:'',baseUrl:'',ajaxUrl:'',reloadToken:false,bootstrap:3,openAuto:false,openDelay:0,maxAutoOpen:0,closeAuto:false,closeDelay:0,closeOther:true,reset:1,redirectURL:'',redirectDelay:3,layout:'slidebox',position:'left',offsetPosition:'top',tooltips:3,msgScroll:true,msgPosition:'after',msgCloseDelay:10,rulesModal:false,togglerNameOpen:'',togglerNameClose:'',slideWidth:0,slideDuration:400,slideTransition:'swing',accordionDuration:500,accordionEaseIn:'easeInBack',accordionEaseOut:'easeOutBounce',modalBackdrop:true,modalClose:true,modalStyle:'default',modalEffect:'square',modalEffectDuration:400,modalEaseIn:'easeInCubic',modalEaseOut:'easeOutCubic',cookieLifetime:30,cookiePath:'/',cookieDomain:'',onLoad:function(){},onOpen:function(){},onClose:function(){},onComplete:function(data){},onError:function(data){},uploadAcceptFileTypes:/(\.|\/)(gif|jpe?g|png|docx?|odt|txt|pdf|zip)$/i,uploadMaxSize:1048576,uploadFilesLimit:5,uploadAutoStart:true,captcha:'',validatorRules:[],calendars:[],calendarFirstDay:0},status:0,hidden:true,timer:false,validator:false,tooltip:false,uploader:false,uploadQueue:0,init:function(options){var that=this;this.options=$.extend({},this.defaults,options);this.options.baseUrl=document.location.protocol+'//'+document.location.host+this.options.basePath+'/';this.options.ajaxUrl=this.options.baseUrl+this.options.ajaxUrl;this.options.selector=this.options.selector+this.options.id;this.options.selectorClass=this.options.selectorClass+this.options.id;this.element=$(this.options.selector);this.Msg=$(this.options.selector+'_msg');this.Form=$(this.options.selector+'_form');this.ButtonSend=$(this.options.selector+'_send');this.Toggler=$(this.options.selector+'_toggler');this.Box=$(this.options.selector+'_box');this.Container=$(this.options.selector+'_container');this.Token=$(this.options.selector+'_token');this.element.data('pwebcontact',this);if(this.Form.get(0)){this.Form.get(0).reset();}
2captcha[this.options.id]={enabled:0,status:-1,plugin:this.options.captcha};if(captcha[this.options.id].enabled===0){captcha[this.options.id].enabled=this.Form.find('.pweb-captcha').length>0;}
3$('a[href="'+this.options.selector+'_toggler"]').addClass((this.options.selector.replace('#',''))+'_toggler');this.Form.submit(function(e){e.preventDefault();});if(this.options.layout=='slidebox'){this.element.appendTo(document.body);this.initSlidebox();}else if(this.options.layout=='modal'){this.element.appendTo(document.body);if(!this.initModal())return false;}else if(this.options.layout=='accordion'){this.initAccordion();}
4this.options.onLoad.apply(this);this.element.trigger('onLoad');if($(this.options.selector+'_form input').css('font-size').slice(0,-2)>=20){$(this.options.selector+'_box input, '+this.options.selector+'_box select').css('height','auto');}
5var openOnLoad=false;if(document.location.hash.indexOf(this.options.selector+':')!==-1){var data=document.location.hash.replace(this.options.selector+':','');if(data.indexOf('open')===0&&(typeof data[4]==='undefined'||data[4]==':')){data=data.replace(/open(:)?/i,'');openOnLoad=true;}
6if(data)this.preloadFields(data);}
7if(this.options.tooltips)
8this.initTooltips();this.initTextareaCounters();if(this.options.rulesModal)
9this.initModalRules();this.initCalendar();if(this.Form.find('.pweb-uploader').length)
10this.initUploader();if(this.Box.hasClass('pweb-labels-over'))
11this.initLabelsOverFields();if(this.options.layout!=='static'){if(this.options.togglerNameClose)
12this.options.togglerNameOpen=this.Toggler.find('.pweb-text').text();$(this.options.selectorClass+'_toggler').click(function(e){e.preventDefault();that.toggleForm(-1,-1,this,e);});if(this.options.closeOther)pwebBoxes.push(this);if(openOnLoad){this.autoPopupOnPageLoad();}else if(this.options.openAuto){if(this.options.maxAutoOpen>0){if(!this.initAutoPopupCookie())this.options.openAuto=false;}
13switch(this.options.openAuto){case 1:this.autoPopupOnPageLoad();break;case 2:this.autoPopupOnPageScroll();break;case 3:this.autoPopupOnPageExit();}}}
14this.initHiddenFields();this.initValidator();
14this.ButtonSend.click(function(){that.submitForm();});if(this.options.reset==3){this.ButtonReset=$(this.options.selector+'_reset');this.ButtonReset.click(function(){$(this).hide();that.resetForm();});}
15if(typeof navigator.cookieEnabled!=='undefined'&&navigator.cookieEnabled===false){this.displayMsg(Joomla.JText._('MOD_PWEBCONTACT_COOKIES_ERR'),'error');}else{this.displayMsg('','');}
16return this;},initSlidebox:function(){var that=this;this.options.togglerSlide=this.Box.hasClass('pweb-toggler-slide');this.options.togglerHidden=this.Box.hasClass('pweb-toggler-hidden');this.options.slidePos=this.element.css('position');if(!this.options.slideWidth)
17this.options.slideWidth=parseInt(this.Box.css('max-width'));this.Box.css('width',this.options.slideWidth);if(this.options.position=='left'||this.options.position=='right'){this.Box.css(this.options.position,-this.options.slideWidth);this.options.togglerWidth=this.options.togglerSlide?this.Toggler.outerWidth():0;this.options.togglerHeight=this.options.togglerSlide?parseInt(this.Box.css('top')):0;this.options.slideOffset=parseInt(this.element.css('top'));if(this.options.togglerSlide)
18this.Toggler.css(this.options.position=='left'?'right':'left',-this.Toggler.outerWidth());}else{setTimeout(function(){that.Box.css(that.options.position,-that.Box.height());},100);this.options.togglerWidth=0;this.options.togglerHeight=this.options.togglerSlide?this.Toggler.outerHeight():0;this.options.slideOffset=0;if(this.options.togglerSlide)
19this.Toggler.css(this.options.position=='top'?'bottom':'top',-this.Toggler.outerHeight());}
20this.Box.addClass('pweb-closed');setTimeout(function(){that.Box.removeClass('pweb-init');},100);if(this.options.togglerHidden){this.Toggler.fadeOut(0).removeClass('pweb-closed').addClass('pweb-opened');if(this.options.togglerNameClose){this.Toggler.find('.pweb-text').text(this.options.togglerNameClose);}}
21this.isFF=navigator.userAgent.indexOf('Gecko')!=-1;$(window).scroll(function(e){if(!that.hidden&&that.element.css('position')=='absolute'&&that.options.slidePos=='fixed'){var offset=$(this).scrollTop();if(that.options.position=='bottom'){offset=offset+$(this).height();if(offset>that.element.offset().top){if(that.isFF){that.element.css('top',offset);}else{that.element.stop().animate({top:offset},250,'linear');}}}else{offset=offset+that.options.slideOffset;if(offset<that.element.offset().top){if(that.isFF){that.element.css('top',offset);}else{that.element.stop().animate({top:offset},250,'linear');}}}}});$(window).resize(function(){if(!that.hidden){var css={width:that.options.slideWidth};var maxWidth=$(window).width();if(that.options.position=='left'||that.options.position=='right'){if(that.options.slideWidth+that.options.togglerWidth>maxWidth){css.width=maxWidth-that.options.togglerWidth;}}else{var offset=that.element.offset().left;if(that.options.offsetPosition=='right'){offset=$(document).width()-offset;}
22if(that.options.slideWidth+offset>maxWidth){css.width=maxWidth-offset;}}
23that.Box.css(css);if(that.options.slidePos=='fixed'){var css={position:'absolute'};if(that.options.position=='left'||that.options.position=='right'){css.top=that.element.offset().top;if(that.Box.height()+that.options.togglerHeight+css.top-$(window).scrollTop()<=$(window).height()){css.position='fixed';css.top=that.options.slideOffset;}}else if(that.Box.height()+that.options.togglerHeight>$(window).height()){css.top=that.element.offset().top;if(that.options.position=='bottom'){css.bottom='auto';}}else{css.position='fixed';css[that.options.position]=0;if(that.options.position=='bottom')css.top='auto';}
24that.element.css(css);}}});},initModal:function(){var that=this;if(typeof $.fn.modal==='function'){this.Modal=$(this.options.selector+'_modal');this.options.modalClass='pwebcontact'+this.options.id+'_modal-open pweb-modal-open pweb-modal-'+this.options.modalStyle;this.Modal.appendTo(document.body).modal({show:false,keyboard:false,backdrop:!this.options.modalClose&&this.options.modalBackdrop?'static':this.options.modalBackdrop}).on('hidden.bs.modal',function(e){e.stopPropagation();if(e.target!==e.currentTarget)return;that.toggleForm(0);$(document.body).removeClass(that.options.modalClass);that.Box.addClass('pweb-closed');}).on('show.bs.modal',function(e){e.stopPropagation();if(e.target!==e.currentTarget)return;$(document.body).addClass(that.options.modalClass);that.Box.removeClass('pweb-closed');}).click(function(e){if(e.target!==e.currentTarget||!that.options.modalClose)return;that.toggleForm(0);});if(this.options.modalEffect!=='default'){this.initGenie();}
25return true;}else if(this.options.debug){this.debug('Bootstrap Modal Plugin is not loaded');}
26return false;},initModalRules:function(){var that=this,links=this.Form.find('.pweb-modal-url');if(!links.length)return;if(typeof $.fn.modal==='function'){if(typeof this.options.modalClass==='undefined'){this.options.modalClass='pwebcontact'+this.options.id+'_modal-open pweb-modal-open pweb-modal-'+this.options.modalStyle;}
27links.click(function(e){e.preventDefault();var href=$(this).attr('href');if(href.indexOf('#')===0&&$(href).length===0)return;var $modal=$('<div class="pweb-modal pweb-modal-rules modal fade">'
28+'<button type="button" class="pweb-button-close" data-dismiss="modal" aria-hidden="true">&times;</button>'
29+'<div class="modal-body pweb-progress"></div>'
30+'</div>');if(that.Box.hasClass('pweb-rtl')){$modal.addClass('pweb-rtl');}
31$modal.appendTo(document.body).modal({show:false,backdrop:(that.options.layout=='modal'?0:true)}).on('hidden.bs.modal',function(){e.stopPropagation();if(href.indexOf('#')===0)$(href).append($modalContent);$(document.body).removeClass(that.options.modalClass);$(this).remove();});$('body').on('show.bs.modal','div.pweb-modal-rules',function(e){e.stopPropagation();if(e.target!==e.currentTarget)return;$(document.body).addClass(that.options.modalClass);});if(href.indexOf('#')!==0){$modal.on('shown.bs.modal',function(){$(this).find('iframe').height($(this).height());}
31).find('.modal-body').html('<iframe width="100%" height="100%" frameborder="0" scrolling="yes" allowtransparency="true" src="'+href+'"></iframe>').css({'width':'auto','height':'100%','padding':'0','overflow':'hidden'}).find('iframe').on('load',function(){$(this).parent().removeClass('pweb-progress');});}else{var $modalContent=$(href).children();$modal.find('.modal-body').append($modalContent).removeClass('pweb-progress');}
32$modal.modal('show');});return true;}else if(this.options.debug){this.debug('Bootstrap Modal Plugin is not loaded');}
33return false;},initGenie:function(){var that=this,bgColorClass=this.Box.attr('class').match(/pweb-bg-[a-z]+/i);this.options.modalGenieClass='pweb-genie pweb-'+this.options.modalEffect+'-'
34+(this.options.position!=='static'?this.options.position:'bottom')
35+' pwebcontact'+this.options.id+'-genie'
36+(this.Box.hasClass('pweb-radius')?' pweb-radius':'')
37+(this.Box.hasClass('pweb-shadow')?' pweb-shadow':'')
38+(bgColorClass?' '+bgColorClass[0]:'')
39if(this.options.modalEffect==='smooth'){this.options.modalEaseIn='easeInQuart';this.options.modalEaseOut='easeOutQuart';}else if(this.options.modalEffect==='rotate'){this.options.modalEaseIn='easeInQuint';this.options.modalEaseOut='easeOutQuint';}
40this.Modal.on('show.bs.modal',function(e){e.stopPropagation();if(e.target!==e.currentTarget)return;if(typeof that.eventSource!=='undefined'&&$(that.eventSource).length){that.Container.css({visibility:'hidden'});}}).on('shown.bs.modal',function(e){e.stopPropagation();if(e.target!==e.currentTarget)return;if(typeof that.eventSource!=='undefined'&&$(that.eventSource).length){$(that.eventSource).trigger('modalOpen');}});$(this.options.selectorClass+'_toggler').on('modalOpen',function(){$(this).effect({effect:'transfer',to:that.Container,duration:that.options.modalEffectDuration,easing:that.options.modalEaseIn,className:'pweb-genie-show '+that.options.modalGenieClass,complete:function(){that.Container.css({visibility:'visible'});}});});this.Container.on('modalClose',function(){$(this).css({visibility:'hidden'}).effect({effect:'transfer',to:$(that.eventSource),duration:that.options.modalEffectDuration,easing:that.options.modalEaseOut,className:'pweb-genie-hide '+that.options.modalGenieClass,complete:function(){that.Modal.modal('hide');}});});},initAccordion:function(){var that=this;$(this.options.selectorClass+'_toggler').on('openAccordion',function(){that.Box.removeClass('pweb-closed').slideDown({duration:that.options.accordionDuration,easing:that.options.accordionEaseOut,complete:function(){var winHeight=$(window).height(),eleHeight=that.element.outerHeight(),eleTop=that.element.offset().top;if(eleTop+eleHeight>$(window).scrollTop()+winHeight){if(eleHeight<winHeight){eleTop=eleTop+eleHeight-winHeight;}
41$('html,body').animate({scrollTop:parseInt(eleTop)},500);}}});});$(this.options.selectorClass+'_toggler').on('closeAccordion',function(){that.Box.slideUp({duration:that.options.accordionDuration,easing:that.options.accordionEaseIn,complete:function(){that.Box.addClass('pweb-closed');}});});this.Box.css('display','none').removeClass('pweb-init');},initTooltips:function(){var that=this;if(typeof $.fn.tooltip==='function'){this.tooltip=true;this.Form.find('input.pweb-input.pweb-tooltip,select.pweb-tooltip,textarea.pweb-tooltip').tooltip({trigger:this.options.tooltips==2?'manual':'focus',html:false});this.Form.find('fieldset.pweb-tooltip,.pweb-field-checkbox label.pweb-tooltip,.fileinput-button.pweb-tooltip').tooltip({trigger:this.options.tooltips==2?'manual':'hover',html:false});this.Form.find('.pweb-tooltip').on('show',function(e){e.stopPropagation();if(e.target!==e.currentTarget)return;}).on('shown',function(e){e.stopPropagation();if(e.target!==e.currentTarget)return;}).on('hide.bs.tooltip',function(e){if(that.options.bootstrap===3){e.preventDefault();$(this).siblings('div.tooltip.in').remove();}
42e.stopPropagation();if(e.target!==e.currentTarget)return;}).on('hidden',function(e){e.stopPropagation();if(e.target!==e.currentTarget)return;});return true;}else if(this.options.debug){this.debug('Bootstrap Tooltip Plugin is not loaded');}
43return false;},initCalendar:function(){if(typeof Calendar==='undefined'){return false;}
44if(this.options.calendars.length){var that=this;$.each(this.options.calendars,function(key,calendar){var id='pwebcontact'+that.options.id+'_field-'+calendar.id;Calendar.setup({inputField:id,button:id+'_btn',onUpdate:function(){this.inputField.focus();},ifFormat:typeof calendar.format!=='undefined'?calendar.format:null,firstDay:that.options.calendarFirstDay,electric:false});});this.Form.find('.pweb-calendar-btn').click(function(){if(that.element.css('position')=='fixed'||that.options.layout=='modal')
45$('div.calendar:last').css('position','fixed');$(this).prev().focus();});}
46return true;},initLabelsOverFields:function(){this.Form.find('input.pweb-input,textarea').focus(function(){$('#'+$(this).attr('id')+'-lbl').parent().hide();}).blur(function(){if(!this.value)
47$('#'+$(this).attr('id')+'-lbl').parent().show();}).each(function(){var $label=$('#'+$(this).attr('id')+'-lbl').parent();$label.parent().addClass('pweb-label-over');if(this.value)
48$label.hide();});this.Form.find('select').focus(function(){$('#'+$(this).attr('id')+'-lbl').parent().hide();$(this).removeClass('pweb-blank').children(':first').text($(this).data('default-option'));}).blur(function(){if($(this).val()==''||$(this).val()==null){$(this).addClass('pweb-blank').children(':first').text(' ');$('#'+$(this).attr('id')+'-lbl').parent().show();}}).each(function(){var $label=$('#'+$(this).attr('id')+'-lbl').parent(),$option=$(this).children(':first');$label.parent().addClass('pweb-label-over');$(this).data('default-option',$option.text());if($(this).val()==''||$(this).val()==null){$(this).addClass('pweb-blank');$option.text(' ');}else{$label.hide();}});return true;},initTextareaCounters:function(){this.Form.find('textarea[maxlength]').keyup(function(){var limit=parseInt($(this).attr('maxlength')),text=$(this).val();if(text.length>=limit){text=text.substring(0,limit);$(this).val(text);}
49$('#'+$(this).attr('id')+'-limit').text(limit-text.length);}).trigger('keyup');return true;},initHiddenFields:function(){$('<input/>
49',{type:'hidden',name:'title',value:document.title}).appendTo(this.Form);$('<input/>',{type:'hidden',name:'url',value:document.location.href}).appendTo(this.Form);$('<input/>',{type:'hidden',name:'screen_resolution',value:screen.width+'x'+screen.height}).appendTo(this.Form);if(this.options.debug){$('<input/>',{type:'hidden',name:'debug',value:1}).appendTo(this.Form);}
50return true;},initUploader:function(){var that=this;if(typeof $.fn.fileupload!=='function'){if(this.options.debug)
51this.debug('jQuery File Upload Plugin is not loaded');return false;}
52this.files=[];this.uploader=$(this.options.selector+'_uploader_container').fileupload({url:this.options.ajaxUrl+'uploader',type:'POST',dataType:'json',dataFilter:this.ajaxResponseDataFilter,accepts:"application/json; charset=utf-8",headers:{Accept:"application/json; charset=utf-8"},converters:{'text json':function(result){result=$.parseJSON(result);if(typeof result.data!=='undefined'&&result.data)
53result=result.data;return result;},'iframe json':function(iframe){iframe=$.parseJSON(iframe);if(typeof iframe.data!=='undefined'&&iframe.data)
54iframe=iframe.data;return iframe;}},formData:function(form){return $.merge(form.serializeArray(),[{name:'format',value:'json'},{name:'mid',value:that.options.id},{name:'ignoreMessages',value:true}]);},autoUpload:this.options.uploadAutoStart===true,acceptFileTypes:this.options.uploadAcceptFileTypes,maxFileSize:this.options.uploadMaxSize,maxNumberOfFiles:this.options.uploadFilesLimit,getNumberOfFiles:function(){return this.filesContainer.children('.pweb-upload-success, .pweb-upload-ready').length;},messages:{uploadedBytes:Joomla.JText._('MOD_PWEBCONTACT_UPLOAD_BYTES_ERR'),maxNumberOfFiles:Joomla.JText._('MOD_PWEBCONTACT_UPLOAD_LIMIT_ERR'),acceptFileTypes:Joomla.JText._('MOD_PWEBCONTACT_UPLOAD_TYPE_ERR'),maxFileSize:Joomla.JText._('MOD_PWEBCONTACT_UPLOAD_SIZE_ERR')},dropZone:this.Box,pasteZone:null,uploadTemplateId:null,downloadTemplateId:null,uploadTemplate:function(o){var rows=$();$.each(o.files,function(index,file){var row=that.uploader.find('.templates .template-upload').clone();row.find('.name').text(file.name);row.find('.cancel').bind('click',function(){if(row.hasClass('pweb-upload-ready'))
55that.uploadQueue--;if(that.status==0)that.displayMsg('','');});rows=rows.add(row);});return rows;},downloadTemplate:function(o){var rows=$();$.each(o.files,function(index,file){var row=that.uploader.find('.templates .template-download').clone();row.find('.size').text(o.formatFileSize(file.size));row.find('.name').text(file.name);var btn=row.find('.delete').bind('click',function(){var index=$.inArray(file.name,that.files);if(index>-1)that.files.splice(index,1);if(that.status==0)that.displayMsg('','');});if(file.name){var query={file:file.name,mid:that.options.id,format:'json',ignoreMessages:true};if(file.deleteType=='POST'){query._method='DELETE';btn.data('type','POST');}
56query[that.Token.attr('name')]=1;btn.data('url',that.options.ajaxUrl+'uploader'+'&'+decodeURIComponent($.param(query)));}
57if(file.error){row.find('.success').remove();row.find('.error').text(file.error);}else{row.find('.warning, .error').remove();row.addClass('pweb-upload-success');that.files.push(file.name);}
58rows=rows.add(row);});return rows;}}).on('fileuploaddragover',function(e){that.Box.addClass('pweb-dragged');that.Box.find('.pweb-dropzone').css({width:that.Box.width(),height:that.Box.height()});}).on('fileuploaddrop',function(e,data){that.Box.removeClass('pweb-dragged');}).on('fileuploadadd',function(e,data){if(that.options.reloadToken&&that.status==0&&that.options.uploadAutoStart)
59that.ajaxCall('getToken',false)}).on('fileuploadprocessdone',function(e,data){that.uploadQueue++;data.context.addClass('pweb-upload-ready').find('.warning,.error').remove();}).on('fileuploadprocessfail',function(e,data){data.context.each(function(index){$(this).find('.ready,.progress').remove();var cancelBtn=$(this).find('.cancel');setTimeout(function(){cancelBtn.click();},3000);});}).on('fileuploadstart',function(e){if(that.options.uploadAutoStart){if(that.status==0)
60that.displayMsg('','');that.status=2;}}).on('fileuploaddone',function(e,data){that.uploadQueue--;if(!(data.getFilesFromResponse(data)).length){that.displayMsg(Joomla.JText._('MOD_PWEBCONTACT_UPLOAD_ERR')+(typeof data.result.message!=='undefined'?'. '+data.result.message:''),'error');if(data.autoUpload===false)
61that.status=5;}}).on('fileuploadfail',function(e,data){that.displayMsg(Joomla.JText._('MOD_PWEBCONTACT_UPLOAD_ERR'),'error');if(data.autoUpload===false)
62that.status=5;}).on('fileuploadalways',function(e,data){if(data.textStatus=='parsererror'){that.debug(data.jqXHR.responseText);}else if(that.options.debug&&data.result&&typeof data.result.debug!=='undefined'&&data.result.debug){that.debug(data.result.debug,data.result.status);}}).on('fileuploadfinished',function(e,data){if(that.uploadQueue==0){if(data.autoUpload||that.status==5){that.
62status=0;}else if(that.status==1){that.ajaxCall('sendEmail');}}});this.Box.bind('dragleave',function(e){$(this).removeClass('pweb-dragged');});if(this.tooltip){this.uploader.find('.fileinput-button').click(function(){if($(this).hasClass('pweb-tooltip'))
63$(this).tooltip('hide');});}
64$(window).on('unload',function(){if(that.files.length){that.uploader.find('.files .delete').click();}});return true;},initValidator:function(){var that=this;if(typeof $.fn.validate==='function'){if(captcha[this.options.id].enabled===true){setTimeout(function(){that.Form.find('.pweb-captcha input[type=text]').addClass('pweb-input required');},1000);}
65$.each(this.options.validatorRules,function(key,rule){$.validator.addMethod('pweb'+that.options.id+'-validate-'+rule.name,function(value,element){return this.optional(element)||(rule.regexp).test(value);},'');});if(this.uploader){$.validator.addMethod('pweb-validate-uploader',function(value,element){return $(element).closest('.pweb-uploader').find('.files .pweb-upload-success,.files .pweb-upload-ready').length;},'');}
66this.validator=this.Form.validate({debug:this.options.debug,onsubmit:false,errorClass:'invalid',showErrors:function(errorMap,errorList){var i,elements;for(i=0;errorList[i];i++){var element=errorList[i].element;this.settings.highlight.call(this,element,this.settings.errorClass,this.settings.validClass);element=$(element);if(element.hasClass('pweb-fieldset'))
67element=element.parents('fieldset');$('#'+element[0].id+'-lbl').addClass(this.settings.errorClass);if(i==0&&that.element.css('position')!='fixed'){if(that.options.layout=='modal'){var maxPos=that.Box.outerHeight()-$(window).height();if(maxPos>0){var pos=element.parent().parent().offset().top-that.Box.offset().top;if(pos>maxPos)pos=maxPos;that.Modal.animate({scrollTop:parseInt(pos)},500);}}else if(that.element.css('position')!='fixed'){var pos=element.parent().parent().offset().top-10,winTop=$(window).scrollTop(),winHeight=$(window).height();if(pos<winTop+50||pos>winTop+winHeight-50){pos=pos-winHeight / 2;$('html,body').animate({scrollTop:parseInt(pos)},500);}}}
68if(that.tooltip&&that.options.tooltips>=2){if(element.hasClass('pweb-single-checkbox')){if(element.next().hasClass('pweb-tooltip'))
69element.next().tooltip('show');}else if(element.hasClass('pweb-tooltip')){element.tooltip('show');}}}
70for(i=0,elements=this.validElements();elements[i];i++){var element=elements[i];this.settings.unhighlight.call(this,element,this.settings.errorClass,this.settings.validClass);element=$(element);if(element.hasClass('pweb-fieldset'))
71element=element.parents('fieldset');$('#'+element[0].id+'-lbl').removeClass(this.settings.errorClass);if(that.tooltip&&that.options.tooltips>=2){if(element.hasClass('pweb-single-checkbox')){if(element.next().hasClass('pweb-tooltip'))
72element.next().tooltip('hide');}else if(element.hasClass('pweb-tooltip')){element.tooltip('hide');}}}}});return true;}else if(this.options.debug){this.debug('jQuery Validate Plugin is not loaded');}
73return false;},preloadFields:function(data){var that=this;try{var fields=data.split('/');$.each(fields,function(key,field){field=field.split('=');if(field.length>=2){field[1]=unescape(field[1]);var element=$(that.options.selector+'_field-'+field[0]),tag=element.prop('tagName').toLowerCase();if(tag=='fieldset'){element.find('input').val(field[1].split(';'));}else if(tag=='select'&&element.attr('multiple')){element.val(field[1].split(';')).trigger('focus').trigger('blur');}else if(tag=='input'&&element.attr('type')=='checkbox'){element.attr('checked',field[1]!=0?true:false);}else{element.val(field[1]).trigger('focus').trigger('blur');if(tag=='textarea')
74element.trigger('keyup');}}});}catch(e){console.log(e);}},close:function(){this.toggleForm(0);},toggleForm:function(state,recipient,bind,event){var that=this;if(typeof state==='undefined')
75state=-1;if(typeof bind==='undefined')
76bind=this.Toggler;if(!this.hidden&&(state===-1||state===0)){this.hidden=true;if(this.Toggler.length&&!this.options.togglerHidden){this.Toggler.removeClass('pweb-opened').addClass('pweb-closed');if(this.options.togglerNameClose)
77this.Toggler.find('.pweb-text').text(this.options.togglerNameOpen);}
78if(this.options.openAuto===false&&this.timer){clearTimeout(this.timer);}
79if(this.options.layout=='slidebox'){var css={};css[this.options.position]=(this.options.position=='left'||this.options.position=='right')?-this.Box.width():-this.Box.height();
79this.Box.stop(true,false).animate(css,this.options.slideDuration,this.options.slideTransition,function(){that.Box.addClass('pweb-closed');if(that.element.css('position')=='absolute'&&that.options.slidePos=='fixed'){var css={position:'fixed'};if(that.options.position=='left'||that.options.position=='right'){css.top=that.options.slideOffset;}else{css[that.options.position]=0;if(that.options.position=='bottom')css.top='auto';}
80that.element.css(css);}});if(this.options.togglerHidden){this.Toggler.fadeOut(this.options.slideDuration);}}else if(this.options.layout=='modal'){if(this.options.modalEffect!='default'&&typeof this.eventSource!=='undefined'){this.Container.trigger('modalClose');}else{this.Modal.modal('hide');}}else if(this.options.layout=='accordion'){$(bind).trigger('closeAccordion');}
81this.options.onClose.apply(this);this.element.trigger('onClose');if(this.options.reset==2){this.resetForm();}}else if(this.hidden&&(state===-1||state===1)){if(this.options.closeOther){$.each(pwebBoxes,function(){if(this.options.id!=that.options.id&&typeof this.close==='function')this.close();});}
82if(this.options.openAuto===1||this.options.openAuto===2){this.options.openAuto=false;if(this.timer){clearTimeout(this.timer);}}
83if(typeof recipient==='number'&&recipient>=0){var select=$(this.options.selector+'_mailto');if(select.length){select[0].selectedIndex=parseInt(recipient);if(this.Box.hasClass('pweb-labels-over'))select.trigger('focus').trigger('blur');}}
84if($(bind).length){if($(bind).data('pwebcontact-fields')){this.preloadFields($(bind).data('pwebcontact-fields'));}
85if($(bind).data('pwebcontact-fields-once')){this.preloadFields($(bind).data('pwebcontact-fields-once'));$(bind).data('pwebcontact-fields-once','');}}
86this.hidden=false;if(this.Toggler.length&&!this.options.togglerHidden){this.Toggler.removeClass('pweb-closed').addClass('pweb-opened');if(this.options.togglerNameClose)
87this.Toggler.find('.pweb-text').text(this.options.togglerNameClose);}
88if(this.options.layout=='slidebox'){var css={width:this.options.slideWidth};css[this.options.position]=0;var maxWidth=$(window).width();if(this.options.position=='left'||this.options.position=='right'){if(this.options.slideWidth+this.options.togglerWidth>maxWidth){css.width=maxWidth-this.options.togglerWidth;}}else{var offset=this.element.offset().left;if(this.options.offsetPosition=='right'){offset=$(document).width()-offset;}
89if(this.options.slideWidth+offset>maxWidth){css.width=maxWidth-offset;}}
90this.Box.stop(true,false).animate(css,this.options.slideDuration,this.options.slideTransition,function(){if(that.options.slidePos=='fixed'){var css={position:'absolute'};if(that.options.position=='left'||that.options.position=='right'){css.top=that.element.offset().top;if(that.Box.height()+that.options.togglerHeight+css.top-$(window).scrollTop()>$(window).height()){css.top=that.element.offset().top;that.element.css(css);}}else if(that.Box.height()+that.options.togglerHeight>$(window).height()){css.top=that.element.offset().top;if(that.options.position=='bottom'){css.bottom='auto';}
91that.element.css(css);}}}).css('overflow','visible').removeClass('pweb-closed');if(this.options.togglerHidden){this.Toggler.fadeIn(this.options.slideDuration);}}else if(this.options.layout=='modal'){if(this.options.modalEffect!='default'&&$(bind).length){this.eventSource=bind;}
92this.Modal.modal('show');}else if(this.options.layout=='accordion'){$(bind).trigger('openAccordion');}
93this.options.onOpen.apply(this);this.element.trigger('onOpen');}},resetForm:function(){if(this.status==3){var that=this;setTimeout(function(){that.status=0;},5000);this.status=4;this.displayMsg('','');if(!this.options.redirectURL)this.ajaxCall('getToken');this.ButtonSend.show();this.Form.find('textarea.pweb-charslimit').each(function(){$('#'+$(this).attr('id')+'-charsleft').text(parseInt($(this).attr('maxlength')));});if(this.validator)
94this.validator.resetForm();if(this.Form.get(0))
95this.Form.get(0).reset();this.Form.find('.invalid').removeClass('invalid');if(this.Box.hasClass('pweb-labels-over'))
96this.Form.find('input.pweb-input,textarea,select').trigger('focus').trigger('blur');if(this.uploader){var files=this.uploader.find('.files');files.find('.cancel,.delete').click();files.empty();this.files=[];this.uploadQueue=0;}
97captcha[this.options.id].status=-1;if(captcha[this.options.id].enabled===true&&!this.options.redirectURL){if(captcha[this.options.id].plugin==='grecaptcha'&&typeof grecaptcha!=='undefined'){var grecaptchaId=$(this.options.selector+'_captcha').data('grecaptchaId');if(typeof grecaptchaId==='number'){grecaptcha.reset(grecaptchaId);}}else if(captcha[this.options.id].plugin==='recaptcha'&&typeof Recaptcha!=='undefined'){Recaptcha.reload();}}}},submitForm:function(){var that=this;if(this.status==1||this.status==2||this.status==3||this.status==5)
98return false;if(this.validator&&!this.validator.form())
99return false;if(this.status==4){var msg=Joomla.JText._('MOD_PWEBCONTACT_SEND_ERR');if(this.options.msgPosition=='popup'){this.displayAlert(msg,'error');}else{this.scrollToMsg();this.displayMsg(msg,'error');}
100return false;}
101this.status=1;this.scrollToMsg();if(this.options.reloadToken)this.ajaxCall('getToken',false);
101if(this.uploader&&!this.options.uploadAutoStart){var uploads=this.uploader.find('.files .pweb-upload-ready');if(uploads.length){this.displayMsg(Joomla.JText._('MOD_PWEBCONTACT_UPLOADING'),'progress');uploads.each(function(index){var data=$(this).data('data');if(typeof data.submit==='function'){data.submit();}});return true;}}
102if(this.status==1)this.ajaxCall('sendEmail');},ajaxCall:function(method,async){var that=this,query={mid:this.options.id,format:'json',ignoreMessages:true};if(method=='sendEmail'){if(this.uploader&&this.files.length&&method=='sendEmail'){query.attachments=this.files;}
103query=decodeURIComponent($.param(query))+'&'+this.Form.serialize();}
104if(typeof async==='undefined')async=true;$.ajax({url:this.options.ajaxUrl+method,type:'POST',cache:false,async:async,data:query,dataType:'json',dataFilter:this.ajaxResponseDataFilter,beforeSend:function(){if(method=='sendEmail'||!async)
105that.displayMsg(Joomla.JText._('MOD_PWEBCONTACT_SENDING'),'progress');}}).done(function(response,textStatus,jqXHR){if(typeof response.data!=='undefined'&&typeof response.data.status!=='undefined'){var data=response.data;if(!async)that.displayMsg('','');if(method=='getToken'){that.options.reloadToken=false;that.Token.attr('name',data.token);}else{if(data.debug){that.debug(data.debug,data.status);}
106if(typeof data.deleted!=='undefined'&&!that.options.reset&&data.deleted&&that.uploader){that.uploader.find('.files').empty();that.files=[];that.uploadQueue=0;}
107if(data.status>=1&&data.status<=199){if(method=='sendEmail'){that.status=3;that.options.onComplete.apply(that,[data]);that.element.trigger('onComplete');if(that.uploader)
108that.uploader.find('.files .pweb-upload-success .delete').remove();switch(that.options.reset){case 1:that.resetForm();break;case 2:that.ButtonSend.hide();break;case 3:that.ButtonSend.hide();that.ButtonReset.show();break;default:that.status=4;setTimeout(function(){that.status=0;},5000);break;}
109if(that.options.msgPosition=='popup'){that.displayAlert(data.msg,'success');data.msg='';}
110that.displayMsg(data.msg,'success');if(that.options.closeAuto){that.autoCloseOnSuccess();}
111if(that.options.redirectURL){that.redirectOnSuccess();}}}else{if(typeof data.invalid!=='undefined'){that.Form.find('.invalid').removeClass('invalid');$.each(data.invalid,function(key,field){var el=$(that.options.selector+'_'+field);if(el.is('input,textarea,select'))el.addClass('invalid');$(that.options.selector+'_'+field+'-lbl').addClass('invalid');});}
112that.options.onError.apply(that,[data]);that.element.trigger('onError');that.status=0;if(data.status>=300&&!that.options.debug){that.status=5;that.ButtonSend.hide();}
113if(that.options.msgPosition=='popup'){that.displayAlert(data.msg,'error');data.msg='';}
114that.displayMsg(data.msg,'error');}}}else{that.displayError(textStatus,jqXHR.responseText.indexOf('<html')===-1?jqXHR.responseText:'');}}).fail(function(jqXHR,textStatus,errorThrown){that.displayError(jqXHR.status+' '+errorThrown,jqXHR.responseText.indexOf('<html')===-1?jqXHR.responseText:'');});},ajaxResponseDataFilter:function(data,type){if(type==='iframe json'&&data&&typeof data==='object'){data=$(data[0].body).text();}
115if(type.indexOf('json')!==-1&&typeof data==='string'&&(data.indexOf('{')!==0||data[data.length-1]!=='}')){var json=data.match(/{"success":.+{"status":[0-9]+(,"[a-z]+":.+)+}}/i);if(json){if(typeof JSON.stringify==='function'){var result=$.parseJSON(json[0]);if(typeof result.data.debug==='undefined'||!result.data.debug)
116result.data.debug=[];result.data.debug.push(data.replace(json[0],' '));data=JSON.stringify(result);}else{data=json[0];}}}
117return data;},captchaExpired:function(){captcha[this.options.id].status=-1;},scrollToMsg:function(){if(this.options.msgScroll&&(this.options.msgPosition=='before'||this.options.msgPosition=='after')){if(this.options.layout=='modal'){var pos=this.options.msgPosition=='after'?this.Box.outerHeight()-$(window).height():0;if(pos>=0)this.Modal.animate({scrollTop:pos},500);}else if(this.element.css('position')!='fixed'){var msgTopOffset=this.Msg.offset().top,msgHeight=this.Msg.height(),winScrollTop=$(window).scrollTop(),wndHeight=$(window).height();if(msgTopOffset<winScrollTop||msgTopOffset+msgHeight>winScrollTop+wndHeight){if(this.options.msgPosition=='before'){var pos=msgTopOffset-100;}else{var pos=msgTopOffset+msgHeight+100-wndHeight;}
118$('html,body').animate({scrollTop:parseInt(pos)},500);}}}},initAutoPopupCookie:function(){if(typeof $.cookie==='function'){var counter=parseInt($.cookie('pwebcontact'+this.options.id+'_openauto'));counter=isNaN(counter)?1:counter+1;
118if(counter<=this.options.maxAutoOpen){$.cookie('pwebcontact'+this.options.id+'_openauto',counter,{domain:this.options.cookieDomain,path:this.options.cookiePath,expires:this.options.cookieLifetime});return true;}}else if(this.options.debug){this.debug('jQuery Cookie Plugin is not loaded');}
119return false;},autoPopupOnPageLoad:function(){if(this.options.openDelay){this.timer=this.delay(this.toggleForm,this.options.openDelay,this,[1]);}else{this.toggleForm(1);}},autoPopupOnPageScroll:function(){var that=this;this.autoOpen=true;$(window).scroll(function(){if(that.autoOpen){that.autoOpen=false;if(that.options.openDelay){that.timer=that.delay(that.toggleForm,that.options.openDelay,that,[1]);}else{that.toggleForm(1);}}});},autoPopupOnPageExit:function(){var that=this;this.autoOpen=-1;$(window).mousemove(function(e){if(that.autoOpen==-1&&e.clientY>70){that.autoOpen=1;}else if(that.autoOpen==1&&e.clientY<30){that.autoOpen=0;if(that.options.openDelay){that.timer=that.delay(that.toggleForm,that.options.openDelay,that,[1]);}else{that.toggleForm(1);}}});},autoCloseOnSuccess:function(){if(this.options.closeDelay){this.timer=this.delay(this.toggleForm,this.options.closeDelay,this,[0]);}else{this.toggleForm(0);}},redirectOnSuccess:function(){var that=this;setTimeout(function(){document.location=that.options.redirectURL;},this.options.redirectDelay*1000);},delay:function(element,delay,bind,args){return setTimeout(function(){return element.apply(bind,args||arguments);},delay);},displayError:function(text,debugHtml){if(!this.options.debug){this.status=5;this.ButtonSend.hide();}else{this.status=0;}
120var msg=Joomla.JText._('MOD_PWEBCONTACT_REQUEST_ERR')+text;if(this.options.msgPosition=='popup'){this.displayAlert(msg,'error');}else{this.displayMsg(msg,'error');}
121if(debugHtml)this.debug(debugHtml);},displayMsg:function(html,type){this.Msg.html(html?html:'&nbsp;').attr('class',type?'pweb-'+type:'');},alertElement:null,displayAlert:function(html,type,heading,close){if(typeof $.fn.alert==='function'){if(this.alertElement){this.alertElement.alert('close');}
122this.alertElement=$('<div class="pweb-alert alert alert-block '+(type?'alert-'+type:'')+'">'
123+'<button data-dismiss="alert" class="close" type="button">&times;</button>'
124+(typeof heading!=='undefined'?'<h4 class="alert-heading">'+heading+'</h4>':'')
125+'<p>'+html+'</p>'
126+'</div>').alert().appendTo(document.body);}else{alert(html.replace('<br>','\r\n'));}},debug:function(html,code){if($.isArray(html)){html=html.join('<br>');}
127if(typeof code!=='undefined'){html=html+'<br>Response code: '+code;}
128this.displayAlert(html,'info','Shack Forms Pro Debug',false);}};})();pwebContact.options=pwebContact.prototype.options;if(typeof Joomla==='undefined'){Joomla={};}
129if(typeof Joomla.JText==='undefined'||typeof Joomla.JText._!=='function'){Joomla.JText={strings:Joomla.JText||{},'_':function(key,def){return typeof this.strings[key.toUpperCase()]!=='undefined'?this.strings[key.toUpperCase()]:def;},load:function(object){for(var key in object){this.strings[key.toUpperCase()]=object[key];}
130return this;}};}})(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.