PageSourceSearch

https://ocdaction.org.uk/wp-content/plugins/moderation-tools-for-bbpress/js/report-post.js?ver=1.2.0

js ocdaction.org.uk collected 2026-10-02 05:23:30 UTC 1,421 bytes, 73 lines download raw bytes

1jQuery( function( $ ) {
2
3	$( '.bbp-report-link' ).on( 'click' , function( event ) {
4
5		event.preventDefault();
6
7		if ( $( this ).hasClass( 'bbp-report-linked-reported' ) ) {
8
9			return;
10
11		}
12
13		$( this ).siblings( '.bbp-report-type' ).css( 'display', 'inline-block' );
14
15	});
16
17	$( '.bbp-report-select' ).on( 'change', function() {
18
19		bbp_modtools_report_post( $( this ) );
20
21	});
22
23	$( '.bbp-report-link' ).each( function() {
24
25		bbp_modtools_check_reported( $( this ).attr( 'data-post-id' ) );
26
27	});
28
29	/*
30	*
31	* bbp_modtools_report_post
32	* Ajax post to the server when user reports a post
33	*
34	*/
35	function bbp_modtools_report_post( obj ) {
36
37		var post_id = $( obj ).attr( 'data-post-id' );
38		var type = $( obj ).val();
39		var container = $( obj ).parent();
40		var data = {
41			action: 'bbp_report_post',
42			post_id: post_id,
43			type: type,
44			nonce: REPORT_POST.nonce,
45		}
46
47		$.post( REPORT_POST.ajax_url, data, function( response ) {
48
49			localStorage.setItem( 'bbp_reported_post_' + post_id, 1 );
50
51			$( container ).html( response );
52			$( '.bbp-report-link-' + post_id ).text( 'Reported' ).addClass( 'bbp-report-linked-reported' );
53
54		});
55
56	}
57
58	/*
59	*
60	* bbp_modtools_check_reported
61	*
62	*/
63	function bbp_modtools_check_reported( post_id ) {
64
65		if ( localStorage.getItem( 'bbp_reported_post_' + post_id ) == 1 ) {
66
67			$( '.bbp-report-link-' + post_id ).text( 'Reported' ).addClass( 'bbp-report-linked-reported' );
68
69		}
70
71	}
72
73});

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.