# stream/3.0.2/ui/js/global.js

Stream – Activity Log &amp; Audit Trail, version 3.0.2. 41 lines.

- Page: https://pluginprobe.com/plugins/stream/3.0.2/code/ui/js/global.js
- Raw: https://pluginprobe.com/plugins/stream/3.0.2/raw/ui/js/global.js
- Modified: 2015-10-02T03:27:50+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/stream/3.0.2/code/ui/js/global.js#L10-L20`.

```javascript
/* globals wp_stream_global */
/* exported wp_stream_regenerate_alt_rows */
jQuery( function( $ ) {

	// List table actions, ignores filtering
	$( '.actions :submit:not([name="filter_action"])' ).on( 'click', function( e ) {
		if ( $( 'table.widefat tbody :checkbox:checked' ).length > wp_stream_global.bulk_actions.threshold ) {
			warning_message( e );
		}
	});

	// Post type empty trash
	$( '#delete_all' ).on( 'click', function( e ) {
		var trash_count = parseInt( $( 'ul.subsubsub li.trash .count' ).text().replace( /\D/g, '' ), 10 );

		if ( trash_count > wp_stream_global.bulk_actions.threshold ) {
			warning_message( e );
		}
	});

	function warning_message( e ) {
		if ( ! window.confirm( wp_stream_global.bulk_actions.i18n.confirm_action ) ) {
			e.preventDefault();
		}
	}

});

// Regenerate alternating row classes
var wp_stream_regenerate_alt_rows = function( $rows ) {
	if ( ! $rows.length ) {
		return false;
	}

	$rows.removeClass( 'alternate' );

	$rows.each( function( index ) {
		jQuery( this ).addClass( index % 2 ? '' : 'alternate' );
	});
};

```
