/*jslint browser: true*/

( function( $, vui ) {

	$.widget( 'vui.vui_list', {

		_create: function() {

			var $node = $( this.element );

			var updateListSelection = function() {

				$node.find( 'li.vui-checkbox > label > input, li.vui-radio > label > input' ).each(
					function ( index, inputNode ) {
						
						var $input = $( inputNode );

						$input.closest( 'li.vui-checkbox, li.vui-radio' ).toggleClass(
							'vui-selected', $input.prop( 'checked' )
						);
					
					}
				);

			};

			updateListSelection();

			$node.change( function( args ) {

				var $target = $( args.target );
				
				if ( $target.attr( 'type' ) === 'checkbox' ) {
					
					$target.closest( 'li.vui-checkbox' ).toggleClass(
						'vui-selected', $target.prop( 'checked' ) 
					);

				} else if ( $target.attr( 'type' ) === 'radio' ) {

					updateListSelection();

				}

			} );

		}

	} );

	vui.addClassInitializer(
			'vui-list',
			function( node ) {
				$( node ).vui_list();
			}
		);

} )( window.jQuery, window.vui );
@@ -37,18 +37,33 @@
 on( 
-$, vui ) %7B
+vui, $ ) %7B%0D%0A%0D%0A%09$ = vui.$;
 %0D%0A%0D%0A
@@ -334,16 +334,10 @@
  %7B%0D%0A
-%09%09%09%09%09%09
 %0D%0A
+
 %09%09%09%09
@@ -499,23 +499,18 @@
 %09%09%09%09);%0D%0A
-%09%09%09%09%09
 %0D%0A
+
 %09%09%09%09%09%7D%0D%0A
@@ -633,22 +633,18 @@
 get );%0D%0A
-%09%09%09%09
 %0D%0A
+
 %09%09%09%09if (
@@ -691,15 +691,10 @@
  %7B%0D%0A
-%09%09%09%09%09
 %0D%0A
+
 %09%09%09%09
@@ -792,17 +792,16 @@
 ecked' )
- 
 %0D%0A%09%09%09%09%09)
@@ -1041,27 +1041,12 @@
 %0D%0A%0D%0A
+
 %7D )(
- window.jQuery,
  win

Add the jQuery object to vui and reference that inside controls. Gives us a central point for maintaining a well-defined jQuery object