(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o= 400 && status < 600)) { var message = (typeof body === "string" ? body : false) || messages[String(status).charAt(0)] error = new Error(message) error.statusCode = status } return error } // will load the data & process the response in a special response object function loadResponse() { var status = getStatusCode() var error = errorFromStatusCode(status) var response = { body: getBody(), statusCode: status, statusText: xhr.statusText, raw: xhr } if(xhr.getAllResponseHeaders){ //remember xhr can in fact be XDR for CORS in IE response.headers = parseHeaders(xhr.getAllResponseHeaders()) } else { response.headers = {} } callback(error, response, response.body) } // will load the data and add some response properties to the source xhr // and then respond with that function loadXhr() { var status = getStatusCode() var error = errorFromStatusCode(status) xhr.status = xhr.statusCode = status xhr.body = getBody() xhr.headers = parseHeaders(xhr.getAllResponseHeaders()) callback(error, xhr, xhr.body) } function error(evt) { callback(evt, xhr) } } function noop() {} },{"global/window":"/Users/jloi/code/Squatconf/website/node_modules/load-svg/node_modules/xhr/node_modules/global/window.js","once":"/Users/jloi/code/Squatconf/website/node_modules/load-svg/node_modules/xhr/node_modules/once/once.js","parse-headers":"/Users/jloi/code/Squatconf/website/node_modules/load-svg/node_modules/xhr/node_modules/parse-headers/parse-headers.js"}],"/Users/jloi/code/Squatconf/website/node_modules/load-svg/node_modules/xhr/node_modules/global/window.js":[function(require,module,exports){ (function (global){ if (typeof window !== "undefined") { module.exports = window; } else if (typeof global !== "undefined") { module.exports = global; } else { module.exports = {}; } }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) },{}],"/Users/jloi/code/Squatconf/website/node_modules/load-svg/node_modules/xhr/node_modules/once/once.js":[function(require,module,exports){ module.exports = once once.proto = once(function () { Object.defineProperty(Function.prototype, 'once', { value: function () { return once(this) }, configurable: true }) }) function once (fn) { var called = false return function () { if (called) return called = true return fn.apply(this, arguments) } } },{}],"/Users/jloi/code/Squatconf/website/node_modules/load-svg/node_modules/xhr/node_modules/parse-headers/node_modules/for-each/index.js":[function(require,module,exports){ var isFunction = require('is-function') module.exports = forEach var toString = Object.prototype.toString var hasOwnProperty = Object.prototype.hasOwnProperty function forEach(list, iterator, context) { if (!isFunction(iterator)) { throw new TypeError('iterator must be a function') } if (arguments.length < 3) { context = this } if (toString.call(list) === '[object Array]') forEachArray(list, iterator, context) else if (typeof list === 'string') forEachString(list, iterator, context) else forEachObject(list, iterator, context) } function forEachArray(array, iterator, context) { for (var i = 0, len = array.length; i < len; i++) { if (hasOwnProperty.call(array, i)) { iterator.call(context, array[i], i, array) } } } function forEachString(string, iterator, context) { for (var i = 0, len = string.length; i < len; i++) { // no such thing as a sparse string. iterator.call(context, string.charAt(i), i, string) } } function forEachObject(object, iterator, context) { for (var k in object) { if (hasOwnProperty.call(object, k)) { iterator.call(context, object[k], k, object) } } } },{"is-function":"/Users/jloi/code/Squatconf/website/node_modules/load-svg/node_modules/xhr/node_modules/parse-headers/node_modules/for-each/node_modules/is-function/index.js"}],"/Users/jloi/code/Squatconf/website/node_modules/load-svg/node_modules/xhr/node_modules/parse-headers/node_modules/for-each/node_modules/is-function/index.js":[function(require,module,exports){ module.exports = isFunction var toString = Object.prototype.toString function isFunction (fn) { var string = toString.call(fn) return string === '[object Function]' || (typeof fn === 'function' && string !== '[object RegExp]') || (typeof window !== 'undefined' && // IE8 and below (fn === window.setTimeout || fn === window.alert || fn === window.confirm || fn === window.prompt)) }; },{}],"/Users/jloi/code/Squatconf/website/node_modules/load-svg/node_modules/xhr/node_modules/parse-headers/node_modules/trim/index.js":[function(require,module,exports){ exports = module.exports = trim; function trim(str){ return str.replace(/^\s*|\s*$/g, ''); } exports.left = function(str){ return str.replace(/^\s*/, ''); }; exports.right = function(str){ return str.replace(/\s*$/, ''); }; },{}],"/Users/jloi/code/Squatconf/website/node_modules/load-svg/node_modules/xhr/node_modules/parse-headers/parse-headers.js":[function(require,module,exports){ var trim = require('trim') , forEach = require('for-each') , isArray = function(arg) { return Object.prototype.toString.call(arg) === '[object Array]'; } module.exports = function (headers) { if (!headers) return {} var result = {} forEach( trim(headers).split('\n') , function (row) { var index = row.indexOf(':') , key = trim(row.slice(0, index)).toLowerCase() , value = trim(row.slice(index + 1)) if (typeof(result[key]) === 'undefined') { result[key] = value } else if (isArray(result[key])) { result[key].push(value) } else { result[key] = [ result[key], value ] } } ) return result } },{"for-each":"/Users/jloi/code/Squatconf/website/node_modules/load-svg/node_modules/xhr/node_modules/parse-headers/node_modules/for-each/index.js","trim":"/Users/jloi/code/Squatconf/website/node_modules/load-svg/node_modules/xhr/node_modules/parse-headers/node_modules/trim/index.js"}],"/Users/jloi/code/Squatconf/website/node_modules/valid-email/index.js":[function(require,module,exports){ module.exports = require('./lib/valid-email'); },{"./lib/valid-email":"/Users/jloi/code/Squatconf/website/node_modules/valid-email/lib/valid-email.js"}],"/Users/jloi/code/Squatconf/website/node_modules/valid-email/lib/valid-email.js":[function(require,module,exports){ /*! * Valid Email * Copyright(c) 2013 John Henry * MIT Licensed */ /** * Valid-Email: * * An alternative to using a regular expression to validate email. * Inspired by: * http://stackoverflow.com/questions/997078/email-regular-expression * http://stackoverflow.com/questions/201323/using-a-regular-expression-to-validate-an-email-address * * Examples: * console.log(require('valid-email')('john@iamjohnhenry.com'))//#true * console.log(require('valid-email')('iamjohnhenry.com'))//#false * * @param {String} email * // potential email address * @return {Boolean} * @api public */ module.exports = function valid(email){ var at = email.search("@"); if (at <0) return false; var user = email.substr(0, at); var domain = email.substr(at+1); var userLen = user.length; var domainLen = domain.length; if (userLen < 1 || userLen > 64) return false;// user part length exceeded if (domainLen < 1 || domainLen > 255) return false;// domain part length exceeded if (user.charAt(0) === '.' || user.charAt(userLen-1) === '.') return false;// user part starts or ends with '.' if (user.match(/\.\./)) return false;// user part has two consecutive dots if (!domain.match(/^[A-Za-z0-9.-]+$/)) return false;// character not valid in domain part if (domain.match( /\\.\\./)) return false;// domain part has two consecutive dots if (!user.replace("\\\\","").match(/^(\\\\.|[A-Za-z0-9!#%&`_=\\/$\'*+?^{}|~.-])+$/)) if (!user.replace("\\\\","").match(/^"(\\\\"|[^"])+"$/)) return false return true; } },{}],"/Users/jloi/code/Squatconf/website/src/email-client.js":[function(require,module,exports){ (function (process){ var ready = require('domready') , check_email = require('valid-email') , loadsvg = require('load-svg') process.nextTick(function() { ready(function() { var form = document.getElementById('signup-form') , input_email = '' , status_msg = document.getElementById('status-msg') , logoCont = document.getElementById('logoCont') loadsvg('/assets/img/squatconf_baguette.svg', function (err, svg) { logoCont.appendChild(svg); }); for (var n = 0, l = form.childNodes[1].childNodes.length; n < l; n++) { var el = form.childNodes[1].childNodes[n] if (el.nodeName === 'INPUT' && el.name === 'email') input_email = el } document .getElementById("signup-form") .addEventListener("click", function(e) { if (e.srcElement.nodeName === 'BUTTON') { if (input_email && input_email.value) { var is_valid = check_email(input_email.value) if (is_valid) { var progress = 0 , timerID = null e.preventDefault() status_msg.className = 'info' status_msg.innerHTML = "Sending" timerID = setInterval(function() { if (++progress < 8) { status_msg.innerHTML += "." } else { clearInterval(timerID) form.submit() } }, 150) } else { e.preventDefault() input_email.value = '' status_msg.className = 'error' status_msg.innerHTML = "that doesn't look like an email address," + "
please try again..." setTimeout(function() { status_msg.innerHTML = ' ' }, 2000) } } } }) }) }) }).call(this,require('_process')) },{"_process":"/usr/local/lib/node_modules/watchify/node_modules/browserify/node_modules/process/browser.js","domready":"/Users/jloi/code/Squatconf/website/node_modules/domready/ready.js","load-svg":"/Users/jloi/code/Squatconf/website/node_modules/load-svg/index.js","valid-email":"/Users/jloi/code/Squatconf/website/node_modules/valid-email/index.js"}],"/usr/local/lib/node_modules/watchify/node_modules/browserify/node_modules/process/browser.js":[function(require,module,exports){ // shim for using process in browser var process = module.exports = {}; process.nextTick = (function () { var canSetImmediate = typeof window !== 'undefined' && window.setImmediate; var canPost = typeof window !== 'undefined' && window.postMessage && window.addEventListener ; if (canSetImmediate) { return function (f) { return window.setImmediate(f) }; } if (canPost) { var queue = []; window.addEventListener('message', function (ev) { var source = ev.source; if ((source === window || source === null) && ev.data === 'process-tick') { ev.stopPropagation(); if (queue.length > 0) { var fn = queue.shift(); fn(); } } }, true); return function nextTick(fn) { queue.push(fn); window.postMessage('process-tick', '*'); }; } return function nextTick(fn) { setTimeout(fn, 0); }; })(); process.title = 'browser'; process.browser = true; process.env = {}; process.argv = []; function noop() {} process.on = noop; process.addListener = noop; process.once = noop; process.off = noop; process.removeListener = noop; process.removeAllListeners = noop; process.emit = noop; process.binding = function (name) { throw new Error('process.binding is not supported'); } // TODO(shtylman) process.cwd = function () { return '/' }; process.chdir = function (dir) { throw new Error('process.chdir is not supported'); }; },{}]},{},["/Users/jloi/code/Squatconf/website/src/email-client.js"]);