npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

phonenumbers

v1.0.2

Published

The jQuery.PhoneNumbers plugin automatically detects phone numbers on the page and makes them clickable for dialing.

Downloads

94

Readme

jQuery PhoneNumbers

The jQuery.PhoneNumbers plugin automatically detects phone numbers on the page and makes them clickable for dialing. This functionality is primarily useful for mobile, but jQuery.PhoneNumbers also supports any platform. Fully customizable, easy to use and setup, very lightweight.

This plugin is distributed as is, and does not include any official support. However, if you come across an issue or need any assistance deploying exLink, just let me know! I'd be happy to help.

Also, if you'd like to contribute to the plugin, that's cool too. Just fork and start creating!

Current Version: 1.0.2

Release Date: April 29, 2015

Usage

PhoneNumbers is incredibly light weight, and very easy to setup. This plugin will function without anything beyond jQuery.

1). Include the required Javascript.


<script type="text/javascript" src="/PhoneNumbers/jquery.PhoneNumbers.min.js"></script>

To download using npm, just run this command from your project directory:


sudo npm install phonenumbers

2). After the required files have been included in your document, usage is incredibly easy! For the default case, just initiate the jQuery.PhoneNumbers plugin. This uses all of the default options.


$.fn.PhoneNumbers();

If you'd like to customize the plugin (which most people do), then you'll need to specify the options you want to change. Here is an initialization with ALL possible options.


$.fn.PhoneNumbers({
 	pattern: /((\d{1} ((\(\d{3}\)|\d{3})| (\(\d{3}\))) |(\(\d{3}\)) ?)|(\d{3}-))?\d{3}-\d{4}/g,
	protocol: 'tel://',
	linkColor: '#ffffff',
	linkDecoration: 'underline',
	target: ['#div', '.class'],
	mobileOnly: true
});

Options

######Functionality Options

pattern - The PhoneNumbers plugin uses a RegEx to detect all phone numbers listed on the page in many of the most popular US formats. You can use a custom RegEx with jQuery.PhoneNumbers by passing your RegEx through this option.

protocol - This determines which telephone protocol to use for the link. tel:, or tel://. This is a string, set to tel:// by default. Ex: protocol: 'tel://'

target - An array containing the elements you would like to scan for numbers.

mobileOnly - This option determines which platform you want th elinks to be clickable on. If set to false, the plugin will ignore the platform and make all numbers call links. If set to true, the plugin will only initialize if the user is on a mobile device. This is a boolean value set to true by default. Ex: mobileOnly: true

######Visual Options

linkColor - The color of the call link. This is a string (containing a hex value) left blank by default. Ex: linkColor: '#fff'

linkDecoration - Set the style of the link decoration. This is a string value set to underline by default. All CSS values accepted. Ex: linkDecoration: 'underline'

Connect & Support Stuffs

If you find this plugin useful (or don't), need some help with it or just want to connect with me, please do so!