From b162e8ae7896cdabc3acccbe0203d36184e14ecf Mon Sep 17 00:00:00 2001 From: "James D. Forrester" Date: Wed, 3 Oct 2018 17:45:29 -0700 Subject: [PATCH] Follow-up 3481e3b2: Drop disablability of ExpiryInputWidget before 1.32 is cut No longer used anywhere(?); we'd rather not have to explain the temporary variable in the MediaWiki 1.32.0 release notes if we can instead just not ship it. Bug: T192620 Change-Id: Icfb82f228512ed45f1a27ce3e565fbc5fc09f39c --- includes/DefaultSettings.php | 9 --------- includes/widget/ExpiryInputWidget.php | 20 ++++--------------- .../mw.widgets.ExpiryInputWidget.js | 18 ----------------- 3 files changed, 4 insertions(+), 43 deletions(-) diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php index 6a1ed925da..12d4aaa038 100644 --- a/includes/DefaultSettings.php +++ b/includes/DefaultSettings.php @@ -9001,15 +9001,6 @@ $wgMultiContentRevisionSchemaMigrationStage = SCHEMA_COMPAT_WRITE_BOTH | SCHEMA_ */ $wgActorTableSchemaMigrationStage = SCHEMA_COMPAT_OLD; -/** - * Temporary option to disable the date picker from the Expiry Widget. - * - * @since 1.32 - * @deprecated 1.32 - * @var bool - */ -$wgExpiryWidgetNoDatePicker = false; - /** * change_tag table schema migration stage. * diff --git a/includes/widget/ExpiryInputWidget.php b/includes/widget/ExpiryInputWidget.php index f9985eb9b2..289cc85ba4 100644 --- a/includes/widget/ExpiryInputWidget.php +++ b/includes/widget/ExpiryInputWidget.php @@ -20,11 +20,6 @@ class ExpiryInputWidget extends Widget { */ protected $relativeInput; - /** - * @var bool - */ - protected $noDatePicker; - /** * @var bool */ @@ -37,11 +32,8 @@ class ExpiryInputWidget extends Widget { public function __construct( Widget $relativeInput, array $options = [] ) { $config = \RequestContext::getMain()->getConfig(); - $options['noDatePicker'] = $config->get( 'ExpiryWidgetNoDatePicker' ); - parent::__construct( $options ); - $this->noDatePicker = $options['noDatePicker']; $this->required = $options['required'] ?? false; // Properties @@ -49,14 +41,11 @@ class ExpiryInputWidget extends Widget { $this->relativeInput->addClasses( [ 'mw-widget-ExpiryWidget-relative' ] ); // Initialization - $classes = [ - 'mw-widget-ExpiryWidget', - ]; - if ( $options['noDatePicker'] === false ) { - $classes[] = 'mw-widget-ExpiryWidget-hasDatePicker'; - } $this - ->addClasses( $classes ) + ->addClasses( [ + 'mw-widget-ExpiryWidget', + 'mw-widget-ExpiryWidget-hasDatePicker' + ] ) ->appendContent( $this->relativeInput ); } @@ -68,7 +57,6 @@ class ExpiryInputWidget extends Widget { * {@inheritdoc} */ public function getConfig( &$config ) { - $config['noDatePicker'] = $this->noDatePicker; $config['required'] = $this->required; $config['relativeInput'] = []; $this->relativeInput->getConfig( $config['relativeInput'] ); diff --git a/resources/src/mediawiki.widgets/mw.widgets.ExpiryInputWidget.js b/resources/src/mediawiki.widgets/mw.widgets.ExpiryInputWidget.js index 26f347a350..333b8f9977 100644 --- a/resources/src/mediawiki.widgets/mw.widgets.ExpiryInputWidget.js +++ b/resources/src/mediawiki.widgets/mw.widgets.ExpiryInputWidget.js @@ -28,24 +28,6 @@ // Parent constructor mw.widgets.ExpiryWidget.parent.call( this, config ); - // If the wiki does not want the date picker, then initialize the relative - // field and exit. - if ( config.noDatePicker ) { - this.relativeField.on( 'change', function ( event ) { - // Emit a change event for this widget. - this.emit( 'change', event ); - }.bind( this ) ); - - // Initialization - this.$element - .addClass( 'mw-widget-ExpiryWidget' ) - .append( - this.relativeField.$element - ); - - return; - } - // Properties this.inputSwitch = new OO.ui.ButtonSelectWidget( { tabIndex: -1, -- 2.20.1