text: jQuery(document).ready(function(e){e(".colorpicker").hide();e(".colorpicker").each(function(){e(this).farbtastic(e(this).closest(".color-picker").find(".color"))});e(".color").click(function(){e(this).closest(".color-picker").find(".colorpicker").fadeIn()});e(document).mousedown(function(){e(".colorpicker").each(function(){var t=e(this).css("display");t=="block"&&e(this).fadeOut()})});var t;jQuery.fn.uploadMediaFile=function(e,n){var r=e.attr("id"),i=r.replace("_button",""),s=r.replace("_button","_preview");if(t){t.open();return}t=wp.media.frames.file_frame=wp.media({title:jQuery(this).data("uploader_title"),button:{text:jQuery(this).data("uploader_button_text")},multiple:!1});t.on("select",function(){attachment=t.state().get("selection").first().toJSON();jQuery("#"+i).val(attachment.id);n&&jQuery("#"+s).attr("src",attachment.sizes.thumbnail.url);t=!1});t.open()};jQuery(".image_upload_button").click(function(){jQuery.fn.uploadMediaFile(jQuery(this),!0)});jQuery(".image_delete_button").click(function(){jQuery(this).closest("td").find(".image_data_field").val("");jQuery(this).closest("td").find(".image_preview").remove();return!1})});