Merge "Update wikimedia/relpath from 1.0.3 -> 2.0.0"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Sat, 29 Jul 2017 00:01:17 +0000 (00:01 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Sat, 29 Jul 2017 00:01:18 +0000 (00:01 +0000)
12 files changed:
languages/i18n/en.json
languages/i18n/qqq.json
resources/Resources.php
resources/src/mediawiki.legacy/commonPrint.css
resources/src/mediawiki.rcfilters/dm/mw.rcfilters.dm.SavedQueriesModel.js
resources/src/mediawiki.rcfilters/mw.rcfilters.Controller.js
resources/src/mediawiki.rcfilters/styles/mw.rcfilters.ui.SaveFiltersPopupButtonWidget.less
resources/src/mediawiki.rcfilters/styles/mw.rcfilters.ui.less
resources/src/mediawiki.rcfilters/ui/mw.rcfilters.ui.ChangesLimitButtonWidget.js
resources/src/mediawiki.rcfilters/ui/mw.rcfilters.ui.DateButtonWidget.js
resources/src/mediawiki.rcfilters/ui/mw.rcfilters.ui.SaveFiltersPopupButtonWidget.js
resources/src/mediawiki.special/mediawiki.special.changeslist.legend.js

index 2f09573..b18fa0b 100644 (file)
        "rcfilters-savedqueries-new-name-label": "Name",
        "rcfilters-savedqueries-new-name-placeholder": "Describe the purpose of the filter",
        "rcfilters-savedqueries-apply-label": "Create filter",
+       "rcfilters-savedqueries-apply-and-setdefault-label": "Create default filter",
        "rcfilters-savedqueries-cancel-label": "Cancel",
        "rcfilters-savedqueries-add-new-title": "Save current filter settings",
        "rcfilters-restore-default-filters": "Restore default filters",
index 06274a3..e1ab37b 100644 (file)
        "rcfilters-savedqueries-new-name-label": "Label for the input that holds the name of the new saved filters in [[Special:RecentChanges]]\n{{Identical|Name}}",
        "rcfilters-savedqueries-new-name-placeholder": "Placeholder for the input that holds the name of the new saved filters in [[Special:RecentChanges]]",
        "rcfilters-savedqueries-apply-label": "Label for the button to apply saving a new filter setting in [[Special:RecentChanges]]. This is for a small popup, please try to use a short string.",
+       "rcfilters-savedqueries-apply-and-setdefault-label": "Label for the button to apply saving a new filter setting and set it as default in [[Special:RecentChanges]]. This is for a small popup, please try to use a short string.",
        "rcfilters-savedqueries-cancel-label": "Label for the button to cancel the saving of a new quick link in [[Special:RecentChanges]]\n{{Identical|Cancel}}",
        "rcfilters-savedqueries-add-new-title": "Title for the popup to add new quick link in [[Special:RecentChanges]]. This is for a small popup, please try to use a short string.",
        "rcfilters-restore-default-filters": "Label for the button that resets filters to defaults",
index 64ecc96..cc282e3 100644 (file)
@@ -1853,6 +1853,7 @@ return [
                        'rcfilters-savedqueries-new-name-placeholder',
                        'rcfilters-savedqueries-add-new-title',
                        'rcfilters-savedqueries-apply-label',
+                       'rcfilters-savedqueries-apply-and-setdefault-label',
                        'rcfilters-savedqueries-cancel-label',
                        'rcfilters-restore-default-filters',
                        'rcfilters-clear-all-filters',
index dec0fe8..67fc77d 100644 (file)
@@ -266,19 +266,21 @@ img.thumbborder {
 
 /**
  * Table rendering
- * As on shared.css but with white background.
  */
+/* Compare `table.wikitable` in shared.css */
 table.wikitable,
-table.mw_metadata {
+.mw_metadata {
        background: #fff;
        margin: 1em 0;
        border: 1pt solid #aaa;
        border-collapse: collapse;
+       font-size: 10pt;
 }
 
 table.wikitable > caption,
 .mw_metadata caption {
-       font-weight: bold;
+       padding: 5px;
+       font-size: 10pt;
 }
 
 table.wikitable > tr > th,
@@ -287,15 +289,17 @@ table.wikitable > * > tr > th,
 table.wikitable > * > tr > td,
 .mw_metadata th,
 .mw_metadata td {
+       /* Important is required to override any inline styles provided by editors */
+       background: #fff !important; /* stylelint-disable-line declaration-no-important */
+       /* We need to also set color in case editors applied a light text color */
+       color: #000 !important; /* stylelint-disable-line declaration-no-important */
        border: 1pt solid #aaa;
-       padding: 0.2em;
+       padding: 0.4em 0.6em;
 }
 
 table.wikitable > tr > th,
 table.wikitable > * > tr > th,
 .mw_metadata th {
-       background: #fff;
-       font-weight: bold;
        text-align: center;
 }
 
index 29134a5..d6dda1e 100644 (file)
         *
         * @param {string} label Label for the new query
         * @param {Object} data Data for the new query
+        * @return {string} ID of the newly added query
         */
        mw.rcfilters.dm.SavedQueriesModel.prototype.addNewQuery = function ( label, data ) {
                var randomID = ( new Date() ).getTime(),
                                normalizedData
                        )
                ] );
+
+               return randomID;
        };
 
        /**
index 2563479..8cee0a8 100644 (file)
         * Save the current model state as a saved query
         *
         * @param {string} [label] Label of the saved query
+        * @param {boolean} [setAsDefault=false] This query should be set as the default
         */
-       mw.rcfilters.Controller.prototype.saveCurrentQuery = function ( label ) {
-               var highlightedItems = {},
+       mw.rcfilters.Controller.prototype.saveCurrentQuery = function ( label, setAsDefault ) {
+               var queryID,
+                       highlightedItems = {},
                        highlightEnabled = this.filtersModel.isHighlightEnabled();
 
                // Prepare highlights
                highlightedItems.highlight = this.filtersModel.isHighlightEnabled();
 
                // Add item
-               this.savedQueriesModel.addNewQuery(
+               queryID = this.savedQueriesModel.addNewQuery(
                        label || mw.msg( 'rcfilters-savedqueries-defaultlabel' ),
                        {
                                filters: this.filtersModel.getSelectedState(),
                        }
                );
 
+               if ( setAsDefault ) {
+                       this.savedQueriesModel.setDefault( queryID );
+               }
+
                // Save item
                this._saveSavedQueries();
        };
index 272909d..ec4954c 100644 (file)
@@ -1,6 +1,7 @@
 .mw-rcfilters-ui-saveFiltersPopupButtonWidget {
        &-popup {
-               &-layout {
+               &-layout,
+               &-options {
                        padding-bottom: 1.5em;
                }
 
index c0f24c6..0bee2f1 100644 (file)
                vertical-align: top;
        }
 }
-
-// Temporary icon classes, until these icons
-// are merged into OOUI properly
-.oo-ui-iconElement-icon.oo-ui-icon-clip {
-       /* @embed */
-       background-image: url( ../images/clip.svg );
-}
-
-.oo-ui-iconElement-icon.oo-ui-icon-unClip {
-       /* @embed */
-       background-image: url( ../images/unClip.svg );
-}
-
-.oo-ui-iconElement-icon.oo-ui-icon-pushPin {
-       /* @embed */
-       background-image: url( ../images/pushPin.svg );
-}
index b85a89f..32d2097 100644 (file)
@@ -67,7 +67,7 @@
                                        width: 300,
                                        padded: true,
                                        anchor: false,
-                                       align: 'backwards',
+                                       align: 'forwards',
                                        $autoCloseIgnore: this.$overlay,
                                        $content: changesLimitPopupWidget.$element
                                }
index 647e42d..af81883 100644 (file)
@@ -63,7 +63,7 @@
                                        width: 300,
                                        padded: true,
                                        anchor: false,
-                                       align: 'backwards',
+                                       align: 'forwards',
                                        $autoCloseIgnore: this.$overlay,
                                        $content: datePopupWidget.$element
                                }
index dfb188d..70a2227 100644 (file)
@@ -14,6 +14,7 @@
         */
        mw.rcfilters.ui.SaveFiltersPopupButtonWidget = function MwRcfiltersUiSaveFiltersPopupButtonWidget( controller, model, config ) {
                var layout,
+                       checkBoxLayout,
                        $popupContent = $( '<div>' );
 
                config = config || {};
                        align: 'top'
                } );
 
+               this.setAsDefaultCheckbox = new OO.ui.CheckboxInputWidget();
+               checkBoxLayout = new OO.ui.FieldLayout( this.setAsDefaultCheckbox, {
+                       label: mw.msg( 'rcfilters-savedqueries-setdefault' ),
+                       align: 'inline'
+               } );
+
                this.applyButton = new OO.ui.ButtonWidget( {
                        label: mw.msg( 'rcfilters-savedqueries-apply-label' ),
                        classes: [ 'mw-rcfilters-ui-saveFiltersPopupButtonWidget-popup-buttons-apply' ],
@@ -61,6 +68,9 @@
                                $( '<div>' )
                                        .addClass( 'mw-rcfilters-ui-saveFiltersPopupButtonWidget-popup-layout' )
                                        .append( layout.$element ),
+                               $( '<div>' )
+                                       .addClass( 'mw-rcfilters-ui-saveFiltersPopupButtonWidget-popup-options' )
+                                       .append( checkBoxLayout.$element ),
                                $( '<div>' )
                                        .addClass( 'mw-rcfilters-ui-saveFiltersPopupButtonWidget-popup-buttons' )
                                        .append(
@@ -80,6 +90,7 @@
                this.input.$input.on( {
                        keyup: this.onInputKeyup.bind( this )
                } );
+               this.setAsDefaultCheckbox.connect( this, { change: 'onSetAsDefaultChange' } );
                this.cancelButton.connect( this, { click: 'onCancelButtonClick' } );
                this.applyButton.connect( this, { click: 'onApplyButtonClick' } );
 
                this.input.focus();
        };
 
+       /**
+        * Respond to "set as default" checkbox change
+        * @param {boolean} checked State of the checkbox
+        */
+       mw.rcfilters.ui.SaveFiltersPopupButtonWidget.prototype.onSetAsDefaultChange = function ( checked ) {
+               var messageKey = checked ?
+                       'rcfilters-savedqueries-apply-and-setdefault-label' :
+                       'rcfilters-savedqueries-apply-label';
+
+               this.applyButton
+                       .setIcon( checked ? 'pushPin' : null )
+                       .setLabel( mw.msg( messageKey ) );
+       };
+
        /**
         * Respond to cancel button click event
         */
                // This condition is more for sanity-check, since the
                // apply button should be disabled if the label is empty
                if ( label ) {
-                       this.controller.saveCurrentQuery( label );
+                       this.controller.saveCurrentQuery( label, this.setAsDefaultCheckbox.isSelected() );
                        this.input.setValue( '' );
+                       this.setAsDefaultCheckbox.setSelected( false );
                        this.popup.toggle( false );
 
                        this.emit( 'saveCurrent' );
index ea63e39..a991d36 100644 (file)
@@ -7,11 +7,10 @@
        var
                cookieName = 'changeslist-state',
                // Expanded by default
-               isCollapsed = mw.cookie.get( cookieName ) === 'collapsed',
                doCollapsibleLegend = function ( $container ) {
                        $container.find( '.mw-changeslist-legend' )
                                .makeCollapsible( {
-                                       collapsed: isCollapsed
+                                       collapsed: mw.cookie.get( cookieName ) === 'collapsed'
                                } )
                                .on( 'beforeExpand.mw-collapsible', function () {
                                        mw.cookie.set( cookieName, 'expanded' );