Remove compat code for version 1.27

This extension requires 1.28.1

Change-Id: I842e7915002a1b30216599915ffa268d3374b00c
This commit is contained in:
Umherirrender 2019-03-03 01:21:56 +01:00 committed by Reedy
parent 9baf35594c
commit 38ff8983c7
5 changed files with 2 additions and 63 deletions

View file

@ -1,30 +0,0 @@
/**
* JavaScript for the Nuke MediaWiki extension.
* @see https://www.mediawiki.org/wiki/Extension:Nuke
*
* @licence GNU GPL v2 or later
* @author Jeroen De Dauw <jeroendedauw at gmail dot com>
*/
( function ( $ ) {
'use strict';
$( document ).ready( function () {
function selectPages( check ) {
$( 'input[type=checkbox]' ).prop( 'checked', check );
}
$( '#toggleall' ).click( function () {
selectPages( true );
} );
$( '#togglenone' ).click( function () {
selectPages( false );
} );
$( '#toggleinvert' ).click( function () {
$( 'input[type="checkbox"]' ).each( function () {
$( this ).prop( 'checked', !$( this ).is( ':checked' ) );
} );
} );
} );
}( jQuery ) );

View file

@ -26,11 +26,6 @@
]
},
"ResourceModules": {
"ext.nuke": {
"scripts": [
"ext.nuke.js"
]
},
"ext.nuke.confirm": {
"scripts": [
"ext.nuke.confirm.js"

View file

@ -15,10 +15,8 @@
"nuke-multiplepeople": "Mass deletion of recently added pages",
"nuke-tools": "This tool allows for mass deletions of pages recently added by a given user or an IP address.\nInput the username or IP address to get a list of pages to delete, or leave blank for all users.",
"nuke-submit-user": "List pages",
"nuke-toggleinvert": "Invert",
"nuke-submit-delete": "Delete selected",
"right-nuke": "Mass delete pages",
"nuke-select": "Select: $1",
"nuke-userorip": "Username, IP address or blank:",
"nuke-maxpages": "Maximum number of pages:",
"nuke-editby": "Created by [[Special:Contributions/$1|{{GENDER:$1|$1}}]]",

View file

@ -26,10 +26,8 @@
"nuke-multiplepeople": "Reason for deletion in logs, when pages created by multiple users were deleted.\n\n{{msg-mw|nuke-defaultreason}} is used when pages created by only 1 user are deleted.",
"nuke-tools": "Used as intro text for the Nuke (mass deletion) form.",
"nuke-submit-user": "The submit button of a form used to generate a list of pages. \"List\" is a verb here.",
"nuke-toggleinvert": "Used to invert checkbox selection.\n{{Identical|Invert}}",
"nuke-submit-delete": "Submit button to delete the selected pages.",
"right-nuke": "{{doc-right|nuke}}",
"nuke-select": "Parameters:\n* $1 - two links: {{msg-mw|Powersearch-toggleall}} and {{msg-mw|Powersearch-togglenone}} which respectively selects all pages and de-selects all\npages\n{{Identical|Select}}",
"nuke-userorip": "Used as label for \"target\" input box.",
"nuke-maxpages": "Used as label for \"nuke limit\" input box.",
"nuke-editby": "This message is followed by {{msg-mw|Comma-separator}} and {{msg-mw|Nuke-viewchanges}}.\n\nParameters:\n* $1 - a username",

View file

@ -176,27 +176,8 @@ class SpecialNuke extends SpecialPage {
);
// Select: All, None, Invert
// ListToggle was introduced in 1.27, old code kept for B/C
if ( class_exists( 'ListToggle' ) ) {
$listToggle = new ListToggle( $this->getOutput() );
$selectLinks = $listToggle->getHTML();
} else {
$out->addModules( 'ext.nuke' );
$links = [];
$links[] = '<a href="#" id="toggleall">' .
$this->msg( 'powersearch-toggleall' )->escaped() . '</a>';
$links[] = '<a href="#" id="togglenone">' .
$this->msg( 'powersearch-togglenone' )->escaped() . '</a>';
$links[] = '<a href="#" id="toggleinvert">' .
$this->msg( 'nuke-toggleinvert' )->escaped() . '</a>';
$selectLinks = Xml::tags( 'p',
null,
$this->msg( 'nuke-select' )
->rawParams( $this->getLanguage()->commaList( $links ) )->escaped()
);
}
$listToggle = new ListToggle( $this->getOutput() );
$selectLinks = $listToggle->getHTML();
$out->addHTML(
$selectLinks .
@ -390,9 +371,6 @@ class SpecialNuke extends SpecialPage {
* @return string[] Matching subpages
*/
public function prefixSearchSubpages( $search, $limit, $offset ) {
if ( !class_exists( 'UserNamePrefixSearch' ) ) { // check for version 1.27
return [];
}
$user = User::newFromName( $search );
if ( !$user ) {
// No prefix suggestion for invalid user