From: jenkins-bot Date: Fri, 13 Oct 2017 19:42:22 +0000 (+0000) Subject: Merge "Remove old workaround for HHVM" X-Git-Tag: 1.31.0-rc.0~1780 X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=commitdiff_plain;h=128881c1f19a9c5c476822bde821ae898d0c5887;hp=edda8bbf8f6a7c37c0c2b8389d262e7afadf3bdc Merge "Remove old workaround for HHVM" --- diff --git a/RELEASE-NOTES-1.31 b/RELEASE-NOTES-1.31 index 57cbec456d..efadf9abb1 100644 --- a/RELEASE-NOTES-1.31 +++ b/RELEASE-NOTES-1.31 @@ -44,6 +44,8 @@ changes to languages because of Phabricator reports. * MessageBlobStore::insertMessageBlob() (deprecated in 1.27) was removed. * The global function wfBCP47 was renamed to LanguageCode::bcp47. * The global function wfBCP47 is now deprecated. +* The global function wfCountDown() is now deprecated in favor of + Maintenance::countDown(). == Compatibility == MediaWiki 1.31 requires PHP 5.5.9 or later. There is experimental support for diff --git a/autoload.php b/autoload.php index 0a2ecf01c5..abedffd169 100644 --- a/autoload.php +++ b/autoload.php @@ -255,7 +255,6 @@ $wgAutoloadLocalClasses = [ 'CheckLanguageCLI' => __DIR__ . '/maintenance/language/checkLanguage.inc', 'CheckLess' => __DIR__ . '/maintenance/checkLess.php', 'CheckStorage' => __DIR__ . '/maintenance/storage/checkStorage.php', - 'CheckSyntax' => __DIR__ . '/maintenance/checkSyntax.php', 'CheckUsernames' => __DIR__ . '/maintenance/checkUsernames.php', 'ClassCollector' => __DIR__ . '/includes/utils/AutoloadGenerator.php', 'CleanupAncientTables' => __DIR__ . '/maintenance/cleanupAncientTables.php', diff --git a/composer.json b/composer.json index 634bace923..2bd8d6c4ed 100644 --- a/composer.json +++ b/composer.json @@ -59,7 +59,7 @@ "nikic/php-parser": "2.1.0", "nmred/kafka-php": "0.1.5", "phpunit/phpunit": "4.8.35", - "psy/psysh": "0.8.5", + "psy/psysh": "0.8.11", "wikimedia/avro": "1.7.7", "wikimedia/testing-access-wrapper": "~1.0", "wmde/hamcrest-html-matchers": "^0.1.0" diff --git a/includes/EditPage.php b/includes/EditPage.php index 3fc12ced8c..bc91623159 100644 --- a/includes/EditPage.php +++ b/includes/EditPage.php @@ -3166,7 +3166,7 @@ class EditPage { */ function getSummaryInputOOUI( $summary = "", $labelText = null, $inputAttrs = null ) { wfDeprecated( __METHOD__, '1.30' ); - $this->getSummaryInputWidget( $summary, $labelText, $inputAttrs ); + return $this->getSummaryInputWidget( $summary, $labelText, $inputAttrs ); } /** diff --git a/includes/GlobalFunctions.php b/includes/GlobalFunctions.php index d53e98dbe1..ffdfc92c4d 100644 --- a/includes/GlobalFunctions.php +++ b/includes/GlobalFunctions.php @@ -2684,6 +2684,7 @@ function wfRelativePath( $path, $from ) { function wfBaseConvert( $input, $sourceBase, $destBase, $pad = 1, $lowercase = true, $engine = 'auto' ) { + wfDeprecated( __FUNCTION__, '1.27' ); return Wikimedia\base_convert( $input, $sourceBase, $destBase, $pad, $lowercase, $engine ); } @@ -3047,6 +3048,8 @@ function wfWaitForSlaves( * Count down from $seconds to zero on the terminal, with a one-second pause * between showing each number. For use in command-line scripts. * + * @deprecated since 1.31, use Maintenance::countDown() + * * @codeCoverageIgnore * @param int $seconds */ diff --git a/includes/api/ApiQueryLinks.php b/includes/api/ApiQueryLinks.php index 2f75e76343..508bdf3f9d 100644 --- a/includes/api/ApiQueryLinks.php +++ b/includes/api/ApiQueryLinks.php @@ -87,25 +87,34 @@ class ApiQueryLinks extends ApiQueryGeneratorBase { $this->addTables( $this->table ); $this->addWhereFld( $this->prefix . '_from', array_keys( $this->getPageSet()->getGoodTitles() ) ); - $this->addWhereFld( $this->prefix . '_namespace', $params['namespace'] ); + $multiNS = true; + $multiTitle = true; if ( $params[$this->titlesParam] ) { + // Filter the titles in PHP so our ORDER BY bug avoidance below works right. + $filterNS = $params['namespace'] ? array_flip( $params['namespace'] ) : false; + $lb = new LinkBatch; foreach ( $params[$this->titlesParam] as $t ) { $title = Title::newFromText( $t ); if ( !$title ) { $this->addWarning( [ 'apiwarn-invalidtitle', wfEscapeWikiText( $t ) ] ); - } else { + } elseif ( !$filterNS || isset( $filterNS[$title->getNamespace()] ) ) { $lb->addObj( $title ); } } $cond = $lb->constructSet( $this->prefix, $this->getDB() ); if ( $cond ) { $this->addWhere( $cond ); + $multiNS = count( $lb->data ) !== 1; + $multiTitle = count( call_user_func_array( 'array_merge', $lb->data ) ) !== 1; } else { // No titles so no results return; } + } elseif ( $params['namespace'] ) { + $this->addWhereFld( $this->prefix . '_namespace', $params['namespace'] ); + $multiNS = count( $params['namespace'] ) !== 1; } if ( !is_null( $params['continue'] ) ) { @@ -134,12 +143,15 @@ class ApiQueryLinks extends ApiQueryGeneratorBase { if ( count( $this->getPageSet()->getGoodTitles() ) != 1 ) { $order[] = $this->prefix . '_from' . $sort; } - if ( count( $params['namespace'] ) != 1 ) { + if ( $multiNS ) { $order[] = $this->prefix . '_namespace' . $sort; } - - $order[] = $this->prefix . '_title' . $sort; - $this->addOption( 'ORDER BY', $order ); + if ( $multiTitle ) { + $order[] = $this->prefix . '_title' . $sort; + } + if ( $order ) { + $this->addOption( 'ORDER BY', $order ); + } $this->addOption( 'LIMIT', $params['limit'] + 1 ); $res = $this->select( __METHOD__ ); diff --git a/languages/i18n/en.json b/languages/i18n/en.json index 6bf32b2216..9826a56b69 100644 --- a/languages/i18n/en.json +++ b/languages/i18n/en.json @@ -1061,8 +1061,8 @@ "timezoneregion-europe": "Europe", "timezoneregion-indian": "Indian Ocean", "timezoneregion-pacific": "Pacific Ocean", - "allowemail": "Enable email from other users", - "email-blacklist-label": "Prohibit these users from sending emails to me:", + "allowemail": "Allow other users to email me", + "email-blacklist-label": "Prohibit these users from emailing me:", "prefs-searchoptions": "Search", "prefs-namespaces": "Namespaces", "default": "default", diff --git a/maintenance/Maintenance.php b/maintenance/Maintenance.php index 4ad6e6e7d5..7de0ae4ccb 100644 --- a/maintenance/Maintenance.php +++ b/maintenance/Maintenance.php @@ -1416,6 +1416,32 @@ abstract class Maintenance { return $title; } + /** + * Count down from $seconds to zero on the terminal, with a one-second pause + * between showing each number. If the maintenance script is in quiet mode, + * this function does nothing. + * + * @since 1.31 + * + * @codeCoverageIgnore + * @param int $seconds + */ + protected function countDown( $seconds ) { + if ( $this->isQuiet() ) { + return; + } + for ( $i = $seconds; $i >= 0; $i-- ) { + if ( $i != $seconds ) { + $this->output( str_repeat( "\x08", strlen( $i + 1 ) ) ); + } + $this->output( $i ); + if ( $i ) { + sleep( 1 ); + } + } + $this->output( "\n" ); + } + /** * Wrapper for posix_isatty() * We default as considering stdin a tty (for nice readline methods) diff --git a/maintenance/checkSyntax.php b/maintenance/checkSyntax.php deleted file mode 100644 index 3910f29d20..0000000000 --- a/maintenance/checkSyntax.php +++ /dev/null @@ -1,349 +0,0 @@ -addDescription( 'Check syntax for all PHP files in MediaWiki' ); - $this->addOption( 'with-extensions', 'Also recurse the extensions folder' ); - $this->addOption( - 'path', - 'Specific path (file or directory) to check, either with absolute path or ' - . 'relative to the root of this MediaWiki installation', - false, - true - ); - $this->addOption( - 'list-file', - 'Text file containing list of files or directories to check', - false, - true - ); - $this->addOption( - 'modified', - 'Check only files that were modified (requires Git command-line client)' - ); - $this->addOption( 'syntax-only', 'Check for syntax validity only, skip code style warnings' ); - } - - public function getDbType() { - return Maintenance::DB_NONE; - } - - public function execute() { - $this->buildFileList(); - - $this->output( "Checking syntax (using php -l, this can take a long time)\n" ); - foreach ( $this->mFiles as $f ) { - $this->checkFileWithCli( $f ); - if ( !$this->hasOption( 'syntax-only' ) ) { - $this->checkForMistakes( $f ); - } - } - $this->output( "\nDone! " . count( $this->mFiles ) . " files checked, " . - count( $this->mFailures ) . " failures and " . count( $this->mWarnings ) . - " warnings found\n" ); - } - - /** - * Build the list of files we'll check for syntax errors - */ - private function buildFileList() { - global $IP; - - $this->mIgnorePaths = [ - ]; - - $this->mNoStyleCheckPaths = [ - // Third-party code we don't care about - "/activemq_stomp/", - "EmailPage/PHPMailer", - "FCKeditor/fckeditor/", - '\bphplot-', - "/svggraph/", - "\bjsmin.php$", - "PEAR/File_Ogg/", - "QPoll/Excel/", - "/geshi/", - "/smarty/", - ]; - - if ( $this->hasOption( 'path' ) ) { - $path = $this->getOption( 'path' ); - if ( !$this->addPath( $path ) ) { - $this->error( "Error: can't find file or directory $path\n", true ); - } - - return; // process only this path - } elseif ( $this->hasOption( 'list-file' ) ) { - $file = $this->getOption( 'list-file' ); - MediaWiki\suppressWarnings(); - $f = fopen( $file, 'r' ); - MediaWiki\restoreWarnings(); - if ( !$f ) { - $this->error( "Can't open file $file\n", true ); - } - $path = trim( fgets( $f ) ); - while ( $path ) { - $this->addPath( $path ); - } - fclose( $f ); - - return; - } elseif ( $this->hasOption( 'modified' ) ) { - $this->output( "Retrieving list from Git... " ); - $files = $this->getGitModifiedFiles( $IP ); - $this->output( "done\n" ); - foreach ( $files as $file ) { - if ( $this->isSuitableFile( $file ) && !is_dir( $file ) ) { - $this->mFiles[] = $file; - } - } - - return; - } - - $this->output( 'Building file list...', 'listfiles' ); - - // Only check files in these directories. - // Don't just put $IP, because the recursive dir thingie goes into all subdirs - $dirs = [ - $IP . '/includes', - $IP . '/mw-config', - $IP . '/languages', - $IP . '/maintenance', - $IP . '/skins', - ]; - if ( $this->hasOption( 'with-extensions' ) ) { - $dirs[] = $IP . '/extensions'; - } - - foreach ( $dirs as $d ) { - $this->addDirectoryContent( $d ); - } - - // Manually add two user-editable files that are usually sources of problems - if ( file_exists( "$IP/LocalSettings.php" ) ) { - $this->mFiles[] = "$IP/LocalSettings.php"; - } - - $this->output( 'done.', 'listfiles' ); - } - - /** - * Returns a list of tracked files in a Git work tree differing from the master branch. - * @param string $path Path to the repository - * @return array Resulting list of changed files - */ - private function getGitModifiedFiles( $path ) { - global $wgMaxShellMemory; - - if ( !is_dir( "$path/.git" ) ) { - $this->error( "Error: Not a Git repository!\n", true ); - } - - // git diff eats memory. - $oldMaxShellMemory = $wgMaxShellMemory; - if ( $wgMaxShellMemory < 1024000 ) { - $wgMaxShellMemory = 1024000; - } - - $ePath = wfEscapeShellArg( $path ); - - // Find an ancestor in common with master (rather than just using its HEAD) - // to prevent files only modified there from showing up in the list. - $cmd = "cd $ePath && git merge-base master HEAD"; - $retval = 0; - $output = wfShellExec( $cmd, $retval ); - if ( $retval !== 0 ) { - $this->error( "Error retrieving base SHA1 from Git!\n", true ); - } - - // Find files in the working tree that changed since then. - $eBase = wfEscapeShellArg( rtrim( $output, "\n" ) ); - $cmd = "cd $ePath && git diff --name-only --diff-filter AM $eBase"; - $retval = 0; - $output = wfShellExec( $cmd, $retval ); - if ( $retval !== 0 ) { - $this->error( "Error retrieving list from Git!\n", true ); - } - - $wgMaxShellMemory = $oldMaxShellMemory; - - $arr = []; - $filename = strtok( $output, "\n" ); - while ( $filename !== false ) { - if ( $filename !== '' ) { - $arr[] = "$path/$filename"; - } - $filename = strtok( "\n" ); - } - - return $arr; - } - - /** - * Returns true if $file is of a type we can check - * @param string $file - * @return bool - */ - private function isSuitableFile( $file ) { - $file = str_replace( '\\', '/', $file ); - $ext = pathinfo( $file, PATHINFO_EXTENSION ); - if ( $ext != 'php' && $ext != 'inc' && $ext != 'php5' ) { - return false; - } - foreach ( $this->mIgnorePaths as $regex ) { - $m = []; - if ( preg_match( "~{$regex}~", $file, $m ) ) { - return false; - } - } - - return true; - } - - /** - * Add given path to file list, searching it in include path if needed - * @param string $path - * @return bool - */ - private function addPath( $path ) { - global $IP; - - return $this->addFileOrDir( $path ) || $this->addFileOrDir( "$IP/$path" ); - } - - /** - * Add given file to file list, or, if it's a directory, add its content - * @param string $path - * @return bool - */ - private function addFileOrDir( $path ) { - if ( is_dir( $path ) ) { - $this->addDirectoryContent( $path ); - } elseif ( file_exists( $path ) ) { - $this->mFiles[] = $path; - } else { - return false; - } - - return true; - } - - /** - * Add all suitable files in given directory or its subdirectories to the file list - * - * @param string $dir Directory to process - */ - private function addDirectoryContent( $dir ) { - $iterator = new RecursiveIteratorIterator( - new RecursiveDirectoryIterator( $dir ), - RecursiveIteratorIterator::SELF_FIRST - ); - foreach ( $iterator as $file ) { - if ( $this->isSuitableFile( $file->getRealPath() ) ) { - $this->mFiles[] = $file->getRealPath(); - } - } - } - - /** - * Check a file for syntax errors using php -l - * @param string $file Path to a file to check for syntax errors - * @return bool - */ - private function checkFileWithCli( $file ) { - $res = exec( 'php -l ' . wfEscapeShellArg( $file ) ); - if ( strpos( $res, 'No syntax errors detected' ) === false ) { - $this->mFailures[$file] = $res; - $this->output( $res . "\n" ); - - return false; - } - - return true; - } - - /** - * Check a file for non-fatal coding errors, such as byte-order marks in the beginning - * or pointless ?> closing tags at the end. - * - * @param string $file String Path to a file to check for errors - */ - private function checkForMistakes( $file ) { - foreach ( $this->mNoStyleCheckPaths as $regex ) { - $m = []; - if ( preg_match( "~{$regex}~", $file, $m ) ) { - return; - } - } - - $text = file_get_contents( $file ); - $tokens = token_get_all( $text ); - - $this->checkEvilToken( $file, $tokens, '@', 'Error supression operator (@)' ); - $this->checkRegex( $file, $text, '/^[\s\r\n]+<\?/', 'leading whitespace' ); - $this->checkRegex( $file, $text, '/\?>[\s\r\n]*$/', 'trailing ?>' ); - $this->checkRegex( $file, $text, '/^[\xFF\xFE\xEF]/', 'byte-order mark' ); - } - - private function checkRegex( $file, $text, $regex, $desc ) { - if ( !preg_match( $regex, $text ) ) { - return; - } - - if ( !isset( $this->mWarnings[$file] ) ) { - $this->mWarnings[$file] = []; - } - $this->mWarnings[$file][] = $desc; - $this->output( "Warning in file $file: $desc found.\n" ); - } - - private function checkEvilToken( $file, $tokens, $evilToken, $desc ) { - if ( !in_array( $evilToken, $tokens ) ) { - return; - } - - if ( !isset( $this->mWarnings[$file] ) ) { - $this->mWarnings[$file] = []; - } - $this->mWarnings[$file][] = $desc; - $this->output( "Warning in file $file: $desc found.\n" ); - } -} - -$maintClass = "CheckSyntax"; -require_once RUN_MAINTENANCE_IF_MAIN; diff --git a/maintenance/rebuildtextindex.php b/maintenance/rebuildtextindex.php index faa4d96293..c786925440 100644 --- a/maintenance/rebuildtextindex.php +++ b/maintenance/rebuildtextindex.php @@ -145,9 +145,10 @@ class RebuildTextIndex extends Maintenance { private function createMysqlTextIndex() { $searchindex = $this->db->tableName( 'searchindex' ); $this->output( "\nRebuild the index...\n" ); - $sql = "ALTER TABLE $searchindex ADD FULLTEXT si_title (si_title), " . - "ADD FULLTEXT si_text (si_text)"; - $this->db->query( $sql, __METHOD__ ); + foreach ( [ 'si_title', 'si_text' ] as $field ) { + $sql = "ALTER TABLE $searchindex ADD FULLTEXT $field ($field)"; + $this->db->query( $sql, __METHOD__ ); + } } /** diff --git a/maintenance/resetUserTokens.php b/maintenance/resetUserTokens.php index 481da980da..1c8b4b9d0b 100644 --- a/maintenance/resetUserTokens.php +++ b/maintenance/resetUserTokens.php @@ -64,7 +64,7 @@ class ResetUserTokens extends Maintenance { $this->output( "\n" ); $this->output( "Abort with control-c in the next five seconds " . "(skip this countdown with --nowarn) ... " ); - wfCountDown( 5 ); + $this->countDown( 5 ); } // We list user by user_id from one of the replica DBs diff --git a/maintenance/update.php b/maintenance/update.php index 5f705ba371..5e2947b2db 100755 --- a/maintenance/update.php +++ b/maintenance/update.php @@ -128,7 +128,7 @@ class UpdateMediaWiki extends Maintenance { $this->compatChecks(); } else { $this->output( "Skipping compatibility checks, proceed at your own risk (Ctrl+C to abort)\n" ); - wfCountDown( 5 ); + $this->countDown( 5 ); } // Check external dependencies are up to date @@ -155,7 +155,7 @@ class UpdateMediaWiki extends Maintenance { if ( !$this->hasOption( 'quick' ) ) { $this->output( "Abort with control-c in the next five seconds " . "(skip this countdown with --quick) ... " ); - wfCountDown( 5 ); + $this->countDown( 5 ); } $time1 = microtime( true ); diff --git a/resources/Resources.php b/resources/Resources.php index 4df8194f0e..06012b8f9f 100644 --- a/resources/Resources.php +++ b/resources/Resources.php @@ -1786,6 +1786,7 @@ return [ ], 'mediawiki.rcfilters.filters.ui' => [ 'scripts' => [ + 'resources/src/mediawiki.rcfilters/ui/mw.rcfilters.ui.GroupWidget.js', 'resources/src/mediawiki.rcfilters/ui/mw.rcfilters.ui.CheckboxInputWidget.js', 'resources/src/mediawiki.rcfilters/ui/mw.rcfilters.ui.FilterTagMultiselectWidget.js', 'resources/src/mediawiki.rcfilters/ui/mw.rcfilters.ui.ItemMenuOptionWidget.js', diff --git a/resources/src/mediawiki.rcfilters/mw.rcfilters.Controller.js b/resources/src/mediawiki.rcfilters/mw.rcfilters.Controller.js index 4bc6183449..5b12cf7b31 100644 --- a/resources/src/mediawiki.rcfilters/mw.rcfilters.Controller.js +++ b/resources/src/mediawiki.rcfilters/mw.rcfilters.Controller.js @@ -452,12 +452,20 @@ */ mw.rcfilters.Controller.prototype.clearFilter = function ( filterName ) { var filterItem = this.filtersModel.getItemByName( filterName ), - isHighlighted = filterItem.isHighlighted(); + isHighlighted = filterItem.isHighlighted(), + isSelected = filterItem.isSelected(); - if ( filterItem.isSelected() || isHighlighted ) { + if ( isSelected || isHighlighted ) { this.filtersModel.clearHighlightColor( filterName ); this.filtersModel.toggleFilterSelected( filterName, false ); - this.updateChangesList(); + + if ( isSelected ) { + // Only update the changes list if the filter changed + // its selection state. If it only changed its highlight + // then don't reload + this.updateChangesList(); + } + this.filtersModel.reassessFilterInteractions( filterItem ); // Log filter grouping diff --git a/resources/src/mediawiki.rcfilters/styles/mw.rcfilters.ui.SavedLinksListItemWidget.less b/resources/src/mediawiki.rcfilters/styles/mw.rcfilters.ui.SavedLinksListItemWidget.less index 9dccc2451c..6a20f5616f 100644 --- a/resources/src/mediawiki.rcfilters/styles/mw.rcfilters.ui.SavedLinksListItemWidget.less +++ b/resources/src/mediawiki.rcfilters/styles/mw.rcfilters.ui.SavedLinksListItemWidget.less @@ -22,6 +22,7 @@ min-width: 16px; min-height: 16px; opacity: 0.5; + position: relative; } &-icon span { diff --git a/resources/src/mediawiki.rcfilters/styles/mw.rcfilters.ui.ViewSwitchWidget.less b/resources/src/mediawiki.rcfilters/styles/mw.rcfilters.ui.ViewSwitchWidget.less index a6ce4cd88a..1896103970 100644 --- a/resources/src/mediawiki.rcfilters/styles/mw.rcfilters.ui.ViewSwitchWidget.less +++ b/resources/src/mediawiki.rcfilters/styles/mw.rcfilters.ui.ViewSwitchWidget.less @@ -6,9 +6,5 @@ &-buttons { margin-top: 0.5em; - - .oo-ui-buttonWidget:not( :first-child ) { - margin-left: 0.5em; - } } } diff --git a/resources/src/mediawiki.rcfilters/ui/mw.rcfilters.ui.GroupWidget.js b/resources/src/mediawiki.rcfilters/ui/mw.rcfilters.ui.GroupWidget.js new file mode 100644 index 0000000000..167df09112 --- /dev/null +++ b/resources/src/mediawiki.rcfilters/ui/mw.rcfilters.ui.GroupWidget.js @@ -0,0 +1,41 @@ +( function ( mw ) { + /** + * A group widget to allow for aggregation of events + * + * @extends OO.ui.Widget + * + * @constructor + * @param {Object} [config] Configuration object + * @param {Object} [events] Events to aggregate. The object represent the + * event name to aggregate and the event value to emit on aggregate for items. + */ + mw.rcfilters.ui.GroupWidget = function MwRcfiltersUiViewSwitchWidget( config ) { + var aggregate = {}; + + config = config || {}; + + // Parent constructor + mw.rcfilters.ui.GroupWidget.parent.call( this, config ); + + // Mixin constructors + OO.ui.mixin.GroupElement.call( this, $.extend( {}, config, { $group: this.$element } ) ); + + if ( config.events ) { + // Aggregate events + $.each( config.events, function ( eventName, eventEmit ) { + aggregate[ eventName ] = eventEmit; + } ); + + this.aggregate( aggregate ); + } + + if ( Array.isArray( config.items ) ) { + this.addItems( config.items ); + } + }; + + /* Initialize */ + + OO.inheritClass( mw.rcfilters.ui.GroupWidget, OO.ui.Widget ); + OO.mixinClass( mw.rcfilters.ui.GroupWidget, OO.ui.mixin.GroupWidget ); +}( mediaWiki ) ); diff --git a/resources/src/mediawiki.rcfilters/ui/mw.rcfilters.ui.SavedLinksListWidget.js b/resources/src/mediawiki.rcfilters/ui/mw.rcfilters.ui.SavedLinksListWidget.js index 7eda90a8f9..8287ef96c0 100644 --- a/resources/src/mediawiki.rcfilters/ui/mw.rcfilters.ui.SavedLinksListWidget.js +++ b/resources/src/mediawiki.rcfilters/ui/mw.rcfilters.ui.SavedLinksListWidget.js @@ -36,10 +36,14 @@ label: $labelNoEntries, icon: 'unClip' } ); - // The only reason we're using "ButtonGroupWidget" here is that - // straight-out "GroupWidget" is a mixin and cannot be initialized - // on its own, so we need something to be its widget. - this.menu = new OO.ui.ButtonGroupWidget( { + + this.menu = new mw.rcfilters.ui.GroupWidget( { + events: { + click: 'menuItemClick', + 'delete': 'menuItemDelete', + 'default': 'menuItemDefault', + edit: 'menuItemEdit' + }, classes: [ 'mw-rcfilters-ui-savedLinksListWidget-menu' ], items: [ this.placeholderItem ] } ); @@ -58,13 +62,6 @@ } } ); - this.menu.aggregate( { - click: 'menuItemClick', - 'delete': 'menuItemDelete', - 'default': 'menuItemDefault', - edit: 'menuItemEdit' - } ); - // Events this.model.connect( this, { add: 'onModelAddItem', diff --git a/resources/src/mediawiki.rcfilters/ui/mw.rcfilters.ui.ViewSwitchWidget.js b/resources/src/mediawiki.rcfilters/ui/mw.rcfilters.ui.ViewSwitchWidget.js index fef856722f..aadded156f 100644 --- a/resources/src/mediawiki.rcfilters/ui/mw.rcfilters.ui.ViewSwitchWidget.js +++ b/resources/src/mediawiki.rcfilters/ui/mw.rcfilters.ui.ViewSwitchWidget.js @@ -18,7 +18,10 @@ this.controller = controller; this.model = model; - this.buttons = new OO.ui.ButtonGroupWidget( { + this.buttons = new mw.rcfilters.ui.GroupWidget( { + events: { + click: 'buttonClick' + }, items: [ new OO.ui.ButtonWidget( { data: 'namespaces', @@ -35,7 +38,6 @@ // Events this.model.connect( this, { update: 'onModelUpdate' } ); - this.buttons.aggregate( { click: 'buttonClick' } ); this.buttons.connect( this, { buttonClick: 'onButtonClick' } ); this.$element