guards.js

View the Project on GitHub on-site/guards.js

Documentation

Anything documented in here is considered publicly available and finalized as far as semantic versioning is considered. If you find a method, funtion or feature that is not documented, please be prepared for the possibility of it being removed or changed without notice and without a major version change.

Guards should work with jQuery as low as version 1.4.4 as of guards version 1.3.0.

Below is a brief description of each section of the documentation.

Data Attributes

This section lists all the available data attributes for data attribute based guards. This form of guards does not need any custom javascript to work.

Global Functions

All global functions are described here. Global functions are attached to the jQuery object so they will not pollute the actual global namespace.

Named Guards

Predefined named guards can be found here. These are all the guards available without defining any custom guards.

Guards Type

The Guards type can be found via the $.Guards function. An instance of it is automatically instantiated and assigned to $.guards for ease of use. It represents a collection of common functions and defaults for all guards, as well as contains references to all guards that have been named or created.

Guard Type

The Guard type can be found via the $.Guard function. It represents an instance of a single guard (whether named or not). A named guard is a guard that has a name but is not tied to any selector, while other guards are tied to a specific selector. Named guards can be triggered via data attribute based guards, otherwise they can only be triggered via an instance of a guard that uses the given named guard.

jQuery Methods

This section describes all custom jQuery methods attached to $.fn.