Archive for the ‘jQuery’ Category

Release: Validation Plugin 1.6

Monday, November 30th, 2009

Update update: Files are now availble via Microsoft’s AJAX CDN.

An update for the jQuery validation plugin is available. There are five new localizations (now at 26 in total), including Arabic and Farsi (both right-to-left). Validation of selects is now more interactive, click events are properly handled to provide quicker feedback (also a bug related to selects in IE8 is fixed). The equalTo-method is now aware of changes to the target field, so a change to a password field will be reflected in a confirm-password field. And more…

Download this release.

The only not fully backwards-compatible change (if you spot anything else, please report it as a bug): The dateDE and numberDE methods were replaced with a localization/methods_de.js file, with localized versions of both the date and number methods. There are also localized methods for the NL and PT locales. The goal is to gather more localized versions of these, similar to the localized messages.

The full changelog:

As usual, support is available via:

  • Please post questions to the jQuery discussion list, putting “(validate)” into the subject of your post, making it easier to spot it and respond quickly. Keep your question short and succinct and provide code when possible; a testpage makes it much more likely that you get an useful answer in no time.
  • Please post bug reports and other contributions (enhancements, features, eg. new validation methods) to the plugins.jQuery.com bug tracker (requires registration).

Enjoy!

Release: Message plugin 1.0.0

Friday, June 19th, 2009

I’m happy to announce the first release of the Message jQuery plugin. The plugin allows you to easily display feedback messages as an unobstrusive overlay. The message fades away automatically after some time, avoiding the need to click an “ok” button or something similar. The user can speed up hiding of the message by moving the mouse or clicking anywhere.

More details can be found on the new plugin page.

Enjoy!

Release: Validation Plugin 1.5.3

Monday, June 15th, 2009

An update for the jQuery validation plugin is available. Among various bugfixes there are two new localizations (Taiwan and Kazakhstan), an enhancement to $.validator.addMethod that allows you to specify (localized) messages first, the actual method later; the submitHandler-option now keeps a submit-button “alive”, that is, won’t get lost when using the option.

Probably most notable: The remote method now allows you to specify custom messages! Return JSON “true” for a valid field, false/null/undefined for an invalid field and the default message, or any other value to use as the message.

