2013-02-18 17:26:00 -05:00
|
|
|
window.wp=window.wp||{};(function(b){var a;b(".post-format-select a").on("click",function(f){f.preventDefault();var d=b(this),c=d.data("wpFormat");b(".post-format-select a.nav-tab-active").removeClass("nav-tab-active");d.addClass("nav-tab-active").blur();b("#post_format").val(c);b("#post-body-content").attr("class","wp-format-"+c)});b("#wp-format-image-select").click(function(e){var c=b(this),f=b("#wp-format-image-holder"),d=b("#wp_format_image");e.preventDefault();if(a){a.open();return}a=wp.media.frames.formatImage=wp.media({title:c.data("choose"),library:{type:"image"},button:{text:c.data("update")}});a.on("select",function(){var h=a.state().get("selection").first(),g=h.get("url");d.attr("value",h.id);c.html('<img src="'+g+'" />');f.removeClass("empty")});a.open()})})(jQuery);
|