{:uriI"·file:///Users/mbeizer/Sites/bookends/app/assets/javascripts/newsletter.js?type=application/javascript&pipeline=self&id=9a97c8d5e8a1c1666a0e0c07f796d9e428293ae76780f439697ffa869ad3ad88:ET:load_pathI"9/Users/mbeizer/Sites/bookends/app/assets/javascripts;T: filenameI"G/Users/mbeizer/Sites/bookends/app/assets/javascripts/newsletter.js;T: nameI"newsletter;T:logical_pathI"newsletter.self.js;T:content_typeI"application/javascript;T:sourceI"var Heroku = Heroku || {}; var bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }; Heroku.NewsletterSignup = (function() { function NewsletterSignup() { this.handleSubmit = bind(this.handleSubmit, this); this.$container = $('#bookends-newsletter'); this.$honeyPot = this.$container.find('#bookends-website'); this.$input = this.$container.find('input[type=email]'); this.$submit = this.$container.find(':submit'); this.$resultContainer = $('#bookends-newsletter-result'); this.$container.on('submit', this.handleSubmit); } NewsletterSignup.prototype.handleSubmit = function(e) { var val; var self; e.preventDefault(); if(this.$honeyPot.val() !== '') { return this.handleSuccess(); } val = this.$input.val(); self = this; $.ajax({ url: 'https://www.heroku.com/newsletter_signups', type: 'POST', crossDomain: true, data: { newsletter_signup: { email: val } } }) .done(function(res) { return self.handleSuccess(); }) .fail(function(err) { return self.handleFailure(); }); }; NewsletterSignup.prototype.handleSuccess = function() { this.$input.replaceWith('
Check your email now to confirm your sign-up.
'); }; NewsletterSignup.prototype.handleFailure = function() { this.$input.val(""); this.$resultContainer .removeClass('hide') .text('There was an error registering you. Please refresh.'); }; return NewsletterSignup; })(); ;T: metadata{:dependencieso:Set: @hash{ I"environment-version;TTI"environment-paths;TTI"rails-env;TTI"Zprocessors:type=application/javascript&file_type=application/javascript&pipeline=self;TTI"Ufile-digest:///Users/mbeizer/Sites/bookends/app/assets/javascripts/newsletter.js;TT: requiredo;;{ :stubbedo;;{ : linkso;;{ :charsetI" utf-8;F:digest"% Þ%8^g¥¥åjr7'É€V¹D)Ô@©ۧÉQÍŽú:lengthi:dependencies_digest"%ÎEIp¤Ì[7¨mís¡PÁRÁh`mUÒÓS›@´:idI"E9a97c8d5e8a1c1666a0e0c07f796d9e428293ae76780f439697ffa869ad3ad88;F: mtimel+á¬W