Plugins

The plugins site is currently in development.

We've been looking to provide a higher-quality, spam-free experience at the plugins site for some time, and a major error on our part forced us to shut down the current site before we could put the new one in place. We are developing a new site, and you can follow along with its development on GitHub. For more information about this transition, including steps you can take as a plugin author to prepare, please read our post about what's going on.

prototype port


Identify element that do not have and id by assigning them a GUID

Identify allows you to identify a set of elements by assigning them a GUID if no id is found for each element

Identify is kind of a port of prototypes identify behavior (http://www.prototypejs.org/api/element/identify) but with more options

It allows you to check if a found id is unique and if not replace the existing one by a unique GUID

HTML

<span>My first Span</span>
<span id="second">My Second span</span>
<span>My third span</span>
<span id="a_span">My Fourth Span</span>
...
<span id="a_span">My N Span</span>

Javascript

$('SPAN').identify();

Result HTML

<span id="id_e7e40d1a-fa11-830a-9f71-fc02e303a355">My first Span</span>
<span id="second">My Second span</span>
<span id="id_4a4302a3-9ad4-693d-2a14-1695db2beed7">My third span</span>
<span id="a_span">My Fourth Span</span>
...
<span id="a_span">My N Span</span>

Protify - The Prototype Array and Enumerable Methods

A port of Prototypes array and enumerable methods into a jQuery plugin.

This jQuery plugin creates an array with Prototypes array and enumerable methods, and allows chaining the way that Prototype does.

Syntax: // this does not extend the array.

var arr = [1,2,3,4,5,6];
$.protify(arr).findAll(function(a) {
    return a <=3;
}); // --> [1,2,3]

//this does extend the array, but only for this object.

$.protify(arr, true);
arr.findAll(function(a) {
    return a <=3;
}); // --> [1,2,3]

[1,2,3,4,5,6].findAll(function(a) {
    return a <=3;
}); // --> error, findAll is not a function

absolutize prototype port

This is a port of the prototype Element.absolutize() function. The logic is identical.