]> scripts.mit.edu Git - autoinstalls/wordpress.git/blobdiff - wp-includes/js/wp-lists.js
Wordpress 4.6
[autoinstalls/wordpress.git] / wp-includes / js / wp-lists.js
index 117e892f727b80a634b69f426967264e8628468f..2b8e51339bff79fddf2665d6654397b3ea771684 100644 (file)
@@ -297,10 +297,28 @@ wpList = {
                        res = wpAjax.parseAjaxResponse(r, s.response, s.element);
                        rres = r;
 
-                       if ( !res || res.errors ) {
+                       if ( true === res ) {
+                               return true;
+                       }
+
+                       if ( ! res || res.errors ) {
                                element.stop().stop().css( 'backgroundColor', '#FF3333' )[isClass?'removeClass':'addClass'](s.dimClass).show().queue( function() { list.wpList.recolor(); $(this).dequeue(); } );
                                return false;
                        }
+
+                       if ( 'undefined' !== typeof res.responses[0].supplemental.comment_link ) {
+                               var submittedOn = element.find( '.submitted-on' ),
+                                       commentLink = submittedOn.find( 'a' );
+
+                               // Comment is approved; link the date field.
+                               if ( '' !== res.responses[0].supplemental.comment_link ) {
+                                       submittedOn.html( $('<a></a>').text( submittedOn.text() ).prop( 'href', res.responses[0].supplemental.comment_link ) );
+
+                               // Comment is not approved; unlink the date field.
+                               } else if ( commentLink.length ) {
+                                       submittedOn.text( commentLink.text() );
+                               }
+                       }
                };
 
                s.complete = function(x, st) {