]> scripts.mit.edu Git - autoinstalls/wordpress.git/blobdiff - wp-admin/js/inline-edit-post.js
Wordpress 3.6
[autoinstalls/wordpress.git] / wp-admin / js / inline-edit-post.js
index 9abf478ada6fcf9db21d78e796c386c282e45ff3..8076c31e09ae10f88e3fc5af1899eb9d59407d00 100644 (file)
@@ -42,7 +42,7 @@ inlineEditPost = {
                });
 
                // add events
-               $('a.editinline').live('click', function(){
+               $('#the-list').on('click', 'a.editinline', function(){
                        inlineEditPost.edit(this);
                        return false;
                });
@@ -53,15 +53,6 @@ inlineEditPost = {
                        $('#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){
@@ -299,5 +290,42 @@ inlineEditPost = {
        }
 };
 
-$(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(/&amp;/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));