RCFilters: Style the Saved Links placeholder and add a title
authorMoriel Schottlender <moriel@gmail.com>
Fri, 12 May 2017 22:34:52 +0000 (15:34 -0700)
committerMoriel Schottlender <moriel@gmail.com>
Mon, 15 May 2017 19:37:43 +0000 (12:37 -0700)
Bug: T164861
Change-Id: I4cfdfdc82d53631008df35e9444781cf91bad06e

languages/i18n/en.json
languages/i18n/qqq.json
resources/Resources.php
resources/src/mediawiki.rcfilters/styles/mw.rcfilters.ui.SavedLinksListWidget.less
resources/src/mediawiki.rcfilters/ui/mw.rcfilters.ui.SavedLinksListWidget.js

index 00e0013..4e9018d 100644 (file)
        "recentchanges-submit": "Show",
        "rcfilters-activefilters": "Active filters",
        "rcfilters-quickfilters": "Quick links",
-       "rcfilters-quickfilters-placeholder": "Save your favorite tool settings to re-use them later.",
+       "rcfilters-quickfilters-placeholder-title": "No links saved yet",
+       "rcfilters-quickfilters-placeholder-description": "To save your filter settings and reuse them later, click the bookmark icon in the Active Filter area, below.",
        "rcfilters-savedqueries-defaultlabel": "Saved filters",
        "rcfilters-savedqueries-rename": "Rename",
        "rcfilters-savedqueries-setdefault": "Set as default",
index 75fd99b..fd99b22 100644 (file)
        "recentchanges-submit": "Label for submit button in [[Special:RecentChanges]]\n{{Identical|Show}}",
        "rcfilters-activefilters": "Title for the filters selection showing the active filters.",
        "rcfilters-quickfilters": "Label for the button that opens the quick filters menu in [[Special:RecentChanges]]",
-       "rcfilters-quickfilters-placeholder": "Text shown in the quick filters menu on [[Special:RecentChanges]] if the user has not saved any quick filters.",
+       "rcfilters-quickfilters-placeholder-title": "Title for the text shown in the quick filters menu on [[Special:RecentChanges]] if the user has not saved any quick filters.",
+       "rcfilters-quickfilters-placeholder-description": "Description for the text shown in the quick filters menu on [[Special:RecentChanges]] if the user has not saved any quick filters.",
        "rcfilters-savedqueries-defaultlabel": "Default name for saving a new set of quick filters [[Special:RecentChanges]]",
        "rcfilters-savedqueries-rename": "Label for the menu option that edits a quick filter in [[Special:RecentChanges]]\n{{Identical|Rename}}",
        "rcfilters-savedqueries-setdefault": "Label for the menu option that sets a quick filter as default in [[Special:RecentChanges]]",
index ad83632..109a676 100644 (file)
@@ -1803,7 +1803,8 @@ return [
                'messages' => [
                        'rcfilters-activefilters',
                        'rcfilters-quickfilters',
-                       'rcfilters-quickfilters-placeholder',
+                       'rcfilters-quickfilters-placeholder-title',
+                       'rcfilters-quickfilters-placeholder-description',
                        'rcfilters-savedqueries-defaultlabel',
                        'rcfilters-savedqueries-rename',
                        'rcfilters-savedqueries-setdefault',
index 5bda034..716ed03 100644 (file)
@@ -6,6 +6,11 @@
        }
 
        &-placeholder {
+               &-title {
+                       font-weight: bold;
+                       margin-bottom: 1em;
+               }
+
                // Extra specificity needed to override OOUI rule that sets white-space: nowrap;
                // on labels inside options
                &.oo-ui-optionWidget .oo-ui-labelElement-label {
 
                .oo-ui-iconElement-icon {
                        opacity: 0.5;
+                       // Override OOUI option widget rules for icons
+                       // we want the icon to appear at the top near the
+                       // title, not in the middle of the multiline option
+                       top: 0.7em !important; /* stylelint-disable-line declaration-no-important */
+                       height: inherit !important; /* stylelint-disable-line declaration-no-important */
                }
        }
 }
index 91c05b2..8c021d0 100644 (file)
         * @cfg {jQuery} [$overlay] A jQuery object serving as overlay for popups
         */
        mw.rcfilters.ui.SavedLinksListWidget = function MwRcfiltersUiSavedLinksListWidget( controller, model, config ) {
+               var $labelNoEntries = $( '<div>' )
+                       .append(
+                               $( '<div>' )
+                                       .addClass( 'mw-rcfilters-ui-savedLinksListWidget-placeholder-title' )
+                                       .text( mw.msg( 'rcfilters-quickfilters-placeholder-title' ) ),
+                               $( '<div>' )
+                                       .addClass( 'mw-rcfilters-ui-savedLinksListWidget-placeholder-description' )
+                                       .text( mw.msg( 'rcfilters-quickfilters-placeholder-description' ) )
+                       );
+
                config = config || {};
 
                // Parent
@@ -22,7 +32,7 @@
 
                this.placeholderItem = new OO.ui.DecoratedOptionWidget( {
                        classes: [ 'mw-rcfilters-ui-savedLinksListWidget-placeholder' ],
-                       label: mw.msg( 'rcfilters-quickfilters-placeholder' ),
+                       label: $labelNoEntries,
                        icon: 'unClip'
                } );
                // The only reason we're using "ButtonGroupWidget" here is that