' ).appendTo( app.$content );
+ $.getJSON( '/w/api.php', {
+ action: 'query',
+ format: 'json',
+ list: 'search',
+ srsearch: 'User:' + app.relevantUser + ' prefix:Wikipedia:Editing restrictions/',
+ srnamespace: 4
+ } )
+ .done( ( data ) => {
+ app.$content.find( '#empty' ).remove();
+ if ( data.query.search.length ) {
+ $editingRestrictions.append( $( '
', { class: 'mw-headline' } )
+ .text( 'Search results: Wikipedia:Editing restrictions' ) );
+ $.each( data.query.search, ( i, result ) => {
+ $editingRestrictions.append( $( '
', {
+ href: '/wiki/' + result.title.replace( / /g, '_' ) + '#:~:text=' + app.relevantUser,
+ title: result.title
+ } ).text( result.title ) ) );
+ $editingRestrictions.append( $( '
' ) );
+ } );
+ } else {
+ $editingRestrictions.remove();
+ }
+ doFinalPanelLoadingTasks();
+ } )
+ .fail( () => {
+ putErrorMessageInPanel();
+ } );
+
+ const $arbitrationEnforcement = $( '
' ).appendTo( app.$content );
+ $.getJSON( '/w/api.php', {
+ action: 'query',
+ format: 'json',
+ list: 'search',
+ srsearch: 'User:' + app.relevantUser + ' prefix:Wikipedia:Arbitration enforcement log/',
+ srnamespace: 4
+ } )
+ .done( ( data ) => {
+ app.$content.find( '#empty' ).remove();
+ if ( data.query.search.length ) {
+ $arbitrationEnforcement.append( $( '
' )
+ .append( '
', { class: 'mw-headline' } )
+ .text( 'Search results: Wikipedia:Arbitration enforcement log' ) );
+ $.each( data.query.search, ( i, result ) => {
+ $arbitrationEnforcement.append( $( '
' )
+ .append( $( '
', {
+ href: '/wiki/' + result.title.replace( / /g, '_' ) + '#:~:text=' + app.relevantUser,
+ title: result.title
+ } ).text( result.title ) ) );
+ $arbitrationEnforcement.append( $( '
' + result.snippet + '
' ) );
+ $arbitrationEnforcement.append( $( '
' ) );
+ } );
+ } else {
+ $arbitrationEnforcement.remove();
+ }
+ doFinalPanelLoadingTasks();
+ } )
+ .fail( () => {
+ putErrorMessageInPanel();
+ } );
+ }
+
+ function openCtopAlertPanel() {
+ openPanel( '/wiki/Special:AbuseLog?wpSearchTitle=User_talk%3A' + app.relevantUser + '&wpSearchFilter=602' );
+ $.getJSON( '/w/api.php', {
+ action: 'query',
+ format: 'json',
+ list: 'abuselog',
+ afldir: 'older',
+ afltitle: 'User talk:' + app.relevantUser,
+ aflfilter: 602
+ } )
+ .done( ( data ) => {
+ app.$content.empty();
+ if ( data.query.abuselog.filter( ( item ) => ( item.revid ) ).length ) {
+ $.each( data.query.abuselog, ( i, item ) => {
+ if ( item.result == 'tag' && item.revid ) {
+ const $item = $( '
' ).appendTo( app.$content );
+ $.getJSON( '/w/api.php', {
+ action: 'compare',
+ format: 'json',
+ fromrev: item.revid,
+ torelative: 'prev',
+ prop: 'user|comment|diff'
+ } )
+ .done( ( comparedata ) => {
+ let ts = new Date( item.timestamp ).toUTCString();
+ ts = ts.slice( 5, ts.indexOf( 'GMT' ) - 1 );
+ const sum = ts + ' [[User:' + comparedata.compare.touser + '|' + comparedata.compare.touser + ']] ([[Special:Diff/' + item.revid + '|diff]])\n';
+
+ let diff = '';
+ $( comparedata.compare[ '*' ] ).find( 'td.diff-addedline > div' ).each( ( i, item ) => {
+ diff += $( item ).html() + '\n';
+ } );
+
+ diff = $( '
' ).html( diff ).text();
+ diff = diff + "
" + sum + '
\n{{hr}}';
+ $.getJSON( '/w/api.php', { action: 'parse', format: 'json', contentmodel: 'wikitext', text: diff } )
+ .done( ( parsedata ) => {
+ $item.append( parsedata.parse.text[ '*' ] );
+ $item.find( '.mw-editsection' ).remove();
+ doFinalPanelLoadingTasks();
+ } );
+ } );
+ }
+ } );
+ } else {
+ doFinalPanelLoadingTasks();
+ }
+ } )
+ .fail( () => {
+ putErrorMessageInPanel();
+ } );
+ }
+
+ function closeAllPanels( e ) {
+ if ( e ) {
+ e.preventDefault();
+ }
+ $( 'body' ).off( 'keyup', app.$keyup );
+ if ( app.styleSheetFragment ) {
+ $( app.styleSheetFragment.ownerNode ).remove();
+ app.styleSheetFragment = null;
+ }
+ $( app.$window ).remove();
+ $( app.active ).removeClass( 'active' );
+ app.active = null;
+ }
+
+ $( () => {
+ mw.loader.using( [ 'mediawiki.util' ], () => {
+ execute();
+ } );
+ } );
+}( jQuery, mediaWiki ) );
diff --git a/UnblockReview/main.js b/UnblockReview/main.js
index a07f2fe..05b1e09 100644
--- a/UnblockReview/main.js
+++ b/UnblockReview/main.js
@@ -47,15 +47,15 @@ Many additional bugs fixed.
container.innerHTML = `
|
-
+
|
-
+
|
|
-
+
|