Merge "Delete maintenance/deleteRevision.php"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Tue, 22 Aug 2017 01:56:17 +0000 (01:56 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Tue, 22 Aug 2017 01:56:17 +0000 (01:56 +0000)
13 files changed:
docs/uidesign/child-selector-emu.html [deleted file]
includes/Preferences.php
languages/i18n/en.json
languages/i18n/qqq.json
package.json
resources/Resources.php
resources/lib/jquery/jquery.migrate.js
resources/src/mediawiki.rcfilters/dm/mw.rcfilters.dm.SavedQueryItemModel.js
resources/src/mediawiki.rcfilters/mw.rcfilters.Controller.js
resources/src/mediawiki.rcfilters/styles/mw.rcfilters.ui.HighlightColorPickerWidget.less
resources/src/mediawiki.rcfilters/ui/mw.rcfilters.ui.SaveFiltersPopupButtonWidget.js
resources/src/mediawiki.rcfilters/ui/mw.rcfilters.ui.SavedLinksListItemWidget.js
resources/src/mediawiki.rcfilters/ui/mw.rcfilters.ui.TagItemWidget.js

diff --git a/docs/uidesign/child-selector-emu.html b/docs/uidesign/child-selector-emu.html
deleted file mode 100644 (file)
index 9db4c54..0000000
+++ /dev/null
@@ -1,100 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-       <title>CSS Child selector emulation for IE 6</title>
-       <style>
-               /** Common rules **/
-               body  { background-color: #CCC; }
-               table { border:1px black solid; }
-               caption {
-                       background-color: #98fb98;
-                       border:1px solid #40FF40;
-               }
-
-               /** "old" rules" **/
-               table.global th,
-               table.global td
-               {
-                       border: 1px red solid;
-                       background-color:white;
-                       padding:1em;
-               }
-               table.global th
-               {
-                       background-color: #ffc0cb;
-               }
-
-               /** second table. Try to emulate child selector */
-               table.childemu th,
-               table.childemu td {
-                       border: 1px red solid;
-                       background-color:white;
-                       padding:1em;
-               }
-               table.childemu th
-               {
-                       background-color: #ffc0cb;
-               }
-
-               /** Reset style applied in childemu classes */
-               /** TODO: find the real default value!! */
-               table.childemu tr * th,
-               table.childemu tr * td {
-                       border: none;
-                       background-color: transparent;
-                       padding: 0;
-               }
-
-
-               /** child selector emulation */
-       </style>
-</head>
-<body>
-<p>
-The following table show how nested tables inherit colors from the wikitable class (here it was renamed "global").
-</p>
-<table class="global">
-<caption>Global table</caption>
-<tr>
-       <th>TH: should have pink bg</th>
-</tr>
-<tr>
-       <td>TD: white bg</td>
-</tr>
-<tr>
-       <td>
-               <table class="nested">
-               <caption>Nested table</caption>
-               <tr>
-                       <th>Nested TH: transparent</th>
-                       <td>Nested TD: transparent</td>
-               </tr>
-               </table>
-       </td>
-</tr>
-</table>
-
-<p>
-With child selector we could limit the wikitable styling to the direct childs of the table. Unfortunately, Internet Explorer 6.0 does not support child selector. See <a href="https://bugzilla.wikimedia.org/show_bug.cgi?id=33752">our bug #33752</a>.
-</p>
-<table class="childemu">
-<caption>Global table</caption>
-<tr>
-       <th>TH: should have pink bg</th>
-</tr>
-<tr>
-       <td>TD: white bg</td>
-</tr>
-<tr>
-       <td>
-               <table class="nested">
-               <caption>Nested table</caption>
-               <tr>
-                       <th>Nested TH: transparent</th>
-                       <td>Nested TD: transparent</td>
-               </tr>
-               </table>
-       </td>
-</tr>
-</table>
-<p><strong>NOTE:</strong>The nested caption keep the green background. The nested table keep the black border. This is because those declarations are global so we did not reset them.</p>
index 2f3b954..c64e8a8 100644 (file)
@@ -1685,7 +1685,7 @@ class PreferencesForm extends HTMLForm {
                $html = parent::getButtons();
 
                if ( $this->getModifiedUser()->isAllowed( 'editmyoptions' ) ) {
-                       $t = SpecialPage::getTitleFor( 'Preferences', 'reset' );
+                       $t = $this->getTitle()->getSubpage( 'reset' );
 
                        $linkRenderer = MediaWikiServices::getInstance()->getLinkRenderer();
                        $html .= "\n" . $linkRenderer->makeLink( $t, $this->msg( 'restoreprefs' )->text(),
index b5cc6a5..a44b3cf 100644 (file)
        "recentchanges-legend-unpatrolled": "{{int:recentchanges-label-unpatrolled}}",
        "recentchanges-legend-plusminus": "(<em>±123</em>)",
        "recentchanges-submit": "Show",
+       "rcfilters-tag-remove": "Remove '$1'",
        "rcfilters-legend-heading": "<strong>List of abbreviations:</strong>",
        "rcfilters-other-review-tools": "<strong>Other review tools</strong>",
        "rcfilters-group-results-by-page": "Group results by page",
index 25517b9..92c3a89 100644 (file)
        "recentchanges-legend-unpatrolled": "Used as legend on [[Special:RecentChanges]] and [[Special:Watchlist]].\n\nRefers to {{msg-mw|Recentchanges-label-unpatrolled}}.",
        "recentchanges-legend-plusminus": "{{optional}}\nA plus/minus sign with a number for the legend.",
        "recentchanges-submit": "Label for submit button in [[Special:RecentChanges]]\n{{Identical|Show}}",
+       "rcfilters-tag-remove": "A tooltip for the button that removes a filter from the active filters area in [[Special:RecentChanges]] and [[Special:Watchlist]] when RCFilters are enabled. \n\nParameters: $1 - Tag label",
        "rcfilters-legend-heading": "Used as a heading for legend box on [[Special:RecentChanges]] and [[Special:Watchlist]] when RCFilters are enabled.",
        "rcfilters-other-review-tools": "Used as a heading for the community collection of other links on [[Special:RecentChanges]] when RCFilters are enabled.",
        "rcfilters-group-results-by-page": "A label for the checkbox describing whether the results in [[Special:RecentChanges]] are grouped by page when RCFilters are enabled.",
index 8507238..96a425f 100644 (file)
@@ -9,7 +9,7 @@
   "devDependencies": {
     "deepmerge": "1.3.2",
     "eslint": "3.12.2",
-    "eslint-config-wikimedia": "0.4.0",
+    "eslint-config-wikimedia": "0.5.0",
     "grunt": "1.0.1",
     "grunt-banana-checker": "0.6.0",
     "grunt-contrib-copy": "1.0.0",
index 0216471..89eab94 100644 (file)
@@ -1832,6 +1832,7 @@ return [
                        ],
                ],
                'messages' => [
+                       'rcfilters-tag-remove',
                        'rcfilters-activefilters',
                        'rcfilters-advancedfilters',
                        'rcfilters-group-results-by-page',
index 879509f..f094aaa 100644 (file)
@@ -1,13 +1,34 @@
 /*!
- * jQuery Migrate - v3.0.0 - 2016-06-09
+ * jQuery Migrate - v3.0.1-pre - 2017-08-17
  * Copyright jQuery Foundation and other contributors
+ *
+ * Patched for MediaWiki:
+ * - Preserve handler of uncaught exceptions in promise chains
+ *   https://gerrit.wikimedia.org/r/#/c/360999/
+ *   https://github.com/jquery/jquery-migrate/pull/262
  */
-(function( jQuery, window ) {
+;( function( factory ) {
+       if ( typeof define === "function" && define.amd ) {
+
+               // AMD. Register as an anonymous module.
+               define( [ "jquery" ], window, factory );
+       } else if ( typeof module === "object" && module.exports ) {
+
+               // Node/CommonJS
+               // eslint-disable-next-line no-undef
+               module.exports = factory( require( "jquery" ), window );
+       } else {
+
+               // Browser globals
+               factory( jQuery, window );
+       }
+} )( function( jQuery, window ) {
 "use strict";
 
 
-jQuery.migrateVersion = "3.0.0";
+jQuery.migrateVersion = "3.0.1-pre";
 
+/* exported migrateWarn, migrateWarnFunc, migrateWarnProp */
 
 ( function() {
 
@@ -15,7 +36,9 @@ jQuery.migrateVersion = "3.0.0";
        // IE9 only creates console object when dev tools are first opened
        // Also, avoid Function#bind here to simplify PhantomJS usage
        var log = window.console && window.console.log &&
-                       function() { window.console.log.apply( window.console, arguments ); },
+               function() {
+                       window.console.log.apply( window.console, arguments );
+               },
                rbadVersions = /^[12]\./;
 
        if ( !log ) {
@@ -74,11 +97,22 @@ function migrateWarnProp( obj, prop, value, msg ) {
                get: function() {
                        migrateWarn( msg );
                        return value;
+               },
+               set: function( newValue ) {
+                       migrateWarn( msg );
+                       value = newValue;
                }
        } );
 }
 
-if ( document.compatMode === "BackCompat" ) {
+function migrateWarnFunc( obj, prop, newFunc, msg ) {
+       obj[ prop ] = function() {
+               migrateWarn( msg );
+               return newFunc.apply( this, arguments );
+       };
+}
+
+if ( window.document.compatMode === "BackCompat" ) {
 
        // JQuery has never supported or tested Quirks Mode
        migrateWarn( "jQuery is not compatible with Quirks Mode" );
@@ -115,7 +149,7 @@ jQuery.find = function( selector ) {
                // The nonstandard and undocumented unquoted-hash was removed in jQuery 1.12.0
                // First see if qS thinks it's a valid selector, if so avoid a false positive
                try {
-                       document.querySelector( selector );
+                       window.document.querySelector( selector );
                } catch ( err1 ) {
 
                        // Didn't *look* valid to qSA, warn and try quoting what we think is the value
@@ -126,7 +160,7 @@ jQuery.find = function( selector ) {
                        // If the regexp *may* have created an invalid selector, don't update it
                        // Note that there may be false alarms if selector uses jQuery extensions
                        try {
-                               document.querySelector( selector );
+                               window.document.querySelector( selector );
                                migrateWarn( "Attribute selector with '#' must be quoted: " + args[ 0 ] );
                                args[ 0 ] = selector;
                        } catch ( err2 ) {
@@ -148,7 +182,7 @@ for ( findProp in oldFind ) {
 
 // The number of elements contained in the matched element set
 jQuery.fn.size = function() {
-       migrateWarn( "jQuery.fn.size() is deprecated; use the .length property" );
+       migrateWarn( "jQuery.fn.size() is deprecated and removed; use the .length property" );
        return this.length;
 };
 
@@ -175,14 +209,14 @@ jQuery.isNumeric = function( val ) {
        return oldValue;
 };
 
-migrateWarnProp( jQuery, "unique", jQuery.uniqueSort,
-       "jQuery.unique is deprecated, use jQuery.uniqueSort" );
+migrateWarnFunc( jQuery, "unique", jQuery.uniqueSort,
+       "jQuery.unique is deprecated; use jQuery.uniqueSort" );
 
 // Now jQuery.expr.pseudos is the standard incantation
 migrateWarnProp( jQuery.expr, "filters", jQuery.expr.pseudos,
-       "jQuery.expr.filters is now jQuery.expr.pseudos" );
+       "jQuery.expr.filters is deprecated; use jQuery.expr.pseudos" );
 migrateWarnProp( jQuery.expr, ":", jQuery.expr.pseudos,
-       "jQuery.expr[\":\"] is now jQuery.expr.pseudos" );
+       "jQuery.expr[':'] is deprecated; use jQuery.expr.pseudos" );
 
 
 var oldAjax = jQuery.ajax;
@@ -192,11 +226,11 @@ jQuery.ajax = function( ) {
 
        // Be sure we got a jQXHR (e.g., not sync)
        if ( jQXHR.promise ) {
-               migrateWarnProp( jQXHR, "success", jQXHR.done,
+               migrateWarnFunc( jQXHR, "success", jQXHR.done,
                        "jQXHR.success is deprecated and removed" );
-               migrateWarnProp( jQXHR, "error", jQXHR.fail,
+               migrateWarnFunc( jQXHR, "error", jQXHR.fail,
                        "jQXHR.error is deprecated and removed" );
-               migrateWarnProp( jQXHR, "complete", jQXHR.always,
+               migrateWarnFunc( jQXHR, "complete", jQXHR.always,
                        "jQXHR.complete is deprecated and removed" );
        }
 
@@ -302,8 +336,26 @@ var oldData = jQuery.data;
 jQuery.data = function( elem, name, value ) {
        var curData;
 
+       // Name can be an object, and each entry in the object is meant to be set as data
+       if ( name && typeof name === "object" && arguments.length === 2 ) {
+               curData = jQuery.hasData( elem ) && oldData.call( this, elem );
+               var sameKeys = {};
+               for ( var key in name ) {
+                       if ( key !== jQuery.camelCase( key ) ) {
+                               migrateWarn( "jQuery.data() always sets/gets camelCased names: " + key );
+                               curData[ key ] = name[ key ];
+                       } else {
+                               sameKeys[ key ] = name[ key ];
+                       }
+               }
+
+               oldData.call( this, elem, sameKeys );
+
+               return name;
+       }
+
        // If the name is transformed, look for the un-transformed name in the data object
-       if ( name && name !== jQuery.camelCase( name ) ) {
+       if ( name && typeof name === "string" && name !== jQuery.camelCase( name ) ) {
                curData = jQuery.hasData( elem ) && oldData.call( this, elem );
                if ( curData && name in curData ) {
                        migrateWarn( "jQuery.data() always sets/gets camelCased names: " + name );
@@ -319,7 +371,7 @@ jQuery.data = function( elem, name, value ) {
 
 var oldTweenRun = jQuery.Tween.prototype.run;
 
-jQuery.Tween.prototype.run = function( percent ) {
+jQuery.Tween.prototype.run = function( ) {
        if ( jQuery.easing[ this.easing ].length > 1 ) {
                migrateWarn(
                        "easing function " +
@@ -327,21 +379,34 @@ jQuery.Tween.prototype.run = function( percent ) {
                        "\" should use only first argument"
                );
 
-               jQuery.easing[ this.easing ] = jQuery.easing[ this.easing ].bind(
-                       jQuery.easing,
-                       percent, this.options.duration * percent, 0, 1, this.options.duration
-               );
+               var oldEasing = jQuery.easing[ this.easing ];
+               jQuery.easing[ this.easing ] = function( percent ) {
+                       return oldEasing.call( jQuery.easing, percent, percent, 0, 1, 1 );
+               }.bind( this );
        }
 
        oldTweenRun.apply( this, arguments );
 };
 
+jQuery.fx.interval = jQuery.fx.interval || 13;
+
+// Support: IE9, Android <=4.4
+// Avoid false positives on browsers that lack rAF
+if ( window.requestAnimationFrame ) {
+       migrateWarnProp( jQuery.fx, "interval", jQuery.fx.interval,
+               "jQuery.fx.interval is deprecated" );
+}
+
 var oldLoad = jQuery.fn.load,
+       oldEventAdd = jQuery.event.add,
        originalFix = jQuery.event.fix;
 
 jQuery.event.props = [];
 jQuery.event.fixHooks = {};
 
+migrateWarnProp( jQuery.event.props, "concat", jQuery.event.props.concat,
+       "jQuery.event.props.concat() is deprecated and removed" );
+
 jQuery.event.fix = function( originalEvent ) {
        var event,
                type = originalEvent.type,
@@ -360,7 +425,7 @@ jQuery.event.fix = function( originalEvent ) {
                migrateWarn( "jQuery.event.fixHooks are deprecated and removed: " + type );
                if ( ( props = fixHook.props ) && props.length ) {
                        while ( props.length ) {
-                          jQuery.event.addProp( props.pop() );
+                               jQuery.event.addProp( props.pop() );
                        }
                }
        }
@@ -370,6 +435,15 @@ jQuery.event.fix = function( originalEvent ) {
        return fixHook && fixHook.filter ? fixHook.filter( event, originalEvent ) : event;
 };
 
+jQuery.event.add = function( elem, types ) {
+
+       // This misses the multiple-types case but that seems awfully rare
+       if ( elem === window && types === "load" && window.document.readyState === "complete" ) {
+               migrateWarn( "jQuery(window).on('load'...) called after load event occurred" );
+       }
+       return oldEventAdd.apply( this, arguments );
+};
+
 jQuery.each( [ "load", "unload", "error" ], function( _, name ) {
 
        jQuery.fn[ name ] = function() {
@@ -402,12 +476,12 @@ jQuery.each( [ "load", "unload", "error" ], function( _, name ) {
 
 // Trigger "ready" event only once, on document ready
 jQuery( function() {
-       jQuery( document ).triggerHandler( "ready" );
+       jQuery( window.document ).triggerHandler( "ready" );
 } );
 
 jQuery.event.special.ready = {
        setup: function() {
-               if ( this === document ) {
+               if ( this === window.document ) {
                        migrateWarn( "'ready' event is deprecated" );
                }
        }
@@ -448,7 +522,7 @@ jQuery.fn.offset = function() {
                return origin;
        }
 
-       docElem = ( elem.ownerDocument || document ).documentElement;
+       docElem = ( elem.ownerDocument || window.document ).documentElement;
        if ( !jQuery.contains( docElem, elem ) ) {
                migrateWarn( "jQuery.fn.offset() requires an element connected to a document" );
                return origin;
@@ -475,7 +549,7 @@ jQuery.param = function( data, traditional ) {
 var oldSelf = jQuery.fn.andSelf || jQuery.fn.addBack;
 
 jQuery.fn.andSelf = function() {
-       migrateWarn( "jQuery.fn.andSelf() replaced by jQuery.fn.addBack()" );
+       migrateWarn( "jQuery.fn.andSelf() is deprecated and removed, use jQuery.fn.addBack()" );
        return oldSelf.apply( this, arguments );
 };
 
@@ -538,5 +612,5 @@ jQuery.Deferred = function( func ) {
 // Preserve handler of uncaught exceptions in promise chains
 jQuery.Deferred.exceptionHook = oldDeferred.exceptionHook;
 
-
-})( jQuery, window );
+return jQuery;
+} );
index c066a1f..81c8306 100644 (file)
@@ -42,7 +42,7 @@
        /**
         * Get an object representing the state of this item
         *
-        * @returns {Object} Object representing the current data state
+        * @return {Object} Object representing the current data state
         *  of the object
         */
        mw.rcfilters.dm.SavedQueryItemModel.prototype.getState = function () {
index c24e6c6..209e7c8 100644 (file)
                this.filtersModel.toggleInvertedNamespaces();
 
                if (
-                       this.filtersModel.getFiltersByView( 'namespaces' )
-                               .filter( function ( filterItem ) {
-                                       return filterItem.isSelected();
-                               } )
-                               .length
+                       this.filtersModel.getFiltersByView( 'namespaces' ).filter(
+                               function ( filterItem ) { return filterItem.isSelected(); }
+                       ).length
                ) {
                        // Only re-fetch results if there are namespace items that are actually selected
                        this.updateChangesList();
index 4a7c3f8..667f528 100644 (file)
@@ -9,6 +9,15 @@
 
        &-buttonSelect {
                &-color {
+                       // Override OOUI definition from padded popup; the definition
+                       // forces the first-child to be margin-top:0; which overrides
+                       // our definitions below where margin is 0.5em.
+                       // We set up the margin-top as 0.5em for all circles so we get
+                       // a consistent result
+                       &.oo-ui-widget-enabled.oo-ui-optionWidget.oo-ui-buttonElement.oo-ui-buttonElement-frameless.oo-ui-buttonOptionWidget {
+                               margin-top: 0.5em;
+                       }
+
                        // Make the rule much more specific to override OOUI
                        .oo-ui-iconElement-icon.oo-ui-icon-check {
                                // Override OOUI icon dimensions
index 70a2227..bb837e0 100644 (file)
         * Respond to input keyup event, this is the way to intercept 'escape' key
         *
         * @param {jQuery.Event} e Event data
-        * @returns {boolean} false
+        * @return {boolean} false
         */
        mw.rcfilters.ui.SaveFiltersPopupButtonWidget.prototype.onInputKeyup = function ( e ) {
                if ( e.which === OO.ui.Keys.ESCAPE ) {
index cac1059..3655c16 100644 (file)
         * Respond to input keyup event, this is the way to intercept 'escape' key
         *
         * @param {jQuery.Event} e Event data
-        * @returns {boolean} false
+        * @return {boolean} false
         */
        mw.rcfilters.ui.SavedLinksListItemWidget.prototype.onInputKeyup = function ( e ) {
                if ( e.which === OO.ui.Keys.ESCAPE ) {
        /**
         * Get item ID
         *
-        * @returns {string} Query identifier
+        * @return {string} Query identifier
         */
        mw.rcfilters.ui.SavedLinksListItemWidget.prototype.getID = function () {
                return this.model.getID();
index bf75149..81889b2 100644 (file)
@@ -48,6 +48,9 @@
                this.$highlight = $( '<div>' )
                        .addClass( 'mw-rcfilters-ui-tagItemWidget-highlight' );
 
+               // Add title attribute with the item label to 'x' button
+               this.closeButton.setTitle( mw.msg( 'rcfilters-tag-remove', this.model.getLabel() ) );
+
                // Events
                this.model.connect( this, { update: 'onModelUpdate' } );