Merge "Enable RCFilters app on Watchlist"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Fri, 18 Aug 2017 22:01:36 +0000 (22:01 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Fri, 18 Aug 2017 22:01:36 +0000 (22:01 +0000)
.stylelintrc [deleted file]
.stylelintrc.json [new file with mode: 0644]
RELEASE-NOTES-1.30
includes/skins/SkinTemplate.php
resources/Resources.php
resources/src/jquery/jquery.mwExtension.js [deleted file]
resources/src/mediawiki.less/mediawiki.ui/variables.less
tests/qunit/QUnitTestResources.php
tests/qunit/suites/resources/jquery/jquery.mwExtension.test.js [deleted file]

diff --git a/.stylelintrc b/.stylelintrc
deleted file mode 100644 (file)
index 27e289d..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-{
-       "extends": "stylelint-config-wikimedia",
-       "rules": {
-               "no-descending-specificity": null,
-
-               "selector-no-id": null
-       }
-}
diff --git a/.stylelintrc.json b/.stylelintrc.json
new file mode 100644 (file)
index 0000000..27e289d
--- /dev/null
@@ -0,0 +1,8 @@
+{
+       "extends": "stylelint-config-wikimedia",
+       "rules": {
+               "no-descending-specificity": null,
+
+               "selector-no-id": null
+       }
+}
index 9474f21..dd39561 100644 (file)
@@ -168,6 +168,9 @@ changes to languages because of Phabricator reports.
 * WikiImporter now requires the second parameter to be an instance of the Config,
   class. Prior to that, the Config parameter was optional (a behavior deprecated in
   1.25).
+* Removed 'jquery.mwExtension' module. (deprecated since 1.26)
+* mediawiki.ui: Deprecate greys, which are not part of WikimediaUI color palette
+  any more.
 
 == Compatibility ==
 MediaWiki 1.30 requires PHP 5.5.9 or later. There is experimental support for
index 5ad1b11..cbffe1e 100644 (file)
@@ -306,8 +306,8 @@ class SkinTemplate extends Skin {
                $tpl->set( 'pagetitle', $out->getHTMLTitle() );
                $tpl->set( 'displaytitle', $out->mPageLinkTitle );
 
-               $tpl->setRef( 'thispage', $this->thispage );
-               $tpl->setRef( 'titleprefixeddbkey', $this->thispage );
+               $tpl->set( 'thispage', $this->thispage );
+               $tpl->set( 'titleprefixeddbkey', $this->thispage );
                $tpl->set( 'titletext', $title->getText() );
                $tpl->set( 'articleid', $title->getArticleID() );
 
@@ -336,32 +336,32 @@ class SkinTemplate extends Skin {
                                        'href' => $link
                                ];
                        }
-                       $tpl->setRef( 'feeds', $feeds );
+                       $tpl->set( 'feeds', $feeds );
                } else {
                        $tpl->set( 'feeds', false );
                }
 
-               $tpl->setRef( 'mimetype', $wgMimeType );
-               $tpl->setRef( 'jsmimetype', $wgJsMimeType );
+               $tpl->set( 'mimetype', $wgMimeType );
+               $tpl->set( 'jsmimetype', $wgJsMimeType );
                $tpl->set( 'charset', 'UTF-8' );
-               $tpl->setRef( 'wgScript', $wgScript );
-               $tpl->setRef( 'skinname', $this->skinname );
+               $tpl->set( 'wgScript', $wgScript );
+               $tpl->set( 'skinname', $this->skinname );
                $tpl->set( 'skinclass', static::class );
-               $tpl->setRef( 'skin', $this );
-               $tpl->setRef( 'stylename', $this->stylename );
+               $tpl->set( 'skin', $this );
+               $tpl->set( 'stylename', $this->stylename );
                $tpl->set( 'printable', $out->isPrintable() );
                $tpl->set( 'handheld', $request->getBool( 'handheld' ) );
-               $tpl->setRef( 'loggedin', $this->loggedin );
+               $tpl->set( 'loggedin', $this->loggedin );
                $tpl->set( 'notspecialpage', !$title->isSpecialPage() );
                $tpl->set( 'searchaction', $this->escapeSearchLink() );
                $tpl->set( 'searchtitle', SpecialPage::getTitleFor( 'Search' )->getPrefixedDBkey() );
                $tpl->set( 'search', trim( $request->getVal( 'search' ) ) );
