Entries for month: January 2013

Some Words About the New jQuery Plugins Registry

JavaScript , jQuery , Web development No Comments »

In case you missed it, last week the jQuery team announced the launch of the long-awaited jQuery Plugin Registry (http://plugins.jquery.com/).  This new site is designed to address the issues that were present in the old jQuery plugins site and make it easier for plugin authors to share their creations via an authoritative listing.

I like what they ended up doing with the registry.  Instead of hosting copies of the plugins, it leverages GitHub.  Plugin authors put their plugins up on GitHub, add a manifest JSON file to their project that provides descriptive metadata about the plugin, and then add a webhook for the registry to the GitHub project (all of these steps are well-documented on the registry site).  Once all that is set up, every time someone creates a new GitHub tag for the plugin and pushes it up to the repo, GitHub will notify the plugin registry of the change and the registry will be automatically updated.  In other words, updating the project on GitHub updates the plugin registry as well.

Finally having a robust centralized, official listing of jQuery plugins is really going to help the plugin ecosystem.  It'll hopefully give lesser-known plugin authors more exposure and give plugin users a central place to search for plugins that returns results with quality, up-to-date information.

I've already added my recently updated dirtyFields plugin to the registry.  Not sure if I'll add my older, simpler plugin for counting characters/words in a textarea; I'll have to look and see what's already out there in that regard to see if my implementation fills a niche need for that sort of thing.

dirtyFields jQuery Plugin Updated with New Options/Functions

Downloads , JavaScript , jQuery No Comments »

I've made some updates to my dirtyFields jQuery plugin.  Here's the rundown:

  • Added two new public functions:
    • getDirtyFieldNames() returns an array of all currently dirty fields.
    • updateFormState() checks the clean/dirty state of all form fields in the specified container
  • Made two changes to how the CSS class denoting a dirty/changed form is applied:
    • Added a new configuration option ("self") to apply the class to the actual form element.
    • Split the single option for applying a style to a changed text input and select drop-down into two separate options for granular control (if you used the textboxSelectContext option with a previous version of the plugin, you will need to update your code).
  • Added three new configuration options to control plugin behavior:
    • The denoteDirtyFields option controls whether or not the dirty CSS class is applied to the form elements that are dirty/changed.
    • The exclusionClass option specifies the name of the CSS class that, when applied to a form field, will exclude that field from being processed by the plugin.
    • The ignoreCaseClass option specifies the name of the CSS class that, when applied to a form field, will instruct the plugin to do a case-insensitive evaluation of the current and original states of the field.

All of these changes were implemented in response to code suggestions made a team of developers (listed in the GitHub readme.txt file) who modified the plugin to meet their specific needs in one of their intranet sites.