var settings = (function () { var exports = {}; var streams = []; function add_bot_row(name, email, avatar_url, api_key) { var info = { name: name, email: email, avatar_url: avatar_url, api_key: api_key }; var row = $(templates.render('bot_avatar_row', info)); $('#bots_list').append(row); $('#bots_list').show(); } function is_local_part(value, element) { // Adapted from Django's EmailValidator return this.optional(element) || /^[\-!#$%&'*+\/=?\^_`{}|~0-9A-Z]+(\.[\-!#$%&'*+\/=?\^_`{}|~0-9A-Z]+)*$/i.test(value); } function build_stream_list($select) { $select.empty(); _.each(_.pluck(streams, 'name'), function (name) { $select.append($('