mirror of
https://github.com/WordPress/WordPress.git
synced 2024-11-01 08:19:38 +01:00
2710bcade1
* This moves our "development" versions from .dev.js to .js (same for css). * The compressed version then moves from .js to .min.js (same for css). By switching to the standard .min convention, it sets expectations for developers, and works nicely with existing tools such as ack. fixes #21633. git-svn-id: http://core.svn.wordpress.org/trunk@21592 1a063a9b-81f0-0310-95a4-ce76da25c4cd
35 lines
1008 B
JavaScript
35 lines
1008 B
JavaScript
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' );
|
|
} );
|