CoreFiles by mySites.guru
theme-options.js35 lines, 754 bytes, from wordpress-3.2-beta2.zip
Raw History Compare with 3.2-beta1
md5
233f87305f39852c252f6cf65438a2a1
sha1
f110d9e79090d87b7c1ce198e03ffe6cd0881789
sha256
29347dc0a4f6a9c83dcec848d6ab91199a22b0dd2096394982121f1461975c7f
var farbtastic;

(function($){
	var pickColor = function(a) {
		farbtastic.setColor(a);
		$('#link-color').val(a);
		$('#link-color-example').css('background-color', a);
	};

	$(document).ready( function() {
		farbtastic = $.farbtastic('#colorPickerDiv', pickColor);

		pickColor( $('#link-color').val() );

		$('.pickcolor').click( function(e) {
			$('#colorPickerDiv').show();
			e.preventDefault();
		});

		$('#link-color').keyup( function() {
			var a = $('#link-color').val(),
				b = a;

			a = a.replace(/[^a-fA-F0-9]/, '');
			if ( '#' + a !== b )
				$('#link-color').val(a);
			if ( a.length === 3 || a.length === 6 )
				pickColor( '#' + a );
		});

		$(document).mousedown( function() {
			$('#colorPickerDiv').hide();
		});
	});
})(jQuery);

The same content is in 2 releases, WordPress 3.2-beta1 to 3.2-beta2. See them all, or every version of this file.