WordPress/wp-content/themes/twentyeleven/inc/theme-options/theme-options.js
iandstewart 90451d9052 Twenty Eleven: functions.php cleanup and introduction of theme options; see #17198
* Cleanup functions.php, adding comments and function_exists() checks following Twenty Ten's example
* Theme option for choosing an alternate (dark) color scheme. It currently only loads a placeholder CSS file with dark styles to follow.
* Theme option for selecting a link color that loads an internal style block for resetting link colors. An updated style.css will follow to take advantage of this.
* Theme options for selecting an alternate layout. Adds a class to the body element. An updated style.css will follow to take advantage of this.


git-svn-id: http://svn.automattic.com/wordpress/trunk@17721 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2011-04-26 22:52:18 +00:00

39 lines
905 B
JavaScript

var farbtastic;
function pickColor(a) {
farbtastic.setColor(a);
jQuery("#link-color").val(a);
jQuery("#link-color").css("background-color", a);
}
jQuery(document).ready(function() {
jQuery("#pickcolor").click(function() {
jQuery("#colorPickerDiv").show();
return false;
});
jQuery("#link-color").keyup(function() {
var b = jQuery("#link-color").val(),
a = b;
if (a.charAt(0) != "#") {
a = "#" + a;
}
a = a.replace(/[^#a-fA-F0-9]+/, "");
if (a != b) {
jQuery("#link-color").val(a);
}
if (a.length == 4 || a.length == 7) {
pickColor(a);
}
});
farbtastic = jQuery.farbtastic("#colorPickerDiv",
function(a) {
pickColor(a);
});
pickColor(jQuery("#link-color").val());
jQuery(document).mousedown(function() {
jQuery("#colorPickerDiv").each(function() {
var a = jQuery(this).css("display");
if (a == "block") {
jQuery(this).fadeOut(2);
}
});
});
});