Leitgedanken/msd2/wordpress/wp-content/plugins/amp/assets/js/amp-validated-urls-index.js
2023-01-23 11:03:31 +01:00

35 lines
715 B
JavaScript

/* exported ampValidatedUrlsIndex */
const ampValidatedUrlsIndex = ( function() { // eslint-disable-line no-unused-vars
let component = {
classes: {}
};
/**
* The class for the new status
*
* @type {string}
*/
component.classes.new = 'new';
/**
* Boot.
*/
component.boot = function boot() {
component.highlightRowsWithNewStatus();
};
/**
* Highlight rows with new status.
*/
component.highlightRowsWithNewStatus = function highlightRowsWithNewStatus() {
document.querySelectorAll( 'tr[id^="post-"]' ).forEach( function( row ) {
if ( row.querySelector( 'span.status-text.' + component.classes.new ) ) {
row.classList.add( 'new' );
}
} );
};
return component;
}() );