-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpigeonfarm-min.js
6 lines (6 loc) · 5.33 KB
/
pigeonfarm-min.js
1
2
3
4
5
6
(function(){var i;window.PigeonFarm=function(c){var g,d,e,a,j,p,k,l,f,m,n,o;if(jQuery&&c&&c.container){d={};a={};e=c.email_label!=null?c.email_label:"Email:";f=c.subject_label!=null?c.subject_label:"Subject:";if(e)e="<label for='pf-contact-sender'>"+e+"</label> ";if(f)f="<label for='pf-contact-subject'>"+f+"</label> ";j=function(){var b;b=true;d.sender=a.sender.val();d.subject=a.subject.val();d.body=a.body.val();if(!n(d.sender)){b=false;a.sender.addClass("pf-error");a.sender_status.addClass("pf-error");
a.sender_status.css({visibility:"visible"})}if(!o(d.subject)){b=false;a.subject.addClass("pf-error");a.subject_status.addClass("pf-error");a.subject_status.css({visibility:"visible"})}if(!m(d.body)){b=false;a.body.addClass("pf-error");a.status.addClass("pf-error");a.status.text("Please enter a message");a.status.css({visibility:"visible"})}return b};n=function(b){return/^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/.test(b)};o=function(b){return b!==""};m=function(b){return b!==""};
g=function(){return jQuery(this).removeClass("pf-error")};k=function(){var b;a.sender_status.css({visibility:"hidden"});a.subject_status.css({visibility:"hidden"});a.status.css({visibility:"hidden"});a.spinner.show();if(j()){b={site:c.site,key:c.key,sender:d.sender,subject:d.subject,body:d.body};return jQuery.get(""+c.server+"/inbound/",b,function(h){if(h.status!=null&&h.status==="success")l();else{a.status.addClass("pf-error");a.status.text("There was a problem. Please try again.");a.status.css({visibility:"visible"})}c.callback!=
null&&typeof c.callback==="function"&&c.callback(h);return a.spinner.hide()},"jsonp")}else return a.spinner.hide()};l=function(){var b;b=c.success_message!=null?c.success_message:"Success! Your message has been sent. We will get back to you as soon as possible.";return jQuery(c.container).html(b)};(function(){var b;b=""+e+"<input id='pf-contact-sender' type='text' placeholder='your email address'><span id='pf-contact-sender-status' style='visibility:hidden;'>Please enter a valid email address</span><br />\n"+
f+"<input id='pf-contact-subject' type='text' placeholder='subject'><span id='pf-contact-subject-status' style='visibility:hidden;'>Please enter a subject</span><br />\n<textarea id='pf-contact-body' placeholder='message'></textarea><br />\n<button id='pf-contact-send'>send »</button><img id='pf-contact-spinner' src='"+i+"' style=display:none;/>\n<span id='pf-contact-general-status' style='visibility:hidden;'></span>";jQuery(c.container).append(b);a.status=jQuery("#pf-contact-general-status");
a.sender=jQuery("#pf-contact-sender");a.sender_status=jQuery("#pf-contact-sender-status");a.subject=jQuery("#pf-contact-subject");a.subject_status=jQuery("#pf-contact-subject-status");a.body=jQuery("#pf-contact-body");a.send=jQuery("#pf-contact-send");a.spinner=jQuery("#pf-contact-spinner");a.send.click(k);a.sender.focus(g);a.subject.focus(g);return a.body.focus(g)})();return this}};i="data:image/gif;base64,R0lGODlhEAAQAPQAAP///wAAAPDw8IqKiuDg4EZGRnp6egAAAFhYWCQkJKysrL6+vhQUFJycnAQEBDY2NmhoaAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH/C05FVFNDQVBFMi4wAwEAAAAh/hpDcmVhdGVkIHdpdGggYWpheGxvYWQuaW5mbwAh+QQJCgAAACwAAAAAEAAQAAAFdyAgAgIJIeWoAkRCCMdBkKtIHIngyMKsErPBYbADpkSCwhDmQCBethRB6Vj4kFCkQPG4IlWDgrNRIwnO4UKBXDufzQvDMaoSDBgFb886MiQadgNABAokfCwzBA8LCg0Egl8jAggGAA1kBIA1BAYzlyILczULC2UhACH5BAkKAAAALAAAAAAQABAAAAV2ICACAmlAZTmOREEIyUEQjLKKxPHADhEvqxlgcGgkGI1DYSVAIAWMx+lwSKkICJ0QsHi9RgKBwnVTiRQQgwF4I4UFDQQEwi6/3YSGWRRmjhEETAJfIgMFCnAKM0KDV4EEEAQLiF18TAYNXDaSe3x6mjidN1s3IQAh+QQJCgAAACwAAAAAEAAQAAAFeCAgAgLZDGU5jgREC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