Files
Testing/blog/wp-content/plugins/stream/ui/js/live-updates.min.js
sean 0e8a8b3028
Some checks failed
deploy-testing / deploy (push) Has been cancelled
Initial testing snapshot
2026-11-17 16:15:01 -05:00

1 line
1.7 KiB
JavaScript

jQuery(function(d){d(document).ready(function(){var _;"toplevel_page_wp_stream"===wp_stream_live_updates.current_screen&&"1"===wp_stream_live_updates.current_page&&"asc"!==wp_stream_live_updates.current_order&&(1<parseInt(wp_stream_live_updates.current_query_count,10)||(_=".toplevel_page_wp_stream #the-list",wp.heartbeat.interval("fast"),d(document).on("heartbeat-send.stream",function(e,t){t["wp-stream-heartbeat"]="live-update";var a=d(_+" tr:first .column-date time"),r=1;0!==a.length&&(r=""===a.attr("datetime")?1:a.attr("datetime")),t["wp-stream-heartbeat-last-time"]=r,t["wp-stream-heartbeat-query"]=wp_stream_live_updates.current_query}),d(document).on("heartbeat-tick.stream",function(e,t){var a,r,s,n,l,p,i;t["wp-stream-heartbeat"]&&0!==t["wp-stream-heartbeat"].length&&(a=d("#edit_stream_per_page").val(),r=d(_+" tr"),(s=d(t["wp-stream-heartbeat"])).addClass("new-row"),n=r.first().hasClass("alternate"),1!==s.length||n?(l=0!=s.length%2||n?"odd":"even",s.filter(":nth-child("+l+")").addClass("alternate")):s.addClass("alternate"),d(_).prepend(s),d(".metabox-prefs input").each(function(){var e;!0!==d(this).prop("checked")&&(e=d(this).val(),d("td.column-"+e).hide())}),(p=a-(s.length+r.length))<0&&d(_+" tr").slice(p).remove(),d(_+" tr.no-items").remove(),(i=t.total_items_i18n||"")&&(d(".displaying-num").text(i),d(".total-pages").text(t.total_pages_i18n),d(".tablenav-pages").find(".next-page, .last-page").toggleClass("disabled",t.total_pages===d(".current-page").val()),d(".tablenav-pages .last-page").attr("href",t.last_page_link)),d(_).parent().trigger("updated"),wp_stream_regenerate_alt_rows(d(_+" tr")),setTimeout(function(){d(".new-row").addClass("fadeout"),setTimeout(function(){d(_+" tr").removeClass("new-row fadeout")},500)},3e3))})))})});