RCFilters: tweak old changes indicator
authorStephane Bisson <sbisson@wikimedia.org>
Mon, 7 Aug 2017 20:09:50 +0000 (16:09 -0400)
committerStephane Bisson <sbisson@wikimedia.org>
Mon, 7 Aug 2017 20:43:54 +0000 (16:43 -0400)
Bug: T172213
Change-Id: Ia9e669376390a56e52422352840a5d9e2576b1a8

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

index a14e926..52d3e32 100644 (file)
        "rcfilters-restore-default-filters": "Restore default filters",
        "rcfilters-clear-all-filters": "Clear all filters",
        "rcfilters-show-new-changes": "View newest changes",
-       "rcfilters-previous-changes-label": "Previously viewed changes",
        "rcfilters-search-placeholder": "Filter recent changes (browse or start typing)",
        "rcfilters-invalid-filter": "Invalid filter",
        "rcfilters-empty-filter": "No active filters. All contributions are shown.",
index 7be71f0..21051f5 100644 (file)
        "rcfilters-restore-default-filters": "Label for the button that resets filters to defaults",
        "rcfilters-clear-all-filters": "Title for the button that clears all filters",
        "rcfilters-show-new-changes": "Label for the button to show new changes.",
-       "rcfilters-previous-changes-label": "Label to indicate the changes below have been previously viewed.",
        "rcfilters-search-placeholder": "Placeholder for the filter search input.",
        "rcfilters-invalid-filter": "A label for an invalid filter.",
        "rcfilters-empty-filter": "Placeholder for the filter list when no filters were chosen.",
index d8ab7d7..c31a70c 100644 (file)
@@ -1861,7 +1861,6 @@ return [
                        'rcfilters-restore-default-filters',
                        'rcfilters-clear-all-filters',
                        'rcfilters-show-new-changes',
-                       'rcfilters-previous-changes-label',
                        'rcfilters-search-placeholder',
                        'rcfilters-invalid-filter',
                        'rcfilters-empty-filter',
index d60e616..31f3f1d 100644 (file)
@@ -1,5 +1,14 @@
 @import 'mw.rcfilters.mixins';
 
+@keyframes fadeBlue {
+       60% {
+               border-top-color: #36c;
+       }
+       100% {
+               border-top-color: #c8ccd1;
+       }
+}
+
 .mw-rcfilters-ui-changesListWrapperWidget {
 
        &-newChanges {
 
        &-previousChangesIndicator {
                margin: 10px 0;
-               color: #36c;
-               border-top: 2px solid #36c;
-               text-align: center;
-
-               &:hover {
-                       color: #72777d;
-                       border-top-color: #72777d;
-                       cursor: pointer;
-               }
+               border-top: 2px solid #c8ccd1;
+               animation: 1s ease fadeBlue;
        }
 
        &-results {
index 7eab6cb..ba3ca97 100644 (file)
         * @param {string} from Anything newer than this is considered 'new'
         */
        mw.rcfilters.ui.ChangesListWrapperWidget.prototype.emphasizeNewChanges = function ( from ) {
-               var $lastSeen,
+               var $firstNew,
                        $indicator,
                        $newChanges = $( [] ),
                        selector = this.inEnhancedMode() ?
 
                        if ( ts >= from ) {
                                $newChanges = $newChanges.add( $this );
-                               $lastSeen = $this;
+                               $firstNew = $this;
 
                                // guards against putting the marker after the last element
                                if ( index === ( length - 1 ) ) {
-                                       $lastSeen = null;
+                                       $firstNew = null;
                                }
                        }
                } );
 
-               if ( $lastSeen ) {
+               if ( $firstNew ) {
                        $indicator = $( '<div>' )
-                               .addClass( 'mw-rcfilters-ui-changesListWrapperWidget-previousChangesIndicator' )
-                               .text( mw.message( 'rcfilters-previous-changes-label' ).text() );
+                               .addClass( 'mw-rcfilters-ui-changesListWrapperWidget-previousChangesIndicator' );
 
-                       $indicator.on( 'click', function () {
-                               $indicator.detach();
-                       } );
-
-                       $lastSeen.after( $indicator );
+                       $firstNew.after( $indicator );
                }
 
                $newChanges