/**
 * jQuery Library for Multilingual Press
 *
 * @version        2014.03.24
 * @package		mlp
 *
 * @todo		Doc
 */

jQuery.noConflict();
( function( $ ) {

	/**
	 * Class Holder
	 */
	multilingual_press = {

		/**
		 * Initial Function
		 */
		init : function () {
			this.do_blog_checkup();
			this.set_toggle();
		},

		/**
		 * Retrieves all responses from the blog checkup
		 *
		 * @since	0.8
		 */
		do_blog_checkup : function() {
			if ( ! '#multilingual_press_checkup' )
				return;

			$( '#multilingual_press_checkup_link' ).live( 'click', function() {
				var data = {
					action: 'checkup_blogs'
				};

				$.ajax( {
    				url: ajaxurl,
    				data: data,
    				async: true,
    				success: function ( response ) {
    					$( '#multilingual_press_checkup' ).append( response ).delay( 250 ).animate( {
    						backgroundColor: 'lightYellow',
						    borderBottomColor: '#E6DB55',
						    borderLeftColor: '#E6DB55',
    						borderRightColor: '#E6DB55',
    						borderTopColor: '#E6DB55'
    					}, 500 ).delay( 3500 ).slideUp();
    				}
    			} );
			} );
		},

		/**
		 * Toggle handler, show/hide elements with the class 'mlp_toggler'.
		 */
		set_toggle: function () {

			$(document).on("click", ".mlp_toggler", function (event) {

				var toggle_container = $($(this).data('toggle_selector'));

				// buttons and links
				if ('submit' == this.type || 'A' == this.tagName) {
					event.stopPropagation();
					event.preventDefault();
					toggle_container.toggle();
					return false;
				}

				// labels, needs improvements
				if ('LABEL' == this.tagName) {
					var target = $('#' + $(this).attr('for'));

					/* probably not necessary or useful
					 if ( 'radio' != target.attr( 'type' ) )
					 return true;*/

					event.stopPropagation();

					$('input[name="' + target.attr('name') + '"]').change(function () {
						toggle_container.toggle(target.val() == $(this).val());
						return true;
					});

					return true;
				}

				toggle_container.toggle();

				return false;
			});
		}
	};

	$( document ).ready( function( $ ) {
		multilingual_press.init();
	} );

} )( jQuery );
@@ -178,16 +178,20 @@
 r%0A%09 */%0A%09
+var 
 multilin
@@ -262,24 +262,27 @@
 ion () %7B%0A%09%09%09
+// 
 this.do_blog
@@ -315,16 +315,37 @@
 ggle();%0A
+%09%09%09this.copy_post();%0A
 %09%09%7D,%0A%0A%09%09
@@ -2058,16 +2058,705 @@
 %0A%09%09%09%7D);%0A
+%09%09%7D,%0A%0A%09%09/**%0A%09%09 * Copy post buttons next to media buttons.%0A%09%09 */%0A%09%09copy_post: function () %7B%0A%0A%09%09%09$( document ).on( %22click%22, %22.mlp_copy_button%22, function ( event ) %7B%0A%09%09%09%09event.stopPropagation();%0A%09%09%09%09event.preventDefault();%0A%0A%09%09%09%09// @formatter:off%0A%09%09%09%09var blog_id = $( this ).data( %22blog_id%22 ),%0A%09%09%09%09%09title   = $( %22#title%22 ).val(),%0A%09%09%09%09%09content = $( %22#content%22 ).val(),%0A%09%09%09%09%09prefix  = %22mlp_translation_data_%22 + blog_id,%0A%09%09%09%09%09mce     = tinyMCE.get( prefix + %22_content%22 );%0A%0A%09%09%09%09if ( title )%0A%09%09%09%09%09$( %22#%22 + prefix + %22_title%22 ).val( title );%0A%0A%09%09%09%09if ( content ) %7B%0A%09%09%09%09%09$( %22#%22 + prefix + %22_content%22 ).val( content );%0A%0A%09%09%09%09%09if ( mce )%0A%09%09%09%09%09%09mce.setContent( content );%0A%09%09%09%09%7D%0A%09%09%09%09// @formatter:on%0A%09%09%09%7D);%0A
 %09%09%7D%0A%09%7D;%0A

disable blog check