]> scripts.mit.edu Git - autoinstalls/wordpress.git/blobdiff - wp-admin/js/custom-background.js
WordPress 3.4
[autoinstalls/wordpress.git] / wp-admin / js / custom-background.js
index 6cf8851bde9b97c890da2160e9b71055827bc096..66b8bbfd406c33e7c038fb61d8b6f6527a962c85 100644 (file)
@@ -1 +1 @@
-var farbtastic;function pickColor(a){farbtastic.setColor(a);jQuery("#background-color").val(a);jQuery("#custom-background-image").css("background-color",a);if(a&&a!=="#"){jQuery("#clearcolor").show()}else{jQuery("#clearcolor").hide()}}jQuery(document).ready(function(){jQuery("#pickcolor").click(function(){jQuery("#colorPickerDiv").show();return false});jQuery("#clearcolor a").click(function(a){pickColor("");a.preventDefault()});jQuery("#background-color").keyup(function(){var b=jQuery("#background-color").val(),a=b;if(a.charAt(0)!="#"){a="#"+a}a=a.replace(/[^#a-fA-F0-9]+/,"");if(a!=b){jQuery("#background-color").val(a)}if(a.length==4||a.length==7){pickColor(a)}});jQuery('input[name="background-position-x"]').change(function(){jQuery("#custom-background-image").css("background-position",jQuery(this).val()+" top")});jQuery('input[name="background-repeat"]').change(function(){jQuery("#custom-background-image").css("background-repeat",jQuery(this).val())});farbtastic=jQuery.farbtastic("#colorPickerDiv",function(a){pickColor(a)});pickColor(jQuery("#background-color").val());jQuery(document).mousedown(function(){jQuery("#colorPickerDiv").each(function(){var a=jQuery(this).css("display");if(a=="block"){jQuery(this).fadeOut(2)}})})});
\ No newline at end of file
+var farbtastic,pickColor;(function(b){var a="";pickColor=function(c){farbtastic.setColor(c);b("#background-color").val(c);b("#custom-background-image").css("background-color",c);if((a&&c===a)||(!a&&(""===c||"#"===c))){b("#clearcolor").hide()}else{b("#clearcolor").show()}};b(document).ready(function(){a=b("#defaultcolor").val();b("#pickcolor").click(function(){b("#colorPickerDiv").show();return false});b("#clearcolor a").click(function(c){pickColor(a);c.preventDefault()});b("#background-color").keyup(function(){var d=b("#background-color").val(),c=d;if(c.charAt(0)!="#"){c="#"+c}c=c.replace(/[^#a-fA-F0-9]+/,"");if(c!=d){b("#background-color").val(c)}if(c.length==4||c.length==7){pickColor(c)}});b('input[name="background-position-x"]').change(function(){b("#custom-background-image").css("background-position",b(this).val()+" top")});b('input[name="background-repeat"]').change(function(){b("#custom-background-image").css("background-repeat",b(this).val())});farbtastic=b.farbtastic("#colorPickerDiv",function(c){pickColor(c)});pickColor(b("#background-color").val());b(document).mousedown(function(){b("#colorPickerDiv").each(function(){var c=b(this).css("display");if(c=="block"){b(this).fadeOut(2)}})})})})(jQuery);
\ No newline at end of file