Merge "Create Expiry Widget with Date Time Selector"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Tue, 24 Apr 2018 18:22:58 +0000 (18:22 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Tue, 24 Apr 2018 18:22:58 +0000 (18:22 +0000)
1  2 
autoload.php
includes/DefaultSettings.php
resources/Resources.php

diff --combined autoload.php
@@@ -1,6 -1,6 +1,6 @@@
  <?php
  // This file is generated by maintenance/generateLocalAutoload.php, do not adjust manually
 -// phpcs:ignoreFile Generic.Files.LineLength
 +// phpcs:disable Generic.Files.LineLength
  global $wgAutoloadLocalClasses;
  
  $wgAutoloadLocalClasses = [
        'DeleteAction' => __DIR__ . '/includes/actions/DeleteAction.php',
        'DeleteArchivedFiles' => __DIR__ . '/maintenance/deleteArchivedFiles.php',
        'DeleteArchivedRevisions' => __DIR__ . '/maintenance/deleteArchivedRevisions.php',
 +      'DeleteAutoPatrolLogs' => __DIR__ . '/maintenance/deleteAutoPatrolLogs.php',
        'DeleteBatch' => __DIR__ . '/maintenance/deleteBatch.php',
        'DeleteDefaultMessages' => __DIR__ . '/maintenance/deleteDefaultMessages.php',
        'DeleteEqualMessages' => __DIR__ . '/maintenance/deleteEqualMessages.php',
        'ExplodeIterator' => __DIR__ . '/includes/libs/ExplodeIterator.php',
        'ExportProgressFilter' => __DIR__ . '/includes/export/ExportProgressFilter.php',
        'ExportSites' => __DIR__ . '/maintenance/exportSites.php',
 +      'ExtensionDependencyError' => __DIR__ . '/includes/registration/ExtensionDependencyError.php',
        'ExtensionJsonValidationError' => __DIR__ . '/includes/registration/ExtensionJsonValidationError.php',
        'ExtensionJsonValidator' => __DIR__ . '/includes/registration/ExtensionJsonValidator.php',
        'ExtensionLanguages' => __DIR__ . '/maintenance/language/languages.inc',
        'HTMLComboboxField' => __DIR__ . '/includes/htmlform/fields/HTMLComboboxField.php',
        'HTMLDateTimeField' => __DIR__ . '/includes/htmlform/fields/HTMLDateTimeField.php',
        'HTMLEditTools' => __DIR__ . '/includes/htmlform/fields/HTMLEditTools.php',
+       'HTMLExpiryField' => __DIR__ . '/includes/htmlform/fields/HTMLExpiryField.php',
        'HTMLFileCache' => __DIR__ . '/includes/cache/HTMLFileCache.php',
        'HTMLFloatField' => __DIR__ . '/includes/htmlform/fields/HTMLFloatField.php',
        'HTMLForm' => __DIR__ . '/includes/htmlform/HTMLForm.php',
        'MediaTransformInvalidParametersException' => __DIR__ . '/includes/media/MediaTransformInvalidParametersException.php',
        'MediaTransformOutput' => __DIR__ . '/includes/media/MediaTransformOutput.php',
        'MediaWiki' => __DIR__ . '/includes/MediaWiki.php',
 -      'MediaWikiI18N' => __DIR__ . '/includes/skins/MediaWikiI18N.php',
        'MediaWikiShell' => __DIR__ . '/maintenance/shell.php',
        'MediaWikiSite' => __DIR__ . '/includes/site/MediaWikiSite.php',
        'MediaWikiTitleCodec' => __DIR__ . '/includes/title/MediaWikiTitleCodec.php',
        'MediaWiki\\Widget\\ComplexTitleInputWidget' => __DIR__ . '/includes/widget/ComplexTitleInputWidget.php',
        'MediaWiki\\Widget\\DateInputWidget' => __DIR__ . '/includes/widget/DateInputWidget.php',
        'MediaWiki\\Widget\\DateTimeInputWidget' => __DIR__ . '/includes/widget/DateTimeInputWidget.php',
+       'MediaWiki\\Widget\\ExpiryInputWidget' => __DIR__ . '/includes/widget/ExpiryInputWidget.php',
        'MediaWiki\\Widget\\NamespaceInputWidget' => __DIR__ . '/includes/widget/NamespaceInputWidget.php',
        'MediaWiki\\Widget\\SearchInputWidget' => __DIR__ . '/includes/widget/SearchInputWidget.php',
        'MediaWiki\\Widget\\Search\\BasicSearchResultSetWidget' => __DIR__ . '/includes/widget/search/BasicSearchResultSetWidget.php',
        'PoolCounterWorkViaCallback' => __DIR__ . '/includes/poolcounter/PoolCounterWorkViaCallback.php',
        'PoolCounter_Stub' => __DIR__ . '/includes/poolcounter/PoolCounter.php',
        'PoolWorkArticleView' => __DIR__ . '/includes/poolcounter/PoolWorkArticleView.php',
 +      'PopulateArchiveRevId' => __DIR__ . '/maintenance/populateArchiveRevId.php',
        'PopulateBacklinkNamespace' => __DIR__ . '/maintenance/populateBacklinkNamespace.php',
        'PopulateCategory' => __DIR__ . '/maintenance/populateCategory.php',
        'PopulateContentModel' => __DIR__ . '/maintenance/populateContentModel.php',
        'WikiTextStructure' => __DIR__ . '/includes/content/WikiTextStructure.php',
        'Wikimedia\\Http\\HttpAcceptNegotiator' => __DIR__ . '/includes/libs/http/HttpAcceptNegotiator.php',
        'Wikimedia\\Http\\HttpAcceptParser' => __DIR__ . '/includes/libs/http/HttpAcceptParser.php',
 +      'Wikimedia\\Rdbms\\AtomicSectionIdentifier' => __DIR__ . '/includes/libs/rdbms/database/AtomicSectionIdentifier.php',
        'Wikimedia\\Rdbms\\Blob' => __DIR__ . '/includes/libs/rdbms/encasing/Blob.php',
        'Wikimedia\\Rdbms\\ChronologyProtector' => __DIR__ . '/includes/libs/rdbms/ChronologyProtector.php',
        'Wikimedia\\Rdbms\\ConnectionManager' => __DIR__ . '/includes/libs/rdbms/connectionmanager/ConnectionManager.php',
        'Wikimedia\\Rdbms\\DBReplicationWaitError' => __DIR__ . '/includes/libs/rdbms/exception/DBReplicationWaitError.php',
        'Wikimedia\\Rdbms\\DBTransactionError' => __DIR__ . '/includes/libs/rdbms/exception/DBTransactionError.php',
        'Wikimedia\\Rdbms\\DBTransactionSizeError' => __DIR__ . '/includes/libs/rdbms/exception/DBTransactionSizeError.php',
 +      'Wikimedia\\Rdbms\\DBTransactionStateError' => __DIR__ . '/includes/libs/rdbms/exception/DBTransactionStateError.php',
        'Wikimedia\\Rdbms\\DBUnexpectedError' => __DIR__ . '/includes/libs/rdbms/exception/DBUnexpectedError.php',
        'Wikimedia\\Rdbms\\Database' => __DIR__ . '/includes/libs/rdbms/database/Database.php',
        'Wikimedia\\Rdbms\\DatabaseDomain' => __DIR__ . '/includes/libs/rdbms/database/DatabaseDomain.php',
@@@ -71,7 -71,7 +71,7 @@@ $wgConfigRegistry = 
   * MediaWiki version number
   * @since 1.2
   */
 -$wgVersion = '1.31.0-alpha';
 +$wgVersion = '1.32.0-alpha';
  
  /**
   * Name of the site. It must be changed in LocalSettings.php
@@@ -157,6 -157,19 +157,6 @@@ $wgUsePathInfo = ( strpos( PHP_SAPI, 'c
        ( strpos( PHP_SAPI, 'apache2filter' ) === false ) &&
        ( strpos( PHP_SAPI, 'isapi' ) === false );
  
 -/**
 - * The extension to append to script names by default.
 - *
 - * Some hosting providers used PHP 4 for *.php files, and PHP 5 for *.php5.
 - * This variable was provided to support those providers.
 - *
 - * @since 1.11
 - * @deprecated since 1.25; support for '.php5' has been phased out of MediaWiki
 - *  proper. Backward-compatibility can be maintained by configuring your web
 - *  server to rewrite URLs. See RELEASE-NOTES for details.
 - */
 -$wgScriptExtension = '.php';
 -
  /**@}*/
  
  /************************************************************************//**
@@@ -490,6 -503,9 +490,6 @@@ $wgImgAuthUrlPathMap = []
   *   - descBaseUrl       URL of image description pages, e.g. https://en.wikipedia.org/wiki/File:
   *   - scriptDirUrl      URL of the MediaWiki installation, equivalent to $wgScriptPath, e.g.
   *                       https://en.wikipedia.org/w
 - *   - scriptExtension   Script extension of the MediaWiki installation, equivalent to
 - *                       $wgScriptExtension, e.g. ".php5". Defaults to ".php".
 - *
   *   - articleUrl        Equivalent to $wgArticlePath, e.g. https://en.wikipedia.org/wiki/$1
   *   - fetchDescription  Fetch the text of the remote file description page. Equivalent to
   *                       $wgFetchCommonsDescriptions.
@@@ -1085,15 -1101,6 +1085,15 @@@ $wgJpegTran = '/usr/bin/jpegtran'
   */
  $wgJpegPixelFormat = 'yuv420';
  
 +/**
 + * When scaling a JPEG thumbnail, this is the quality we request
 + * from the backend. It should be an int between 1 and 100,
 + * with 100 indicating 100% quality.
 + *
 + * @since 1.32
 + */
 +$wgJpegQuality = 80;
 +
  /**
   * Some tests and extensions use exiv2 to manipulate the Exif metadata in some
   * image formats.
@@@ -1573,17 -1580,16 +1573,17 @@@ $wgDjvuOutputExtension = 'jpg'
  /**
   * Site admin email address.
   *
 - * Defaults to "wikiadmin@$wgServerName".
 + * Defaults to "wikiadmin@$wgServerName" (in Setup.php).
   */
  $wgEmergencyContact = false;
  
  /**
   * Sender email address for e-mail notifications.
   *
 - * The address we use as sender when a user requests a password reminder.
 + * The address we use as sender when a user requests a password reminder,
 + * as well as other e-mail notifications.
   *
 - * Defaults to "apache@$wgServerName".
 + * Defaults to "apache@$wgServerName" (in Setup.php).
   */
  $wgPasswordSender = false;
  
@@@ -1597,7 -1603,7 +1597,7 @@@ $wgPasswordSenderName = 'MediaWiki Mail
  /**
   * Reply-To address for e-mail notifications.
   *
 - * Defaults to $wgPasswordSender.
 + * Defaults to $wgPasswordSender (in Setup.php).
   */
  $wgNoReplyAddress = false;
  
@@@ -1691,15 -1697,8 +1691,15 @@@ $wgAdditionalMailParams = null
  $wgAllowHTMLEmail = false;
  
  /**
 - * True: from page editor if s/he opted-in. False: Enotif mails appear to come
 - * from $wgEmergencyContact
 + * Allow sending of e-mail notifications with the editor's address as sender.
 + *
 + * This setting depends on $wgEnotifRevealEditorAddress also being enabled.
 + * If both are enabled, notifications for actions from users that have opted-in,
 + * will be sent to other users with their address as "From" instead of "Reply-To".
 + *
 + * If disabled, or not opted-in, notifications come from $wgPasswordSender.
 + *
 + * @var bool
   */
  $wgEnotifFromEditor = false;
  
@@@ -1731,18 -1730,8 +1731,18 @@@ $wgEnotifWatchlist = false
  $wgEnotifUserTalk = false;
  
  /**
 - * Set the Reply-to address in notifications to the editor's address, if user
 - * allowed this in the preferences.
 + * Allow sending of e-mail notifications with the editor's address in "Reply-To".
 + *
 + * Note, enabling this only actually uses it in notification e-mails if the user
 + * opted-in to this feature. This feature flag also controls visibility of the
 + * 'enotifrevealaddr' preference, which, if users opt into, will make e-mail
 + * notifications about their actions use their address as "Reply-To".
 + *
 + * To set the address as "From" instead of "Reply-To", also enable $wgEnotifFromEditor.
 + *
 + * If disabled, or not opted-in, notifications come from $wgPasswordSender.
 + *
 + * @var bool
   */
  $wgEnotifRevealEditorAddress = false;
  
@@@ -3271,6 -3260,17 +3271,6 @@@ $wgXhtmlNamespaces = []
   */
  $wgSiteNotice = '';
  
 -/**
 - * If this is set, a "donate" link will appear in the sidebar. Set it to a URL.
 - */
 -$wgSiteSupportPage = '';
 -
 -/**
 - * Validate the overall output using tidy and refuse
 - * to display the page if it's not valid.
 - */
 -$wgValidateAllHtml = false;
 -
  /**
   * Default skin, for new users and anonymous visitors. Registered users may
   * change this to any one of the other available skins in their preferences.
@@@ -4270,9 -4270,8 +4270,9 @@@ $wgAllowImageTag = false
  
  /**
   * Configuration for HTML postprocessing tool. Set this to a configuration
 - * array to enable an external tool. Dave Raggett's "HTML Tidy" is typically
 - * used. See https://www.w3.org/People/Raggett/tidy/
 + * array to enable an external tool. By default, we now use the RemexHtml
 + * library; historically, Dave Raggett's "HTML Tidy" was typically used.
 + * See https://www.w3.org/People/Raggett/tidy/
   *
   * If this is null and $wgUseTidy is true, the deprecated configuration
   * parameters will be used instead.
   *  - tidyBin: For RaggettExternal, the path to the tidy binary.
   *  - tidyCommandLine: For RaggettExternal, additional command line options.
   */
 -$wgTidyConfig = null;
 +$wgTidyConfig = [ 'driver' => 'RemexHtml' ];
  
  /**
   * Set this to true to use the deprecated tidy configuration parameters.
@@@ -5151,7 -5150,6 +5151,7 @@@ $wgGroupPermissions['user']['reupload'
  $wgGroupPermissions['user']['reupload-shared'] = true;
  $wgGroupPermissions['user']['minoredit'] = true;
  $wgGroupPermissions['user']['editmyusercss'] = true;
 +$wgGroupPermissions['user']['editmyuserjson'] = true;
  $wgGroupPermissions['user']['editmyuserjs'] = true;
  $wgGroupPermissions['user']['purge'] = true;
  $wgGroupPermissions['user']['sendemail'] = true;
@@@ -5187,7 -5185,6 +5187,7 @@@ $wgGroupPermissions['sysop']['deletedte
  $wgGroupPermissions['sysop']['undelete'] = true;
  $wgGroupPermissions['sysop']['editinterface'] = true;
  $wgGroupPermissions['sysop']['editusercss'] = true;
 +$wgGroupPermissions['sysop']['edituserjson'] = true;
  $wgGroupPermissions['sysop']['edituserjs'] = true;
  $wgGroupPermissions['sysop']['import'] = true;
  $wgGroupPermissions['sysop']['importupload'] = true;
@@@ -5819,7 -5816,6 +5819,7 @@@ $wgGrantPermissions['editprotected']['e
  // FIXME: Rename editmycssjs to editmyconfig
  $wgGrantPermissions['editmycssjs'] = $wgGrantPermissions['editpage'];
  $wgGrantPermissions['editmycssjs']['editmyusercss'] = true;
 +$wgGrantPermissions['editmycssjs']['editmyuserjson'] = true;
  $wgGrantPermissions['editmycssjs']['editmyuserjs'] = true;
  
  $wgGrantPermissions['editmyoptions']['editmyoptions'] = true;
  $wgGrantPermissions['editinterface'] = $wgGrantPermissions['editpage'];
  $wgGrantPermissions['editinterface']['editinterface'] = true;
  $wgGrantPermissions['editinterface']['editusercss'] = true;
 +$wgGrantPermissions['editinterface']['edituserjson'] = true;
  $wgGrantPermissions['editinterface']['edituserjs'] = true;
  
  $wgGrantPermissions['createeditmovepage'] = $wgGrantPermissions['editpage'];
@@@ -6067,7 -6062,7 +6067,7 @@@ $wgUseTeX = false
  /************************************************************************//**
   * @name   Profiling, testing and debugging
   *
 - * To enable profiling, edit StartProfiler.php
 + * See $wgProfiler for how to enable profiling.
   *
   * @{
   */
@@@ -6312,66 -6307,6 +6312,66 @@@ $wgDevelopmentWarnings = false
   */
  $wgDeprecationReleaseLimit = false;
  
 +/**
 + * Profiler configuration.
 + *
 + * To use a profiler, set $wgProfiler in LocalSetings.php.
 + * For backwards-compatibility, it is also allowed to set the variable from
 + * a separate file called StartProfiler.php, which MediaWiki will include.
 + *
 + * Example:
 + *
 + * @code
 + *  $wgProfiler['class'] = ProfilerXhprof::class;
 + * @endcode
 + *
 + * For output, set the 'output' key to an array of class names, one for each
 + * output type you want the profiler to generate. For example:
 + *
 + * @code
 + *  $wgProfiler['output'] = [ ProfilerOutputText::class ];
 + * @endcode
 + *
 + * The output classes available to you by default are ProfilerOutputDb,
 + * ProfilerOutputDump, ProfilerOutputStats, ProfilerOutputText, and
 + * ProfilerOutputUdp.
 + *
 + * ProfilerOutputStats outputs profiling data as StatsD metrics. It expects
 + * that you have set the $wgStatsdServer configuration variable to the host (or
 + * host:port) of your statsd server.
 + *
 + * ProfilerOutputText will output profiling data in the page body as a comment.
 + * You can make the profiling data in HTML render as part of the page content
 + * by setting the 'visible' configuration flag:
 + *
 + * @code
 + *  $wgProfiler['visible'] = true;
 + * @endcode
 + *
 + * 'ProfilerOutputDb' expects a database table that can be created by applying
 + * maintenance/archives/patch-profiling.sql to your database.
 + *
 + * 'ProfilerOutputDump' expects a $wgProfiler['outputDir'] telling it where to
 + * write dump files. The files produced are compatible with the XHProf gui.
 + * For a rudimentary sampling profiler:
 + *
 + * @code
 + *   $wgProfiler['class'] = 'ProfilerXhprof';
 + *   $wgProfiler['output'] = array( 'ProfilerOutputDb' );
 + *   $wgProfiler['sampling'] = 50; // one every 50 requests
 + * @endcode
 + *
 + * When using the built-in `sampling` option, the `class` will changed to
 + * ProfilerStub for non-sampled cases.
 + *
 + * For performance, the profiler is always disabled for CLI scripts as they
 + * could be long running and the data would accumulate. Use the '--profiler'
 + * parameter of maintenance scripts to override this.
 + *
 + * @since 1.17.0
 + */
 +$wgProfiler = [];
 +
  /**
   * Only record profiling info for pages that took longer than this
   * @deprecated since 1.25: set $wgProfiler['threshold'] instead.
@@@ -6928,6 -6863,11 +6928,6 @@@ $wgUseNPPatrol = true
   */
  $wgUseFilePatrol = true;
  
 -/**
 - * Log autopatrol actions to the log table
 - */
 -$wgLogAutopatrol = true;
 -
  /**
   * Provide syndication feeds (RSS, Atom) for, e.g., Recentchanges, Newpages
   */
@@@ -8050,6 -7990,25 +8050,6 @@@ $wgExemptFromUserRobotsControl = null
   * @{
   */
  
 -/**
 - * Enable the MediaWiki API for convenient access to
 - * machine-readable data via api.php
 - *
 - * See https://www.mediawiki.org/wiki/API
 - *
 - * @deprecated since 1.31
 - */
 -$wgEnableAPI = true;
 -
 -/**
 - * Allow the API to be used to perform write operations
 - * (page edits, rollback, etc.) when an authorised user
 - * accesses it
 - *
 - * @deprecated since 1.31
 - */
 -$wgEnableWriteAPI = true;
 -
  /**
   *
   *     WARNING: SECURITY THREAT - debug use only
@@@ -8188,8 -8147,6 +8188,8 @@@ $wgAPIUselessQueryPages = 
  
  /**
   * Enable AJAX framework
 + *
 + * @deprecated (officially) since MediaWiki 1.31 and ignored since 1.32
   */
  $wgUseAjax = true;
  
@@@ -8206,7 -8163,7 +8206,7 @@@ $wgAjaxExportList = []
  $wgAjaxUploadDestCheck = true;
  
  /**
 - * Enable previewing licences via AJAX. Also requires $wgEnableAPI to be true.
 + * Enable previewing licences via AJAX.
   */
  $wgAjaxLicensePreview = true;
  
@@@ -8300,7 -8257,7 +8300,7 @@@ $wgMaxShellWallClockTime = 180
  $wgShellCgroup = false;
  
  /**
 - * Executable path of the PHP cli binary (php/php5). Should be set up on install.
 + * Executable path of the PHP cli binary. Should be set up on install.
   */
  $wgPhpCli = '/usr/bin/php';
  
@@@ -8881,6 -8838,15 +8881,15 @@@ $wgCommentTableSchemaMigrationStage = M
   */
  $wgActorTableSchemaMigrationStage = MIGRATION_OLD;
  
+ /**
+  * Temporary option to disable the date picker from the Expiry Widget.
+  *
+  * @since 1.32
+  * @deprecated 1.32
+  * @var bool
+  */
+ $wgExpiryWidgetNoDatePicker = false;
  /**
   * For really cool vim folding this needs to be at the end:
   * vim: foldmarker=@{,@} foldmethod=marker
diff --combined resources/Resources.php
@@@ -1411,7 -1411,7 +1411,7 @@@ return 
                'targets' => [ 'desktop', 'mobile' ],
        ],
        'mediawiki.editfont.styles' => [
 -              'styles' => 'resources/src/mediawiki/mediawiki.editfont.css',
 +              'styles' => 'resources/src/mediawiki/mediawiki.editfont.less',
                'targets' => [ 'desktop', 'mobile' ],
        ],
        'mediawiki.visibleTimeout' => [
                        'apisandbox-loading',
                        'apisandbox-load-error',
                        'apisandbox-fetch-token',
 +                      'apisandbox-add-multi',
                        'apisandbox-helpurls',
                        'apisandbox-examples',
                        'apisandbox-dynamic-parameters',
                'scripts' => 'resources/src/mediawiki.special/mediawiki.special.block.js',
                'dependencies' => [
                        'oojs-ui-core',
+                       'oojs-ui.styles.icons-editing-core',
+                       'oojs-ui.styles.icons-editing-advanced',
                        'mediawiki.widgets.SelectWithInputWidget',
+                       'mediawiki.widgets.DateInputWidget',
                        'mediawiki.util',
                        'mediawiki.htmlform',
+                       'moment',
                ],
        ],
        'mediawiki.special.changecredentials.js' => [
                'dependencies' => [
                        'oojs-ui-core',
                        'jquery.lengthLimit',
 +                      'mediawiki.language',
                        'mediawiki.String',
                ],
                'targets' => [ 'desktop', 'mobile' ]
                ],
                'targets' => [ 'desktop', 'mobile' ],
        ],
+       'mediawiki.widgets.expiry' => [
+               'scripts' => [
+                       'resources/src/mediawiki.widgets/mw.widgets.ExpiryInputWidget.js',
+               ],
+               'dependencies' => [
+                       'oojs-ui-core',
+                       'oojs-ui-widgets',
+                       'moment',
+                       'mediawiki.widgets.datetime'
+               ],
+               'skinStyles' => [
+                       'default' => 'resources/src/mediawiki.widgets/mw.widgets.ExpiryInputWidget.less',
+               ],
+               'targets' => [ 'desktop', 'mobile' ],
+       ],
        'mediawiki.widgets.CategoryMultiselectWidget' => [
                'scripts' => [
                        'resources/src/mediawiki.widgets/mw.widgets.CategoryCapsuleItemWidget.js',