-               $tpl->setRef( 'stylepath', $wgStylePath );
-               $tpl->setRef( 'articlepath', $wgArticlePath );
-               $tpl->setRef( 'scriptpath', $wgScriptPath );
-               $tpl->setRef( 'serverurl', $wgServer );
-               $tpl->setRef( 'logopath', $wgLogo );
-               $tpl->setRef( 'sitename', $wgSitename );
+               $tpl->set( 'stylepath', $wgStylePath );
+               $tpl->set( 'articlepath', $wgArticlePath );
+               $tpl->set( 'scriptpath', $wgScriptPath );
+               $tpl->set( 'serverurl', $wgServer );
+               $tpl->set( 'logopath', $wgLogo );
+               $tpl->set( 'sitename', $wgSitename );
 
                $userLang = $this->getLanguage();
                $userLangCode = $userLang->getHtmlCode();
@@ -374,8 +374,8 @@ class SkinTemplate extends Skin {
                $tpl->set( 'capitalizeallnouns', $userLang->capitalizeAllNouns() ? ' capitalize-all-nouns' : '' );
                $tpl->set( 'showjumplinks', true ); // showjumplinks preference has been removed
                $tpl->set( 'username', $this->loggedin ? $this->username : null );
-               $tpl->setRef( 'userpage', $this->userpage );
-               $tpl->setRef( 'userpageurl', $this->userpageUrlDetails['href'] );
+               $tpl->set( 'userpage', $this->userpage );
+               $tpl->set( 'userpageurl', $this->userpageUrlDetails['href'] );
                $tpl->set( 'userlang', $userLangCode );
 
                // Users can have their language set differently than the
index 09bd4dc..5aa166d 100644 (file)
@@ -301,10 +301,6 @@ return [
                'scripts' => 'resources/src/jquery/jquery.mw-jump.js',
                'targets' => [ 'desktop', 'mobile' ],
        ],
-       'jquery.mwExtension' => [
-               'scripts' => 'resources/src/jquery/jquery.mwExtension.js',
-               'targets' => [ 'desktop', 'mobile' ],
-       ],
        'jquery.placeholder' => [
                'deprecated' => 'Use of "jquery.placeholder" is deprecated since MediaWiki 1.29.0',
 
diff --git a/resources/src/jquery/jquery.mwExtension.js b/resources/src/jquery/jquery.mwExtension.js
deleted file mode 100644 (file)
index 9d970ed..0000000
+++ /dev/null
@@ -1,128 +0,0 @@
-/*
- * JavaScript backwards-compatibility alternatives and other convenience functions
- *
- * @deprecated since 1.26 Dated collection of miscellaneous utilities. Methods are
- *  either trivially inline, obsolete, or have a better place elsewhere.
- */
-( function ( $, mw ) {
-       $.each( {
-               trimLeft: function ( str ) {
-                       return str === null ? '' : str.toString().replace( /^\s+/, '' );
-               },
-               trimRight: function ( str ) {
-                       return str === null ?
-                               '' : str.toString().replace( /\s+$/, '' );
-               },
-               ucFirst: function ( str ) {
-                       return str.charAt( 0 ).toUpperCase() + str.slice( 1 );
-               },
-               isDomElement: function ( el ) {
-                       return !!el && !!el.nodeType;
-               },
-               isEmpty: function ( v ) {
-                       var key;
-                       if (
-                               v === '' || v === 0 || v === '0' || v === null || v === false || v === undefined
-                       ) {
-                               return true;
-                       }
-                       // the for-loop could potentially contain prototypes
-                       // to avoid that we check its length first
-                       if ( v.length === 0 ) {
-                               return true;
-                       }
-                       if ( typeof v === 'object' ) {
-                               for ( key in v ) {
-                                       return false;
-                               }
-                               return true;
-                       }
-                       return false;
-               },
-               compareArray: function ( arrThis, arrAgainst ) {
-                       var i;
-                       if ( arrThis.length !== arrAgainst.length ) {
-                               return false;
-                       }
-                       for ( i = 0; i < arrThis.length; i++ ) {
-                               if ( Array.isArray( arrThis[ i ] ) ) {
-                                       if ( !$.compareArray( arrThis[ i ], arrAgainst[ i ] ) ) {
-                                               return false;
-                                       }
-                               } else if ( arrThis[ i ] !== arrAgainst[ i ] ) {
-                                       return false;
-                               }
-                       }
-                       return true;
-               },
-               compareObject: function ( objectA, objectB ) {
-                       var prop, type;
-
-                       // Do a simple check if the types match
-                       if ( typeof objectA === typeof objectB ) {
-
-                               // Only loop over the contents if it really is an object
-                               if ( typeof objectA === 'object' ) {
-                                       // If they are aliases of the same object (ie. mw and mediaWiki) return now
-                                       if ( objectA === objectB ) {
-                                               return true;
-                                       } else {
-                                               // Iterate over each property
-                                               for ( prop in objectA ) {
-                                                       // Check if this property is also present in the other object
-                                                       if ( prop in objectB ) {
-                                                               // Compare the types of the properties
-                                                               type = typeof objectA[ prop ];
-                                                               if ( type === typeof objectB[ prop ] ) {
-                                                                       // Recursively check objects inside this one
-                                                                       switch ( type ) {
-                                                                               case 'object' :
-                                                                                       if ( !$.compareObject( objectA[ prop ], objectB[ prop ] ) ) {
-                                                                                               return false;
-                                                                                       }
-                                                                                       break;
-                                                                               case 'function' :
-                                                                                       // Functions need to be strings to compare them properly
-                                                                                       if ( objectA[ prop ].toString() !== objectB[ prop ].toString() ) {
-                                                                                               return false;
-                                                                                       }
-                                                                                       break;
-                                                                               default:
-                                                                                       // Strings, numbers
-                                                                                       if ( objectA[ prop ] !== objectB[ prop ] ) {
-                                                                                               return false;
-                                                                                       }
-                                                                                       break;
-                                                                       }
-                                                               } else {
-                                                                       return false;
-                                                               }
-                                                       } else {
-                                                               return false;
-                                                       }
-                                               }
-                                               // Check for properties in B but not in A
-                                               // This is about 15% faster (tested in Safari 5 and Firefox 3.6)
-                                               // ...than incrementing a count variable in the above and below loops
-                                               // See also: https://www.mediawiki.org/wiki/ResourceLoader/Default_modules/compareObject_test#Results
-                                               for ( prop in objectB ) {
-                                                       if ( !( prop in objectA ) ) {
-                                                               return false;
-                                                       }
-                                               }
-                                       }
-                               }
-                       } else {
-                               return false;
-                       }
-                       return true;
-               }
-       }, function ( key, value ) {
-               mw.log.deprecate( $, key, value, null, '$.' + key );
-       } );
-
-       mw.log.deprecate( $, 'escapeRE', function ( str ) {
-               return str.replace( /([\\{}()|.?*+\-^$\[\]])/g, '\\$1' ); // eslint-disable-line no-useless-escape
-       }, 'Use mediawiki.RegExp instead.', '$.escapeRE' );
-
-}( jQuery, mediaWiki ) );
index 56824f2..0ad791b 100644 (file)
@@ -1,20 +1,14 @@
 // Colors for use in mediawiki.ui and elsewhere
 
-// Although this defines many shades, be parsimonious in your own use of grays. Prefer
-// colors already in use in MediaWiki. Prefer semantic color names such as "@colorText".
+// Although this defines many shades, be parsimonious in your own use of grays.
+// Prefer semantic color names such as `@colorText` below.
 @colorGray1: #000; // darkest
 @colorGray2: #222;
-@colorGray3: #333;
 @colorGray4: #444;
 @colorGray5: #54595d;
-@colorGray6: #666;
 @colorGray7: #72777d;
-@colorGray8: #888;
-@colorGray9: #999;
 @colorGray10: #a2a9b1;
-@colorGray11: #bbb;
 @colorGray12: #c8ccd1;
-@colorGray13: #ddd;
 @colorGray14: #eaecf0;
 @colorGray15: #f8f9fa; // lightest
 @colorBaseInverted: #fff;
 
 // Form input sizes, equal to OOUI at 14px base font-size
 @sizeInputBinary: 1.5625em;
+
+// Deprecated color variables from when WikimediaUI color palette wasn't around
+// See https://wikimedia.github.io/WikimediaUI-Style-Guide/visual-style_colors.html
+@colorGray3: #333;
+@colorGray6: #666;
+@colorGray8: #888;
+@colorGray9: #999;
+@colorGray11: #bbb;
+@colorGray13: #ddd;
index ee3cd5b..7367560 100644 (file)
@@ -56,7 +56,6 @@ return [
                        'tests/qunit/suites/resources/jquery/jquery.highlightText.test.js',
                        'tests/qunit/suites/resources/jquery/jquery.localize.test.js',
                        'tests/qunit/suites/resources/jquery/jquery.makeCollapsible.test.js',
-                       'tests/qunit/suites/resources/jquery/jquery.mwExtension.test.js',
                        'tests/qunit/suites/resources/jquery/jquery.tabIndex.test.js',
                        'tests/qunit/suites/resources/jquery/jquery.tablesorter.test.js',
                        'tests/qunit/suites/resources/jquery/jquery.tablesorter.parsers.test.js',
@@ -112,7 +111,6 @@ return [
                        'jquery.highlightText',
                        'jquery.localize',
                        'jquery.makeCollapsible',
-                       'jquery.mwExtension',
                        'jquery.tabIndex',
                        'jquery.tablesorter',
                        'jquery.textSelection',
diff --git a/tests/qunit/suites/resources/jquery/jquery.mwExtension.test.js b/tests/qunit/suites/resources/jquery/jquery.mwExtension.test.js
deleted file mode 100644 (file)
index aeda516..0000000
+++ /dev/null
@@ -1,64 +0,0 @@
-( function ( $ ) {
-       QUnit.module( 'jquery.mwExtension', QUnit.newMwEnvironment( {
-               // This entire module is deprecated.
-               // Surpress deprecation warnings in test output.
-               setup: function () {
-                       this.suppressWarnings();
-               },
-               teardown: function () {
-                       this.restoreWarnings();
-               }
-       } ) );
-
-       QUnit.test( 'String functions', function ( assert ) {
-               assert.equal( $.trimLeft( '  foo bar  ' ), 'foo bar  ', 'trimLeft' );
-               assert.equal( $.trimRight( '  foo bar  ' ), '  foo bar', 'trimRight' );
-               assert.equal( $.ucFirst( 'foo' ), 'Foo', 'ucFirst' );
-
-               assert.equal( $.escapeRE( '<!-- ([{+mW+}]) $^|?>' ),
-                       '<!\\-\\- \\(\\[\\{\\+mW\\+\\}\\]\\) \\$\\^\\|\\?>', 'escapeRE - Escape specials' );
-               assert.equal( $.escapeRE( 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' ),
-                       'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'escapeRE - Leave uppercase alone' );
-               assert.equal( $.escapeRE( 'abcdefghijklmnopqrstuvwxyz' ),
-                       'abcdefghijklmnopqrstuvwxyz', 'escapeRE - Leave lowercase alone' );
-               assert.equal( $.escapeRE( '0123456789' ), '0123456789', 'escapeRE - Leave numbers alone' );
-       } );
-
-       QUnit.test( 'isDomElement', function ( assert ) {
-               assert.strictEqual( $.isDomElement( document.createElement( 'div' ) ), true,
-                       'isDomElement: HTMLElement' );
-               assert.strictEqual( $.isDomElement( document.createTextNode( '' ) ), true,
-                       'isDomElement: TextNode' );
-               assert.strictEqual( $.isDomElement( null ), false,
-                       'isDomElement: null' );
-               assert.strictEqual( $.isDomElement( document.getElementsByTagName( 'div' ) ), false,
-                       'isDomElement: NodeList' );
-               assert.strictEqual( $.isDomElement( $( 'div' ) ), false,
-                       'isDomElement: jQuery' );
-               assert.strictEqual( $.isDomElement( { foo: 1 } ), false,
-                       'isDomElement: Plain Object' );
-       } );
-
-       QUnit.test( 'isEmpty', function ( assert ) {
-               assert.strictEqual( $.isEmpty( 'string' ), false, 'isEmpty: "string"' );
-               assert.strictEqual( $.isEmpty( '0' ), true, 'isEmpty: "0"' );
-               assert.strictEqual( $.isEmpty( '' ), true, 'isEmpty: ""' );
-               assert.strictEqual( $.isEmpty( 1 ), false, 'isEmpty: 1' );
-               assert.strictEqual( $.isEmpty( [] ), true, 'isEmpty: []' );
-               assert.strictEqual( $.isEmpty( {} ), true, 'isEmpty: {}' );
-
-               // Documented behavior
-               assert.strictEqual( $.isEmpty( { length: 0 } ), true, 'isEmpty: { length: 0 }' );
-       } );
-
-       QUnit.test( 'Comparison functions', function ( assert ) {
-               assert.ok( $.compareArray( [ 0, 'a', [], [ 2, 'b' ] ], [ 0, 'a', [], [ 2, 'b' ] ] ),
-                       'compareArray: Two deep arrays that are excactly the same' );
-               assert.ok( !$.compareArray( [ 1 ], [ 2 ] ), 'compareArray: Two different arrays (false)' );
-
-               assert.ok( $.compareObject( {}, {} ), 'compareObject: Two empty objects' );
-               assert.ok( $.compareObject( { foo: 1 }, { foo: 1 } ), 'compareObject: Two the same objects' );
-               assert.ok( !$.compareObject( { bar: true }, { baz: false } ),
-                       'compareObject: Two different objects (false)' );
-       } );
-}( jQuery ) );