The full changelog:

  • Fixed a bug related to the wrapper-option, where all ancestor-elements that matched the wrapper-option where selected (http://plugins.jquery.com/node/7624)
  • Updated multipart demo to use latest jQuery UI accordion
  • Added dateNL and time methods to additionalMethods.js
  • Added Traditional Chinese (Taiwan, tw) and Kazakhstan (KK) localization
  • Moved jQuery.format (fomerly String.format) to jQuery.validator.format, jQuery.format is deprecated and will be removed in 1.6 (see http://code.google.com/p/jquery-utils/issues/detail?id=15 for details)
  • Cleaned up messages_pl.js and messages_ptbr.js (still defined messages for max/min/rangeValue, which were removed in 1.4)
  • Fixed flawed boolean logic in valid-plugin-method for multiple elements; now all elements need to be valid for a boolean-true result (http://plugins.jquery.com/node/8481)
  • Enhancement $.validator.addMethod: An undefined third message-argument won’t overwrite an existing message (http://plugins.jquery.com/node/8443)
  • Enhancement to submitHandler option: When used, click events on submit buttons are captured and the submitting button is inserted into the form before calling submitHandler, and removed afterwards; keeps submit buttons intact (http://plugins.jquery.com/node/7183)
  • Added option validClass, default “valid”, which adds that class to all valid elements, after validation (http://dev.jquery.com/ticket/2205)
  • Added creditcardtypes method to additionalMethods.js, including tests (via http://dev.jquery.com/ticket/3635)
  • Improved remote method to allow serverside message as a string, or true for valid, or false for invalid using the clientside defined message (http://dev.jquery.com/ticket/3807)
  • Improved accept method to also accept a Drupal-style comma-seperated list of values (http://plugins.jquery.com/node/8580)

As usual, support is available via:

  • Please post questions to the jQuery discussion list, putting “(validate)” into the subject of your post, making it easier to spot it and respond quickly. Keep your question short and succinct and provide code when possible; a testpage makes it much more likely that you get an useful answer in no time.
  • Please post bug reports and other contributions (enhancements, features, eg. new validation methods) to the plugins.jQuery.com bug tracker (requires registration).

Enjoy!

Update:
Just uploaded a hotfix 1.5.4 release, with a fix for the remote method.

Update II:
Uploaded another release, now at 1.5.5, hopefully the final fix for the remote method: http://plugins.jquery.com/node/8659

Labs Preview: jQuery UI Photoviewer

Tuesday, June 2nd, 2009

Fresh from the jQuery UI Lab comes the Photoviewer widget. As described on its planning wiki page:

An alternative to Lightbox and its various clones, with the sole purpose of displaying images: One or more thumbnails point at the full resolution image, and instead of displaying that image on a new page, its displayed, above an overlay, on the current page.

When a group of anchors with thumbnails is selected, the user can navigate with mouse and keyboard to rotate through the images.

The result is this:

Demo

There’s another demo showing how the widget can resize images that don’t fit into the browser window, as well as customizing animations.

Worth mentioning about the current implementation:

  • A “canvas” element is used to render the shadow. This allows a lot of flexibility in terms of positioning, color and size of the shadow; if a browser doesn’t support canvas (IE without excanvas) the shadow simply isn’t rendered
  • You can click anywhere to close the viewer, or press Escape
  • Cursor keys, mousewheel as well as mouse navigation buttons (previous/next buttons on some models) can be used to rotate through an image gallery
  • By using the mousewheel to rotate images, there is no need to emulate fixed positioning or similar hacks, though you need to include the mousewheel plugin
  • When the last image is reached, the first is displayed, and the other way round; that way its more obvious that you reached the end of a gallery (“I’ve seen that one already” instead of “Why isn’t anything happening?”)
  • A loading indicator is displayed when loading takes more then 250ms. That way you won’t see it most of the time, just in those cases where you’d otherwise wonder if anything is happening at all
  • The jQuery UI “drop’” effect is used by default to rotate images in a gallery, giving the slight illusion of a slide-projector, therefore giving the viewer a more natural/human feel
  • Images that are too big are resized to fit into the browser window; that also happens when the browser window is resized while the viewer is open
  • The markup is very simply, therefore easy to style: There is one element for the overlay (currently buggy in IE6), one container element containing the canvas-shadow element as well as the actual image (by default styled with 15px rounded white borders)

I’d like to hear your feedback! Post a comment here, send me an email, or participate on the planning wiki page.

Release: Prettydate plugin 1.0.0

Thursday, May 28th, 2009

I’m happy to announce the first release of the Prettydate jQuery plugin. The plugin is based on the plugin originally written by John Resig and provides clientside date formatting in the style of Twitter’s timeline: “just now”, “5 minutes ago”, “yesterday”, “2 weeks ago”. This release extends John’s original release, providing support for internationalization and improving the API a bit: You can specify the source of the ISO-date, while not having to manually set up an interval to update the date formatting over time.

More details can be found on the new plugin page.

Enjoy!

Release: Password Validation plugin 1.0.0

Saturday, May 23rd, 2009

I’m happy to announce the first release of the Password Validation plugin, an extension for the jQuery Validation plugin.

This plugin extends the jQuery validation plugin, providing two components:

  • A function that rates passwords for factors like mixed upper/lower case, mix of characters (digits, special characters), length and similarity to a username (optional).
  • A custom method for the validation plugin that uses the rating function to display a password strength meter, requiring the field to have a “good” rating. The text displayed can be localized.

More details can be found on the new plugin page.

Enjoy!

Release: Validation Plugin 1.5.2

Friday, March 20th, 2009

An update for the jQuery validation plugin is available. There is a small code fix, a new supported locale (slovak) and most notably, a new demo featuring integration with jQuery UI tabs and grouping selects.

  • Fixed messages in additional-methods.js for maxWords, minWords, and rangeWords to include call to $.format
  • Fixed value passed to methods to exclude carriage return (r), same as jQuery’s val() does
  • Added slovak (sk) localization
  • Added demo for intergration with jQuery UI tabs
  • Added selects-grouping example to tabs demo (see second tab, birthdate field)

As usual, support is available via:

  • Please post questions to the jQuery discussion list, putting [validate] into the subject of your post, making it easier to spot it and respond quickly. Keep your question short and succinct and provide code when possible; a testpage makes it much more likely that you get an useful answer in no time.
  • Please post bug reports and other contributions (enhancements, features, eg. new validation methods) to the jQuery bug tracker (requires registration). Please put [validate] into the title of a ticket.

Enjoy!

Releases: jQuery 1.3 and Validation Plugin 1.5.1

Wednesday, January 14th, 2009

jQuery 1.3 is out – head over to the jQuery blog release post for details. Happy third birthday, jQuery!

If you plan to update, make sure to also update the validation plugin to 1.5.1, which provides compability with 1.3 as well as 1.2.6. Other changes include:

As usual, support is available via:

  • Please post questions to the jQuery discussion list, putting [validate] into the subject of your post, making it easier to spot it and respond quickly. Keep your question short and succinct and provide code when possible; a testpage makes it much more likely that you get an useful answer in no time.
  • Please post bug reports and other contributions (enhancements, features, eg. new validation methods) to the jQuery bug tracker (requires registration). Please put [validate] into the title of a ticket.

Enjoy!

Release: Validation Plugin 1.5

Sunday, November 30th, 2008

A new release of the validation plugin is done, now at version 1.5.

Four more localizations were added: norwegian (no), italian (it), hungarian (hu), and romanian (ro), bringing the total number up to 16 localizations!

A few new options are available as well: ignoreTitle is false by default, when set to true, all titles are ignored when looking for messages. This should be used when dealing with problems with the Google Toolbar.

The rules-method now accepts also messages, making it equivalent to other means of providing rules and messages, just as the last release enabled messages to be specified via metadata.

As a shortcut for manually binding the invalid-form custom event, there is now the invalidHandler-option, the counterpart of submitHandler, called whenever an invalid form is submitted.

A major enhancement affects the remote method: You can now fully customize the request being send to the server by providing $.ajax options as the paramter. It still accepts the url as a string paramter for compability. Details are provided in the documentation for the remote method.

The complete list of changes:

  • Improved basic demo, validating confirm-password field after password changed
  • Fixed basic validation to pass the untrimmed input value as the first parameter to validation methods, changed required accordingly; breaks existing custom method that rely on the trimming
  • Added norwegian (no), italian (it), hungarian (hu) and romanian (ro) localization
  • Fixed #3195: Two flaws in swedish localization
  • Fixed #3503: Extended rules(“add”) to accept messages propery: use to specify add custom messages to an element via rules(“add”, { messages: { required: “Required! ” } });
  • Fixed #3356: Regression from #2908 when using meta-option
  • Fixed #3370: Added ignoreTitle option, set to skip reading messages from the title attribute, helps to avoid issues with Google Toolbar; default is false for compability
  • Fixed #3516: Trigger invalid-form event even when remote validation is involved
  • Added invalidHandler option as a shortcut to bind(“invalid-form”, function() {})
  • Fixed Safari issue for loading indicator in ajaxSubmit-integration-demo (append to body first, then hide)
  • Added test for creditcard validation and improved default message
  • Enhanced remote validation, accepting options to passthrough to $.ajax as paramter (either url string or options, including url property plus everything else that $.ajax supports)

As usual, support is available via:

  • Please post questions to the jQuery discussion list, putting [validate] into the subject of your post, making it easier to spot it and respond quickly. Keep your question short and succinct and provide code when possible; a testpage makes it much more likely that you get an useful answer in no time.
  • Please post bug reports and other contributions (enhancements, features, eg. new validation methods) to the jQuery bug tracker (requires registration). Please put [validate] into the title of a ticket.

Release: Tooltip Plugin 1.3

Sunday, August 24th, 2008

This is a small update for the jQuery tooltip plugin. The support for image maps is back, the deprecated $.fn.Tooltip is gone (just use tooltip() instead), and two new features: A fade option, which takes the duration to fade in/out a tooltip in milliseconds. And the positionLeft-option, which configures the plugin to display the tooltip on the left of the cursor.

From the changelog:

  • Added fade option (duration in ms) for fading in/out tooltips; IE <= 6 is excluded when bgiframe plugin is included
  • Fixed imagemaps in IE, added back example
  • Added positionLeft-option – positions the tooltip to the left of the cursor
  • Remove deprecated $.fn.Tooltip in favor of $.fn.tooltip

Have fun!