WordPress/wp-admin/js/custom-background.min.js
Bot (Assets) c57076aab7 Compress scripts/styles: 3.5-beta2-22515.
git-svn-id: http://core.svn.wordpress.org/trunk@22515 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-11-09 22:58:35 +00:00

1 line
930 B
JavaScript

(function(a){a(document).ready(function(){var b=a("#custom-background-image"),c;a("#background-color").wpColorPicker({change:function(d,e){b.css("background-color",e.color.toString())},clear:function(){b.css("background-color","")}});a('input[name="background-position-x"]').change(function(){b.css("background-position",a(this).val()+" top")});a('input[name="background-repeat"]').change(function(){b.css("background-repeat",a(this).val())});a("#choose-from-library-link").click(function(e){var d=a(this);e.preventDefault();if(c){c.open();return}c=wp.media({title:d.data("choose"),library:{type:"image"}});c.toolbar.on("activate:select",function(){c.toolbar.view().add({select:{style:"primary",text:d.data("update"),click:function(){var f=c.state().get("selection").first();a.post(ajaxurl,{action:"set-background-image",attachment_id:f.id,size:"full"},function(){window.location.reload()})}}})});c.state("library")})})})(jQuery);