PluginProbe
Stream – Activity Log & Audit Trail / 2.0.2
Stream – Activity Log & Audit Trail v2.0.2
4.4.0 4.3.0 4.2.2 4.2.1 trunk 2.0.1 2.0.2 2.0.3 2.0.4 2.0.5 3.0.0 3.0.1 3.0.2 3.0.3 3.0.4 3.0.5 3.0.6 3.0.7 3.1 3.1.1 3.10.0 3.2.0 3.2.1 3.2.2 3.2.3 All 50 releases
stream / ui / js / global.js

global.js in Stream – Activity Log & Audit Trail 2.0.2, at ui/js/global.js

48 lines 1.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 /* globals wp_stream_global */
2 /* exported wp_stream_regenerate_alt_rows */
3 jQuery( function( $ ) {
4
5 // List table actions, ignores filtering
6 $( '.actions :submit:not([name="filter_action"])' ).on( 'click', function( e ) {
7 if ( $( 'table.widefat tbody :checkbox:checked' ).length > wp_stream_global.bulk_actions.threshold ) {
8 warning_message( e );
9 }
10 });
11
12 // Post type empty trash
13 $( '#delete_all' ).on( 'click', function( e ) {
14 var trash_count = parseInt( $( 'ul.subsubsub li.trash .count' ).text().replace( /\D/g, '' ), 10 );
15
16 if ( trash_count > wp_stream_global.bulk_actions.threshold ) {
17 warning_message( e );
18 }
19 });
20
21 function warning_message( e ) {
22 if ( ! window.confirm( wp_stream_global.bulk_actions.i18n.confirm_action ) ) {
23 e.preventDefault();
24 }
25 }
26
27 // Content import
28 $( '#import-upload-form :submit' ).on( 'click', function( e ) {
29 e.preventDefault();
30 window.alert( wp_stream_global.bulk_actions.i18n.confirm_import );
31 window.location.href = wp_stream_global.plugins_screen_url;
32 });
33
34 });
35
36 // Regenerate alternating row classes
37 var wp_stream_regenerate_alt_rows = function( $rows ) {
38 if ( ! $rows.length ) {
39 return false;
40 }
41
42 $rows.removeClass( 'alternate' );
43
44 $rows.each( function( index ) {
45 jQuery( this ).addClass( index % 2 ? '' : 'alternate' );
46 });
47 };
48