CoreFiles by mySites.guru
custom-fields.dev.js34 lines, 1,006 bytes, from wordpress-2.8.zip
Raw History Compare with 2.7.1
md5
06cb5141c3ac8e8abdfa887560fc9fc0
sha1
a4cc6632bf4b730a223eadab47f98c00a7d54c0e
sha256
da497494613e68071f5fcf54fa2fd26ed491d65865af188022e7c2c639899ace
jQuery(document).ready( function($) {
	var before, addBefore, addAfter, delBefore;

	before = function() {
		var nonce = $('#newmeta [name=_ajax_nonce]').val(), postId = $('#post_ID').val();
		if ( !nonce || !postId ) { return false; }
		return [nonce,postId];
	}

	addBefore = function( s ) {
		var b = before();
		if ( !b ) { return false; }
		s.data = s.data.replace(/_ajax_nonce=[a-f0-9]+/, '_ajax_nonce=' + b[0]) + '&post_id=' + b[1];
		return s;
	};

	addAfter = function( r, s ) {
		var postId = $('postid', r).text(), h;
		if ( !postId ) { return; }
		$('#post_ID').attr( 'name', 'post_ID' ).val( postId );
		h = $('#hiddenaction');
		if ( 'post' == h.val() ) { h.val( 'postajaxpost' ); }
	};

	delBefore = function( s ) {
		var b = before(); if ( !b ) return false;
		s.data._ajax_nonce = b[0]; s.data.post_id = b[1];
		return s;
	}

	$('#the-list')
		.wpList( { addBefore: addBefore, addAfter: addAfter, delBefore: delBefore } )
		.find('.updatemeta, .deletemeta').attr( 'type', 'button' );
} );

The same content is in 45 releases, WordPress 2.8-RC1 to 3.1.4. See them all, or every version of this file.