🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
DemoInstallSign in
Socket

email_name_textfield

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

email_name_textfield

0.0.2
Rubygems
Version published
Maintainers
1
Created
Source

EmailNameTextfield

Text area entry tool that allows you to paste e-mail names and addresses from common mail clients such as Gmail, Yahoo! and Outlook. This tool will recognize the pasted input and parse out the first and last name as well as validating the e-mail address.

Demo

Requirements

  • Rails
  • JQuery
  • CoffeeScript
  • Backbone.js
  • Underscore.js

Installation

Add this line to your application's Gemfile:

gem 'email_name_textfield'

And then execute:

$ bundle

Add this line to your application.js file after the lines that require Backbone.js and Underscore.js:

//= require email_name_textfield

Include the css file in your application.css file:

@import "email_name_textfield";

Usage

Reference this text area by creating a new object:

myemailnamefield = new EmailNameTextField.EmailInputAreaView(placeholder: "email@address.com")

The placeholder text is simply the text that will appear by default when no e-mail addresses are shown.

Now, render this object to your view:

$("mydiv").html(myemailnamefield.render())

Emails will be immediately validated upon pasting or losing the focus on the text area.

To access the resulting list of emails and names call:

myemailnamefield.name_data()

Result will be an array of JSON objects in the format of:

{ firstName: "Mary", lastName: "Smith", email: "msmith@example.com" }

Supported email formats

  • Gmail - "Mary Smith" msmith@example.com
  • Yahoo! - Mary Smith msmith@example.com
  • Outlook - Smith, Mary msmith@example.com
  • Hotmail - Mary Smith(msmith@example.com)

Other formats

Contributing

  • Fork it
  • Create your feature branch (git checkout -b my-new-feature)
  • Commit your changes (git commit -am 'Add some feature')
  • Push to the branch (git push origin my-new-feature)
  • Create new Pull Request

FAQs

Package last updated on 16 May 2013

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts