Useful JavaScript Libraries and jQuery Plugins — Part 2

If you have a problem and need a solution for it, chances are high that a JavaScript library or jQuery plugin exists that was created to solve this very problem. Such libraries are always great to have in your bookmarks or in your local folders, especially if you aren’t a big fan of cross-browser debugging.

In this overview, we feature some of the recent useful JavaScript and jQuery libraries which could be just the right solutions for your common problems. You might know some of these libraries, but you probably don’t know most of them. In either case, we hope that this overview will help you find or rediscover some tools that you could use in your next projects.

Due to the length of this post, we’ve split it into two parts for your convenience:

QUICK OVERVIEW:

Below you’ll find a brief overview and links to the libraries and tools featured in this post.

Text Manipulation Libraries

Prism
A lightweight and extensible syntax highlighter. There are no Prism-specific markup or class names, you can use the standard markup. Prism supports parallelism with Web workers, if available. All styling is done through CSS, with sensible class names like .comment.string.property etc. The overall core core size is only 1.5Kb (minified and gzipped).

Prism

TOC jQuery Plugin: Generate Tables Of Contents
This library automatically generates and guides the user through a table of contents on a page. It’s customizable and is able to automatically highlight a current section of the document. The plugin is also very lightweight, can be used multiple times on a page, and even includes a smooth scrolling functionality for the correct section. The plugin is developed by Greg Allen and is currently available in beta. You might want to check out Tocify jQuery plugin as well.

JavaScript Library

MagicNav: Generates Links for The FAQ
If you want to create a quick navigation for your FAQ page, you can use this jQuery plugin for generating navigation links dynamically from page elements.

Cutter.js
This library solves the problem when cutting content by a number of words is required but you don’t want to change the markup. It simply cuts the content to the required length, while allowing the user to see the full content again.

Trunk8
Trunk8 is a text truncation jQuery plugin that cuts off just enough text from a large block of text to prevent it from spilling over. While conventional truncation just limits the character length, this library is able to measure the content area for spill-over and chooses the text that best fits into a given space.

Relevancy.js
This library allows you to sort an array of items based on their relevancy. This script is attempting to implement basic partial matching which so far has not been successfully implemented. It assigns strings to their respective elements.

Manipulating Tables and Lists

Handsontables: Excel-Like Tables For The Web
This jQuery library allows you to use auto-expanding and auto-complete as well as add new rows and columns. It also includes a legend, scrolling (so as your table grows, it won’t take up your entire page and become unwieldy), context menus, conditional formatting and other features. You can even set it to track changes made to the table. And, all the data you enter in Handsontable can be copied and pasted to Excel, Google Spreadsheet, or LibreOffice.

JavaScript Library

List.js
A cross-browser native JavaScript library that transforms HTML lists into flexible content that you can easily edit. It makes your list easily searchable and sortable. A template-driven concept lets you simply add and edit items.

List.js

Create Nested Sortable Lists With jQuery
This plugin lets you create a sortable list where your users can drag and drop list items into any configuration they choose. You can set various attributes, such as the maximum number of nested levels, as well as setting custom methods (including To hierarchy, To array, and Serialize). As an alternative, there’s also the HTML5 Sortable plugin, which uses HTML5 and jQuery for a similar functionality.

JavaScript Library

Pivot.js
With Pivot you can easily summarize large data sets on the fly. The library lets you create customizable table views from your browser. The results of pivot-table tools (which automatically sort, count, total or give the average) will be displayed as an HTML table pivoting from the input data (CSV or JSON).

Pivot.js

Crossfilter
Crossfilter is a JavaScript library which supports exploring large multivariate datasets in the browser. It enables fast (<30ms) interaction with coordinated views, even with large data sets containing more than a million records. It was built to power analytics for Square Register and allows merchants to slice and dice their payment history fluidly. By using sorted indexes, the library speeds up incremental filtering and thereby increases the performance of live histograms and top-K lists.

Crossfilter

jQuery CSV to Table
This library reads in comma separated values (CSV) or tab separated values (TSV) data and generates an HTML table.

jQuery CSV to Table

Csonv.js
Paul Engel has released a tiny library to fetch relational CSV data client-side (JSON). When using CSV, one file represents one entity; the librarycan also nest relational data within the resulting objects as if you are joining SQL tables.

DataTables jQuery Plug-in
The library can display data from different sources, be it DOM, a JavaScript array, or a server-side file with JSON formatting. Among other features, the library provides pagination, on-the-fly filtering, and multi-column sorting with data type detection. And the features that DataTables provides can be enhanced by many freely available plug-ins: e.g. with row grouping, column filtering, column resizer, etc. The library weighs 68Kb minified, and 20Kb gzip’d. Open source, and released under GPL and BSD.

JavaScript Library

Useful JavaScript Tools for Web Development

Yeoman
Yeoman is a set of tools and libraries that helps to scaffold new projects, automatically compiles CoffeeScript & Compass, runs yours scripts against jshint for proper language coverage and optimizes all your images. It effectively uses plugins like NodeJS, Compass, Grunt and PhantomJS and actually requires the installation of Node 0.8.x.

JavaScript Library

Grunt.js: Task-Based Command Line Tool
Grunt is a task-based command line build tool for JavaScript projects. It has a dozen of predefined tasks built-in already: file concatenation, project scaffolding from a predefined template, validation with JSHint, minifcation with UglifyJS, qUnit tests, server start, running unit tests with nodeunit and running watched files.

Grunt.js: Task-Based Command Line Tool

Holder.js
A client-side image placeholder library to render placeholders entirely in browser. It works both online and offline, and offers a chainable API to style and create placeholders with ease. You can use Holder in different areas on different images with custom themes. Since it extends its default settings with the settings you provide, you only have to include those settings which you want changed.

Holder.js

PxLoader
A JavaScript library that makes it easier to download images, sound files or any other file needed before taking an action on your website. The script lets you set up a preloader for HTML5 games and websites. You can monitor download status and even prioritize downloads in tagged groups.

PxLoader

Percentage Loader
With this jQuery plugin the common horizontal progress bar is displayed differently. The script uses HTML5 canvas and data URI encoding (vector graphics) to allow for visually appealing and variably sizable graphics. Also, it can be used to display feedback during long-running tasks.

Percentage Loader

Resumable.js
The library is designed to introduce fault-tolerance into the upload of large files through HTTP. It thus provides multiple, simultaneous and resumable uploads through the HTML5 File API. That means, losing the networks connection doesn’t require a completely new upload. Users can also manage their uploads without loss of data. However, due to the reliance on the HTML5 File API, support is currently limited to Firefox 4+ and Chrome 11+.

History.js
The library gracefully supports the HTML5 History/State APIs (pushStatereplaceStateonPopState) in all browsers. Including continued support for data, titles, replaceState. Supports jQuery, MooTools and Prototype. You can modify the URL directly, without needing to use hashes.

Jurlp
Jurlp is a jQuery URL parser plugin for parsing, manipulating, filtering and monitoring URLs in hrefand src attributes within arbitrary elements, as well as creating anchor elements from URLs found in HTML or text.

Jurlp

URI.js
To work with URLs you could use this JavaScript library, that offers a jQuery-like API. URI.js offers simple, yet powerful ways of working with query string, has a number of URI-normalization functions and converts relative/absolute paths.

Touchy.js
A JavaScript library which handles touch events without any dependencies. It’s an easy way to assign hand functionality for touchscreen devices to your website. You might want to check outHammer.js as well.

Touchy.js

gridster.js
A jQuery plugin that allows building intuitive draggable layouts from elements spanning multiple columns. You can even dynamically add and remove elements from the grid. It is on par with sliced bread, or possibly better. MIT licensed.

gridster.js

Freetile
A jQuery plugin that enables you to organize the page content in a dynamic and responsive layout. Once applied to a container element, it attempts to arrange its children in a layout that makes optimal use of screen space, by “packing” them in a tight arrangement.

Freetile.js

Strapdown.js
This tool makes it easy for you to embed a Markdown editor into your page. No server-side compilation required. The tool is cross-browser-compatible and has Github-style syntax highlighting.

Strapdown.js

accessifyhtml5.js
Eric Eggert has released a practical polyfill to make HTML5 more accessible. Most modern browsers work fine with HTML5′s new semantic elements, however, they often lack the ARIA accessibility attributes that the specification demands. This small script adds those attributes to enhance accessibility of web sites.

accessifyhtml5.js

jQuery++
An MIT-licensed collection of useful DOM helpers such as jQuery.cookie, jQuery.formParams, jQuery.within and special events for jQuery 1.7 that provide low-level utilities for features that jQuery doesn’t support. You can download a variety of plugins you might wish to use and disregard the rest.

jQuery++

Hogan.js
Twitter’s templating engine that lets you precompile your templates ahead of time for vanilla JavaScript. This engine was developed with Mustache test suite compatibility and performance in mind.

Zepto.js
Zepto is a lightweight JavaScript library with a largely jQuery-compatible API. The main purpose of the library is to cover the most important jQuery functions yet have a relatively small modular library that loads and executes fast, with a familiar and versatile API. If you use jQuery, you already know how to use Zepto. You might want to check Mini.js and CreateJS as well if you are looking for simple and lightweight JavaScript libraries to perform very specific tasks.

Zepto.js

CSSrefresh
A useful small script file that immediately implements changes on your browser made to your CSS-files, by surveying the CSS files in your Web page. Saved CSS-files are executed right away.

CSSrefresh

Has.js
Instead of browser sniffing and feature inference, this library provides a collection of self-contained tests and a unified framework using pure feature detection for whatever library consumes it. Make sure to consider other alternatives, too.

Filepicker.io
An advanced solution for uploading files to the server as well as conversion, synchronization and integration of file uploads with services such as Facebook, Dropbox etc. A free plan is available.

Filepicker.io

XRegExp
An open source MIT licensed JavaScript library, XRegExp provides augmented, extensible regular expressions. The library provides a new syntax, flags, and methods beyond what browsers support natively. Also, take a look at Matches.js, an advanced pattern matching library for JavaScript.

XRegExp

FrameWarp
This library helps you to show pages on your site with a CSS-driven transition effect. It has a helper function which compares the URL of the iframe with the address of the current page. If both the domain and the protocol match, Framewarp will try to access the DOM of the iframe and add the APU methods – one for hiding it, and another one for sending a message to the parent.

Filer.js
Eric Bidelman released a wrapper library for the HTML5 Filesystem API. Filer.js reuses familiar UNIX commands and makes the HTML5 API more approachable for developers that have done file I/O in other languages. Repetitive operations (renaming, moving, duplicating) are easier to manage. You might want to check out DownloadBuilder.js, a library that supports concatenation of local files and uses session storage to cache Ajax/JSONP requests.

Filer.js

Client Side Caching For JavaScript
Server caching is useful for quick response times, but sometimes, especially when you are developing a Web application, you migh need to cache objects client-side rather than server-side. Maybe you need to cache something for offline use, or for reuse later. That’s where locache.jscomes in. It’s a JavaScript caching framework for client side caching in the browser using HTML5 local storage. The library has a memcache-similar API, no dependencies and is very small. And the best part: locache gracefully degrades when the browser doesn’t support local storage. So users with IE6 and IE7 will not get any errors, but as developers say, “caching attempts will be silently dropped and lookups will always appear to be a cache miss.” You can provide an expiration time for cached objects as well.

JavaScript Library

Last Click

ReView.js
This library provides a responsive Web design viewing choice. Users can either “opt-in” or “opt-out” of responsive design states and keep the persistent view preference for each session. Developed in pure JavaScript according to the principles of core (mobile-) first progressive enhancement. You might want to check FlexiNavCalc as well, a responsive navigation library that calculates navigation item widths in percentages to ensure that the navigation holds the layout until a break-point is executed.

JavaScript Library

A Hotline For All Your JavaScript Problems
Do you feel like giving up? Nothing makes sense anymore? Your problems seem insurmountable? Wouldn’t it be great if you could talk to someone who cares and knows your woes? Why don’t you give the friendly, supporting folk at JS Hotline a call when your JavaScript wisdom is at an end? Garann Means created JS Hotline as a helpline for people who are stuck with a JavaScript problem. This call-service powered by Pocket Hotline promises professional help to people who need advice concerning JavaScript. They’ll talk you off the ledge when you just can’t make it work. And it won’t cost you anything but a smile.

JavaScript Library

Publicités

Useful JavaScript Libraries and jQuery Plugins Part 1

If you have a problem and need a solution for it, chances are high that a JavaScript library or jQuery plugin exists that was created to solve this very problem. Such libraries are always great to have in your bookmarks or in your local folders, especially if you aren’t a big fan of cross-browser debugging.

A JavaScript library isn’t always the best solution: it should never be a single point of failure for any website, and neither should a website rely on JavaScript making the content potentially inaccessible. Progressive enhancement is our friend; sometimes JavaScript won’t load properly, or won’t be supported — e.g. users of mobile devices might run into latency issues or performance issues with some JavaScript-libraries. Often large all-around JavaScript libraries such as jQuery might be an overkill, while tiny JavaScript micro-libraries could serve as good, “light” alternatives for a particular problem. We’ll present some of them today.

In this two-part overview, we feature some of the most useful JavaScript and jQuery librarieswhich could be just the right solutions for your common problems. You might know some of these libraries, but you probably don’t know all of them. In either case, we hope that this overview will help you find or rediscover some tools that you could use in your next projects.

Due to the length of this post, we’ve split it into two parts for your convenience:

QUICK OVERVIEW:

Below you’ll find a brief overview and links to the libraries and tools featured in this post. They are supposed to help you find just the right tool quickly without browsing the whole page.

Web Forms and Input Validation

Select2 jQuery Plugin
A jQuery-plugin for replacement and enhancement of <select>-boxes. The plugin supports search, remote data sets, and infinite scrolling of results. Users can just start typing what they’re looking for. Non-matching entries are removed from the view, and options can be selected using “Enter” or a mouse click. The plug-in works with standard select input fields as well as with multiple selects andoptgroup. It also has support for selecteddisabled and default text (HTML5’s placeholderattribute). The plug-in is based on Chosen, an alternative solution which is currently available in jQuery, MooTools and Prototype flavors and as a Drupal 7 module.

 

JavaScript Library

jQueryCoreUISelect
Another cross-browser solution to enhance the <select> element with jQuery and CSS. Requires jQuery 1.6 or higher. It provides full customization, support of optiongroup, automatic calculations, keyboard support, callback functions and is compatible with mobile devices.

jQueryCoreUISelect

Sisyphus.js
This script allows Gmail-like auto-saving of drafts. It stores form data to the HTML5 local storage of the user’s browser and restores it when the user reloads or reopens the page or opens the page in a new tab. The data is cleared from local storage when the user submits or resets the form.

Sisyphus.js

jQuery Credit Card Validator
This library attaches to the input event (with a fallback to the keyup event) and so every time a number in the input field changes, it calls a validation function. When a card is recognized, the credit card type is highlighted; and if the credit card number is correct, it is highlighted with a green checkmark as well. The plugin supports American Express, Diners Club, Discover Card, JCB, Laser, Maestro, MasterCard, Visa and Visa Electron. You might want to consider credit cards JavaScript validator and the Smart Validate Credit Card Validation plugin.

JavaScript Library

TextExt
This library allows you to transform HTML text into input fields, without resorting to code inflation. The plugin inserts aesthetic as well as practical input possibilities, e.g. Tags, Ajax, Focus and others.

TextExt

Avgrund: Better Modal Boxes
A jQuery plugin for displaying a depth illusion between popup and page. The original script by Hakim El Hattab uses CSS transitions and transformations, and the plugin gracefully degrades in those that do not support transitions and transforms. MIT licensed.

Avgrund: Better Modal Boxes

VisualSearch.js
This library enhances ordinary search boxes with the ability to autocomplete faceted search queries. You can specify the facets for completion, along with the completable values for any facet. You can retrieve the search query as a structured object, so you don’t have to parse the query string yourself.

Ideal Forms Framework
A very comprehensive jQuery plugin for building and validating responsive HTML5 forms. It provides keyboard support, customizable input types, “on the spot” validation, localization and HTML5 placeholder polyfill. Supported in IE8+, Chrome, Firefox, Opera, iOS5+, Android 4.0+.

Ideal Forms Framework

Mailcheck
With this JavaScript spell-checker you can suggests another domain when the user misspells it in an email address. Mailcheck helps effectively reducing sign up typos. While it already includes some  domains, you can easily supply your own.

Mailcheck

Validate.js
A lightweight JavaScript form validation library. You can validate form fields using over a dozen rules and set custom messages; the library doesn’t have any dependencies and you can define your own validation callbacks for custom rules. Works in all major browsers (even IE6!).

JavaScript Library

jQuery File Upload
File Upload widget with multiple file selection, drag&drop-support, progress bars and preview images. It supports cross-domain, chunked and resumable file uploads and client-side image resizing. Works with any server-side platform (PHP, Python, Ruby on Rails, Java, Node.js, Go etc.) that supports standard HTML form file uploads.

JavaScript Library

Grumble.js
This jQuery plugin provides tool tips without being limited to cardinal directions. A grumble can be rotated around a given element at any angle, all 360 degrees and at any distance — with CSS. Works in Internet Explorer 6+ and modern browsers. Also, check Tipped, a larger library of various designs and implementations of tooltips with an extensive API.

Grumble.js

Dialogs for Twitter Bootstrap
A small JavaScript library which allows you to create dialog boxes using Twitter’s Bootstrap modals, without having to worry about creating, managing or removing any of the required DOM elements or JS event handlers. You might want to check out the Date Range Picket for Bootstrap as well as a growing library of HTML Snippets for Twitter Bootstrap.

JavaScript Library

ddSlick
Prashant Chaudhary has realeased a free lightweight jQuery plugin that lets you create a custom drop-down that can include images, a short description, along with your usual text and value. It also supports callback functions on selection. You could use CSS3 Drop-Downs as well.

ddSlick

noty
This jQuery plugin makes it easy to create alert, success, error, warning, information and confirmation messages. The notification can be positioned anywhere on the page and you can customize the text, animation, speed and buttons easily.

noty

jQuery.complexify.js
Complexify helps you to accurately gauge the quality of a user’s password to give them visual feedback, and to enforce a minimum level of security.

JavaScript Library

Numberfy
With Numberfy you can integrate native support for line numbers in your website’s text areas. On every key press in the text area, the text area’s current value is split into lines. This script will not work in IE due to a bug in the text-wrap properties.

FormAccordion
A jQuery plugin for easily hiding and revealing related form fields conditionally.

jQuery.superLabels
You can use the library to give your forms a fade-out label. This implementation makes the label slide across the field when gaining focus and fade out when a value is entered. A fallback is provided as well.

cryptico
An encryption system utilizing RSA and AES for JavaScript.

Web Typography Libraries and Plugins

Baseline.js
A jQuery plugin for restoring baselines thrown off by odd image sizes. To use it, you just call the plugin passing the height of your baseline as a variable. You can also define multiple baselines for different responsive breakpoints.

Baseline.js

FTColumnflow
Developed by the development team of Financial Times, this library is essentially a polyfill that fixes the inadequacies of CSS column layouts. With the library, you can provide configurable column widths, gutters and margins, define elements spanning columns, keep-with-next to avoid headings at the bottom of a column, group columns into pages and standardize line height to align text baseline to a grid.

FTcolumnflow

Responsive Measure jQuery Plugin
A simple script that allows you to pass in a selector (ideally the container where your primary content will go), which generates the ideal font size needed to produce the ideal measure for your text. The script also  generates a resolution-independent font-scale based on the ideal font-size. Created by Josh Brewer.

Baseline.js

The Widow Tamer
The Widow Tamer is a small JavaScript library that automatically “fixes” typographic widows. It’s designed to work with responsive sites, fixing widows as it finds them on resize or orientation change.

JavaScript Library

Fluid Line-Height
With his article, Tim Brown inspired developers to release tools that adjust line-height for optimum readability on responsive websites. The so-called molten-leading binds the height of the line to an element’s minimum and maximum width. jQuery-minLineHeight is a jQuery plugin that works similarly with minimum and maximum width association.

Nice Web Type

FitText.js
This jQuery plugin helps you create scalable headlines that fill the width of a parent element in your fluid or responsive layouts. You might want to check out Lettering.js as well to get a complete down-to-the-letter control of letters in your projects.

FitText.js

Kerning.js
This library lets you kern, style, transform, and scale your Web type with CSS rules, automatically. You can adjust pairings, introduce font conditionals and augment properties.

Kerning.js

SlabText.js
The script splits headlines into rows before resizing each row to fill the available horizontal space. The ideal number of characters to set on each row is calculated by dividing the available width by the pixel font-size – the script then uses this ideal character count to split the headline into word combinations that are displayed as separate rows of text.

Nice Web Type

Little Time-Savers

money.js: Open-Source Exchange Rates and Currency Conversion
Joss Crowcroft has created an Open Source Exchange Rates API, which provides up-to-date, flexible and portable currency-conversion data that can be used in any application, framework or language (not just JavaScript). It has no access fees, no rate limits, no nasty XML: just free, hourly updated exchange rates in JSON. Joss also built money.js, a JavaScript currency conversion library that can be easily integrated in any website. A demo playground and detailed documentation are provided on the website, and the source code is available on GitHub.

JavaScript Library

Accounting.js: Easier Number and Currency Formatting
This simple, tiny JavaScript library will solve your currency and numbers-related formatting hassles, and it even includes optional Excel-style column rendering to line up symbols and decimals. It will make all of your numbers and currencies look much more uniform and professional.

JavaScript Library

Moment.js: Format Dates And Times
Moment.js is a lightweight JavaScript library which lets you format, parse and manipulate dates. You can add or subtract dates from one another, as well as parse things like Unix Timestamps. Display options include formatted dates, time from now, difference, time from another moment, native date and support for leap years.

JavaScript Library

Smart Time Ago
This little jQuery library provides you with an intelligent way of updating relative timestamps in your documents. Smart Time Ago checks and updates every 60 seconds the relative time, within a scope which you specify at the start. It checks the newest time in your scope and tunes the checking time interval to a proper value. The tool can be used as a jQuery plugin, or – if using node – can be installed from npm.

Smart Time Ago

sortByTimeAgo.js
A little JavaScript library that takes an array of objects with TimeAgo properties and sorts them from newest to oldest.

Piecon
Piecon is a tiny JavaScript library for dynamically generating progress pie charts in your favicons. It has been tested to work in Chrome 15+, Firefox 9+ and Opera 11+.

Piecon

Notificon: Favicon Notifications and Alerts
Matt Williams’ Notificon is a JavaScript library for creating favicon alerts and notifications. Instead of having to create a number of favicons and serving them to the client, you can specify a label and a favicon (the default being the current favicon), and it will generate a favicon notification for you. The script currently works with Chrome 6+, Firefox 2+ and Opera, but it’s a nice little add-on for browsers that support it.

jQuery Stick ‘em: Make Content Sticky on Scroll, to a Point
A problem: some of the images in the layout are very tall, so by the time you scrolled down to the bottom of the images, you would have to scroll back up just to read the description of the images or navigation items. The solution: make the content sticky as you are scrolling. This library solves this problem.

jQuery Stick 'em

Countdown.js
Human descriptions for a span of time are often fuzzier than a computer naturally computes. For example, how long does “in 1 month” mean? We casually talk about four weeks, but in fact there is only one month in a year which is four weeks long. Countdown.js tackles this problem by producing an accurate and intuitive description of timespans which are consistent as time goes on.

geolib
A small library to provide some basic geo functions like distance calculation, conversion of decimal coordinates to sexagesimal and vice versa.

Geolib.js

Cookies
Cookies.js is a small client-side JavaScript library that makes managing cookies easy. It caches cookie values, making sequential reads faster, supports AMD / CommonJS loaders and is supported in Chrome, Firefox 3+, Safari 4+, Opera 10+ and Internet Explorer 6+.

firstImpression.js
firstImpression.js is a micro-library (1 Kb minified) that answers the simple question, “Has this user visited this site before?” The detection doesn’t require much logic, so the majority of the code is just a plain JavaScript port of the popular jquery.cookie plugin.

Chirp.js: Tweets on Your Website
A lightweight templating JavaScript library that enables you to display tweets on your website. Client-side caching is available; and you can set if you’d like to show retweets and replies, too.

Chirp.js: Tweets on your website

simpleWeather jQuery Plugin
A simple jQuery plugin to display the weather information for any location. The data is pulled from the public Yahoo! Weather feed via the YQL API.

zip.js
A JavaScript library to zip and unzip files. zip.js provides a low-level API for writing and reading large zip files (up to 4GB with File Writer API). Works with Chrome, Firefox, Safari 6 and (unfortunately) Internet Explorer 10+. With Safari 5 and IE9, you must disable Web Workers and use a Typed Array polyfill.

string.js
A library that provides extra String methods to normalize text strings and manipulate them.

Images, Maps, Graphs and Visualization Libraries

jVectorMap
jVectorMap is a jQuery plugin that renders SVG and VML vector maps in browsers ranging from the ancient Internet Explorer 6 to modern browsers. jVectorMap uses JavaScript, CSS, HTML, SVG or VML, and no Flash or any other proprietary browser plugin is required.

JavaScript Library

Subway Map Visualization jQuery Plugin
If you often deal with government projects, university departments or any websites of sophisticated organizations, every now and again you’ll be asked to design a nice visualization that would explain the various divisions, structures and internal hierarchy of those organizations. Where do you start? Well, creating a Subway Map-alike visualization is an option worth considering.

JavaScript Library

GMaps.js
This library allows you to easily use Google Maps in your projects. Extensive documentation or large amount of code aren’t required anymore. You might want to check out Gmap3 jQuery pluginas well.

GMaps.js

Leaflet: Open-Source Interactive Maps With JavaScript
A library for creating tile-based interactive maps for desktop and mobile browsers. An easy-to-use API is available, and the tool emphasizes usability, performance, flexibility and excellent browser support. The library offers a variety of map layers, including tiles, markers, pop-ups, image overlays and GeoJSON. It supports panning on both mobile and desktop browsers, double-tap zoom on mobile browsers (plus multi-touch zoom on iOS) and more. On iOS, hardware acceleration is enabled, and Leaflet has a modular structure that lets you reduce the size of the library to make it even faster. The project is open source and available for further development and forking on GitHub.

JavaScript Library

SVGeezy: a JavaScript plugin for SVG fallbacks
A JavaScript library which detects SVG images on your website and automatically “looks” for a standard image fallback for those older, less capable browsers. Created by Ben Howdle and Jack Smith.

SVGeezy - a JS plugin for SVG fallbacks

Retina.js
A script that checks each image on your website, when it’s loaded by a user, and replaces low-resolution image with their high-resolution equivalent, if available. It’s assumed that you use Apple’s high resolution modifier (@2x) to designate high resolution versions of images.

JustGage
A JavaScript library for generating and animating gauges. Based on Raphaël library for vector drawing, it’s resolution-independent and works in all modern browsers.

JustGage

arbor.js
A graph visualization library for building trees with connected nodes of data. Arbor.js is essentially a layout algorithm with abstractions for graph organization and screen refresh handling.

Arbor.js

Timeline: Generate Timelines To Visualize Data
This library is supposed to pull in media from different sources. It has built-in support for pulling in data from Twitter, YouTube, Flickr, Vimeo, Google Maps and SoundCloud—and more will be included in the near future. You can easily fill in data from a Google spreadsheet, or use a more detailed method such as JSON to create your time-line. You can also host it on your website by using the Timeline jQuery plugin. The library is available on GitHub, or as WordPress plugin.

JavaScript Library

Unicon
Unicon is a Grunt.js task that makes it easy to manage icons and background images for all devices, preferring HD (retina) SVG icons but also provides fallback support for standard definition browsers, and old browsers alike. From a CSS perspective, it’s easy to use, as it generates a class referencing each icon, and doesn’t use CSS sprites.

Foresight.js
This device recognition library, gives websites the ability to gauge the users device capabilities before the image is requested from the server. Judging display resolution and network speed, it customizes the img src attribute to optimize the websites image resolution to the individual users hardware.

A Magnifying Glass With CSS3 And jQuery
This technique achieves an aesthetically pleasing visual effect. The CSS3 box-shadow and border-radius properties are used to create the magnifying glass itself, while jQuery is used to detect the cursor coordinates and mouse movements and present the larger image. And when your cursor moves off the image, the magnifying glass elegantly fades away. The included tutorial makes it very easy to learn and understand how to achieve this effect. The technique includes both a small and a large image in the markup, so optimizing the technique to load a larger image on demand might be a good idea.

JavaScript Library

Rickshaw
This free and open source JavaScript toolkit provides the elements which you need to create interactive graphs, such as renderers, legends, hovers and range selectors. Rickshaw is based on D3, graphs are drawn with standard SVG and styled with CSS.

Rickshaw

Flot: Plotting for jQuery
A JavaScript plotting library for jQuery, supports Internet Explorer 6+, Chrome, Firefox 2+, Safari 3+ and Opera 9.5+. You can use different types of graphs, use multiple axes, annotate a chart, update graphs with AJAX, provide support for zooming and interaction with the data points, use stacked charts, theresholding the data, apply pie charts and plot prerendered images.

Flot.js

Chronoline.js
Chronoline.js is a library that allows you to create a chronology time-line out of events on a horizontal timescale. From a list of dates and events, it can generate a graphical representation of schedules, historical events, deadlines, and more.

JavaScript Library

Cubism
This D3 plugin helps you to visualize time series and construct better real-time dashboards, pulling data from Graphite, Cube and other sources. Cubism scales and reduces server load by pulling only the most recent values. Cubism can scale easily to hundreds of metrics updating every ten seconds. Cubism’s horizon charts allow you to see many more metrics at-a-glance space than standard area charts.

Cubism

Envision.js
An alternative library for creating fast, dynamic and interactive HTML5 visualizations.

JavaScript Library

Data Visualization JavaScript Libraries
A growing, curated collection of data visualization JavaScript libraries that make it easier to create meaningful and beautiful data visualizations. If you haven’t one a useful data visualization library in the list above, you’ll definitely find the right one in this overview.

Data Visualization JavaScript Libraries

Last Click

jQuery Fundamentals
This HTML book is designed to get you comfortable working through common problems you’ll be called upon to solve using jQuery. You can read the content and try the various interactive examples. Each chapter will cover a concept and give you a chance to try example code related to the concept. Written by Rebecca Murphey and recently updated by her and the rest of the gang at Bocoup.

JavaScript Library

JavaScript Patterns Collection
A JavaScript pattern and anti-pattern collection that covers function patterns, jQuery patterns, jQuery plugin patterns, design patterns, general patterns, literals and constructor patterns, object creation patterns, code reuse patterns, DOM and browser patterns.

JavaScript Library

JavaScript Garden
A growing collection of documentation about the most quirky parts of the JavaScript programming language. It gives advice to avoid common mistakes and subtle bugs, as well as performance issues and bad practices, that non-expert JavaScript programmers may encounter on their endeavors into the depths of the language.

JavaScript Library

 

Comment insérer un plugin JQuery dans son thème WP

SOURCE

JDMWEB.com 

Partie 1: Anatomie d’un plugin jQuery

Dans cette partie, nous allons voir de quoi est généralement constitué un plugin jQuery, et où nous devons placer les différents composants. Tout au long de cet article, nous allons prendre l’exemple du plugin FancyBox (même s’il existe déjà une implémentation WordPress, c’est juste pour avoir un exemple concret).

A) La Source Javascript

jQuery est une librairie JavaScript, et les plugins servent à étendre ses possibilités, ils sont donc écrit en suivant la même syntaxe que jQuery. Chaque plugin que vous trouverez est écrit dans un fichier JavaScript. C’est le coeur même du plugin, et doit donc être inclus dans votre application:

  1. //Include the plugin script
  2. <script type= »text/javascript » src= »Chemin_vers/jquery.fancybox.js »></script>

B) Le Code Javascript

Une fois le plugin inclus, vous êtes souvent amené à écrire quelques lignes de code afin de faire marcher votre plugin avec votre application. La plupart du temps, cela consiste à écrire quelques lignes afin de faire marcher le plugin avec un élément particulier de votre page, et avec un évènement particulier. Comme par exemple, faire marcher la FancyBox après un clic sur un lien:

  1. //Write the plugin setup
  2. <script type= »text/javascript »>
  3. jQuery(document).ready(function(){
  4. //Fancybox
  5. jQuery(« a.fancy »).fancybox({
  6. overlayShow: true,
  7. overlayOpacity: 0.7
  8. });
  9. });
  10. </script>

C) Les styles additionnels

Certains plugins marchent avec des styles particuliers, comme les fenêtres modales comme la FancyBox par exemple. Ces styles sont requis et garantissent le bon fonctionnement du plugin. Ils doivent donc être inclus dans l’application.

  1. //Include the plugin Stylesheet
  2. <link rel= »stylesheet » type= »text/css » href= »Chemin_vers/jquery.fancybox.css » />

D) Comment tout mettre en place ?

Une fois que vos fichiers sont prêts, c’est une pratique courante et recommandée de les ajouter à votre application en mettant les styles dans le header de la page, et les scripts juste avant la fermeture du tag </body>.

Partie 2: Comment tout intégrer dans WordPress?

Maintenant que nous avons une meilleure compréhension des différents éléments que l’on peut trouver dans un plugin jQuery, et où ils sont sensé aller, voyons comment nous pouvons faire de même dans WordPress.

Comment déclarer un plugin WordPress ?

A) Dans WordPress, les plugins sont stockés dans le dossier /wp-content/plugins. Il suffit donc de se rendre dans ce dossier, et de créer un dossier du même nom que votre plugin, dans notre cas, FancyBox.

B) Dans ce dossier, copiez tous les fichiers nécessaires au bon fonctionnement de votre plugin jQuery, (script, css, images etc).

C) Créez un fichier appelé init.php. Init.php est un fichier particulier que va utiliser WordPress pour reconnaître notre nouveau plugin. Ouvrez ce fichier et copiez le code suivant dedans:

  1. /*
  2. Plugin Name: FancyBox //Your plugin name (here we’d write Fancybox)
  3. Plugin URI: http://www.jdmweb.com/resources/fancybox //Url of your choice
  4. Description: Implementation of the FancyBox for jQuery //Brief PLugin Description
  5. Version: 1.0 //Version of your plugin
  6. Author: Jeremy Desvaux //Name of the author
  7. Author URI: http://jdmweb.com/ //Url of your site
  8. License: Creative Commons Attribution-ShareAlike //Licence
  9. //Other terms and conditions
  10. This program is free software; you can redistribute it and/or modify
  11. it under the terms of the GNU General Public License as published by
  12. the Free Software Foundation; either version 2 of the License, or
  13. (at your option) any later version.
  14. */

Comme vous pouvez le voir, dans ce fichier on spécifie un nom, une URL, une description et deux trois autres informations du même type. Ces informations sont ensuite réutilisées par WordPress dans l’interface d’administration des plugins comme vous pouvez le voir sur l’image suivante:

Plugin Interface Screenshot

Depuis cette image, nous pouvons voir que notre futur plugin a été reconnu par WordPress, et qu’il contient les informations que nous avons spécifiées. Le moment est venu de tout faire marcher maintenant. D’après ce que nous avons wu dans la partie 1, il nous faut trouver un moyen d’inclure nos fichiers dans le header et le footer de notre application.

Comment inclure des fichiers dans le header de WordPress?

Ce que l’on veut faire, c’est inclure notre feuille de style, dans le header de la page. En html, on le fait en plaçant une balise link directement dans le header. Dans WordPress, c’est déconseillé, il existe une fonction spécifique pour réaliser cela, elle s’appelle wp_enqueue_style() (ref codex ici)

wp_enqueue_style accepte plusieurs paramètres, principalement le nom de votre feuille de style et son url. On peut aussi ajouter des dépendances (c’est à dire d’autres styles qui doivent être inclus avant), et un numéro de version. Dans notre cas, afin d’ajouter notre feuille de style dans le header, on utiliserait wp_enqueue_style comme ceci:

  1. //Add the stylesheet into the header
  2. wp_enqueue_style(
  3. « jquery.fancybox »,
  4. WP_PLUGIN_URL. »/jQuery2Wp_fancybox/jquery.fancybox-1.3.1.css »,
  5. false,
  6. « 1.3.1 »
  7. );

Ligne 3, vous pouvez voir le nom que l’on donne à notre feuille de style, l’url de sa source, avec l’emploi de la constante WP_PLUGIN_URL qui renferme le chemin vers le dossier des plugins. Du coup si l’utilisateur décide de le changer, le lien vers la feuille de style ne sera pas brisé. Ligne 5, false veut dire qu’il n’y a pas de dépendance. et ligne 6, 1.3.1 détermine la version de la feuille.

Voilà tout pour le header. En fait, pour récapituler, au lieu d’ajouter par nous même la feuille de style dans le header directement, on demande à WordPress de le faire pour nous.

Comment inclure des fichiers dans le footer de WordPress?

D’une manière très similaire, afin d’ajouter nos scripts dans le footer de WordPress, nous faisons à nouveau appel à une fonction, cette fois ci appellée wp_enqueue_script() (ref codex ici).

wp_enqueue_script accepte des paramètres similaires à wp_enqueue_style, c’est à dire un nom de script, une url, des dépendances et un numéro de version. Le dernier paramètre est un booléen et vous permet de spécifier où vous désirez inclure vos fichiers. Si c’est 0 (par défaut), le script sera inclus dans le header, sinon, si c’est 1, dans le footer. Dans notre cas, afin d’inclure les fichiers dans le footer, on utilisera le booléen avec la valeur 1.

Il est maintenant temps d’inclure nos scripts avec wp_enqueue_script:

  1. //Add the scripts in the footer
  2. wp_enqueue_script(« jquery »);
  3. wp_enqueue_script(
  4. « jquery.fancybox », WP_PLUGIN_URL. »/jQuery2Wp_fancybox/jquery.fancybox.js »,
  5. array(« jquery »), « 1.3.1 »,1);
  6. wp_enqueue_script(
  7. « jquery.fancyboxsetup », WP_PLUGIN_URL. »/jQuery2Wp_fancybox/fancybox-setup.js »,
  8. array(« jquery », »jquery.fancybox »), «  »,1);

Lignes 3 et 6, vous pouvez voir wp_enqueue_script en action. On ajoute les scripts en sépcifiant leur nom, chemin, dépendance et version, et on les places dans le footer grâce au 1 à la fin. Comme vous pouvez le voir, la FancyBox a une dépendance (jQuery) et le script d’initialisation en a 2, (jQuery et FancyBox).

Il est temps de tester.

Votre plugin est maintenant prêt à l’emploi. Si vous retournez dans l’interface d’administration des plugins et que vous l’activez, WordPress va ajouter vos fichiers aux bons endroits, et votre plugin commencera à marcher.

Comment utiliser le plugin sur des pages spécifiques seulement?

Maintenant que notre plugin est actif, WordPress va ajouter les fichiers spécifiés dans init.php dans chaque page de votre application. Alors si c’est ce que vous voulez car vous utilisez le plugin sur toutes les pages c’est très bien. Sinon, c’est un gaspillage de ressources, et cela rajoute du temps de téléchargement pour rien.

Je vais vous montrer une petite technique toute simple que j’utilise pour avoir plus de contrôle. C’est très simple.

L’astuce consiste à rassembler le code que l’on vient d’écrire, et de la placer dans une nouvelle fonction que l’on appellera FancyBox_wp_setup():

  1. //Group the code inside a function
  2. function fancybox_wp_setup(){
  3. wp_enqueue_style(
  4. « jquery.fancybox », WP_PLUGIN_URL. »/jQuery2Wp_fancybox/jquery.fancybox-1.3.1.css »,
  5. false, « 1.3.1 »);
  6. wp_enqueue_script(« jquery »);
  7. wp_enqueue_script(
  8. « jquery.fancybox », WP_PLUGIN_URL. »/jQuery2Wp_fancybox/jquery.fancybox.js »,
  9. array(« jquery »), « 1.3.1 »,1);
  10. wp_enqueue_script(
  11. « jquery.fancyboxsetup », WP_PLUGIN_URL. »/jQuery2Wp_fancybox/fancybox-setup.js »,
  12. array(« jquery », »jquery.fancybox »), «  »,1);
  13. }

Ceci à 2 effets différents. Cela empêche WordPress d’ajouter vos fichiers de partout, ce qui est ce que l’on voulait, mais cela vous donne aussi accès à la fonction FancyBox_wp_setup(), que vous pouvez appeler sur chaque page où vous désirez utiliser le plugin.

Conclusion

Quand vous trouvez le plugin idéal pour votre nouveau design, l’intégrer dans WordPress n’est qu’à quelques lignes de code! J’espère que la prochaine fois que vous trouverez un plugin que vous souhaitez utiliser, vous vous souviendrez de cet article et que vous le transformerez en un plugin WordPress en 5 petites minutes.

Plugin jQuery de paramétrage des champs de saisie de formulaire.

Comment ça marche?

DEMO

TELECHARGEMENT  

Masked Input Plugin

Dans le code:

First, include the jQuery and masked input javascript files.

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

Next, call the mask function for those items you wish to have masked.

jQuery(function($){
   $("#date").mask("99/99/9999");
   $("#phone").mask("(999) 999-9999");
   $("#tin").mask("99-9999999");
   $("#ssn").mask("999-99-9999");
});

Optionally, if you are not satisfied with the underscore (‘_’) character as a placeholder, you may pass an optional argument to the maskedinput method.

jQuery(function($){
   $("#product").mask("99/99/9999",{placeholder:" "});
});

Optionally, if you would like to execute a function once the mask has been completed, you can specify that function as an optional argument to the maskedinput method.

jQuery(function($){
   $("#product").mask("99/99/9999",{completed:function(){alert("You typed the following: "+this.val());}});
});

You can now supply your own mask definitions.

jQuery(function($){
   $.mask.definitions['~']='[+-]';
   $("#eyescript").mask("~9.99 ~9.99 999");
});

You can have part of your mask be optional. Anything listed after ‘?’ within the mask is considered optional user input. The common example for this is phone number + optional extension.

jQuery(function($){
   $("#phone").mask("(999) 999-9999? x99999");
});

Map addiction… googlemap montres toi!

De supers plugins jQuery existent pour faire à peu près tout ce que vous voulez avec une map.

Mes choix:

– jquery vector maps

– gmap

– jsCraft

– avec une alternative intéressante à googlemaps: osmLeaflet

  

Et sur WordPress on a quoi comme extensions qui vont bien??????

– Google-Maps-GPX-Viewer

– Comprehensive Google Map Plugin

Scroller, un plugin jQuery qui fait des bulles!

 

Voici un plugin jquery qui permet des animations sympas au survol de la souris.

Source: jscraft

DEMO

Télécharger SCROLLER

JavaScript

  1. $(‘.scroller’).scroller({
  2. element: ‘a’, // (string) HTML element
  3. direction: ‘horizontal’, // (string) available options: horizontal, vertical
  4. container: {
  5. name: ‘inside’, // (string) class name for the container
  6. easing: ‘easeOutBack’, // (string) set the easing of the animation, required: jQuery Easing plugin: http://gsgd.co.uk/sandbox/jquery/easing/
  7. duration: 800 // (int) set the speed of the easing animation in milliseconds
  8. },
  9. options: {
  10. margin: -20, // (int) set the margin for each element
  11. zoom: 1.5, // (int) zoom multiplier
  12. easing: [‘easeOutBack’, ‘easeOutBounce’],
  13. duration: [300, 500]
  14. },
  15. onclick: function(a, img){},
  16. onmouseover: function(a, img){},
  17. onmouseout: function(a, img){}
  18. });

HTML

  1. <div class= »scroller »>
  2. <div class= »inside »>
  3. <a href= »# »><img src= »assets/img1.jpg » alt= » » /></a>
  4. <a href= »# »><img src= »assets/img2.jpg » alt= » » /></a>
  5. <a href= »# »><img src= »assets/img3.jpg » alt= » » /></a>
  6. <a href= »# »><img src= »assets/img4.jpg » alt= » » /></a>
  7. <!– etc. –>
  8. </div>
  9. </div>