Debian Codegraph @

resources/src/mediawiki.misc-authed-ooui/special.undelete.js

raw symbols SCIP
1 /*!
2 * JavaScript for Special:Undelete
3 */
4 ( function () {
5
6 if ( mw.config.get( 'wgCanonicalSpecialPageName' ) !== 'Undelete' ) {
7 return;
8 }
9
10 $( () => {
11 const $widget = $( '#wpComment' ).closest( '.oo-ui-widget' );
12
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 }
19
20 const wpComment = OO.ui.infuse( $widget );
21
22 const wpCommentList = OO.ui.infuse( $( '#wpCommentList' ).closest( '.oo-ui-widget' ) );
23
24 $( '#mw-undelete-invert' ).on( 'click', () => {
25 $( '.mw-undelete-revlist input[type="checkbox"]' ).prop( 'checked', ( i, val ) => !val );
26 } );
27
28 mw.widgets.visibleCodePointLimitWithDropdown( wpComment, wpCommentList, mw.config.get( 'wgCommentCodePointLimit' ) );
29 } );
30 }() );