Merge "rdbms: make transaction rounds apply DBO_TRX to DB_REPLICA connections"
[mediawiki.git] / resources / src / mediawiki.misc-authed-ooui / special.undelete.js
blobacf901d271e1140257c33de39ed51f4ce9a43649
1 /*!
2  * JavaScript for Special:Undelete
3  */
4 ( function () {
6         if ( mw.config.get( 'wgCanonicalSpecialPageName' ) !== 'Undelete' ) {
7                 return;
8         }
10         $( () => {
11                 const $widget = $( '#wpComment' ).closest( '.oo-ui-widget' );
13                 if ( !$widget.length ) {
14                         // If the user has permission to see only the deleted
15                         // revisions but not restore or the page is not currently
16                         // deleted there'd be no comment field and no checkboxes.
17                         return;
18                 }
20                 const wpComment = OO.ui.infuse( $widget );
22                 const wpCommentList = OO.ui.infuse( $( '#wpCommentList' ).closest( '.oo-ui-widget' ) );
24                 $( '#mw-undelete-invert' ).on( 'click', () => {
25                         $( '.mw-undelete-revlist input[type="checkbox"]' ).prop( 'checked', ( i, val ) => !val );
26                 } );
28                 mw.widgets.visibleCodePointLimitWithDropdown( wpComment, wpCommentList, mw.config.get( 'wgCommentCodePointLimit' ) );
29         } );
30 }() );