});
// add events
- $('a.editinline').live('click', function(){
+ $('#the-list').on('click', 'a.editinline', function(){
inlineEditPost.edit(this);
return false;
});
$('#inline-edit label.inline-edit-tags').clone()
);
- // hiearchical taxonomies expandable?
- $('span.catshow').click(function(){
- $(this).hide().next().show().parent().next().addClass("cat-hover");
- });
-
- $('span.cathide').click(function(){
- $(this).hide().prev().show().parent().next().removeClass("cat-hover");
- });
-
$('select[name="_status"] option[value="future"]', bulkRow).remove();
$('#doaction, #doaction2').click(function(e){
}
};
-$(document).ready(function(){inlineEditPost.init();});
-})(jQuery);
+$( document ).ready( function(){ inlineEditPost.init(); } );
+
+// Show/hide locks on posts
+$( document ).on( 'heartbeat-tick.wp-check-locked-posts', function( e, data ) {
+ var locked = data['wp-check-locked-posts'] || {};
+
+ $('#the-list tr').each( function(i, el) {
+ var key = el.id, row = $(el), lock_data, avatar;
+
+ if ( locked.hasOwnProperty( key ) ) {
+ if ( ! row.hasClass('wp-locked') ) {
+ lock_data = locked[key];
+ row.find('.column-title .locked-text').text( lock_data.text );
+ row.find('.check-column checkbox').prop('checked', false);
+
+ if ( lock_data.avatar_src ) {
+ avatar = $('<img class="avatar avatar-18 photo" width="18" height="18" />').attr( 'src', lock_data.avatar_src.replace(/&/g, '&') );
+ row.find('.column-title .locked-avatar').empty().append( avatar );
+ }
+ row.addClass('wp-locked');
+ }
+ } else if ( row.hasClass('wp-locked') ) {
+ // Make room for the CSS animation
+ row.removeClass('wp-locked').delay(1000).find('.locked-info span').empty();
+ }
+ });
+}).on( 'heartbeat-send.wp-check-locked-posts', function( e, data ) {
+ var check = [];
+
+ $('#the-list tr').each( function(i, el) {
+ if ( el.id )
+ check.push( el.id );
+ });
+
+ if ( check.length )
+ data['wp-check-locked-posts'] = check;
+});
+
+}(jQuery));