b6894e1703
* 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: https://develop.svn.wordpress.org/trunk@17721 602fd350-edb4-49c9-b593-d223f7449a82
39 lines
905 B
JavaScript
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);
|
|
}
|
|
});
|
|
});
|
|
}); |