[MediaWiki-commits] [Gerrit] mediawiki...Echo[master]: Align the icon in the popup action sub menus

2018-01-16 Thread Mooeypoo (Code Review)
Mooeypoo has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/404589 )

Change subject: Align the icon in the popup action sub menus
..

Align the icon in the popup action sub menus

Bug: T185046
Change-Id: Iea0305d2b90c659fc24113980fa0900f559c2ab4
---
M modules/styles/mw.echo.ui.MenuItemWidget.less
1 file changed, 0 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Echo 
refs/changes/89/404589/1

diff --git a/modules/styles/mw.echo.ui.MenuItemWidget.less 
b/modules/styles/mw.echo.ui.MenuItemWidget.less
index 799f8a3..ba05662 100644
--- a/modules/styles/mw.echo.ui.MenuItemWidget.less
+++ b/modules/styles/mw.echo.ui.MenuItemWidget.less
@@ -10,9 +10,6 @@
height: 1.5em;
min-width: 1.5em;
min-height: 1.5em;
-
-   position: absolute;
-   top: 0;
}
 
&-content {

-- 
To view, visit https://gerrit.wikimedia.org/r/404589
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iea0305d2b90c659fc24113980fa0900f559c2ab4
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Echo
Gerrit-Branch: master
Gerrit-Owner: Mooeypoo 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...Echo[master]: Fix help menu icon placement for monobook

2018-01-16 Thread Mooeypoo (Code Review)
Mooeypoo has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/404585 )

Change subject: Fix help menu icon placement for monobook
..

Fix help menu icon placement for monobook

Bug: T184023
Change-Id: I6aa356624c7d9532fc69503f0ab99f0511fc30dc
---
M modules/styles/mw.echo.ui.SpecialHelpMenuWidget.less
1 file changed, 7 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Echo 
refs/changes/85/404585/1

diff --git a/modules/styles/mw.echo.ui.SpecialHelpMenuWidget.less 
b/modules/styles/mw.echo.ui.SpecialHelpMenuWidget.less
index 779b89d..7d49498 100644
--- a/modules/styles/mw.echo.ui.SpecialHelpMenuWidget.less
+++ b/modules/styles/mw.echo.ui.SpecialHelpMenuWidget.less
@@ -25,6 +25,13 @@
padding: 0.5em;
margin-right: 0;
 
+   .oo-ui-buttonElement-button .oo-ui-iconElement-icon {
+   // OOUI Apex sets 'display:block;' with a huge 
level of specificity
+   // on this icon. We must override it otherwise 
it sticks on its
+   // own line
+   display: inline-block !important;
+   }
+
.oo-ui-labelElement-label {
white-space: normal;
// Width of the popup (300px) minus the

-- 
To view, visit https://gerrit.wikimedia.org/r/404585
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I6aa356624c7d9532fc69503f0ab99f0511fc30dc
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Echo
Gerrit-Branch: master
Gerrit-Owner: Mooeypoo 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...Echo[master]: Truncate page name in the sidebar and organize into table view

2018-01-11 Thread Mooeypoo (Code Review)
Mooeypoo has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/403844 )

Change subject: Truncate page name in the sidebar and organize into table view
..

Truncate page name in the sidebar and organize into table view

Organize into table view for consistency and truncate the title.

Bug: T184143
Change-Id: I0ae3105ea60dcc2ae6c0f7f2545368a5f86cb2c4
---
M modules/styles/mw.echo.ui.PageNotificationsOptionWidget.less
M modules/ui/mw.echo.ui.PageNotificationsOptionWidget.js
2 files changed, 45 insertions(+), 8 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Echo 
refs/changes/44/403844/1

diff --git a/modules/styles/mw.echo.ui.PageNotificationsOptionWidget.less 
b/modules/styles/mw.echo.ui.PageNotificationsOptionWidget.less
index abbb7fa..3c05f9b 100644
--- a/modules/styles/mw.echo.ui.PageNotificationsOptionWidget.less
+++ b/modules/styles/mw.echo.ui.PageNotificationsOptionWidget.less
@@ -26,8 +26,20 @@
}
}
 
+   &-table {
+   display: table;
+   width: 100%;
+   }
+   &-row {
+   display: table-row;
+   }
+   &-cell {
+   display: table-cell;
+   vertical-align: top;
+   }
+
&.oo-ui-iconElement &-icon {
-   float: left;
+   width: 1em;
.oo-ui-iconElement-icon {
position: static;
display: inline-block;
@@ -36,15 +48,29 @@
 
&-title {
padding: 0.2em 0 0.2em 0.5em;
+   width: 100%;
+
+   &-label {
+   display: inline-block;
+   white-space: nowrap;
+   overflow: hidden;
+   text-overflow: ellipsis;
+   // Sidebar width - icon width - twice padding - counter 
average width
+   max-width: calc( @specialpage-sidebar-width - 1.865em - 2 * 
@specialpage-separation-unit - 2em );
+   }
}
 
&-count {
+   width: 1em;
+   }
+
+   &-label-count {
background-color: #eaecf0;
color: @grey-medium;
-   float: right;
padding: 0.2em 0.5em;
margin-left: 0.5em;
border-radius: 2px;
+   white-space: nowrap;
 
.oo-ui-optionWidget-selected & {
background: none; // `background-color: transparent` 
would be the goto value, but IE 8-9 introduces a bug
diff --git a/modules/ui/mw.echo.ui.PageNotificationsOptionWidget.js 
b/modules/ui/mw.echo.ui.PageNotificationsOptionWidget.js
index a4ac6bd..d07f1c4 100644
--- a/modules/ui/mw.echo.ui.PageNotificationsOptionWidget.js
+++ b/modules/ui/mw.echo.ui.PageNotificationsOptionWidget.js
@@ -37,21 +37,32 @@
label: countLabel
} );
 
+   $row = $( '' )
+   .addClass( 
'mw-echo-ui-pageNotificationsOptionWidget-row' )
+   .append(
+   $( '' )
+   .addClass( 
'mw-echo-ui-pageNotificationsOptionWidget-cell' )
+   .addClass( 
'mw-echo-ui-pageNotificationsOptionWidget-title' )
+   .append( this.$label ),
+   $( '' )
+   .addClass( 
'mw-echo-ui-pageNotificationsOptionWidget-cell' )
+   .addClass( 
'mw-echo-ui-pageNotificationsOptionWidget-count' )
+   .append( this.unreadCountLabel.$element 
)
+   );
+
// Initialization
this.$element
.addClass( 'mw-echo-ui-pageNotificationsOptionWidget' )
.append(
$( '' )
-   .addClass( 
'mw-echo-ui-pageNotificationsOptionWidget-count' )
-   .append( this.unreadCountLabel.$element 
),
-   $( '' )
-   .addClass( 
'mw-echo-ui-pageNotificationsOptionWidget-title' )
-   .append( this.$label )
+   .addClass( 
'mw-echo-ui-pageNotificationsOptionWidget-table' )
+   .append( $row )
);
 
if ( this.getIcon() ) {
-   this.$element.prepend(
+   $row.prepend(
$( '' )
+   .addClass( 
'mw-echo-ui-pageNotificationsOptionWidget-cell' )
.addClass( 
'mw-echo-ui-pageNotificationsOptionWidget-icon' )
  

[MediaWiki-commits] [Gerrit] mediawiki...Flow[master]: [wip^n] Rewrite StructuredDiscussion UI for MVC

2018-01-11 Thread Mooeypoo (Code Review)
Mooeypoo has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/403768 )

Change subject: [wip^n] Rewrite StructuredDiscussion UI for MVC
..

[wip^n] Rewrite StructuredDiscussion UI for MVC

Change-Id: I977c7003a280889e78ba2be5cab2ebc9fa1d81e4
---
M extension.json
M includes/View.php
M modules/flow-initialize.js
M modules/mw.flow.Initializer.js
A modules/sd/dm/mw.sd.dm.ViewModel.js
A modules/sd/mw.sd.ApiHandler.js
A modules/sd/mw.sd.Controller.js
A modules/sd/mw.sd.js
A modules/sd/ui/mw.sd.ui.ComponentWrapperWidget.js
A modules/sd/ui/mw.sd.ui.OldSystemBridgeWidget.js
A modules/styles/sd/mw.sd.ui.less
11 files changed, 708 insertions(+), 36 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Flow 
refs/changes/68/403768/1

diff --git a/extension.json b/extension.json
index ce0ab2d..e00c611 100644
--- a/extension.json
+++ b/extension.json
@@ -553,6 +553,36 @@
"mobile"
]
},
+   "ext.StructuredDiscussion.dm": {
+   "scripts": [
+   "sd/mw.sd.js",
+   "sd/mw.sd.Controller.js",
+   "sd/mw.sd.dm.ViewModel.js"
+   ],
+   "dependencies": [
+   "mediawiki.api",
+   "oojs"
+   ],
+   },
+   "ext.StructuredDiscussion.ui": {
+   "scripts": [
+   "sd/ui/mw.sd.ComponentWrapperWidget.js",
+   "sd/ui/mw.sd.OldSystemBridgeWidget.js"
+   ],
+   "styles": [
+   "styles/sd/mw.sd.ui.less"
+   ],
+   "dependencies": [
+   "ext.flow.components",
+   "ext.StructuredDiscussion.dm",
+   "oojs-ui"
+   ],
+   },
+   "ext.StructuredDiscussion": {
+   "dependencies": [
+   "ext.StructuredDiscussion.ui"
+   ]
+   },
"ext.flow": {
"position": "top",
"styles": [
diff --git a/includes/View.php b/includes/View.php
index dbb547e..ee48433 100644
--- a/includes/View.php
+++ b/includes/View.php
@@ -82,7 +82,8 @@
if ( $this->actions->hasValue( $action, 'modules' ) ) {
$out->addModules( $this->actions->getValue( $action, 
'modules' ) );
} else {
-   $out->addModules( [ 'ext.flow' ] );
+   // $out->addModules( [ 'ext.flow' ] );
+   $out->addModules( [ 'ext.StructuredDiscussion' ] );
}
 
if ( $this->actions->hasValue( $action, 'moduleStyles' ) ) {
diff --git a/modules/flow-initialize.js b/modules/flow-initialize.js
index c6d9987..3477d1c 100644
--- a/modules/flow-initialize.js
+++ b/modules/flow-initialize.js
@@ -10,27 +10,44 @@
$( function () {
var flowBoard,
$component = $( '.flow-component' ),
-   $board = $( '.flow-board' ),
-   pageTitle = mw.Title.newFromText( mw.config.get( 
'wgPageName' ) ),
-   initializer = new mw.flow.Initializer( {
-   pageTitle: pageTitle,
-   $component: $component,
-   $board: $board
-   } );
+   // $board = $( '.flow-board' ),
+   $overlay = $( '' )
+   .addClass( 'mw-sd-ui-overlay' )
+   .append(  ),
+   viewModel = new mw.sd.dm.ViewModel( {
+   pageTitle: mw.Title.newFromText( mw.config.get( 
'wgPageName' ) ),
+   // Initialization data
+   flowData: mw.config.get( 'wgFlowData' ) || ( 
mw.flow && mw.flow.data )
+   // ...
+   } ),
+   controller = new mw.sd.Controller( viewModel ),
+   // TODO: This widget should be initialized after the 
controller
+   // and model are fully initialized and the data is in 
place
+   wrapperWidget = new mw.sd.ui.ComponentWrapperWidget(
+   viewModel,
+   controller,
+   {
+   $element: $component,
+   $overlay: $overlay
+   }
+

[MediaWiki-commits] [Gerrit] mediawiki...Flow[master]: [wip^n] Organize StructuredDiscussions system to MVC

2018-01-08 Thread Mooeypoo (Code Review)
Mooeypoo has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/402898 )

Change subject: [wip^n] Organize StructuredDiscussions system to MVC
..

[wip^n] Organize StructuredDiscussions system to MVC

- Create Controller and OldSystemController to have single
  entrypoint for actions
- Reduce the amount of entangled events
- Have the view model control the data structures and untangle
  the complexity of model-in-model
- Make sure widgets submit actions through the controller and
  not the models

Change-Id: Icd8b461122efe902d84e32117e6144fcd4f209b3
---
M modules/flow/dm/mw.flow.dm.Board.js
M modules/flow/dm/mw.flow.dm.Topic.js
M modules/flow/dm/mw.flow.dm.ViewModel.js
M modules/flow/mw.flow.Controller.js
A modules/flow/mw.flow.OldSystemController.js
M modules/flow/ui/widgets/mw.flow.ui.NavigationWidget.js
M modules/flow/ui/widgets/mw.flow.ui.ReorderTopicsWidget.js
M modules/flow/ui/widgets/mw.flow.ui.ToCWidget.js
M modules/flow/ui/widgets/mw.flow.ui.TopicMenuSelectWidget.js
M modules/mw.flow.Initializer.js
10 files changed, 509 insertions(+), 308 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Flow 
refs/changes/98/402898/1

diff --git a/modules/flow/dm/mw.flow.dm.Board.js 
b/modules/flow/dm/mw.flow.dm.Board.js
index eb7db0e..86feaee 100644
--- a/modules/flow/dm/mw.flow.dm.Board.js
+++ b/modules/flow/dm/mw.flow.dm.Board.js
@@ -11,7 +11,6 @@
 * @param {string} data.id Board Id
 * @param {mw.Title} data.pageTitle Current page title
 * @param {boolean} [data.isDeleted] Board is deleted
-* @param {string} [data.defaultSort='newest'] The initial default 
topic sorting
 * @param {Object} [config] Configuration options
 */
mw.flow.dm.Board = function mwFlowDmBoard( data, config ) {
@@ -29,7 +28,6 @@
this.setId( data.id );
this.pageTitle = data.pageTitle;
this.deleted = !!data.isDeleted;
-   this.sort = data.defaultSort || 'newest';
this.description = new mw.flow.dm.BoardDescription();
 
// Events
@@ -198,28 +196,6 @@
this.setDescription(
new mw.flow.dm.BoardDescription( headerRevision 
)
);
-   }
-   };
-
-   /**
-* Get board sort order, 'newest' or 'updated'
-*
-* @return {string} Board sort order
-*/
-   mw.flow.dm.Board.prototype.getSortOrder = function () {
-   return this.sort;
-   };
-
-   /**
-* Set board sort order, 'newest' or 'updated'
-*
-* @param {string} order Board sort order
-* @fires sortOrderChange
-*/
-   mw.flow.dm.Board.prototype.setSortOrder = function ( order ) {
-   if ( this.sort !== order ) {
-   this.sort = order;
-   this.emit( 'sortOrderChange', order );
}
};
 
diff --git a/modules/flow/dm/mw.flow.dm.Topic.js 
b/modules/flow/dm/mw.flow.dm.Topic.js
index fe1f16b..2880b64 100644
--- a/modules/flow/dm/mw.flow.dm.Topic.js
+++ b/modules/flow/dm/mw.flow.dm.Topic.js
@@ -47,45 +47,45 @@
 
/* Static methods */
 
-   /**
-* Get the topic revision connected to the topic id from the
-* topiclist api response. This connects the topic id to the
-* post id and then returns the specific available revision.
-*
-* @param {Object} topiclist API data for topiclist
-* @param {string} topicId Topic id
-* @return {Object} Revision data
-*/
-   mw.flow.dm.Topic.static.getTopicRevisionFromApi = function ( topiclist, 
topicId ) {
-   var revisionId = topiclist.posts[ topicId ] && topiclist.posts[ 
topicId ][ 0 ];
-
-   return topiclist.revisions[ revisionId ];
-   };
-
-   /**
-* Get an array of topic objects from a topiclist api response.
-*
-* @param {Object} topiclist API data for topiclist
-* @param {string} topicId Topic id
-* @return {mw.flow.dm.Topic[]} Array of topic models
-*/
-   mw.flow.dm.Topic.static.extractTopicsFromAPI = function ( topiclist ) {
-   var i, len, topicId,
-   topics = [];
-
-   for ( i = 0, len = topiclist.roots.length; i < len; i++ ) {
-   topicId = topiclist.roots[ i ];
-   topics.push(
-   new mw.flow.dm.Topic(
-   topicId,
-   this.getTopicRevisionFromApi( 
topiclist, topicId )
-   )
-   );
-   }
-
-   return topics;
-   };
-
+   // /**
+   //  * Get the topic revision connected to the topic id from the
+   //  * topic

[MediaWiki-commits] [Gerrit] mediawiki...Flow[master]: Prepare for setting up a ViewModel in the new Frontend

2018-01-08 Thread Mooeypoo (Code Review)
Mooeypoo has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/402897 )

Change subject: Prepare for setting up a ViewModel in the new Frontend
..

Prepare for setting up a ViewModel in the new Frontend

Change-Id: I4c71a3613412f41425f680d0efdd2533edd1d81b
---
M extension.json
M modules/flow-initialize.js
R modules/flow/dm/mw.flow.dm.ViewModel.js
A modules/flow/mw.flow.Controller.js
M modules/flow/ui/widgets/mw.flow.ui.NavigationWidget.js
M modules/flow/ui/widgets/mw.flow.ui.ToCWidget.js
M modules/flow/ui/widgets/mw.flow.ui.TopicMenuSelectWidget.js
M modules/mw.flow.Initializer.js
R tests/qunit/flow/dm/test_mw.flow.dm.ViewModel.js
9 files changed, 119 insertions(+), 68 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Flow 
refs/changes/97/402897/1

diff --git a/extension.json b/extension.json
index 2c99f0e..b1a160d 100644
--- a/extension.json
+++ b/extension.json
@@ -440,6 +440,7 @@
"ext.flow.dm": {
"scripts": [
"flow/mw.flow.js",
+   "flow/mw.flow.Controller.js",
"flow/dm/mw.flow.dm.js",
"flow/dm/mw.flow.dm.Content.js",
"flow/dm/mw.flow.dm.Item.js",
@@ -449,7 +450,7 @@
"flow/dm/mw.flow.dm.RevisionedContent.js",

"flow/dm/mw.flow.dm.ModeratedRevisionedContent.js",
"flow/dm/mw.flow.dm.BoardDescription.js",
-   "flow/dm/mw.flow.dm.System.js",
+   "flow/dm/mw.flow.dm.ViewModel.js",
"flow/dm/mw.flow.dm.Post.js",
"flow/dm/mw.flow.dm.Topic.js",
"flow/dm/mw.flow.dm.Board.js",
diff --git a/modules/flow-initialize.js b/modules/flow-initialize.js
index c6d9987..b506580 100644
--- a/modules/flow-initialize.js
+++ b/modules/flow-initialize.js
@@ -42,7 +42,7 @@
} );
 
// For reference and debugging
-   mw.flow.system = initializer.getDataModelSystem();
+   mw.flow.viewModel = initializer.getViewModel();
 
if ( initializer.isUndoForm() ) {
// Setup undo pages
diff --git a/modules/flow/dm/mw.flow.dm.System.js 
b/modules/flow/dm/mw.flow.dm.ViewModel.js
similarity index 81%
rename from modules/flow/dm/mw.flow.dm.System.js
rename to modules/flow/dm/mw.flow.dm.ViewModel.js
index e03ec4d..22be320 100644
--- a/modules/flow/dm/mw.flow.dm.System.js
+++ b/modules/flow/dm/mw.flow.dm.ViewModel.js
@@ -1,6 +1,6 @@
 ( function ( $ ) {
/**
-* Flow initialization system
+* Flow frontend view model
 *
 * @class
 * @mixins OO.EventEmitter
@@ -16,7 +16,7 @@
 *  the page. Defaults to the tocPostsLimit
 * @cfg {string} [defaultSort] The current default sort order for topic 
list
 */
-   mw.flow.dm.System = function mwFlowDmSystem( config ) {
+   mw.flow.dm.ViewModel = function mwFlowDmViewModel( config ) {
 
config = config || {};
 
@@ -37,17 +37,18 @@
isDeleted: mw.config.get( 'wgArticleId' ) === 0,
defaultSort: config.defaultSort
} );
-   this.api = new mw.flow.dm.APIHandler( 
this.board.getPageTitle().getPrefixedDb() );
-   this.moreTopicsExistInApi = true;
-   this.fetchPromise = null;
-
this.board.connect( this, { reset: 'resetBoard' } );
+
+   this.moreTopicsExistInApi = false;
+   // This should be in the controller
+   // this.api = new mw.flow.dm.APIHandler( 
this.board.getPageTitle().getPrefixedDb() );
+   // this.fetchPromise = null;
};
 
/* Setup */
 
-   OO.initClass( mw.flow.dm.System );
-   OO.mixinClass( mw.flow.dm.System, OO.EventEmitter );
+   OO.initClass( mw.flow.dm.ViewModel );
+   OO.mixinClass( mw.flow.dm.ViewModel, OO.EventEmitter );
 
/* Events */
 
@@ -84,8 +85,8 @@
 * @return {jQuery.Promise} Promise that is resolved with whether
 *  more topics exist or not.
 */
-   mw.flow.dm.System.prototype.fetchMoreTopics = function () {
-   var system = this,
+   mw.flow.dm.ViewModel.prototype.fetchMoreTopics = function () {
+   var viewModel = this,
sortOrder = this.board.getSortOrder();
 
if ( this.fetchPromise ) {
@@ -105,12 +106,12 @@
toconly: true
} )
.then( function ( topicList ) {
-   var topics = 
mw.flow.dm.Topic.static.extractTopi

[MediaWiki-commits] [Gerrit] mediawiki...Echo[master]: [poc] Defer badge click until Javascript is loaded

2018-01-02 Thread Mooeypoo (Code Review)
Mooeypoo has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/401640 )

Change subject: [poc] Defer badge click until Javascript is loaded
..

[poc] Defer badge click until Javascript is loaded

This is an example usage that goes with the core patch I0f3644400.
It allows the user to click the badge even before JS is ready without
rerouting the user to Special:Notifications unnecessarily.

Depends-On: I0f3644400754cb78bdce54cafb2f0dd2ae056a6a
Change-Id: I84a566a2c7c7258a1eab6b0fef9d7c04fb19e446
---
M Hooks.php
M modules/ext.echo.init.js
2 files changed, 22 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Echo 
refs/changes/40/401640/1

diff --git a/Hooks.php b/Hooks.php
index c934f5c..457a99b 100644
--- a/Hooks.php
+++ b/Hooks.php
@@ -1020,8 +1020,12 @@
'counter-num' => $alertCount,
'counter-text' => $alertFormattedCount,
],
+   'deferredAction' => [
+   'component' => 'notifications',
+   'action' => 'badgeClick',
+   'parameters' => [ 'alert' ]
+   ],
];
-
$insertUrls = [
'notifications-alert' => $alertLink,
];
@@ -1035,6 +1039,11 @@
'counter-num' => $msgCount,
'counter-text' => $msgFormattedCount,
],
+   'deferredAction' => [
+   'component' => 'notifications',
+   'action' => 'badgeClick',
+   'parameters' => [ 'message' ]
+   ],
];
 
$insertUrls['notifications-notice'] = $msgLink;
diff --git a/modules/ext.echo.init.js b/modules/ext.echo.init.js
index 90cf08d..7daff1f 100644
--- a/modules/ext.echo.init.js
+++ b/modules/ext.echo.init.js
@@ -29,7 +29,10 @@
notifications: $( '#pt-notifications-alert a' 
).attr( 'href' ) || mw.util.getUrl( 'Special:Notifications' ),
preferences: ( $( '#pt-preferences a' ).attr( 
'href' ) || mw.util.getUrl( 'Special:Preferences' ) ) +
'#mw-prefsection-echo'
-   };
+   },
+   initialClicks = mw.getDeferredActions( 'notifications', 
'badgeClick' ),
+   // Only work on the latest click
+   preloadData = initialClicks[ initialClicks.length - 1 ];
 
// Respond to click on the notification button and load the UI 
on demand
$( '.mw-echo-notification-badge-nojs' ).click( function ( e ) {
@@ -39,7 +42,6 @@
if ( e.which !== 1 ) {
return;
}
-
// Dim the button while we load
$( this ).addClass( 
'mw-echo-notifications-badge-dimmed' );
 
@@ -131,6 +133,14 @@
// Prevent default
return false;
} );
+
+   if ( preloadData ) {
+   // Trigger click
+   $( preloadData.$element ).trigger( {
+   type: 'click',
+   which: 1
+   } );
+   }
} );
 
 }( mediaWiki, jQuery ) );

-- 
To view, visit https://gerrit.wikimedia.org/r/401640
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I84a566a2c7c7258a1eab6b0fef9d7c04fb19e446
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Echo
Gerrit-Branch: master
Gerrit-Owner: Mooeypoo 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: [poc] Allow for 'deferredAction' in links

2018-01-02 Thread Mooeypoo (Code Review)
Mooeypoo has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/401639 )

Change subject: [poc] Allow for 'deferredAction' in links
..

[poc] Allow for 'deferredAction' in links

Add onClick action that allows for deferred action on a clickable
top link while the javascript is loading.

To see this experiment in action, use with the following
patch from Echo repository:
I84a566a2c7c7258a1eab6b0fef9d7c04fb19e446

Change-Id: I0f3644400754cb78bdce54cafb2f0dd2ae056a6a
---
M includes/skins/BaseTemplate.php
M resources/src/mediawiki/mediawiki.js
2 files changed, 36 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/39/401639/1

diff --git a/includes/skins/BaseTemplate.php b/includes/skins/BaseTemplate.php
index f0b336a..676ec60 100644
--- a/includes/skins/BaseTemplate.php
+++ b/includes/skins/BaseTemplate.php
@@ -143,7 +143,7 @@
if ( isset( $plink['active'] ) ) {
$ptool['active'] = $plink['active'];
}
-   foreach ( [ 'href', 'class', 'text', 'dir', 'data' ] as 
$k ) {
+   foreach ( [ 'href', 'class', 'text', 'dir', 'data', 
'deferredAction' ] as $k ) {
if ( isset( $plink[$k] ) ) {
$ptool['links'][0][$k] = $plink[$k];
}
@@ -402,6 +402,13 @@
unset( $attrs[ 'data' ] );
}
 
+   if ( isset( $attrs['deferredAction'] ) ) {
+   $attrs['onClick'] = 
'window.mwDeferredAction=window.mwDeferredAction||[];' .
+   'window.mwDeferredAction.push( [ this, 
' . json_encode( $attrs['deferredAction'] ) . ' ] );' .
+   'event.preventDefault();';
+   unset( $attrs[ 'deferredAction' ] );
+   }
+
if ( isset( $item['id'] ) && !isset( $item['single-id'] 
) ) {
$item['single-id'] = $item['id'];
}
diff --git a/resources/src/mediawiki/mediawiki.js 
b/resources/src/mediawiki/mediawiki.js
index 6a218e3..658dd0f 100644
--- a/resources/src/mediawiki/mediawiki.js
+++ b/resources/src/mediawiki/mediawiki.js
@@ -10,7 +10,6 @@
 
 /* global mwNow */
 /* eslint-disable no-use-before-define */
-
 ( function ( $ ) {
'use strict';
 
@@ -635,6 +634,34 @@
} );
},
 
+   /**
+* Get the deferred actions for this component
+*
+* @param {string} component Component name
+* @param {string} [action] Action name
+* @return {Object[]} The definition of deferred click actions 
for this component
+*/
+   getDeferredActions: function ( component, action ) {
+   var result = [];
+
+   action = action || '';
+
+   window.mwDeferredAction = window.mwDeferredAction || [];
+   window.mwDeferredAction.forEach( function ( actionData 
) {
+   var $element = $( actionData[ 0 ] ),
+   data = actionData[ 1 ];
+
+   if (
+   ( !component || data.component === 
component ) &&
+   ( !action || data.action === action )
+   ) {
+   result.push( $.extend( { $element: 
$element }, data ) );
+   }
+   } );
+
+   return result;
+   },
+
// Expose Map constructor
Map: Map,
 

-- 
To view, visit https://gerrit.wikimedia.org/r/401639
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I0f3644400754cb78bdce54cafb2f0dd2ae056a6a
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Mooeypoo 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki/core[wmf/1.31.0-wmf.15]: Follow-up Ic67a6f1af: RCFilters: Untypo the recurring namesp...

2018-01-02 Thread Mooeypoo (Code Review)
Mooeypoo has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/401615 )

Change subject: Follow-up Ic67a6f1af: RCFilters: Untypo the recurring 
namespaces typo
..

Follow-up Ic67a6f1af: RCFilters: Untypo the recurring namespaces typo

The param name is namespace, not namespaces. Do keep up, Schottlender.

Bug: T183910
Change-Id: Ib14a3918a85c22ddd2121c8dcc709ab53b5ff63f
(cherry picked from commit 44a4447bbfdf01fac31993c59bead434379843a2)
---
M resources/src/mediawiki.rcfilters/dm/mw.rcfilters.dm.SavedQueriesModel.js
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/15/401615/1

diff --git 
a/resources/src/mediawiki.rcfilters/dm/mw.rcfilters.dm.SavedQueriesModel.js 
b/resources/src/mediawiki.rcfilters/dm/mw.rcfilters.dm.SavedQueriesModel.js
index 8c9fe65..77d5961 100644
--- a/resources/src/mediawiki.rcfilters/dm/mw.rcfilters.dm.SavedQueriesModel.js
+++ b/resources/src/mediawiki.rcfilters/dm/mw.rcfilters.dm.SavedQueriesModel.js
@@ -124,7 +124,7 @@
normalizedData.params = 
model.filtersModel.removeStickyParams( normalizedData.params );
 
// Correct the invert state for effective 
selection
-   if ( normalizedData.params.invert && 
!normalizedData.params.namespaces ) {
+   if ( normalizedData.params.invert && 
!normalizedData.params.namespace ) {
delete normalizedData.params.invert;
}
 

-- 
To view, visit https://gerrit.wikimedia.org/r/401615
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib14a3918a85c22ddd2121c8dcc709ab53b5ff63f
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: wmf/1.31.0-wmf.15
Gerrit-Owner: Mooeypoo 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki/core[wmf/1.31.0-wmf.12]: Follow-up Ic67a6f1af: RCFilters: Untypo the recurring namesp...

2018-01-02 Thread Mooeypoo (Code Review)
Mooeypoo has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/401614 )

Change subject: Follow-up Ic67a6f1af: RCFilters: Untypo the recurring 
namespaces typo
..

Follow-up Ic67a6f1af: RCFilters: Untypo the recurring namespaces typo

The param name is namespace, not namespaces. Do keep up, Schottlender.

Bug: T183910
Change-Id: Ib14a3918a85c22ddd2121c8dcc709ab53b5ff63f
(cherry picked from commit 44a4447bbfdf01fac31993c59bead434379843a2)
---
M resources/src/mediawiki.rcfilters/dm/mw.rcfilters.dm.SavedQueriesModel.js
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/14/401614/1

diff --git 
a/resources/src/mediawiki.rcfilters/dm/mw.rcfilters.dm.SavedQueriesModel.js 
b/resources/src/mediawiki.rcfilters/dm/mw.rcfilters.dm.SavedQueriesModel.js
index 8c9fe65..77d5961 100644
--- a/resources/src/mediawiki.rcfilters/dm/mw.rcfilters.dm.SavedQueriesModel.js
+++ b/resources/src/mediawiki.rcfilters/dm/mw.rcfilters.dm.SavedQueriesModel.js
@@ -124,7 +124,7 @@
normalizedData.params = 
model.filtersModel.removeStickyParams( normalizedData.params );
 
// Correct the invert state for effective 
selection
-   if ( normalizedData.params.invert && 
!normalizedData.params.namespaces ) {
+   if ( normalizedData.params.invert && 
!normalizedData.params.namespace ) {
delete normalizedData.params.invert;
}
 

-- 
To view, visit https://gerrit.wikimedia.org/r/401614
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib14a3918a85c22ddd2121c8dcc709ab53b5ff63f
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: wmf/1.31.0-wmf.12
Gerrit-Owner: Mooeypoo 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Follow-up Ic67a6f1af: RCFilters: Untypo the recurring namesp...

2018-01-02 Thread Mooeypoo (Code Review)
Mooeypoo has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/401607 )

Change subject: Follow-up Ic67a6f1af: RCFilters: Untypo the recurring 
namespaces typo
..

Follow-up Ic67a6f1af: RCFilters: Untypo the recurring namespaces typo

The param name is namespace, not namespaces. Do keep up, Schottlender.

Bug: T183910
Change-Id: Ib14a3918a85c22ddd2121c8dcc709ab53b5ff63f
---
M resources/src/mediawiki.rcfilters/dm/mw.rcfilters.dm.SavedQueriesModel.js
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/07/401607/1

diff --git 
a/resources/src/mediawiki.rcfilters/dm/mw.rcfilters.dm.SavedQueriesModel.js 
b/resources/src/mediawiki.rcfilters/dm/mw.rcfilters.dm.SavedQueriesModel.js
index 8c9fe65..77d5961 100644
--- a/resources/src/mediawiki.rcfilters/dm/mw.rcfilters.dm.SavedQueriesModel.js
+++ b/resources/src/mediawiki.rcfilters/dm/mw.rcfilters.dm.SavedQueriesModel.js
@@ -124,7 +124,7 @@
normalizedData.params = 
model.filtersModel.removeStickyParams( normalizedData.params );
 
// Correct the invert state for effective 
selection
-   if ( normalizedData.params.invert && 
!normalizedData.params.namespaces ) {
+   if ( normalizedData.params.invert && 
!normalizedData.params.namespace ) {
delete normalizedData.params.invert;
}
 

-- 
To view, visit https://gerrit.wikimedia.org/r/401607
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib14a3918a85c22ddd2121c8dcc709ab53b5ff63f
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Mooeypoo 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki/core[wmf/1.31.0-wmf.12]: RCFilters: Correct looking for items in namespace group

2018-01-02 Thread Mooeypoo (Code Review)
Mooeypoo has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/401578 )

Change subject: RCFilters: Correct looking for items in namespace group
..

RCFilters: Correct looking for items in namespace group

To look for the namespace items, we either search for things in the
'namesapces' view (plural) or the 'namespace' group (singular) so
the code had a typo. This is a recurring typo, but overall, it makes
more sense to look for items in the **group** of namespaces rather
than in the namespace view, conceptually.

Bug: T183910
Change-Id: Ic67a6f1afd3e95fe776fbc5c33ecb7af737055b4
---
M resources/src/mediawiki.rcfilters/dm/mw.rcfilters.dm.FiltersViewModel.js
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/78/401578/1

diff --git 
a/resources/src/mediawiki.rcfilters/dm/mw.rcfilters.dm.FiltersViewModel.js 
b/resources/src/mediawiki.rcfilters/dm/mw.rcfilters.dm.FiltersViewModel.js
index 8d22c23..a28afef 100644
--- a/resources/src/mediawiki.rcfilters/dm/mw.rcfilters.dm.FiltersViewModel.js
+++ b/resources/src/mediawiki.rcfilters/dm/mw.rcfilters.dm.FiltersViewModel.js
@@ -910,7 +910,7 @@

mw.rcfilters.dm.FiltersViewModel.prototype.areNamespacesEffectivelyInverted = 
function () {
return this.getInvertModel().isSelected() &&
this.getSelectedItems().some( function ( itemModel ) {
-   return itemModel.getGroupModel().getView() === 
'namespace';
+   return itemModel.getGroupModel().getName() === 
'namespace';
} );
};
 

-- 
To view, visit https://gerrit.wikimedia.org/r/401578
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic67a6f1afd3e95fe776fbc5c33ecb7af737055b4
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: wmf/1.31.0-wmf.12
Gerrit-Owner: Mooeypoo 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: RCFilters: Correct looking for items in namespace group

2018-01-02 Thread Mooeypoo (Code Review)
Mooeypoo has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/401572 )

Change subject: RCFilters: Correct looking for items in namespace group
..

RCFilters: Correct looking for items in namespace group

To look for the namespace items, we either search for things in the
'namesapces' view (plural) or the 'namespace' group (singular) so
the code had a typo. This is a recurring typo, but overall, it makes
more sense to look for items in the **group** of namespaces rather
than in the namespace view, conceptually.

Bug: T183910
Change-Id: Ic67a6f1afd3e95fe776fbc5c33ecb7af737055b4
---
M resources/src/mediawiki.rcfilters/dm/mw.rcfilters.dm.FiltersViewModel.js
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/72/401572/1

diff --git 
a/resources/src/mediawiki.rcfilters/dm/mw.rcfilters.dm.FiltersViewModel.js 
b/resources/src/mediawiki.rcfilters/dm/mw.rcfilters.dm.FiltersViewModel.js
index bbc1d7e..c9f5924 100644
--- a/resources/src/mediawiki.rcfilters/dm/mw.rcfilters.dm.FiltersViewModel.js
+++ b/resources/src/mediawiki.rcfilters/dm/mw.rcfilters.dm.FiltersViewModel.js
@@ -911,7 +911,7 @@

mw.rcfilters.dm.FiltersViewModel.prototype.areNamespacesEffectivelyInverted = 
function () {
return this.getInvertModel().isSelected() &&
this.getSelectedItems().some( function ( itemModel ) {
-   return itemModel.getGroupModel().getView() === 
'namespace';
+   return itemModel.getGroupModel().getName() === 
'namespace';
} );
};
 

-- 
To view, visit https://gerrit.wikimedia.org/r/401572
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic67a6f1afd3e95fe776fbc5c33ecb7af737055b4
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Mooeypoo 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki/core[wmf/1.31.0-wmf.15]: RCFilters: Correct looking for items in namespace group

2018-01-02 Thread Mooeypoo (Code Review)
Mooeypoo has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/401576 )

Change subject: RCFilters: Correct looking for items in namespace group
..

RCFilters: Correct looking for items in namespace group

To look for the namespace items, we either search for things in the
'namesapces' view (plural) or the 'namespace' group (singular) so
the code had a typo. This is a recurring typo, but overall, it makes
more sense to look for items in the **group** of namespaces rather
than in the namespace view, conceptually.

Bug: T183910
Change-Id: Ic67a6f1afd3e95fe776fbc5c33ecb7af737055b4
---
M resources/src/mediawiki.rcfilters/dm/mw.rcfilters.dm.FiltersViewModel.js
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/76/401576/1

diff --git 
a/resources/src/mediawiki.rcfilters/dm/mw.rcfilters.dm.FiltersViewModel.js 
b/resources/src/mediawiki.rcfilters/dm/mw.rcfilters.dm.FiltersViewModel.js
index bbc1d7e..c9f5924 100644
--- a/resources/src/mediawiki.rcfilters/dm/mw.rcfilters.dm.FiltersViewModel.js
+++ b/resources/src/mediawiki.rcfilters/dm/mw.rcfilters.dm.FiltersViewModel.js
@@ -911,7 +911,7 @@

mw.rcfilters.dm.FiltersViewModel.prototype.areNamespacesEffectivelyInverted = 
function () {
return this.getInvertModel().isSelected() &&
this.getSelectedItems().some( function ( itemModel ) {
-   return itemModel.getGroupModel().getView() === 
'namespace';
+   return itemModel.getGroupModel().getName() === 
'namespace';
} );
};
 

-- 
To view, visit https://gerrit.wikimedia.org/r/401576
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic67a6f1afd3e95fe776fbc5c33ecb7af737055b4
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: wmf/1.31.0-wmf.15
Gerrit-Owner: Mooeypoo 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] oojs/ui[master]: MenuTagMultiselectWidget: Don't use overlay for $autoCloseIg...

2017-12-22 Thread Mooeypoo (Code Review)
Mooeypoo has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/399882 )

Change subject: MenuTagMultiselectWidget: Don't use overlay for $autoCloseIgnore
..

MenuTagMultiselectWidget: Don't use overlay for $autoCloseIgnore

If using the overlay, the menu will never close when clicking outside
of it. The overlay should be used for positioning -- the autoCloseIgnore
should include the menu itself and the input, if that exists.

Bug: T183377

Change-Id: I41ae661af6a6aa28382d485b1fd1e82777694635
---
M src/widgets/MenuTagMultiselectWidget.js
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/oojs/ui refs/changes/82/399882/1

diff --git a/src/widgets/MenuTagMultiselectWidget.js 
b/src/widgets/MenuTagMultiselectWidget.js
index d018c82..ccb3169 100644
--- a/src/widgets/MenuTagMultiselectWidget.js
+++ b/src/widgets/MenuTagMultiselectWidget.js
@@ -43,7 +43,7 @@
$input: this.hasInput ? this.input.$input : null,
filterFromInput: !!this.hasInput,
$autoCloseIgnore: this.hasInput ?
-   this.input.$element.add( this.$overlay ) : 
this.$overlay,
+   this.input.$element.add( this.$element ) : 
this.$element,
$floatableContainer: this.hasInput && this.inputPosition === 
'outline' ?
this.input.$element : this.$element,
$overlay: this.$overlay,

-- 
To view, visit https://gerrit.wikimedia.org/r/399882
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I41ae661af6a6aa28382d485b1fd1e82777694635
Gerrit-PatchSet: 1
Gerrit-Project: oojs/ui
Gerrit-Branch: master
Gerrit-Owner: Mooeypoo 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: RCFilters: Move product-specific rules into RCFilters styles

2017-12-22 Thread Mooeypoo (Code Review)
Mooeypoo has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/399863 )

Change subject: RCFilters: Move product-specific rules into RCFilters styles
..

RCFilters: Move product-specific rules into RCFilters styles

Afterwards, the fix in Vector skin should be merged:
Ie36eeddc46c8ea3d154a006fed2fe578be1cd05c

Change-Id: I8357ef2ff0fe4f46b9ee665ef068624de0afd2e5
---
M resources/Resources.php
A resources/src/mediawiki.rcfilters/styles/mw.rcfilters.ui.Overlay.vector.less
2 files changed, 7 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/63/399863/1

diff --git a/resources/Resources.php b/resources/Resources.php
index b494429..0cd66b8 100644
--- a/resources/Resources.php
+++ b/resources/Resources.php
@@ -1845,6 +1845,9 @@

'resources/src/mediawiki.rcfilters/styles/mw.rcfilters.ui.WatchlistTopSectionWidget.less',
],
'skinStyles' => [
+   'vector' => [
+   
'resources/src/mediawiki.rcfilters/styles/mw.rcfilters.ui.Overlay.vector.less',
+   ],
'monobook' => [

'resources/src/mediawiki.rcfilters/styles/mw.rcfilters.ui.Overlay.monobook.less',

'resources/src/mediawiki.rcfilters/styles/mw.rcfilters.ui.CapsuleItemWidget.monobook.less',
diff --git 
a/resources/src/mediawiki.rcfilters/styles/mw.rcfilters.ui.Overlay.vector.less 
b/resources/src/mediawiki.rcfilters/styles/mw.rcfilters.ui.Overlay.vector.less
new file mode 100644
index 000..528707b
--- /dev/null
+++ 
b/resources/src/mediawiki.rcfilters/styles/mw.rcfilters.ui.Overlay.vector.less
@@ -0,0 +1,4 @@
+// Fix z-index for the overlay in Vector, see T183442
+.mw-rcfilters-ui-overlay {
+   z-index: 101;
+}

-- 
To view, visit https://gerrit.wikimedia.org/r/399863
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I8357ef2ff0fe4f46b9ee665ef068624de0afd2e5
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Mooeypoo 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...Vector[master]: Move the 'rcfilters overlay' rule to the RCFilters stylesheet

2017-12-22 Thread Mooeypoo (Code Review)
Mooeypoo has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/399862 )

Change subject: Move the 'rcfilters overlay' rule to the RCFilters stylesheet
..

Move the 'rcfilters overlay' rule to the RCFilters stylesheet

Depends-On: I8357ef2ff0fe4f46b9ee665ef068624de0afd2e5
Change-Id: Ie36eeddc46c8ea3d154a006fed2fe578be1cd05c
---
M skinStyles/ooui.less
1 file changed, 0 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/skins/Vector 
refs/changes/62/399862/1

diff --git a/skinStyles/ooui.less b/skinStyles/ooui.less
index 8749dd9..60fcec2 100644
--- a/skinStyles/ooui.less
+++ b/skinStyles/ooui.less
@@ -3,7 +3,3 @@
z-index: 101;
position: relative;
 }
-
-.skin-vector .mw-rcfilters-ui-overlay {
-   z-index: 101;
-}

-- 
To view, visit https://gerrit.wikimedia.org/r/399862
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie36eeddc46c8ea3d154a006fed2fe578be1cd05c
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/skins/Vector
Gerrit-Branch: master
Gerrit-Owner: Mooeypoo 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] oojs/ui[master]: MenuTagMultiselectWidget: Erase the input when tag is select...

2017-12-20 Thread Mooeypoo (Code Review)
Mooeypoo has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/399539 )

Change subject: MenuTagMultiselectWidget: Erase the input when tag is selected 
if filtering
..

MenuTagMultiselectWidget: Erase the input when tag is selected if filtering

In the case where the menu filters from the input, we want to make sure
that the input is nulled out when tag is selected, so the menu item
can be visible even if it was previously filtering based on some string.

Bug: T183378
Change-Id: I3e143af1527d3c54e4aa46398dc5e36f95763699
---
M src/widgets/MenuTagMultiselectWidget.js
1 file changed, 5 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/oojs/ui refs/changes/39/399539/1

diff --git a/src/widgets/MenuTagMultiselectWidget.js 
b/src/widgets/MenuTagMultiselectWidget.js
index f1eaeb6..d018c82 100644
--- a/src/widgets/MenuTagMultiselectWidget.js
+++ b/src/widgets/MenuTagMultiselectWidget.js
@@ -136,6 +136,11 @@
// but in our case, we want to utilize the menu selection behavior, and
// definitely not remove the item.
 
+   // If there is an input that is used for filtering, erase the value so 
we don't filter
+   if ( this.hasInput && this.menu.filterFromInput ) {
+   this.input.setValue( '' );
+   }
+
// Select the menu item
this.menu.selectItem( menuItem );
 

-- 
To view, visit https://gerrit.wikimedia.org/r/399539
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I3e143af1527d3c54e4aa46398dc5e36f95763699
Gerrit-PatchSet: 1
Gerrit-Project: oojs/ui
Gerrit-Branch: master
Gerrit-Owner: Mooeypoo 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...Echo[master]: Move the popups to the overlay

2017-12-20 Thread Mooeypoo (Code Review)
Mooeypoo has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/399536 )

Change subject: Move the popups to the overlay
..

Move the popups to the overlay

This will solve multiple issues with the design having to overcome
the theme-based design for the #p-tools.

Bug: T156080
Change-Id: Ibfcdfeea649e566059fd88485e146fbad2201016
---
M modules/styles/mw.echo.ui.NotificationBadgeWidget.less
M modules/styles/mw.echo.ui.NotificationBadgeWidget.monobook.less
M modules/styles/mw.echo.ui.overlay.monobook.less
M modules/ui/mw.echo.ui.NotificationBadgeWidget.js
4 files changed, 16 insertions(+), 15 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Echo 
refs/changes/36/399536/1

diff --git a/modules/styles/mw.echo.ui.NotificationBadgeWidget.less 
b/modules/styles/mw.echo.ui.NotificationBadgeWidget.less
index 73092a7..6e638e7 100644
--- a/modules/styles/mw.echo.ui.NotificationBadgeWidget.less
+++ b/modules/styles/mw.echo.ui.NotificationBadgeWidget.less
@@ -4,12 +4,7 @@
 .mw-echo-ui-notificationBadgeButtonPopupWidget {
position: relative;
 
-   > .oo-ui-popupWidget {
-   // #p-personal li has a font-size of 0.75em, but we want the
-   // font size here to be exactly 0.875em, so we must override
-   // the parent em sizing by dividing.
-   font-size: 0.875em / 0.75em;
-
+   &-popup {
> .oo-ui-popupWidget-popup {
> .oo-ui-popupWidget-head {
height: 3.5em;
diff --git a/modules/styles/mw.echo.ui.NotificationBadgeWidget.monobook.less 
b/modules/styles/mw.echo.ui.NotificationBadgeWidget.monobook.less
index 9f40892..3320c95 100644
--- a/modules/styles/mw.echo.ui.NotificationBadgeWidget.monobook.less
+++ b/modules/styles/mw.echo.ui.NotificationBadgeWidget.monobook.less
@@ -4,9 +4,15 @@
text-transform: none;
font-weight: normal;
 
-   &,
-   .oo-ui-popupWidget a.oo-ui-buttonElement-button {
-   color: #333;
+   &-popup {
+   // #p-personal li has a font-size of 0.75em, but we want the
+   // font size here to be exactly 0.875em, so we must override
+   // the parent em sizing by dividing.
+   font-size: 0.875em / 0.75em;
+
+   a.oo-ui-buttonElement-button {
+   color: #333;
+   }
}
 
a {
diff --git a/modules/styles/mw.echo.ui.overlay.monobook.less 
b/modules/styles/mw.echo.ui.overlay.monobook.less
index da3e7d3..280a225 100644
--- a/modules/styles/mw.echo.ui.overlay.monobook.less
+++ b/modules/styles/mw.echo.ui.overlay.monobook.less
@@ -2,7 +2,6 @@
// We need the overlay to be adjusted for:
// #globalWrapper 127%
// .pBody 95%
-   // .portlet ul 95%
// .mw-echo-ui-notificationBadgeButtonPopupWidget > .oo-ui-popupWidget 
0.875/0.75em
-   font-size: 1.27 * 0.95 * 0.95 * 0.875 / 0.75 em;
+   font-size: 1.27 * 0.95 * 0.875 / 0.75em;
 }
diff --git a/modules/ui/mw.echo.ui.NotificationBadgeWidget.js 
b/modules/ui/mw.echo.ui.NotificationBadgeWidget.js
index 1bf9981..77ae15e 100644
--- a/modules/ui/mw.echo.ui.NotificationBadgeWidget.js
+++ b/modules/ui/mw.echo.ui.NotificationBadgeWidget.js
@@ -132,6 +132,7 @@
width: config.popupWidth || 500,
autoClose: true,
containerPadding: 20,
+   $floatableContainer: this.$element,
// Also ignore clicks from the nested action menu 
items, that
// actually exist in the overlay
$autoCloseIgnore: this.$element.add( this.$menuOverlay 
),
@@ -145,6 +146,9 @@
),
classes: [ 
'mw-echo-ui-notificationBadgeButtonPopupWidget-popup' ]
} );
+   // Append the popup to the overlay
+   this.$overlay.append( this.popup.$element );
+
// HACK: Add an icon to the popup head label
this.popupHeadIcon = new OO.ui.IconWidget( { icon: 
config.badgeIcon } );
this.popup.$head.prepend( this.popupHeadIcon.$element );
@@ -186,10 +190,7 @@
'mw-echo-ui-notificationBadgeButtonPopupWidget 
' +

'mw-echo-ui-notificationBadgeButtonPopupWidget-' + adjustedTypeString
)
-   .append(
-   this.badgeButton.$element,
-   this.popup.$element
-   );
+   .append( this.badgeButton.$element );
};
 
/* Initialization */

-- 
To view, visit https://gerrit.wikimedia.org/r/399536
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ibfcdfeea649e5

[MediaWiki-commits] [Gerrit] mediawiki/core[master]: RCFilters: Only normalize title with 'target' when it is needed

2017-12-19 Thread Mooeypoo (Code Review)
Mooeypoo has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/399310 )

Change subject: RCFilters: Only normalize title with 'target' when it is needed
..

RCFilters: Only normalize title with 'target' when it is needed

We right now only need to normalize titles that are with subpages
into target= parameter in the RCLinked page. There's no need to do
that in RC or Watchlist, and it might interfere with other (or future)
features if we do.

This commit sets the normalization as conditional on a config
variable, that is given on initialization based on the proper
page we're in.

Change-Id: I288221edb143e0b3417e161062faf2eb4f9f9a51
---
M resources/src/mediawiki.rcfilters/mw.rcfilters.Controller.js
M resources/src/mediawiki.rcfilters/mw.rcfilters.UriProcessor.js
M resources/src/mediawiki.rcfilters/mw.rcfilters.init.js
M tests/qunit/suites/resources/mediawiki.rcfilters/UriProcessor.test.js
4 files changed, 86 insertions(+), 52 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/10/399310/1

diff --git a/resources/src/mediawiki.rcfilters/mw.rcfilters.Controller.js 
b/resources/src/mediawiki.rcfilters/mw.rcfilters.Controller.js
index 79546b4..1084953 100644
--- a/resources/src/mediawiki.rcfilters/mw.rcfilters.Controller.js
+++ b/resources/src/mediawiki.rcfilters/mw.rcfilters.Controller.js
@@ -20,6 +20,7 @@
this.savedQueriesPreferenceName = 
config.savedQueriesPreferenceName;
this.daysPreferenceName = config.daysPreferenceName;
this.limitPreferenceName = config.limitPreferenceName;
+   this.normalizeTarget = !!config.normalizeTarget;
 
this.requestCounter = {};
this.baseFilterState = {};
@@ -213,7 +214,8 @@
this.filtersModel.initializeFilters( filterStructure, views );
 
this.uriProcessor = new mw.rcfilters.UriProcessor(
-   this.filtersModel
+   this.filtersModel,
+   { normalizeTarget: this.normalizeTarget }
);
 
if ( !mw.user.isAnon() ) {
diff --git a/resources/src/mediawiki.rcfilters/mw.rcfilters.UriProcessor.js 
b/resources/src/mediawiki.rcfilters/mw.rcfilters.UriProcessor.js
index 7bb0a22..87aad09 100644
--- a/resources/src/mediawiki.rcfilters/mw.rcfilters.UriProcessor.js
+++ b/resources/src/mediawiki.rcfilters/mw.rcfilters.UriProcessor.js
@@ -4,9 +4,13 @@
 * URI Processor for RCFilters
 *
 * @param {mw.rcfilters.dm.FiltersViewModel} filtersModel Filters view 
model
+* @param {Object} [config] Configuration object
 */
-   mw.rcfilters.UriProcessor = function MwRcfiltersController( 
filtersModel ) {
+   mw.rcfilters.UriProcessor = function MwRcfiltersController( 
filtersModel, config ) {
+   config = config || {};
this.filtersModel = filtersModel;
+
+   this.setNormalizeTarget( !!config.normalizeTarget );
};
 
/* Initialization */
@@ -102,6 +106,10 @@
var parts,
// matches 
[/wiki/]SpecialNS:RCL/[Namespace:]Title/Subpage/Subsubpage/etc
re = /^((?:\/.+?\/)?.*?:.*?)\/(.*)$/;
+
+   if ( !this.normalizeTarget ) {
+   return uri;
+   }
 
// target in title param
if ( uri.query.title ) {
@@ -277,4 +285,13 @@
{ urlversion: '2' }
);
};
+
+   /**
+* Set the option to normalize 'target' portion of the URL
+*
+* @param {boolean} isNormalized Target should be normalized
+*/
+   mw.rcfilters.UriProcessor.prototype.setNormalizeTarget = function ( 
isNormalized ) {
+   this.normalizeTarget = !!isNormalized;
+   };
 }( mediaWiki, jQuery ) );
diff --git a/resources/src/mediawiki.rcfilters/mw.rcfilters.init.js 
b/resources/src/mediawiki.rcfilters/mw.rcfilters.init.js
index f770899..2fb2262 100644
--- a/resources/src/mediawiki.rcfilters/mw.rcfilters.init.js
+++ b/resources/src/mediawiki.rcfilters/mw.rcfilters.init.js
@@ -24,7 +24,7 @@
{
savedQueriesPreferenceName: 
savedQueriesPreferenceName,
daysPreferenceName: 
daysPreferenceName,
-   limitPreferenceName: 
limitPreferenceName
+   limitPreferenceName: 
limitPreferenceName,
}
);
 
diff --git 
a/tests/qunit/suites/resources/mediawiki.rcfilters/UriProcessor.test.js 
b/tests/qunit/suites/resources/mediawiki.rcfilters/UriProcessor.test.js
index fbd159c..398e5d4 100644
--- a/tests/qunit/suites/resources/mediawiki.rcfi

[MediaWiki-commits] [Gerrit] mediawiki/core[master]: RCFilters: Change findHighlightedItem due to deprecation

2017-12-13 Thread Mooeypoo (Code Review)
Mooeypoo has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/398173 )

Change subject: RCFilters: Change findHighlightedItem due to deprecation
..

RCFilters: Change findHighlightedItem due to deprecation

SelectWidget's getHighlightedItem was deprecated and switched with
findHighlightedItem, see T76630

Change-Id: I90535c9f72d9a63e8e8d4184cc85aaf77e7b454c
---
M resources/src/mediawiki.rcfilters/ui/mw.rcfilters.ui.MenuSelectWidget.js
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/73/398173/1

diff --git 
a/resources/src/mediawiki.rcfilters/ui/mw.rcfilters.ui.MenuSelectWidget.js 
b/resources/src/mediawiki.rcfilters/ui/mw.rcfilters.ui.MenuSelectWidget.js
index 22c176f..5438589 100644
--- a/resources/src/mediawiki.rcfilters/ui/mw.rcfilters.ui.MenuSelectWidget.js
+++ b/resources/src/mediawiki.rcfilters/ui/mw.rcfilters.ui.MenuSelectWidget.js
@@ -332,7 +332,7 @@
 */
mw.rcfilters.ui.MenuSelectWidget.prototype.onKeyDown = function ( e ) {
var nextItem,
-   currentItem = this.getHighlightedItem() || 
this.getSelectedItem();
+   currentItem = this.findHighlightedItem() || 
this.getSelectedItem();
 
// Call parent

mw.rcfilters.ui.MenuSelectWidget.parent.prototype.onKeyDown.call( this, e );

-- 
To view, visit https://gerrit.wikimedia.org/r/398173
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I90535c9f72d9a63e8e8d4184cc85aaf77e7b454c
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Mooeypoo 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: [wip] RCFilters: Synchronize input with menu filters

2017-12-12 Thread Mooeypoo (Code Review)
Mooeypoo has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/397996 )

Change subject: [wip] RCFilters: Synchronize input with menu filters
..

[wip] RCFilters: Synchronize input with menu filters

Synchronize the input value with the visible elements in the menu
by making sure that:
1. The switching of view through a trigger in the input happens
   **before anything else** in change events.
2. Make the view model's findMatches (so, the Menu's updateItemVisibility)
   as the ultimate source of truth as to what should be visible. The items
   are now **always** all included in the menu, but they change their
   visibility according to the logic in the findMatches. If there is a search
   term, the function will account for that and the selected view, so we can
   be sure that search results also change between changing views.

Bug: T182720
Change-Id: If575f348705d863b9d68d19761ded55a4d453550
---
M resources/src/mediawiki.rcfilters/dm/mw.rcfilters.dm.FiltersViewModel.js
M resources/src/mediawiki.rcfilters/ui/mw.rcfilters.ui.MenuSelectWidget.js
2 files changed, 57 insertions(+), 19 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/96/397996/1

diff --git 
a/resources/src/mediawiki.rcfilters/dm/mw.rcfilters.dm.FiltersViewModel.js 
b/resources/src/mediawiki.rcfilters/dm/mw.rcfilters.dm.FiltersViewModel.js
index 8d22c23..46b5597 100644
--- a/resources/src/mediawiki.rcfilters/dm/mw.rcfilters.dm.FiltersViewModel.js
+++ b/resources/src/mediawiki.rcfilters/dm/mw.rcfilters.dm.FiltersViewModel.js
@@ -999,12 +999,13 @@
groupTitle,
result = {},
flatResult = [],
-   view = this.getViewByTrigger( query.substr( 0, 1 ) ),
+   view = this.getCurrentView(),
+   queryView = this.getViewByTrigger( query.substr( 0, 1 ) 
),
items = this.getFiltersByView( view );
 
// Normalize so we can search strings regardless of case and 
view
query = query.trim().toLowerCase();
-   if ( view !== 'default' ) {
+   if ( queryView !== 'default' ) {
query = query.substr( 1 );
}
// Trim again to also intercept cases where the spaces were 
after the trigger
diff --git 
a/resources/src/mediawiki.rcfilters/ui/mw.rcfilters.ui.MenuSelectWidget.js 
b/resources/src/mediawiki.rcfilters/ui/mw.rcfilters.ui.MenuSelectWidget.js
index 22c176f..b43e1d6 100644
--- a/resources/src/mediawiki.rcfilters/ui/mw.rcfilters.ui.MenuSelectWidget.js
+++ b/resources/src/mediawiki.rcfilters/ui/mw.rcfilters.ui.MenuSelectWidget.js
@@ -49,6 +49,19 @@
);
this.setClippableElement( this.$body );
this.setClippableContainer( this.$element );
+   // HACK: We need to make sure things happen as the input is 
changed
+   // and **before** item visibility is called. Right now, the 
only way to
+   // do that is to override OO.ui.MenuSelectWidget's 
onInputEditHandler to
+   // an intermediary method that does what we need it to do and 
*then*
+   // calls this.updateItemVisibility().
+   // TODO: This should be upstreamed so that we just need to 
extend
+   // the method responding to the inputEditHandler rather than
+   // overriding this in the constructor
+   this.onInputEditHandler = OO.ui.debounce( 
this.inputEditHandler.bind( this ), 100 );
+   // The original widget also doesn't account for the input 
changing by external
+   // forces. So we bind that to other types of changes without 
needing keyup/down
+   // event
+   this.$input.on( 'change', this.onInputEditHandler );
 
header = new mw.rcfilters.ui.FilterMenuHeaderWidget(
this.controller,
@@ -122,6 +135,19 @@
/* Methods */
 
/**
+* Respond to an edit on the input
+*/
+   mw.rcfilters.ui.MenuSelectWidget.prototype.inputEditHandler = function 
() {
+   var inputVal = this.$input.val().trim();
+
+   // Change view
+   this.controller.switchView(
+   this.model.getViewByTrigger( inputVal.substr( 0, 1 ) )
+   );
+   this.updateItemVisibility();
+   };
+
+   /**
 * Respond to model update event
 */
mw.rcfilters.ui.MenuSelectWidget.prototype.onModelUpdate = function () {
@@ -143,6 +169,7 @@
mw.rcfilters.ui.MenuSelectWidget.prototype.lazyMenuCreation = function 
() {
var widget = this,
viewGroupCount = {},
+   items = [],
groups = this.model.getFilterGroups();
 
  

[MediaWiki-commits] [Gerrit] mediawiki/core[master]: RCFilters: Set up conditional views for RCLinked

2017-12-06 Thread Mooeypoo (Code Review)
Mooeypoo has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/395901 )

Change subject: RCFilters: Set up conditional views for RCLinked
..

RCFilters: Set up conditional views for RCLinked

The views that are only meant for specific pages should be set up
conditionally only when we are in that specific page, to prevent
issues with saved queries or param overload.

Change-Id: Id0bf89ce397ff8a54ce0a30d1ba7d8f9bbdd14a3
---
M resources/src/mediawiki.rcfilters/mw.rcfilters.Controller.js
M resources/src/mediawiki.rcfilters/mw.rcfilters.init.js
2 files changed, 39 insertions(+), 34 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/01/395901/1

diff --git a/resources/src/mediawiki.rcfilters/mw.rcfilters.Controller.js 
b/resources/src/mediawiki.rcfilters/mw.rcfilters.Controller.js
index c1ffde2..392092d 100644
--- a/resources/src/mediawiki.rcfilters/mw.rcfilters.Controller.js
+++ b/resources/src/mediawiki.rcfilters/mw.rcfilters.Controller.js
@@ -44,12 +44,12 @@
 * @param {Object} [namespaceStructure] Namespace definition
 * @param {Object} [tagList] Tag definition
 */
-   mw.rcfilters.Controller.prototype.initialize = function ( 
filterStructure, namespaceStructure, tagList ) {
+   mw.rcfilters.Controller.prototype.initialize = function ( 
filterStructure, namespaceStructure, tagList, conditionalViews ) {
var parsedSavedQueries, pieces,
displayConfig = mw.config.get( 
'StructuredChangeFiltersDisplayConfig' ),
defaultSavedQueryExists = mw.config.get( 
'wgStructuredChangeFiltersDefaultSavedQueryExists' ),
controller = this,
-   views = {},
+   views = $.extend( true, {}, conditionalViews ),
items = [],
uri = new mw.Uri();
 
@@ -182,37 +182,6 @@
{
name: 'enhanced',
'default': String( 
mw.user.options.get( 'usenewrc', 0 ) )
-   }
-   ]
-   }
-   ]
-   };
-
-   views.recentChangesLinked = {
-   groups: [
-   {
-   name: 'page',
-   type: 'any_value',
-   title: '',
-   hidden: true,
-   isSticky: false,
-   filters: [
-   {
-   name: 'target',
-   'default': ''
-   }
-   ]
-   },
-   {
-   name: 'toOrFrom',
-   type: 'boolean',
-   title: '',
-   hidden: true,
-   isSticky: false,
-   filters: [
-   {
-   name: 'showlinkedto',
-   'default': false
}
]
}
diff --git a/resources/src/mediawiki.rcfilters/mw.rcfilters.init.js 
b/resources/src/mediawiki.rcfilters/mw.rcfilters.init.js
index 6ec1200..7322d58 100644
--- a/resources/src/mediawiki.rcfilters/mw.rcfilters.init.js
+++ b/resources/src/mediawiki.rcfilters/mw.rcfilters.init.js
@@ -12,6 +12,7 @@
topSection,
$watchlistDetails,
namespaces,
+   conditionalViews = {},
savedQueriesPreferenceName = mw.config.get( 
'wgStructuredChangeFiltersSavedQueriesPreferenceName' ),
daysPreferenceName = mw.config.get( 
'wgStructuredChangeFiltersDaysPreferenceName' ),
limitPreferenceName = mw.config.get( 
'wgStructuredChangeFiltersLimitPreferenceName' ),
@@ -36,6 +37,40 @@
specialPage = mw.config.get( 
'wgCanonicalSpecialPageName' ),
$changesListRoot = $( '.mw-changeslist, 
.mw-changeslist-empty, .mw-changeslist-timeout' );
 
+   if ( specialPage =

[MediaWiki-commits] [Gerrit] mediawiki...Flow[master]: [EXPERIMENTAL] Using OOUI lazy-load for rudamentary reply

2017-12-05 Thread Mooeypoo (Code Review)
Mooeypoo has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/395664 )

Change subject: [EXPERIMENTAL] Using OOUI lazy-load for rudamentary reply
..

[EXPERIMENTAL] Using OOUI lazy-load for rudamentary reply

** DO NOT MERGE **

This is an experiment to get a rudamentary 'reply' action working
with ooui php and js for Flow with lazy-loading.

** DO NOT MERGE **

Change-Id: I49b6c68ea2b5a5533722b49abf3a0da5d35105bf
---
M extension.json
M includes/OOUI/BaseUiWidget.php
M includes/OOUI/FlowButtonWidget.php
M includes/OOUI/PostWidget.php
M includes/OOUI/TopicWidget.php
M modules/flow/experimental/initialization.js
A modules/flow/experimental/ui.PostWidget.js
A modules/flow/experimental/ui.ReplyWidget.js
A modules/flow/experimental/ui.SimpleMenuWidget.js
M modules/styles/flow/widgets/experimental/mw.flow.ui.less
10 files changed, 413 insertions(+), 19 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Flow 
refs/changes/64/395664/1

diff --git a/extension.json b/extension.json
index 3a18f89..66bd7e2 100644
--- a/extension.json
+++ b/extension.json
@@ -596,6 +596,17 @@
"flow/experimental/initialization.js"
]
},
+   "ext.flow.ooui.experimental.lazy": {
+   "scripts": [
+   "flow/experimental/ui.SimpleMenuWidget.js",
+   "flow/experimental/ui.PostWidget.js",
+   "flow/experimental/ui.ReplyWidget.js"
+   ],
+   "dependencies": [
+   "oojs-ui",
+   "mediawiki.api"
+   ]
+   },
"ext.flow": {
"position": "top",
"styles": [
diff --git a/includes/OOUI/BaseUiWidget.php b/includes/OOUI/BaseUiWidget.php
index 133b468..70cf851 100644
--- a/includes/OOUI/BaseUiWidget.php
+++ b/includes/OOUI/BaseUiWidget.php
@@ -36,7 +36,7 @@
protected function makeSection( $name, $class = '' ) {
$tag = new \OOUI\Tag( 'div' );
 
-   $class = $class ? $class : 'flow-ui-' . lcfirst( 
self::WIDGET_NAME ) . '-' . $name;
+   $class = $class ? $class : 'mw-flow-ui-' . lcfirst( 
static::WIDGET_NAME ) . '-' . $name;
$tag->addClasses( [ $class ] );
return $tag;
}
diff --git a/includes/OOUI/FlowButtonWidget.php 
b/includes/OOUI/FlowButtonWidget.php
index 97d9128..dabc840 100644
--- a/includes/OOUI/FlowButtonWidget.php
+++ b/includes/OOUI/FlowButtonWidget.php
@@ -8,7 +8,7 @@
 class FlowButtonWidget extends \OOUI\ButtonWidget {
protected $name;
 
-   public function __construct( array $config = [] ) {
+   public function __construct( array $config = [ 'infusable' => true ] ) {
 
parent::__construct( $config );
 
@@ -31,8 +31,9 @@
 
protected function getOnClickDeferredAction( $definition ) {
return 'window.mwSDInitActions = window.mwSDInitActions || [];' 
.
+   'this.className+=" flow-ui-pending";' .
'window.mwSDInitActions.push( [this, ' . $definition . 
']);' .
-   'console.log("clicked",window.mwSDInitActions);' .
+   'console.log("onClick 
intercepted",window.mwSDInitActions);' .
'return false;';
}
-}
\ No newline at end of file
+}
diff --git a/includes/OOUI/PostWidget.php b/includes/OOUI/PostWidget.php
index 80458b5..1145ed7 100644
--- a/includes/OOUI/PostWidget.php
+++ b/includes/OOUI/PostWidget.php
@@ -14,7 +14,7 @@
 * @param array $revisionData Post revision data from the API
 * @param array $config Configuration options
 */
-   public function __construct( $postID, $revisionData, $allTopicPosts, 
$allTopicRevisions, array $config = [] ) {
+   public function __construct( $postID, $topicId, $revisionData, 
$allTopicPosts, $allTopicRevisions, array $config = [] ) {
global $wgLang;
 
// Parent constructor
@@ -25,9 +25,14 @@
// Traits
$this->initializeGroupElement( array_merge( $config, [ 'group' 
=> $this->replies ] ) );
 
+   $this->topicID = $topicId;
// Author info
$userID = $revisionData['author']['id'];
$userName = $revisionData['author']['name'];
+   // var_dump( $userID );
+   // var_dump( \Linker::userLink( $userID, $userName ) );
+   // var_dump( \Linker::userToolLinks( $userID, $userName ) );
+   // die();
$authorName = new \OOUI\LabelWidget( [
'label' => new \OOUI\HtmlSnippet( \Linker::userLink( 
$userID, $userName ) ),
'classes' => 

[MediaWiki-commits] [Gerrit] mediawiki/core[master]: RCFilters: Update invert URL param when toggled

2017-12-04 Thread Mooeypoo (Code Review)
Mooeypoo has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/395165 )

Change subject: RCFilters: Update invert URL param when toggled
..

RCFilters: Update invert URL param when toggled

Bug: T182045
Change-Id: Ia9a8afb336305969ac8b5c2e7ffab146844ad9ee
---
M resources/src/mediawiki.rcfilters/mw.rcfilters.Controller.js
1 file changed, 14 insertions(+), 10 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/65/395165/1

diff --git a/resources/src/mediawiki.rcfilters/mw.rcfilters.Controller.js 
b/resources/src/mediawiki.rcfilters/mw.rcfilters.Controller.js
index 0cec3ff..ba56f6f 100644
--- a/resources/src/mediawiki.rcfilters/mw.rcfilters.Controller.js
+++ b/resources/src/mediawiki.rcfilters/mw.rcfilters.Controller.js
@@ -78,16 +78,19 @@
separator: ';',
fullCoverage: true,
filters: items
-   },
-   {
-   name: 'invertGroup',
-   type: 'boolean',
-   hidden: true,
-   filters: [ {
-   name: 'invert',
-   'default': '0'
-   } ]
} ]
+   };
+   views.invert = {
+   groups: [
+   {
+   name: 'invertGroup',
+   type: 'boolean',
+   hidden: true,
+   filters: [ {
+   name: 'invert',
+   'default': '0'
+   } ]
+   } ]
};
}
if ( tagList ) {
@@ -512,7 +515,6 @@
 */
mw.rcfilters.Controller.prototype.toggleInvertedNamespaces = function 
() {
this.filtersModel.toggleInvertedNamespaces();
-
if (
this.filtersModel.getFiltersByView( 'namespaces' 
).filter(
function ( filterItem ) { return 
filterItem.isSelected(); }
@@ -520,6 +522,8 @@
) {
// Only re-fetch results if there are namespace items 
that are actually selected
this.updateChangesList();
+   } else {
+   this.uriProcessor.updateURL();
}
};
 

-- 
To view, visit https://gerrit.wikimedia.org/r/395165
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia9a8afb336305969ac8b5c2e7ffab146844ad9ee
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Mooeypoo 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: RCFilters: Followup I75cfb2b56a: Fix function declaration

2017-11-30 Thread Mooeypoo (Code Review)
Mooeypoo has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/394370 )

Change subject: RCFilters: Followup I75cfb2b56a: Fix function declaration
..

RCFilters: Followup I75cfb2b56a: Fix function declaration

Bug: T181671
Change-Id: Ie69e9f0f77b2c463bc2e4d41cd9a1b8e87f7efef
---
M includes/specials/SpecialRecentchangeslinked.php
1 file changed, 2 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/70/394370/1

diff --git a/includes/specials/SpecialRecentchangeslinked.php 
b/includes/specials/SpecialRecentchangeslinked.php
index e4cc3d1..7067b46 100644
--- a/includes/specials/SpecialRecentchangeslinked.php
+++ b/includes/specials/SpecialRecentchangeslinked.php
@@ -301,10 +301,11 @@
 * Get a self-referential title object
 * with consideration to the given subpage.
 *
+* @param string|bool $subpage
 * @return Title
 * @since 1.23
 */
-   public function getPageTitle() {
+   public function getPageTitle( $subpage = false ) {
return parent::getPageTitle( $this->rclTarget );
}
 }

-- 
To view, visit https://gerrit.wikimedia.org/r/394370
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie69e9f0f77b2c463bc2e4d41cd9a1b8e87f7efef
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Mooeypoo 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: RCFilters: Update URL even when we skip fetching

2017-11-21 Thread Mooeypoo (Code Review)
Mooeypoo has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/392757 )

Change subject: RCFilters: Update URL even when we skip fetching
..

RCFilters: Update URL even when we skip fetching

In some cases, when the selected value of the filters have not
changed, we don't reload the results. However, we should still
update the URL values.

Change-Id: Iff81b4ca1b78848813b2eb8d55f0f5f5e614b424
---
M resources/src/mediawiki.rcfilters/mw.rcfilters.Controller.js
1 file changed, 8 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/57/392757/1

diff --git a/resources/src/mediawiki.rcfilters/mw.rcfilters.Controller.js 
b/resources/src/mediawiki.rcfilters/mw.rcfilters.Controller.js
index 5386291..0cec3ff 100644
--- a/resources/src/mediawiki.rcfilters/mw.rcfilters.Controller.js
+++ b/resources/src/mediawiki.rcfilters/mw.rcfilters.Controller.js
@@ -400,9 +400,12 @@
 * Reset to default filters
 */
mw.rcfilters.Controller.prototype.resetToDefaults = function () {
-   if ( this.applyParamChange( this._getDefaultParams() ) ) {
+   var params = this._getDefaultParams();
+   if ( this.applyParamChange( params ) ) {
// Only update the changes list if there was a change 
to actual filters
this.updateChangesList();
+   } else {
+   this.uriProcessor.updateURL( params );
}
};
 
@@ -425,6 +428,8 @@
if ( this.applyParamChange( {} ) ) {
// Only update the changes list if there was a change 
to actual filters
this.updateChangesList();
+   } else {
+   this.uriProcessor.updateURL();
}
 
if ( highlightedFilterNames ) {
@@ -712,6 +717,8 @@
if ( this.applyParamChange( params ) ) {
// Update changes list only if there was a difference 
in filter selection
this.updateChangesList();
+   } else {
+   this.uriProcessor.updateURL( params );
}
 
// Log filter grouping

-- 
To view, visit https://gerrit.wikimedia.org/r/392757
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iff81b4ca1b78848813b2eb8d55f0f5f5e614b424
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Mooeypoo 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: RCFilters: Respect subpage in RCLinked

2017-11-21 Thread Mooeypoo (Code Review)
Mooeypoo has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/392756 )

Change subject: RCFilters: Respect subpage in RCLinked
..

RCFilters: Respect subpage in RCLinked

Make sure that when we redirect a URL when there's a saved query,
we retain the information about a subpage.

Then, normalize the URL to always use &target=xxx so that the
system knows to correct the value if the user uses the form that
is, for the moment, outside the regular RCFilters interface.

Bug: T181100
Change-Id: I75cfb2b56a4da6357e6117b3f34f3178bfb2c90c
---
M includes/specials/SpecialRecentchangeslinked.php
M resources/src/mediawiki.rcfilters/mw.rcfilters.UriProcessor.js
2 files changed, 27 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/56/392756/1

diff --git a/includes/specials/SpecialRecentchangeslinked.php 
b/includes/specials/SpecialRecentchangeslinked.php
index 358a309..c5a2e1a 100644
--- a/includes/specials/SpecialRecentchangeslinked.php
+++ b/includes/specials/SpecialRecentchangeslinked.php
@@ -30,6 +30,8 @@
/** @var bool|Title */
protected $rclTargetTitle;
 
+   protected $rclTarget;
+
function __construct() {
parent::__construct( 'Recentchangeslinked' );
}
@@ -44,6 +46,7 @@
 
public function parseParameters( $par, FormOptions $opts ) {
$opts['target'] = $par;
+   $this->rclTarget = $par;
}
 
/**
@@ -293,4 +296,15 @@
public function prefixSearchSubpages( $search, $limit, $offset ) {
return $this->prefixSearchString( $search, $limit, $offset );
}
+
+   /**
+* Get a self-referential title object
+*
+* @param string|bool $subpage
+* @return Title
+* @since 1.23
+*/
+   public function getPageTitle() {
+   return parent::getPageTitle( $this->rclTarget );
+   }
 }
diff --git a/resources/src/mediawiki.rcfilters/mw.rcfilters.UriProcessor.js 
b/resources/src/mediawiki.rcfilters/mw.rcfilters.UriProcessor.js
index 621c200..6eeeb33 100644
--- a/resources/src/mediawiki.rcfilters/mw.rcfilters.UriProcessor.js
+++ b/resources/src/mediawiki.rcfilters/mw.rcfilters.UriProcessor.js
@@ -63,13 +63,25 @@
 * @return {mw.Uri} Updated Uri
 */
mw.rcfilters.UriProcessor.prototype.getUpdatedUri = function ( uriQuery 
) {
-   var uri = new mw.Uri(),
+   var titlePieces,
+   uri = new mw.Uri(),
unrecognizedParams = this.getUnrecognizedParams( 
uriQuery || uri.query );
 
if ( uriQuery ) {
// This is mainly for tests, to be able to give the 
method
// an initial URI Query and test that it retains 
parameters
uri.query = uriQuery;
+   }
+
+   // Normalize subpage to use &target= so we are always
+   // consistent in Special:RecentChangesLinked between the
+   // ?title=Special:RecentChangesLinked/TargetPage and
+   // ?title=Special:RecentChangesLinked&target=TargetPage
+   if ( uri.query.title.indexOf( '/' ) !== -1 ) {
+   titlePieces = uri.query.title.split( '/' );
+
+   unrecognizedParams.title = titlePieces.shift();
+   unrecognizedParams.target = titlePieces.join( '/' );
}
 
uri.query = this.filtersModel.getMinimizedParamRepresentation(
@@ -87,7 +99,6 @@
 
// Reapply unrecognized params and url version
uri.query = $.extend( true, {}, uri.query, unrecognizedParams, 
{ urlversion: '2' } );
-
return uri;
};
 

-- 
To view, visit https://gerrit.wikimedia.org/r/392756
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I75cfb2b56a4da6357e6117b3f34f3178bfb2c90c
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Mooeypoo 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...Flow[master]: [EXPERIMENTAL] Using OOUI-PHP widgets with Flow

2017-11-21 Thread Mooeypoo (Code Review)
Mooeypoo has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/392717 )

Change subject: [EXPERIMENTAL] Using OOUI-PHP widgets with Flow
..

[EXPERIMENTAL] Using OOUI-PHP widgets with Flow

** DO NOT MERGE **

Testing/experimenting with light JS load + lazy loading
that is given from the OOUI-PHP side.

** DO NOT MERGE **

Change-Id: I1ac8569dff61eba4e079c4fb977417b236293cc6
---
M extension.json
M includes/OOUI/BaseUiWidget.php
A includes/OOUI/FlowButtonWidget.php
M includes/OOUI/PostWidget.php
M includes/OOUI/SimpleMenuWidget.php
M includes/View.php
M modules/flow-initialize.js
A modules/flow/experimental/initialization.js
M modules/styles/js.less
9 files changed, 81 insertions(+), 29 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Flow 
refs/changes/17/392717/1

diff --git a/extension.json b/extension.json
index ca1555e..3a18f89 100644
--- a/extension.json
+++ b/extension.json
@@ -591,6 +591,11 @@

"styles/flow/widgets/experimental/mw.flow.ui.PostWidget.less"
]
},
+   "ext.flow.ooui.experimental.initial": {
+   "scripts": [
+   "flow/experimental/initialization.js"
+   ]
+   },
"ext.flow": {
"position": "top",
"styles": [
@@ -1256,6 +1261,7 @@
"Flow\\NotificationController": 
"includes/Notifications/Controller.php",
"Flow\\NotificationsUserLocator": 
"includes/Notifications/UserLocator.php",
"Flow\\OOUI\\BoardDescriptionWidget": 
"includes/OOUI/BoardDescriptionWidget.php",
+   "Flow\\OOUI\\FlowButtonWidget": 
"includes/OOUI/FlowButtonWidget.php",
"Flow\\OOUI\\BaseUiWidget": "includes/OOUI/BaseUiWidget.php",
"Flow\\OOUI\\SimpleMenuWidget": 
"includes/OOUI/SimpleMenuWidget.php",
"Flow\\OOUI\\TopicWidget": "includes/OOUI/TopicWidget.php",
diff --git a/includes/OOUI/BaseUiWidget.php b/includes/OOUI/BaseUiWidget.php
index 837af34..d4334b9 100644
--- a/includes/OOUI/BaseUiWidget.php
+++ b/includes/OOUI/BaseUiWidget.php
@@ -40,11 +40,11 @@
return $tag;
}
 
-   protected function getOnClickDeferredAction( $action ) {
+   protected function getOnClickDeferredAction( $name, $action ) {
$outputAction = json_encode( $action );
-   return 'function () {' .
-   'window.mwSDInitActions = window.mwSDInitActions || 
[];' .
+   return 'window.mwSDInitActions = window.mwSDInitActions || [];' 
.
'window.mwSDInitActions.push( [this,' . $outputAction . 
']);' .
-   '}';
+   'console.log("clicked", mwSDInitActions);' .
+   'return false;';
}
 }
\ No newline at end of file
diff --git a/includes/OOUI/FlowButtonWidget.php 
b/includes/OOUI/FlowButtonWidget.php
new file mode 100644
index 000..a7cc293
--- /dev/null
+++ b/includes/OOUI/FlowButtonWidget.php
@@ -0,0 +1,27 @@
+ true ], 
$config ) );
+
+   if ( isset( $config['addOnClick' ] ) && $config['addOnClick' ] 
) {
+   $this->button->setAttributes( [
+   'onClick' => $this->getOnClickDeferredAction( 
$name ),
+   ] );
+   }
+   }
+
+   protected function getOnClickDeferredAction( $name ) {
+   return 'window.mwSDInitActions = window.mwSDInitActions || [];' 
.
+   'window.mwSDInitActions.push( [this, "click"]);' .
+   'console.log("clicked",window.mwSDInitActions);' .
+   'return false;';
+   }
+}
\ No newline at end of file
diff --git a/includes/OOUI/PostWidget.php b/includes/OOUI/PostWidget.php
index 4fcf652..6910add 100644
--- a/includes/OOUI/PostWidget.php
+++ b/includes/OOUI/PostWidget.php
@@ -97,15 +97,17 @@
// the Thank extension. However, this 
doesn't seem to be the
// way it's done right now, so we will 
hard-code "thanks" here
// too for now
-   new \OOUI\ButtonWidget( [
+   new FlowButtonWidget( [
'framed' => false,
'label' => 'Reply', // TODO: 
i18n
'url' => '',
+   'addOnClick' => true,
] ),
-   new \OOUI\ButtonWidget( [
+   new FlowButtonWidget( [
  

[MediaWiki-commits] [Gerrit] mediawiki...Flow[master]: [EXPERIMENTAL] Using OOUI-PHP widgets with Flow

2017-11-20 Thread Mooeypoo (Code Review)
Mooeypoo has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/392486 )

Change subject: [EXPERIMENTAL] Using OOUI-PHP widgets with Flow
..

[EXPERIMENTAL] Using OOUI-PHP widgets with Flow

** DO NOT MERGE **

This is completely experimental, the idea is to test how much duplication
work exists, minimally, between the backend and frontend, to assess the
level of work required and to see whether we can optimize or answer the
need with other technologies when needed.

** DO NOT MERGE **

Change-Id: I3db0cd60808a79223cb0d93b79a02225b3d0ff0f
---
M Gemfile.lock
M extension.json
A includes/OOUI/PostWidget.php
A includes/OOUI/SimpleMenuWidget.php
A includes/OOUI/TopicWidget.php
M includes/View.php
A modules/styles/flow/widgets/experimental/mw.flow.ui.PostWidget.less
A modules/styles/flow/widgets/experimental/mw.flow.ui.SimpleMenuWidget.less
A modules/styles/flow/widgets/experimental/mw.flow.ui.TopicWidget.less
A modules/styles/flow/widgets/experimental/mw.flow.ui.less
A modules/styles/flow/widgets/mw.flow.ui.SimpleMenuWidget.less
11 files changed, 655 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Flow 
refs/changes/86/392486/1

diff --git a/Gemfile.lock b/Gemfile.lock
index 5e814ab..21dbd11 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -114,6 +114,3 @@
   mediawiki_selenium (~> 1.8)
   rake (~> 11.1, >= 11.1.1)
   rubocop (~> 0.32.1)
-
-BUNDLED WITH
-   1.14.5
diff --git a/extension.json b/extension.json
index e238aa4..71680ba 100644
--- a/extension.json
+++ b/extension.json
@@ -531,7 +531,8 @@

"styles/flow/widgets/editor/editors/mw.flow.ui.WikitextEditorWidget.less",

"styles/flow/widgets/mw.flow.ui.CategoryItemWidget.less",

"styles/flow/widgets/mw.flow.ui.CategoriesWidget.less",
-   
"styles/flow/widgets/mw.flow.ui.TopicTitleWidget.less"
+   
"styles/flow/widgets/mw.flow.ui.TopicTitleWidget.less",
+   
"styles/flow/widgets/mw.flow.ui.SimpleMenuWidget.less"
],
"skinStyles": {
"default": [
@@ -580,6 +581,14 @@
"targets": [
"desktop",
"mobile"
+   ]
+   },
+   "ext.flow.ooui.experimental.styles": {
+   "styles": [
+   
"styles/flow/widgets/experimental/mw.flow.ui.less",
+   
"styles/flow/widgets/experimental/mw.flow.ui.SimpleMenuWidget.less",
+   
"styles/flow/widgets/experimental/mw.flow.ui.TopicWidget.less",
+   
"styles/flow/widgets/experimental/mw.flow.ui.PostWidget.less"
]
},
"ext.flow": {
@@ -1247,6 +1256,9 @@
"Flow\\NotificationController": 
"includes/Notifications/Controller.php",
"Flow\\NotificationsUserLocator": 
"includes/Notifications/UserLocator.php",
"Flow\\OOUI\\BoardDescriptionWidget": 
"includes/OOUI/BoardDescriptionWidget.php",
+   "Flow\\OOUI\\SimpleMenuWidget": 
"includes/OOUI/SimpleMenuWidget.php",
+   "Flow\\OOUI\\TopicWidget": "includes/OOUI/TopicWidget.php",
+   "Flow\\OOUI\\PostWidget": "includes/OOUI/PostWidget.php",
"Flow\\OccupationController": "includes/TalkpageManager.php",
"Flow\\Parsoid\\ContentFixer": 
"includes/Parsoid/ContentFixer.php",
"Flow\\Parsoid\\Extractor": "includes/Parsoid/Extractor.php",
diff --git a/includes/OOUI/PostWidget.php b/includes/OOUI/PostWidget.php
new file mode 100644
index 000..7a1e53e
--- /dev/null
+++ b/includes/OOUI/PostWidget.php
@@ -0,0 +1,181 @@
+replies = $this->makeSection( 'replies' );
+
+   // Traits
+   $this->initializeGroupElement( array_merge( $config, [ 'group' 
=> $this->replies ] ) );
+
+   // Author info
+   $userID = $revisionData['author']['id'];
+   $userName = $revisionData['author']['name'];
+   $authorName = new \OOUI\LabelWidget( [
+   'label' => new \OOUI\HtmlSnippet( \Linker::userLink( 
$userID, $userName ) ),
+   'classes' => [ 'mw-flow-ui-postWidget-user-name' ]
+   ] );
+   $authorInfo = new \OOUI\LabelWidget( [
+   'label' => new \OOUI\HtmlSnippet( 
\Linker::userToolLinks( $userID, $userName ) ),
+   'classes' => [ 'mw-flow-ui-postWidget-user-links' ]
+   ] );
+   $authorSection = $this->makeSection( 'user' );
+   $authorSection->appendContent( $authorName, $authorInfo );
+
+   

[MediaWiki-commits] [Gerrit] mediawiki/core[master]: RCFilters: Followup I08db859c571: Fix typo in "namespaces"

2017-11-20 Thread Mooeypoo (Code Review)
Mooeypoo has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/392477 )

Change subject: RCFilters: Followup I08db859c571: Fix typo in "namespaces"
..

RCFilters: Followup I08db859c571: Fix typo in "namespaces"

Bug: T180863
Change-Id: I1b65ed5dfceb99bea98cbcadea11ddab367c6ca7
---
M resources/src/mediawiki.rcfilters/ui/mw.rcfilters.ui.ItemMenuOptionWidget.js
1 file changed, 2 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/77/392477/1

diff --git 
a/resources/src/mediawiki.rcfilters/ui/mw.rcfilters.ui.ItemMenuOptionWidget.js 
b/resources/src/mediawiki.rcfilters/ui/mw.rcfilters.ui.ItemMenuOptionWidget.js
index 97000d4..51fc9bc 100644
--- 
a/resources/src/mediawiki.rcfilters/ui/mw.rcfilters.ui.ItemMenuOptionWidget.js
+++ 
b/resources/src/mediawiki.rcfilters/ui/mw.rcfilters.ui.ItemMenuOptionWidget.js
@@ -66,7 +66,7 @@
label: mw.msg( 'rcfilters-filter-excluded' )
} );
this.excludeLabel.toggle(
-   this.itemModel.getGroupModel().getView() === 
'namespace' &&
+   this.itemModel.getGroupModel().getView() === 
'namespaces' &&
this.itemModel.isSelected() &&
this.invertModel.isSelected()
);
@@ -138,7 +138,7 @@
 
this.highlightButton.toggle( 
this.filtersViewModel.isHighlightEnabled() );
this.excludeLabel.toggle(
-   this.itemModel.getGroupModel().getView() === 
'namespace' &&
+   this.itemModel.getGroupModel().getView() === 
'namespaces' &&
this.itemModel.isSelected() &&
this.invertModel.isSelected()
);

-- 
To view, visit https://gerrit.wikimedia.org/r/392477
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I1b65ed5dfceb99bea98cbcadea11ddab367c6ca7
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Mooeypoo 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: RCFilters: Ignore 'invert' model if there are no namespaces ...

2017-11-17 Thread Mooeypoo (Code Review)
Mooeypoo has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/392182 )

Change subject: RCFilters: Ignore 'invert' model if there are no namespaces in 
saved queries
..

RCFilters: Ignore 'invert' model if there are no namespaces in saved queries

When comparing and when saving the query, normalize the 'invert'
state so that it represents the **effective** state of the filters.
If there are no namespaces, then 'invert' is irrelevant.

Make sure we ignore that state when it is irrelevant when we save
saved queries and when we compare the current state to a saved query.

Change-Id: If80b50c3d2b90b5116b6b0018a8d56bce2deb7c4
---
M resources/src/mediawiki.rcfilters/dm/mw.rcfilters.dm.FiltersViewModel.js
M resources/src/mediawiki.rcfilters/dm/mw.rcfilters.dm.SavedQueriesModel.js
2 files changed, 32 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/82/392182/1

diff --git 
a/resources/src/mediawiki.rcfilters/dm/mw.rcfilters.dm.FiltersViewModel.js 
b/resources/src/mediawiki.rcfilters/dm/mw.rcfilters.dm.FiltersViewModel.js
index d959540..99558bd 100644
--- a/resources/src/mediawiki.rcfilters/dm/mw.rcfilters.dm.FiltersViewModel.js
+++ b/resources/src/mediawiki.rcfilters/dm/mw.rcfilters.dm.FiltersViewModel.js
@@ -1036,6 +1036,23 @@
};
 
/**
+* Check whether the invert state is a valid one. A valid invert state 
is one where
+* there are actual namespaces selcted.
+*
+* This is done to compare states to previous ones that may have had 
the invert model
+* selected but effectively had no namespaces, so are not effectively 
different than
+* ones where invert is not selected.
+*
+* @return {boolean} Invert is effectively selected
+*/
+   
mw.rcfilters.dm.FiltersViewModel.prototype.areNamespacesEffectivelyInverted = 
function () {
+   return this.getInvertModel().isSelected() &&
+   this.getSelectedItems().some( function ( itemModel ) {
+   return itemModel.getGroupModel().getView() === 
'namespace';
+   } );
+   };
+
+   /**
 * Get the item that matches the given name
 *
 * @param {string} name Filter name
diff --git 
a/resources/src/mediawiki.rcfilters/dm/mw.rcfilters.dm.SavedQueriesModel.js 
b/resources/src/mediawiki.rcfilters/dm/mw.rcfilters.dm.SavedQueriesModel.js
index 1d7934f..1caacf4 100644
--- a/resources/src/mediawiki.rcfilters/dm/mw.rcfilters.dm.SavedQueriesModel.js
+++ b/resources/src/mediawiki.rcfilters/dm/mw.rcfilters.dm.SavedQueriesModel.js
@@ -123,6 +123,11 @@
// the given data, if they exist
normalizedData.params = 
model.filtersModel.removeExcludedParams( normalizedData.params );
 
+   // Correct the invert state for effective 
selection
+   if ( normalizedData.params.invert && 
!normalizedData.params.namespaces ) {
+   delete normalizedData.params.invert;
+   }
+
model.cleanupHighlights( normalizedData );
 
id = String( id );
@@ -226,6 +231,11 @@
}
} );
 
+   // Correct the invert state for effective selection
+   if ( normalizedData.params.invert && 
!this.filtersModel.areNamespacesEffectivelyInverted() ) {
+   delete normalizedData.params.invert;
+   }
+
// Add item
this.addItems( [
new mw.rcfilters.dm.SavedQueryItemModel(
@@ -272,6 +282,11 @@
// Minimize before comparison
fullQueryComparison = 
this.filtersModel.getMinimizedParamRepresentation( fullQueryComparison );
 
+   // Correct the invert state for effective selection
+   if ( fullQueryComparison.invert ) {
+   delete fullQueryComparison.invert;
+   }
+
return this.getItems().filter( function ( item ) {
return OO.compare(
item.getCombinedData(),

-- 
To view, visit https://gerrit.wikimedia.org/r/392182
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: If80b50c3d2b90b5116b6b0018a8d56bce2deb7c4
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Mooeypoo 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: RCFilters: Only apply excluded label to namespace items

2017-11-17 Thread Mooeypoo (Code Review)
Mooeypoo has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/392179 )

Change subject: RCFilters: Only apply excluded label to namespace items
..

RCFilters: Only apply excluded label to namespace items

Bug: T180863
Change-Id: I08db859c571b82ed4e4793d97b99100875ff1e23
---
M resources/src/mediawiki.rcfilters/ui/mw.rcfilters.ui.ItemMenuOptionWidget.js
1 file changed, 10 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/79/392179/1

diff --git 
a/resources/src/mediawiki.rcfilters/ui/mw.rcfilters.ui.ItemMenuOptionWidget.js 
b/resources/src/mediawiki.rcfilters/ui/mw.rcfilters.ui.ItemMenuOptionWidget.js
index db43a53..97000d4 100644
--- 
a/resources/src/mediawiki.rcfilters/ui/mw.rcfilters.ui.ItemMenuOptionWidget.js
+++ 
b/resources/src/mediawiki.rcfilters/ui/mw.rcfilters.ui.ItemMenuOptionWidget.js
@@ -65,7 +65,11 @@
this.excludeLabel = new OO.ui.LabelWidget( {
label: mw.msg( 'rcfilters-filter-excluded' )
} );
-   this.excludeLabel.toggle( this.itemModel.isSelected() && 
this.invertModel.isSelected() );
+   this.excludeLabel.toggle(
+   this.itemModel.getGroupModel().getView() === 
'namespace' &&
+   this.itemModel.isSelected() &&
+   this.invertModel.isSelected()
+   );
 
layout = new OO.ui.FieldLayout( this.checkboxWidget, {
label: $label,
@@ -133,7 +137,11 @@
this.checkboxWidget.setSelected( this.itemModel.isSelected() );
 
this.highlightButton.toggle( 
this.filtersViewModel.isHighlightEnabled() );
-   this.excludeLabel.toggle( this.itemModel.isSelected() && 
this.invertModel.isSelected() );
+   this.excludeLabel.toggle(
+   this.itemModel.getGroupModel().getView() === 
'namespace' &&
+   this.itemModel.isSelected() &&
+   this.invertModel.isSelected()
+   );
};
 
/**

-- 
To view, visit https://gerrit.wikimedia.org/r/392179
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I08db859c571b82ed4e4793d97b99100875ff1e23
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Mooeypoo 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: RCFilters: Remove redundant replaceUpdatedUrl method

2017-11-02 Thread Mooeypoo (Code Review)
Mooeypoo has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/388268 )

Change subject: RCFilters: Remove redundant replaceUpdatedUrl method
..

RCFilters: Remove redundant replaceUpdatedUrl method

The method should call updateURL anyways. If it's initializing, the
comparison to the original URL will still be false and the system
will apply replaceState on the URL.

Change-Id: Ibfa104ed2aba94a5c17ed8ce3580a089d60e4d97
---
M resources/src/mediawiki.rcfilters/mw.rcfilters.Controller.js
M resources/src/mediawiki.rcfilters/mw.rcfilters.UriProcessor.js
2 files changed, 1 insertion(+), 8 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/68/388268/1

diff --git a/resources/src/mediawiki.rcfilters/mw.rcfilters.Controller.js 
b/resources/src/mediawiki.rcfilters/mw.rcfilters.Controller.js
index ac998d7..bf333a9 100644
--- a/resources/src/mediawiki.rcfilters/mw.rcfilters.Controller.js
+++ b/resources/src/mediawiki.rcfilters/mw.rcfilters.Controller.js
@@ -825,7 +825,7 @@
 * without adding an history entry.
 */
mw.rcfilters.Controller.prototype.replaceUrl = function () {
-   this.uriProcessor.replaceUpdatedUri();
+   this.uriProcessor.updateURL();
};
 
/**
diff --git a/resources/src/mediawiki.rcfilters/mw.rcfilters.UriProcessor.js 
b/resources/src/mediawiki.rcfilters/mw.rcfilters.UriProcessor.js
index 0e20e3f..c25aa73 100644
--- a/resources/src/mediawiki.rcfilters/mw.rcfilters.UriProcessor.js
+++ b/resources/src/mediawiki.rcfilters/mw.rcfilters.UriProcessor.js
@@ -55,13 +55,6 @@
};
 
/**
-* Replace the current URI with an updated one from the model state
-*/
-   mw.rcfilters.UriProcessor.prototype.replaceUpdatedUri = function () {
-   this.constructor.static.replaceState( this.getUpdatedUri() );
-   };
-
-   /**
 * Get an updated mw.Uri object based on the model state
 *
 * @param {Object} [uriQuery] An external URI query to build the new uri

-- 
To view, visit https://gerrit.wikimedia.org/r/388268
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ibfa104ed2aba94a5c17ed8ce3580a089d60e4d97
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Mooeypoo 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: RCFilters: Make 'days' and 'limit' sticky

2017-11-02 Thread Mooeypoo (Code Review)
Mooeypoo has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/388264 )

Change subject: RCFilters: Make 'days' and 'limit' sticky
..

RCFilters: Make 'days' and 'limit' sticky

* Each has a hidden preference to override the preferences value
* Each value is different between Watchlist and RecentChanges
* If RCFilters is enabled, the preferences for Watchlist are
  hidden from the preference page.
* If RCFilters is enabled, the 'rcdays' preference, in RecentChanges,
  is hidden.

Bug: T174415
Change-Id: Ib933de3a3f9e876924386e80f315506f60f8af54
---
M includes/Preferences.php
M includes/specialpage/ChangesListSpecialPage.php
M includes/specials/SpecialRecentchanges.php
M includes/specials/SpecialWatchlist.php
M resources/src/mediawiki.rcfilters/mw.rcfilters.Controller.js
M resources/src/mediawiki.rcfilters/mw.rcfilters.UriProcessor.js
M resources/src/mediawiki.rcfilters/mw.rcfilters.init.js
7 files changed, 87 insertions(+), 54 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/64/388264/1

diff --git a/includes/Preferences.php b/includes/Preferences.php
index 94854fa..18f2837 100644
--- a/includes/Preferences.php
+++ b/includes/Preferences.php
@@ -901,15 +901,28 @@
$config = $context->getConfig();
$rcMaxAge = $config->get( 'RCMaxAge' );
# # RecentChanges #
-   $defaultPreferences['rcdays'] = [
-   'type' => 'float',
-   'label-message' => 'recentchangesdays',
-   'section' => 'rc/displayrc',
-   'min' => 1,
-   'max' => ceil( $rcMaxAge / ( 3600 * 24 ) ),
-   'help' => $context->msg( 'recentchangesdays-max' 
)->numParams(
-   ceil( $rcMaxAge / ( 3600 * 24 ) ) )->escaped()
-   ];
+
+
+
+   if (
+   // Only display this preferences if RCFilters is not 
enabled on Watchlist
+   !$user->getOption( 'rcenhancedfilters' ) ||
+   (
+   $config->get( 
'StructuredChangeFiltersShowPreference' ) &&
+   $user->getOption( 'rcenhancedfilters-disable' )
+   )
+   ) {
+   $defaultPreferences['rcdays'] = [
+   'type' => 'float',
+   'label-message' => 'recentchangesdays',
+   'section' => 'rc/displayrc',
+   'min' => 1,
+   'max' => ceil( $rcMaxAge / ( 3600 * 24 ) ),
+   'help' => $context->msg( 
'recentchangesdays-max' )->numParams(
+   ceil( $rcMaxAge / ( 3600 * 24 ) ) 
)->escaped()
+   ];
+   }
+
$defaultPreferences['rclimit'] = [
'type' => 'int',
'min' => 0,
@@ -932,6 +945,13 @@
'type' => 'api',
];
$defaultPreferences['rcfilters-wl-saved-queries'] = [
+   'type' => 'api',
+   ];
+   // Override preferences for RecentChanges 'days' and 'limit'
+   $defaultPreferences['rcfilters-days'] = [
+   'type' => 'api',
+   ];
+   $defaultPreferences['rcfilters-limit'] = [
'type' => 'api',
];
$defaultPreferences['rcfilters-saved-queries-versionbackup'] = [
@@ -1021,23 +1041,29 @@
];
}
 
-   $defaultPreferences['watchlistdays'] = [
-   'type' => 'float',
-   'min' => 0,
-   'max' => $watchlistdaysMax,
-   'section' => 'watchlist/displaywatchlist',
-   'help' => $context->msg( 'prefs-watchlist-days-max' 
)->numParams(
-   $watchlistdaysMax )->escaped(),
-   'label-message' => 'prefs-watchlist-days',
-   ];
-   $defaultPreferences['wllimit'] = [
-   'type' => 'int',
-   'min' => 0,
-   'max' => 1000,
-   'label-message' => 'prefs-watchlist-edits',
-   'help' => $context->msg( 'prefs-watchlist-edits-max' 
)->escaped(),
-   'section' => 'watchlist/displaywatchlist',
-   ];
+   if (
+   // Only display these preferences if RCFilters is not 
enabled on Watchlist
+   !$context->getUser()->getOption( 'rcenhancedfilters' )
+   ) {
+   $defaultPreferences['watch

[MediaWiki-commits] [Gerrit] mediawiki/core[master]: RCFilters: Remove excluded params from URL

2017-11-02 Thread Mooeypoo (Code Review)
Mooeypoo has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/388258 )

Change subject: RCFilters: Remove excluded params from URL
..

RCFilters: Remove excluded params from URL

This was gone unnoticed in the previous upgrade of the UriProcessor
but should be reimplemented: excluded parameters (sticky) should be
excluded from the URL. They should be merged into the uri values so
that their **values** are passing through, but the eventual result
of the URI query itself should not have them.

Change-Id: I06bf2f4da54297e2ec6962dcadb7a4924351cc35
---
M resources/src/mediawiki.rcfilters/mw.rcfilters.UriProcessor.js
1 file changed, 3 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/58/388258/1

diff --git a/resources/src/mediawiki.rcfilters/mw.rcfilters.UriProcessor.js 
b/resources/src/mediawiki.rcfilters/mw.rcfilters.UriProcessor.js
index 53557f6..0e20e3f 100644
--- a/resources/src/mediawiki.rcfilters/mw.rcfilters.UriProcessor.js
+++ b/resources/src/mediawiki.rcfilters/mw.rcfilters.UriProcessor.js
@@ -92,6 +92,9 @@
)
);
 
+   // Remove excluded params from the url
+   uri.query = this.filtersModel.removeExcludedParams( uri.query );
+
// Reapply unrecognized params and url version
uri.query = $.extend( true, {}, uri.query, unrecognizedParams, 
{ urlversion: '2' } );
 

-- 
To view, visit https://gerrit.wikimedia.org/r/388258
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I06bf2f4da54297e2ec6962dcadb7a4924351cc35
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Mooeypoo 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: RCFilters: Truncate saved query menu item

2017-10-19 Thread Mooeypoo (Code Review)
Mooeypoo has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/385227 )

Change subject: RCFilters: Truncate saved query menu item
..

RCFilters: Truncate saved query menu item

Bug: T178610
Change-Id: I787237beb2f08a01bd9c6885c75401bacfcc6f9b
---
M 
resources/src/mediawiki.rcfilters/styles/mw.rcfilters.ui.SavedLinksListItemWidget.less
1 file changed, 2 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/27/385227/1

diff --git 
a/resources/src/mediawiki.rcfilters/styles/mw.rcfilters.ui.SavedLinksListItemWidget.less
 
b/resources/src/mediawiki.rcfilters/styles/mw.rcfilters.ui.SavedLinksListItemWidget.less
index a6f3644..ddff630 100644
--- 
a/resources/src/mediawiki.rcfilters/styles/mw.rcfilters.ui.SavedLinksListItemWidget.less
+++ 
b/resources/src/mediawiki.rcfilters/styles/mw.rcfilters.ui.SavedLinksListItemWidget.less
@@ -46,6 +46,8 @@
cursor: pointer;
margin-left: 0.5px;
color: @colorProgressive;
+   white-space: nowrap;
+   text-overflow: ellipsis;
}
 
&-icon,

-- 
To view, visit https://gerrit.wikimedia.org/r/385227
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I787237beb2f08a01bd9c6885c75401bacfcc6f9b
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Mooeypoo 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: RCFilters: Actually toggle the collapsed class for toplinks

2017-10-19 Thread Mooeypoo (Code Review)
Mooeypoo has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/385222 )

Change subject: RCFilters: Actually toggle the collapsed class for toplinks
..

RCFilters: Actually toggle the collapsed class for toplinks

Bug: T178396
Change-Id: I2206816540342012296669f8dd24ab44762f4788
---
M resources/src/mediawiki.rcfilters/ui/mw.rcfilters.ui.RcTopSectionWidget.js
1 file changed, 1 insertion(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/22/385222/1

diff --git 
a/resources/src/mediawiki.rcfilters/ui/mw.rcfilters.ui.RcTopSectionWidget.js 
b/resources/src/mediawiki.rcfilters/ui/mw.rcfilters.ui.RcTopSectionWidget.js
index 2c99d3d..fce1cb7 100644
--- a/resources/src/mediawiki.rcfilters/ui/mw.rcfilters.ui.RcTopSectionWidget.js
+++ b/resources/src/mediawiki.rcfilters/ui/mw.rcfilters.ui.RcTopSectionWidget.js
@@ -108,5 +108,6 @@
} else {
this.$tableTopLinks.append( this.$topLinks );
}
+   this.$topLinks.toggleClass( 
'mw-recentchanges-toplinks-collapsed', state === 'collapsed' );
};
 }( mediaWiki ) );

-- 
To view, visit https://gerrit.wikimedia.org/r/385222
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I2206816540342012296669f8dd24ab44762f4788
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Mooeypoo 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: RCFilters: Fix RC jumpiness due to expanded/collapsed commun...

2017-10-13 Thread Mooeypoo (Code Review)
Mooeypoo has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/384189 )

Change subject: RCFilters: Fix RC jumpiness due to expanded/collapsed community 
links
..

RCFilters: Fix RC jumpiness due to expanded/collapsed community links

Bug: T177117
Change-Id: Ie0761613ff8c731226e26a78afa500aef9619d01
---
M includes/specials/SpecialRecentchanges.php
M resources/src/mediawiki.rcfilters/styles/mw.rcfilters.less
M 
resources/src/mediawiki.rcfilters/styles/mw.rcfilters.ui.RcTopSectionWidget.less
M resources/src/mediawiki.rcfilters/ui/mw.rcfilters.ui.RcTopSectionWidget.js
4 files changed, 32 insertions(+), 38 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/89/384189/1

diff --git a/includes/specials/SpecialRecentchanges.php 
b/includes/specials/SpecialRecentchanges.php
index 6ce1968..f8005e6 100644
--- a/includes/specials/SpecialRecentchanges.php
+++ b/includes/specials/SpecialRecentchanges.php
@@ -621,23 +621,26 @@
// Check whether the widget is already 
collapsed or expanded
$collapsedState = 
$this->getRequest()->getCookie( 'rcfilters-toplinks-collapsed-state' );
// Note that an empty/unset cookie means 
collapsed, so check for !== 'expanded'
-   $collapsedClass = $collapsedState !== 
'expanded' ? 'mw-rcfilters-toplinks-collapsed' : '';
+   $topLinksAttributes[ 'class' ] .= 
$collapsedState !== 'expanded' ? ' mw-recentchanges-toplinks-collapsed' : '';
 
-   $contentTitle = Html::rawElement( 'div',
-   [ 'class' => 
'mw-recentchanges-toplinks-title ' . $collapsedClass ],
-   $this->msg( 
'rcfilters-other-review-tools' )->parse()
-   );
+   $this->getOutput()->enableOOUI();
+   $contentTitle = new OOUI\ButtonWidget( [
+   'classes' => [ 
'mw-recentchanges-toplinks-title' ],
+   'label' => new OOUI\HtmlSnippet( 
$this->msg( 'rcfilters-other-review-tools' )->parse() ),
+   'framed' => false,
+   'indicator' => $collapsedState !== 
'expanded' ? 'down' : 'up',
+   'flags' => [ 'progressive' ],
+   ] );
+
$contentWrapper = Html::rawElement( 'div',
array_merge(
-   [
-   'class' => 
'mw-recentchanges-toplinks-content mw-collapsible-content ' .
-   $collapsedClass
-   ],
+   [ 'class' => 
'mw-recentchanges-toplinks-content mw-collapsible-content' ],
$langAttributes
),
$content
);
$content = $contentTitle . $contentWrapper;
+
} else {
// Language direction should be on the top div 
only
// if the title is not there. If it is there, 
it's
diff --git a/resources/src/mediawiki.rcfilters/styles/mw.rcfilters.less 
b/resources/src/mediawiki.rcfilters/styles/mw.rcfilters.less
index ba7a70e..7410f98 100644
--- a/resources/src/mediawiki.rcfilters/styles/mw.rcfilters.less
+++ b/resources/src/mediawiki.rcfilters/styles/mw.rcfilters.less
@@ -21,14 +21,24 @@
min-height: @rcfilters-wl-head-min-height;
}
 
-   body:not( .mw-rcfilters-ui-initialized ) {
-   
.mw-recentchanges-toplinks-content.mw-rcfilters-toplinks-collapsed {
-   display: none;
-   }
+   .mw-recentchanges-toplinks {
+   margin-bottom: 0.5em;
 
-   
.mw-recentchanges-toplinks-title.mw-rcfilters-toplinks-collapsed {
-   // Hide, but keep the placement so we don't jump
-   visibility: hidden;
+   &:not( .mw-recentchanges-toplinks-collapsed ) {
+   // Same as the legend
+   border: 1px solid #ddd;
+   }
+   }
+
+   body:not( .mw-rcfilters-ui-initialized ) {
+   .mw-recentchanges-toplinks.mw-recentchanges-toplinks-collapsed {
+   // Similar to the watchlist-details hack, we are going 
to make this float left
+   // while loading to prevent jumpiness in the min-height 
calculation
+

[MediaWiki-commits] [Gerrit] mediawiki/core[master]: RCFilters: Use GroupWidget for grouping buttons and aggregat...

2017-10-12 Thread Mooeypoo (Code Review)
Mooeypoo has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/383963 )

Change subject: RCFilters: Use GroupWidget for grouping buttons and aggregating 
events
..

RCFilters: Use GroupWidget for grouping buttons and aggregating events

Bug: T168849
Change-Id: I3d68121aa4b281751f6ea6cce2c68147855d6c68
---
M resources/Resources.php
M 
resources/src/mediawiki.rcfilters/styles/mw.rcfilters.ui.SavedLinksListItemWidget.less
M resources/src/mediawiki.rcfilters/styles/mw.rcfilters.ui.ViewSwitchWidget.less
A resources/src/mediawiki.rcfilters/ui/mw.rcfilters.ui.GroupWidget.js
M resources/src/mediawiki.rcfilters/ui/mw.rcfilters.ui.SavedLinksListWidget.js
M resources/src/mediawiki.rcfilters/ui/mw.rcfilters.ui.ViewSwitchWidget.js
6 files changed, 55 insertions(+), 17 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/63/383963/1

diff --git a/resources/Resources.php b/resources/Resources.php
index 4df8194..06012b8 100644
--- a/resources/Resources.php
+++ b/resources/Resources.php
@@ -1786,6 +1786,7 @@
],
'mediawiki.rcfilters.filters.ui' => [
'scripts' => [
+   
'resources/src/mediawiki.rcfilters/ui/mw.rcfilters.ui.GroupWidget.js',

'resources/src/mediawiki.rcfilters/ui/mw.rcfilters.ui.CheckboxInputWidget.js',

'resources/src/mediawiki.rcfilters/ui/mw.rcfilters.ui.FilterTagMultiselectWidget.js',

'resources/src/mediawiki.rcfilters/ui/mw.rcfilters.ui.ItemMenuOptionWidget.js',
diff --git 
a/resources/src/mediawiki.rcfilters/styles/mw.rcfilters.ui.SavedLinksListItemWidget.less
 
b/resources/src/mediawiki.rcfilters/styles/mw.rcfilters.ui.SavedLinksListItemWidget.less
index 9dccc24..6a20f56 100644
--- 
a/resources/src/mediawiki.rcfilters/styles/mw.rcfilters.ui.SavedLinksListItemWidget.less
+++ 
b/resources/src/mediawiki.rcfilters/styles/mw.rcfilters.ui.SavedLinksListItemWidget.less
@@ -22,6 +22,7 @@
min-width: 16px;
min-height: 16px;
opacity: 0.5;
+   position: relative;
}
 
&-icon span {
diff --git 
a/resources/src/mediawiki.rcfilters/styles/mw.rcfilters.ui.ViewSwitchWidget.less
 
b/resources/src/mediawiki.rcfilters/styles/mw.rcfilters.ui.ViewSwitchWidget.less
index a6ce4cd..1896103 100644
--- 
a/resources/src/mediawiki.rcfilters/styles/mw.rcfilters.ui.ViewSwitchWidget.less
+++ 
b/resources/src/mediawiki.rcfilters/styles/mw.rcfilters.ui.ViewSwitchWidget.less
@@ -6,9 +6,5 @@
 
&-buttons {
margin-top: 0.5em;
-
-   .oo-ui-buttonWidget:not( :first-child ) {
-   margin-left: 0.5em;
-   }
}
 }
diff --git 
a/resources/src/mediawiki.rcfilters/ui/mw.rcfilters.ui.GroupWidget.js 
b/resources/src/mediawiki.rcfilters/ui/mw.rcfilters.ui.GroupWidget.js
new file mode 100644
index 000..167df09
--- /dev/null
+++ b/resources/src/mediawiki.rcfilters/ui/mw.rcfilters.ui.GroupWidget.js
@@ -0,0 +1,41 @@
+( function ( mw ) {
+   /**
+* A group widget to allow for aggregation of events
+*
+* @extends OO.ui.Widget
+*
+* @constructor
+* @param {Object} [config] Configuration object
+* @param {Object} [events] Events to aggregate. The object represent 
the
+*  event name to aggregate and the event value to emit on aggregate 
for items.
+*/
+   mw.rcfilters.ui.GroupWidget = function MwRcfiltersUiViewSwitchWidget( 
config ) {
+   var aggregate = {};
+
+   config = config || {};
+
+   // Parent constructor
+   mw.rcfilters.ui.GroupWidget.parent.call( this, config );
+
+   // Mixin constructors
+   OO.ui.mixin.GroupElement.call( this, $.extend( {}, config, { 
$group: this.$element } ) );
+
+   if ( config.events ) {
+   // Aggregate events
+   $.each( config.events, function ( eventName, eventEmit 
) {
+   aggregate[ eventName ] = eventEmit;
+   } );
+
+   this.aggregate( aggregate );
+   }
+
+   if ( Array.isArray( config.items ) ) {
+   this.addItems( config.items );
+   }
+   };
+
+   /* Initialize */
+
+   OO.inheritClass( mw.rcfilters.ui.GroupWidget, OO.ui.Widget );
+   OO.mixinClass( mw.rcfilters.ui.GroupWidget, OO.ui.mixin.GroupWidget );
+}( mediaWiki ) );
diff --git 
a/resources/src/mediawiki.rcfilters/ui/mw.rcfilters.ui.SavedLinksListWidget.js 
b/resources/src/mediawiki.rcfilters/ui/mw.rcfilters.ui.SavedLinksListWidget.js
index 7eda90a..8287ef9 100644
--- 
a/resources/src/mediawiki.rcfilters/ui/mw.rcfilters.ui.SavedLinksListWidget.js
+++ 
b/resources/src/mediawiki.rcfilters/ui/mw.rcfilters.ui.SavedLinksListWidget.

[MediaWiki-commits] [Gerrit] mediawiki/core[master]: [poc] RCFilters: Enable a batched update operation

2017-10-12 Thread Mooeypoo (Code Review)
Mooeypoo has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/383956 )

Change subject: [poc] RCFilters: Enable a batched update operation
..

[poc] RCFilters: Enable a batched update operation

Mainly relevant for the filter multiselect and updating of the results
to prevent recomputation or repeated fetching unnecessarily.

Bug: T178042
Change-Id: I1f1c1fc5a5b722d99a0539f47631c71c5ce0e811
---
M resources/src/mediawiki.rcfilters/dm/mw.rcfilters.dm.FiltersViewModel.js
M resources/src/mediawiki.rcfilters/mw.rcfilters.Controller.js
M 
resources/src/mediawiki.rcfilters/ui/mw.rcfilters.ui.FilterTagMultiselectWidget.js
3 files changed, 62 insertions(+), 18 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/56/383956/1

diff --git 
a/resources/src/mediawiki.rcfilters/dm/mw.rcfilters.dm.FiltersViewModel.js 
b/resources/src/mediawiki.rcfilters/dm/mw.rcfilters.dm.FiltersViewModel.js
index 0d65466..2d53d03 100644
--- a/resources/src/mediawiki.rcfilters/dm/mw.rcfilters.dm.FiltersViewModel.js
+++ b/resources/src/mediawiki.rcfilters/dm/mw.rcfilters.dm.FiltersViewModel.js
@@ -828,11 +828,29 @@
 * This is equivalent to display all.
 */
mw.rcfilters.dm.FiltersViewModel.prototype.emptyAllFilters = function 
() {
+   var changed = [];
+
this.getItems().forEach( function ( filterItem ) {
if ( !filterItem.getGroupModel().isSticky() ) {
+   if ( filterItem.isSelected() ) {
+   changed.push( filterItem.getName() );
+   }
+
this.toggleFilterSelected( 
filterItem.getName(), false );
}
}.bind( this ) );
+
+   this.finishItemsUpdate( changed );
+   };
+
+   /**
+* Finish an item update operation for batching updates
+*
+* @param  {string[]} itemNames Names of the items that were updated
+* @fires filtersUpdated
+*/
+   mw.rcfilters.dm.FiltersViewModel.prototype.finishItemsUpdate = function 
( itemNames ) {
+   this.emit( 'filtersUpdated', itemNames );
};
 
/**
@@ -847,6 +865,8 @@
if ( item ) {
item.toggleSelected( isSelected );
}
+
+   this.finishItemsUpdate( [ name ] );
};
 
/**
@@ -858,6 +878,8 @@
Object.keys( filterDef ).forEach( function ( name ) {
this.toggleFilterSelected( name, filterDef[ name ] );
}.bind( this ) );
+
+   this.finishItemsUpdate( Object.keys( filterDef ) );
};
 
/**
@@ -1066,12 +1088,18 @@
// HACK make sure highlights are disabled globally 
while we toggle on the items,
// otherwise we'll call clearHighlight() and 
applyHighlight() many many times
this.highlightEnabled = false;
-   this.getItems().forEach( function ( filterItem ) {
+   this.getItemsSupportingHighlights().forEach( function ( 
filterItem ) {
filterItem.toggleHighlight( enable );
} );
 
this.highlightEnabled = enable;
this.emit( 'highlightChange', this.highlightEnabled );
+
+   this.finishItemsUpdate(
+   this.getItemsSupportingHighlights().map( 
function ( filterItem ) {
+   return filterItem.getName();
+   } )
+   );
}
};
 
@@ -1110,6 +1138,7 @@
 */
mw.rcfilters.dm.FiltersViewModel.prototype.setHighlightColor = function 
( filterName, color ) {
this.getItemByName( filterName ).setHighlightColor( color );
+   this.finishItemsUpdate( [ filterName ] );
};
 
/**
@@ -1119,15 +1148,23 @@
 */
mw.rcfilters.dm.FiltersViewModel.prototype.clearHighlightColor = 
function ( filterName ) {
this.getItemByName( filterName ).clearHighlightColor();
+   this.finishItemsUpdate( [ filterName ] );
};
 
/**
 * Clear highlight for all filter items
 */
mw.rcfilters.dm.FiltersViewModel.prototype.clearAllHighlightColors = 
function () {
-   this.getItems().forEach( function ( filterItem ) {
+   var changed = [];
+
+   this.getItemsSupportingHighlights().forEach( function ( 
filterItem ) {
+   if ( filterItem.getHighlightColor() ) {
+   changed.push( filterItem.getName() );
+   }
filterItem.clearHighlightColor();
  

[MediaWiki-commits] [Gerrit] mediawiki/core[master]: RCFilters: Don't reload the list if the change was highlight...

2017-10-12 Thread Mooeypoo (Code Review)
Mooeypoo has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/383893 )

Change subject: RCFilters: Don't reload the list if the change was 
highlights-only
..

RCFilters: Don't reload the list if the change was highlights-only

Bug: T164131
Change-Id: I9952467d0acef84a6445d970977c1265a3ebff95
---
M resources/src/mediawiki.rcfilters/mw.rcfilters.Controller.js
1 file changed, 28 insertions(+), 7 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/93/383893/1

diff --git a/resources/src/mediawiki.rcfilters/mw.rcfilters.Controller.js 
b/resources/src/mediawiki.rcfilters/mw.rcfilters.Controller.js
index a65bbb9..331b047 100644
--- a/resources/src/mediawiki.rcfilters/mw.rcfilters.Controller.js
+++ b/resources/src/mediawiki.rcfilters/mw.rcfilters.Controller.js
@@ -369,9 +369,17 @@
 * Reset to default filters
 */
mw.rcfilters.Controller.prototype.resetToDefaults = function () {
+   var newFilterState,
+   currFilterState = this.filtersModel.getSelectedState();
+
this.filtersModel.updateStateFromParams( 
this._getDefaultParams() );
 
-   this.updateChangesList();
+   newFilterState = this.filtersModel.getSelectedState();
+
+   if ( !OO.compare( currFilterState, newFilterState ) ) {
+   // Only update the changes list if there was a change 
to actual filters
+   this.updateChangesList();
+   }
};
 
/**
@@ -387,13 +395,20 @@
 * Empty all selected filters
 */
mw.rcfilters.Controller.prototype.emptyFilters = function () {
-   var highlightedFilterNames = this.filtersModel
+   var newFilterState,
+   highlightedFilterNames = this.filtersModel
.getHighlightedItems()
-   .map( function ( filterItem ) { return { name: 
filterItem.getName() }; } );
+   .map( function ( filterItem ) { return { name: 
filterItem.getName() }; } ),
+   currFilterState = this.filtersModel.getSelectedState();
 
this.filtersModel.updateStateFromParams( {} );
 
-   this.updateChangesList();
+   newFilterState = this.filtersModel.getSelectedState();
+
+   if ( !OO.compare( currFilterState, newFilterState ) ) {
+   // Only update the changes list if there was a change 
to actual filters
+   this.updateChangesList();
+   }
 
if ( highlightedFilterNames ) {
this._trackHighlight( 'clearAll', 
highlightedFilterNames );
@@ -655,7 +670,7 @@
 * @param {string} queryID Query id
 */
mw.rcfilters.Controller.prototype.applySavedQuery = function ( queryID 
) {
-   var currentMatchingQuery,
+   var currentMatchingQuery, currParamState, newParamState,
params = this.savedQueriesModel.getItemParams( queryID 
);
 
currentMatchingQuery = this.findQueryMatchingCurrentState();
@@ -669,11 +684,17 @@
return;
}
 
+   currFilterState = this.filtersModel.getSelectedState();
+
// Apply parameters to model
this.filtersModel.updateStateFromParams( params );
 
-   // Update changes list
-   this.updateChangesList();
+   newFilterState = this.filtersModel.getSelectedState();
+
+   if ( !OO.compare( currFilterState, newFilterState ) ) {
+   // Update changes list, only if there was a difference 
in filter selection
+   this.updateChangesList();
+   }
 
// Log filter grouping
this.trackFilterGroupings( 'savedfilters' );

-- 
To view, visit https://gerrit.wikimedia.org/r/383893
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I9952467d0acef84a6445d970977c1265a3ebff95
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Mooeypoo 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: RCFilters: Don't reload when removing highlighted item

2017-10-11 Thread Mooeypoo (Code Review)
Mooeypoo has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/383738 )

Change subject: RCFilters: Don't reload when removing highlighted item
..

RCFilters: Don't reload when removing highlighted item

Bug: T164131
Change-Id: I1f50276a60b8aae3034409664dd77f6ba1d5d87c
---
M resources/src/mediawiki.rcfilters/mw.rcfilters.Controller.js
1 file changed, 11 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/38/383738/1

diff --git a/resources/src/mediawiki.rcfilters/mw.rcfilters.Controller.js 
b/resources/src/mediawiki.rcfilters/mw.rcfilters.Controller.js
index 6da8119..f74dc3b 100644
--- a/resources/src/mediawiki.rcfilters/mw.rcfilters.Controller.js
+++ b/resources/src/mediawiki.rcfilters/mw.rcfilters.Controller.js
@@ -452,12 +452,20 @@
 */
mw.rcfilters.Controller.prototype.clearFilter = function ( filterName ) 
{
var filterItem = this.filtersModel.getItemByName( filterName ),
-   isHighlighted = filterItem.isHighlighted();
+   isHighlighted = filterItem.isHighlighted(),
+   isSelected = filterItem.isSelected();
 
-   if ( filterItem.isSelected() || isHighlighted ) {
+   if ( isSelected || isHighlighted ) {
this.filtersModel.clearHighlightColor( filterName );
this.filtersModel.toggleFilterSelected( filterName, 
false );
-   this.updateChangesList();
+
+   if ( isSelected ) {
+   // Only update the changes list if the filter 
changed
+   // its selection state. If it only changed its 
highlight
+   // then don't reload
+   this.updateChangesList();
+   }
+
this.filtersModel.reassessFilterInteractions( 
filterItem );
 
// Log filter grouping

-- 
To view, visit https://gerrit.wikimedia.org/r/383738
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I1f50276a60b8aae3034409664dd77f6ba1d5d87c
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Mooeypoo 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: [wip] RCFilters: Move parameter operations to ViewModel

2017-10-03 Thread Mooeypoo (Code Review)
Mooeypoo has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/382092 )

Change subject: [wip] RCFilters: Move parameter operations to ViewModel
..

[wip] RCFilters: Move parameter operations to ViewModel

Change-Id: Icec513c94630314e7873f9ffe27779cd39150713
---
M resources/src/mediawiki.rcfilters/dm/mw.rcfilters.dm.FiltersViewModel.js
M resources/src/mediawiki.rcfilters/mw.rcfilters.UriProcessor.js
2 files changed, 115 insertions(+), 107 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/92/382092/1

diff --git 
a/resources/src/mediawiki.rcfilters/dm/mw.rcfilters.dm.FiltersViewModel.js 
b/resources/src/mediawiki.rcfilters/dm/mw.rcfilters.dm.FiltersViewModel.js
index 62627e6..f9b6bfa 100644
--- a/resources/src/mediawiki.rcfilters/dm/mw.rcfilters.dm.FiltersViewModel.js
+++ b/resources/src/mediawiki.rcfilters/dm/mw.rcfilters.dm.FiltersViewModel.js
@@ -18,6 +18,7 @@
this.highlightEnabled = false;
this.invertedNamespaces = false;
this.parameterMap = {};
+   this.emptyParameterState = null;
 
this.views = {};
this.currentView = 'default';
@@ -415,6 +416,95 @@
};
 
/**
+* Update filter view model state based on a parameter object
+*
+* @param {Object} params Parameters object
+*/
+   mw.rcfilters.dm.FiltersViewModel.prototype.updateStateFromParams = 
function ( params ) {
+   // For arbitrary numeric single_option values, check the uri 
and see if it's beyond the limit
+   $.each( this.filtersModel.getFilterGroups(), function ( 
groupName, groupModel ) {
+   if (
+   groupModel.getType() === 'single_option' &&
+   groupModel.isAllowArbitrary()
+   ) {
+   if (
+   groupModel.getMaxValue() !== null &&
+   params[ groupName ] > 
groupModel.getMaxValue()
+   ) {
+   // Change the value to the actual max 
value
+   uriQuery[ groupName ] = String( 
groupModel.getMaxValue() );
+   } else if (
+   groupModel.getMinValue() !== null &&
+   params[ groupName ] < 
groupModel.getMinValue()
+   ) {
+   // Change the value to the actual min 
value
+   params[ groupName ] = String( 
groupModel.getMinValue() );
+   }
+   }
+   } );
+
+   // Update filter states
+   this.filtersModel.toggleFiltersSelected(
+   this.filtersModel.getFiltersFromParameters(
+   parameters
+   )
+   );
+
+   this.filtersModel.toggleInvertedNamespaces( !!Number( 
parameters.invert ) );
+
+   // Update highlight state
+   this.filtersModel.getItems().forEach( function ( filterItem ) {
+   var color = parameters[ filterItem.getName() + '_color' 
];
+   if ( color ) {
+   filterItem.setHighlightColor( color );
+   } else {
+   filterItem.clearHighlightColor();
+   }
+   } );
+   this.filtersModel.toggleHighlight( !!Number( 
parameters.highlight ) );
+
+   // Check all filter interactions
+   this.filtersModel.reassessFilterInteractions();
+   };
+
+   /**
+* Get a representation of an empty (falsey) parameter state
+*
+* @return {Object} Empty parameter state
+*/
+   mw.rcfilters.UriProcessor.prototype.getEmptyParameterState = function 
() {
+   if ( !this.emptyParameterState ) {
+   this.emptyParameterState = $.extend(
+   true,
+   {},
+   this.getParametersFromFilters( {} ),
+   this.getHighlightParameters(),
+   { highlight: '0', invert: '0' }
+   );
+   }
+
+   return this.emptyParameterState;
+   };
+
+   /**
+* Get a parameter representation of the current state of the model
+*
+* @return {Object} Parameter representation of the current state of 
the model
+*/
+   mw.rcfilters.UriProcessor.prototype.getCurrentParameterState = function 
() {
+   return $.extend(
+   true

[MediaWiki-commits] [Gerrit] mediawiki/core[master]: RCFilters: Start the toplinks collapsed/expanded by cookie v...

2017-09-21 Thread Mooeypoo (Code Review)
Mooeypoo has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/379689 )

Change subject: RCFilters: Start the toplinks collapsed/expanded by cookie value
..

RCFilters: Start the toplinks collapsed/expanded by cookie value

Prevent "jumping" of the content by initializing the top links already
collapsed or expanded depending on the cookie value.

Bug: T176380
Change-Id: I6c494b42ec6f029b60182607faa37feba062b597
---
M includes/specials/SpecialRecentchanges.php
M resources/src/mediawiki.rcfilters/mw.rcfilters.init.js
M resources/src/mediawiki.rcfilters/styles/mw.rcfilters.less
3 files changed, 25 insertions(+), 8 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/89/379689/1

diff --git a/includes/specials/SpecialRecentchanges.php 
b/includes/specials/SpecialRecentchanges.php
index 40834cb..886c6ea 100644
--- a/includes/specials/SpecialRecentchanges.php
+++ b/includes/specials/SpecialRecentchanges.php
@@ -656,12 +656,16 @@
$topLinksAttributes = [ 'class' => 
'mw-recentchanges-toplinks' ];
 
if ( $this->isStructuredFilterUiEnabled() ) {
+   // Check whether the widget is already 
collapsed or expanded
+   $collapsedState = 
$this->getRequest()->getCookie( 'rcfilters-toplinks-collapsed-state' );
+   $collapsedClass = $collapsedState === 
'collapsed' ? 'mw-rcfilters-toplinks-collapsed' : '';
+
$contentTitle = Html::rawElement( 'div',
-   [ 'class' => 
'mw-recentchanges-toplinks-title' ],
+   [ 'class' => 
'mw-recentchanges-toplinks-title ' . $collapsedClass ],
$this->msg( 
'rcfilters-other-review-tools' )->parse()
);
$contentWrapper = Html::rawElement( 'div',
-   array_merge( [ 'class' => 
'mw-collapsible-content' ], $langAttributes ),
+   array_merge( [ 'class' => 
'mw-recentchanges-toplinks-content mw-collapsible-content ' . $collapsedClass 
], $langAttributes ),
$content
);
$content = $contentTitle . $contentWrapper;
diff --git a/resources/src/mediawiki.rcfilters/mw.rcfilters.init.js 
b/resources/src/mediawiki.rcfilters/mw.rcfilters.init.js
index 5ab32ea..560241b 100644
--- a/resources/src/mediawiki.rcfilters/mw.rcfilters.init.js
+++ b/resources/src/mediawiki.rcfilters/mw.rcfilters.init.js
@@ -32,7 +32,7 @@
currentPage = mw.config.get( 
'wgCanonicalNamespace' ) +
':' +
mw.config.get( 
'wgCanonicalSpecialPageName' );
-
+debugger;
// TODO: The changesListWrapperWidget should be able to 
initialize
// after the model is ready.
// eslint-disable-next-line no-new
diff --git a/resources/src/mediawiki.rcfilters/styles/mw.rcfilters.less 
b/resources/src/mediawiki.rcfilters/styles/mw.rcfilters.less
index 80aff74..ba7a70e 100644
--- a/resources/src/mediawiki.rcfilters/styles/mw.rcfilters.less
+++ b/resources/src/mediawiki.rcfilters/styles/mw.rcfilters.less
@@ -15,18 +15,31 @@
.rcfilters-head {
min-height: @rcfilters-head-min-height;
}
+
// On the watchlist, reserve a bit more
.mw-special-Watchlist .rcfilters-head {
min-height: @rcfilters-wl-head-min-height;
}
 
-   body:not( .mw-rcfilters-ui-initialized ) .rcfilters-head {
-   opacity: 0.5;
-   pointer-events: none;
-
-   .cloptions {
+   body:not( .mw-rcfilters-ui-initialized ) {
+   
.mw-recentchanges-toplinks-content.mw-rcfilters-toplinks-collapsed {
display: none;
}
+
+   
.mw-recentchanges-toplinks-title.mw-rcfilters-toplinks-collapsed {
+   // Hide, but keep the placement so we don't jump
+   visibility: hidden;
+   }
+
+   .rcfilters-head {
+   opacity: 0.5;
+   pointer-events: none;
+
+   .cloptions {
+   display: none;
+   }
+
+   }
}
 
.rcfilters-container {

-- 
To view, visit https://gerrit.wikimedia.org/r/379689
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I6c494b42ec6f029b60182607faa37feba062b597
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Mooeypoo 

__

[MediaWiki-commits] [Gerrit] mediawiki...WikimediaMessages[master]: RCFilters: Add 'learn more' link to guided tour introducing ...

2017-09-20 Thread Mooeypoo (Code Review)
Mooeypoo has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/379448 )

Change subject: RCFilters: Add 'learn more' link to guided tour introducing 
rcfilters
..

RCFilters: Add 'learn more' link to guided tour introducing rcfilters

Bug: T169613
Change-Id: I2dd93ef7080a7058f8733f444f26792bdb59a53d
---
M WikimediaMessages.hooks.php
M i18n/wikimedia/en.json
M i18n/wikimedia/qqq.json
M modules/rcfilters-intro-tour.js
M modules/rcfilters-intro-tour.less
5 files changed, 24 insertions(+), 7 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/WikimediaMessages 
refs/changes/48/379448/1

diff --git a/WikimediaMessages.hooks.php b/WikimediaMessages.hooks.php
index c0392fa..d7f3c82 100644
--- a/WikimediaMessages.hooks.php
+++ b/WikimediaMessages.hooks.php
@@ -1363,6 +1363,7 @@
'messages' => [

'eri-rcfilters-tour-intro-welcome-title',

'eri-rcfilters-tour-intro-welcome-description',
+   'eri-rcfilters-tour-help',

'eri-rcfilters-tour-intro-welcome-no-ores-description',

'eri-rcfilters-tour-intro-preferences-description',

'eri-rcfilters-tour-intro-welcome-button',
diff --git a/i18n/wikimedia/en.json b/i18n/wikimedia/en.json
index 4a00e8e..d8b48f1 100644
--- a/i18n/wikimedia/en.json
+++ b/i18n/wikimedia/en.json
@@ -289,8 +289,9 @@
"eri-rcfilters-tour-welcome-no-ores-description": "Review edits using 
an easier and more powerful interface, additional filters, user-defined 
highlighting and other improvements.",
"eri-rcfilters-tour-welcome-button": "OK, got it",
"eri-rcfilters-tour-intro-welcome-title": "Welcome to improved Recent 
Changes filtering",
-   "eri-rcfilters-tour-intro-welcome-description": "Review edits more 
efficiently using improved tools, a new interface and the power of machine 
learning.",
-   "eri-rcfilters-tour-intro-welcome-no-ores-description": "Review edits 
more efficiently using new filters, a more powerful interface, user-defined 
highlighting and and other improvements.",
+   "eri-rcfilters-tour-intro-welcome-description": "Review edits more 
efficiently using improved tools, a new interface and the power of machine 
learning. $1",
+   "eri-rcfilters-tour-intro-welcome-no-ores-description": "Review edits 
more efficiently using new filters, a more powerful interface, user-defined 
highlighting and and other improvements. $1",
+   "eri-rcfilters-tour-help": "Learn more",
"eri-rcfilters-tour-intro-preferences-description": "Access your 
preferences any time to disable the improved version of Recent Changes.",
"eri-rcfilters-tour-intro-welcome-button": "OK, got it",
"eri-rcfilters-tour-highlight-title": "Color code your results",
diff --git a/i18n/wikimedia/qqq.json b/i18n/wikimedia/qqq.json
index a8843db..03e14c0 100644
--- a/i18n/wikimedia/qqq.json
+++ b/i18n/wikimedia/qqq.json
@@ -318,8 +318,9 @@
"eri-rcfilters-tour-welcome-no-ores-description": "Description of the 
first step of the guided tour introducing the RC filters beta feature, if 
machine learning tools are not available on the wiki.",
"eri-rcfilters-tour-welcome-button": "Text of the button to close the 
RC filters beta feature guided tour.",
"eri-rcfilters-tour-intro-welcome-title": "Title of the first step of 
the guided tour introducing the new Recent Changes filtering features.",
-   "eri-rcfilters-tour-intro-welcome-description": "Description of the 
first step of the guided tour introducing the new Recent Changes filtering 
features, if machine learning tools are available on this wiki.",
-   "eri-rcfilters-tour-intro-welcome-no-ores-description": "Description of 
the first step of the guided tour introducing the new Recent Changes filtering 
features, if machine learning tools are not available on the wiki.",
+   "eri-rcfilters-tour-intro-welcome-description": "Description of the 
first step of the guided tour introducing the new Recent Changes filtering 
features, if machine learning tools are available on this 
wiki.\n\nParameters:\n$1 - Link to the Enhanced Filters help page",
+   "eri-rcfilters-tour-intro-welcome-no-ores-description": "Description of 
the first step of the guided tour introducing the new Recent Changes filtering 
features, if machine learning tools are not available on the 
wiki.\n\nParameters:\n$1 - Link to the Enhanced Filters help page",
+   "eri-rcfilters-tour-help": "Title for the link to the help page of 
enanced filters in the guided tour introducing the new Recent Changes filtering 
features",
"eri-rcfilters-tour-intro-preferences-description": "Description for 
the second step of the guided tour int

[MediaWiki-commits] [Gerrit] mediawiki/core[master]: [experimental] RCFilters: Toggle the entire interface and la...

2017-09-20 Thread Mooeypoo (Code Review)
Mooeypoo has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/379273 )

Change subject: [experimental] RCFilters: Toggle the entire interface and 
lazy-load
..

[experimental] RCFilters: Toggle the entire interface and lazy-load

Allow users to hide the interface, and lazy-load it next time they
refresh the page in case they want to open it.

** This is a proposal only! DO NOT MERGE **

Change-Id: If1951844ce036ed812452e89051597ff7faebbc2
---
M includes/Preferences.php
M includes/specialpage/ChangesListSpecialPage.php
M languages/i18n/en.json
M languages/i18n/qqq.json
M resources/Resources.php
A resources/src/mediawiki.rcfilters/mw.rcfilters.lazy.js
A resources/src/mediawiki.rcfilters/styles/mw.rcfilters.lazy.less
M resources/src/mediawiki.rcfilters/ui/mw.rcfilters.ui.FilterWrapperWidget.js
8 files changed, 101 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/73/379273/1

diff --git a/includes/Preferences.php b/includes/Preferences.php
index a7e6684..c0c058c 100644
--- a/includes/Preferences.php
+++ b/includes/Preferences.php
@@ -938,6 +938,9 @@
$defaultPreferences['rcfilters-rclimit'] = [
'type' => 'api',
];
+   $defaultPreferences['rcfilters-expand-ui'] = [
+   'type' => 'api',
+   ];
 
if ( $config->get( 'RCWatchCategoryMembership' ) ) {
$defaultPreferences['hidecategorization'] = [
diff --git a/includes/specialpage/ChangesListSpecialPage.php 
b/includes/specialpage/ChangesListSpecialPage.php
index 98b7aa1..c65c41e 100644
--- a/includes/specialpage/ChangesListSpecialPage.php
+++ b/includes/specialpage/ChangesListSpecialPage.php
@@ -1422,8 +1422,14 @@
$out->addModules( 'mediawiki.special.changeslist.legend.js' );
 
if ( $this->isStructuredFilterUiEnabled() ) {
-   $out->addModules( 'mediawiki.rcfilters.filters.ui' );
-   $out->addModuleStyles( 
'mediawiki.rcfilters.filters.base.styles' );
+   if ( $this->getUser()->getBoolOption( 
'rcfilters-expand-ui' ) ) {
+   $out->addModules( 
'mediawiki.rcfilters.filters.ui' );
+   $out->addModuleStyles( 
'mediawiki.rcfilters.filters.base.styles' );
+   } else {
+   $out->addModules( 
'mediawiki.rcfilters.filters.lazy' );
+   $out->addModuleStyles( 
'mediawiki.rcfilters.filters.base.styles.lazy' );
+   $out->addBodyClasses( 'rcfilters-lazyload' );
+   }
}
}
 
diff --git a/languages/i18n/en.json b/languages/i18n/en.json
index 47e6205..010161e 100644
--- a/languages/i18n/en.json
+++ b/languages/i18n/en.json
@@ -1353,6 +1353,8 @@
"recentchanges-legend-unpatrolled": 
"{{int:recentchanges-label-unpatrolled}}",
"recentchanges-legend-plusminus": "(±123)",
"recentchanges-submit": "Show",
+   "rcfilters-open-interface": "Show advanced filters interface",
+   "rcfilters-hide-interface": "Hide interface",
"rcfilters-tag-remove": "Remove '$1'",
"rcfilters-legend-heading": "List of abbreviations:",
"rcfilters-other-review-tools": "Other review tools",
diff --git a/languages/i18n/qqq.json b/languages/i18n/qqq.json
index 0a6e91b..230d169 100644
--- a/languages/i18n/qqq.json
+++ b/languages/i18n/qqq.json
@@ -1545,6 +1545,8 @@
"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-open-interface": "Text for a link to show advanced filters 
interface on [[Special:RecentChanges]] and [[Special:Watchlist]]",
+   "rcfilters-hide-interface": "Text for a button to hide advanced filters 
interface on [[Special:RecentChanges]] and [[Special:Watchlist]]",
"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.",
diff --git a/resources/Resources.php b/resources/Resources.php
index 818112f..4e0892e 100644
--- a/resources/Resources.php

[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Revert "Tweak UI for main filtering entry point"

2017-09-18 Thread Mooeypoo (Code Review)
Hello Jack Phoenix, TTO, Petar.petkovic, jenkins-bot, Siebrand,

I'd like you to do a code review.  Please visit

https://gerrit.wikimedia.org/r/378797

to review the following change.


Change subject: Revert "Tweak UI for main filtering entry point"
..

Revert "Tweak UI for main filtering entry point"

This reverts commit feefb51581574f3144786d7f935f34ccc947efed.

Change-Id: I37dcaf5cd0c0fa63a53da06f06827731fb87de20
---
M languages/i18n/en.json
M resources/Resources.php
M resources/src/mediawiki.rcfilters/styles/mw.rcfilters.mixins.less
M 
resources/src/mediawiki.rcfilters/styles/mw.rcfilters.ui.FilterTagMultiselectWidget.less
M 
resources/src/mediawiki.rcfilters/ui/mw.rcfilters.ui.FilterTagMultiselectWidget.js
5 files changed, 5 insertions(+), 44 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/97/378797/1

diff --git a/languages/i18n/en.json b/languages/i18n/en.json
index a3560d9..75e0c5c 100644
--- a/languages/i18n/en.json
+++ b/languages/i18n/en.json
@@ -1383,7 +1383,7 @@
"rcfilters-restore-default-filters": "Restore default filters",
"rcfilters-clear-all-filters": "Clear all filters",
"rcfilters-show-new-changes": "View newest changes",
-   "rcfilters-search-placeholder": "Main filter menu",
+   "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.",
"rcfilters-filterlist-title": "Filters",
diff --git a/resources/Resources.php b/resources/Resources.php
index ae8436a..246d9f3 100644
--- a/resources/Resources.php
+++ b/resources/Resources.php
@@ -1928,7 +1928,7 @@
'oojs-ui.styles.icons-editing-styling',
'oojs-ui.styles.icons-interactions',
'oojs-ui.styles.icons-content',
-   'oojs-ui.styles.icons-interactions',
+   'oojs-ui.styles.icons-layout',
'oojs-ui.styles.icons-media',
],
],
diff --git a/resources/src/mediawiki.rcfilters/styles/mw.rcfilters.mixins.less 
b/resources/src/mediawiki.rcfilters/styles/mw.rcfilters.mixins.less
index a6b219b..b4e3b0e 100644
--- a/resources/src/mediawiki.rcfilters/styles/mw.rcfilters.mixins.less
+++ b/resources/src/mediawiki.rcfilters/styles/mw.rcfilters.mixins.less
@@ -85,35 +85,3 @@
.highlight-changesListWrapperWidget( tint( mix( @@c1var, mix( 
@@c2var, average( @@c3var, @@c4var ), 25% ), 25% ), 25% ) );
}
 }
-
-.input-placeholder-color( @color, @font-weight: bold ) {
-   /* stylelint-disable selector-no-vendor-prefix */
-   &::-webkit-input-placeholder { /* WebKit, Blink */
-   color: @color;
-   font-weight: @font-weight;
-   }
-   &:-moz-placeholder { /* Mozilla Firefox 4 to 18 */
-   color: @color;
-   opacity: 1; //  Firefox's placeholder defaults with a reduced 
opacity
-   font-weight: @font-weight;
-   }
-   &::-moz-placeholder { /* Mozilla Firefox 19+ */
-   color: @color;
-   opacity: 1;
-   font-weight: @font-weight;
-   }
-   &:-ms-input-placeholder { /* Internet Explorer 10-11 */
-   color: @color;
-   font-weight: @font-weight;
-   }
-   &::-ms-input-placeholder { /* Microsoft Edge */
-   color: @color;
-   font-weight: @font-weight;
-   }
-   /* stylelint-enable */
-   &::placeholder {
-   color: @color;
-   opacity: 1;
-   font-weight: @font-weight;
-   }
-}
diff --git 
a/resources/src/mediawiki.rcfilters/styles/mw.rcfilters.ui.FilterTagMultiselectWidget.less
 
b/resources/src/mediawiki.rcfilters/styles/mw.rcfilters.ui.FilterTagMultiselectWidget.less
index 7e7b9c3..e7233a8 100644
--- 
a/resources/src/mediawiki.rcfilters/styles/mw.rcfilters.ui.FilterTagMultiselectWidget.less
+++ 
b/resources/src/mediawiki.rcfilters/styles/mw.rcfilters.ui.FilterTagMultiselectWidget.less
@@ -1,5 +1,4 @@
-@import 'mediawiki.ui/variables';
-@import 'mw.rcfilters.mixins.less';
+@import 'mediawiki.mixins';
 
 .mw-rcfilters-ui-filterTagMultiselectWidget {
max-width: none;
@@ -9,8 +8,6 @@
direction: ltr;
border-bottom-right-radius: 0;
height: 2.5em;
-
-   .input-placeholder-color( @colorGray5 );
}
 
&.oo-ui-widget-enabled .oo-ui-tagMultiselectWidget-handle {
@@ -81,10 +78,6 @@
 

.oo-ui-labelElement.oo-ui-optionWidget.oo-ui-buttonElement:first-child {
margin-left: 0;
-
-   > .oo-ui-buttonElement-button {
-   color: @colorGr

[MediaWiki-commits] [Gerrit] mediawiki/core[master]: RCFilters: Actually check whether defaults are empty and upd...

2017-09-18 Thread Mooeypoo (Code Review)
Mooeypoo has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/378755 )

Change subject: RCFilters: Actually check whether defaults are empty and update 
state
..

RCFilters: Actually check whether defaults are empty and update state

Defaults come from either the backend or the saved queries, and that can
also change during the session. Allow the system to update itself properly
over whether defaults are empty at any given state, and hide/show the
proper button at the correct state.

Bug: T172387
Change-Id: I173c72a391886b41e899ac64621b504c5eb55b0c
---
M resources/src/mediawiki.rcfilters/dm/mw.rcfilters.dm.FiltersViewModel.js
M resources/src/mediawiki.rcfilters/dm/mw.rcfilters.dm.SavedQueriesModel.js
M resources/src/mediawiki.rcfilters/mw.rcfilters.Controller.js
M 
resources/src/mediawiki.rcfilters/ui/mw.rcfilters.ui.FilterTagMultiselectWidget.js
4 files changed, 31 insertions(+), 25 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/55/378755/1

diff --git 
a/resources/src/mediawiki.rcfilters/dm/mw.rcfilters.dm.FiltersViewModel.js 
b/resources/src/mediawiki.rcfilters/dm/mw.rcfilters.dm.FiltersViewModel.js
index 1f9fd39..3b882a6 100644
--- a/resources/src/mediawiki.rcfilters/dm/mw.rcfilters.dm.FiltersViewModel.js
+++ b/resources/src/mediawiki.rcfilters/dm/mw.rcfilters.dm.FiltersViewModel.js
@@ -775,26 +775,6 @@
};
 
/**
-* Check whether the default values of the filters are all false.
-*
-* @return {boolean} Default filters are all false
-*/
-   mw.rcfilters.dm.FiltersViewModel.prototype.areDefaultFiltersEmpty = 
function () {
-   var defaultFilters;
-
-   if ( this.defaultFiltersEmpty === null ) {
-   // We only need to do this test once,
-   // because defaults are set once per session
-   defaultFilters = this.getFiltersFromParameters( 
this.getDefaultParams() );
-   this.defaultFiltersEmpty = $.isEmptyObject( 
defaultFilters ) || Object.keys( defaultFilters ).every( function ( filterName 
) {
-   return !defaultFilters[ filterName ];
-   } );
-   }
-
-   return this.defaultFiltersEmpty;
-   };
-
-   /**
 * Get the item that matches the given name
 *
 * @param {string} name Filter name
diff --git 
a/resources/src/mediawiki.rcfilters/dm/mw.rcfilters.dm.SavedQueriesModel.js 
b/resources/src/mediawiki.rcfilters/dm/mw.rcfilters.dm.SavedQueriesModel.js
index d87ef734..f878941 100644
--- a/resources/src/mediawiki.rcfilters/dm/mw.rcfilters.dm.SavedQueriesModel.js
+++ b/resources/src/mediawiki.rcfilters/dm/mw.rcfilters.dm.SavedQueriesModel.js
@@ -45,6 +45,13 @@
 * An item has changed
 */
 
+   /**
+* @event default
+* @param {string} New default ID
+*
+* The default has changed
+*/
+
/* Methods */
 
/**
@@ -259,6 +266,8 @@
this.getItems().forEach( function ( item ) {
item.toggleDefault( item.getID() === itemID );
} );
+
+   this.emit( 'default', itemID );
}
};
 
diff --git a/resources/src/mediawiki.rcfilters/mw.rcfilters.Controller.js 
b/resources/src/mediawiki.rcfilters/mw.rcfilters.Controller.js
index b07df57..552b3e6 100644
--- a/resources/src/mediawiki.rcfilters/mw.rcfilters.Controller.js
+++ b/resources/src/mediawiki.rcfilters/mw.rcfilters.Controller.js
@@ -367,6 +367,20 @@
};
 
/**
+* Check whether the default values of the filters are all false.
+*
+* @return {boolean} Defaults are all false
+*/
+   mw.rcfilters.Controller.prototype.areDefaultsEmpty = function () {
+   var defaultFilters = 
this.filtersModel.getFiltersFromParameters( this._getDefaultParams() );
+
+   // Defaults can change in a session, so we need to do this 
every time
+   return Object.keys( defaultFilters ).every( function ( 
filterName ) {
+   return !defaultFilters[ filterName ];
+   } );
+   };
+
+   /**
 * Empty all selected filters
 */
mw.rcfilters.Controller.prototype.emptyFilters = function () {
@@ -1034,9 +1048,10 @@
 * Get an object representing the default parameter state, whether
 * it is from the model defaults or from the saved queries.
 *
+* @param {boolean} [noStickies] Do not include sticky definition
 * @return {Object} Default parameters
 */
-   mw.rcfilters.Controller.prototype._getDefaultParams = function () {
+   mw.rcfilters.Controller.prototype._getDefaultParams = function ( 
noStickies ) {
var data, queryHighlights,
  

[MediaWiki-commits] [Gerrit] mediawiki/core[master]: RCFilters: Don't cast days default to an integer

2017-09-14 Thread Mooeypoo (Code Review)
Mooeypoo has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/378124 )

Change subject: RCFilters: Don't cast days default to an integer
..

RCFilters: Don't cast days default to an integer

Values can be floats, like 1.5 days, etc. Cast instead to a float.

Change-Id: I14ba792f1cd435f89b2e09067b0a0e894a0a2557
---
M includes/specialpage/ChangesListSpecialPage.php
M includes/specials/SpecialRecentchanges.php
M includes/specials/SpecialWatchlist.php
3 files changed, 4 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/24/378124/1

diff --git a/includes/specialpage/ChangesListSpecialPage.php 
b/includes/specialpage/ChangesListSpecialPage.php
index ec09559..6bf9d1b 100644
--- a/includes/specialpage/ChangesListSpecialPage.php
+++ b/includes/specialpage/ChangesListSpecialPage.php
@@ -606,12 +606,13 @@
'wgRCFiltersChangeTags',
$this->buildChangeTagList()
);
+
$out->addJsConfigVars(
'StructuredChangeFiltersDisplayConfig',
[
'maxDays' => 
(int)$this->getConfig()->get( 'RCMaxAge' ) / ( 24 * 3600 ), // Translate to days
'limitArray' => 
$this->getConfig()->get( 'RCLinkLimits' ),
-   'limitDefault' => 
$this->getDefaultLimit(),
+   'limitDefault' => floatval( 
$this->getDefaultLimit() ),
'daysArray' => $this->getConfig()->get( 
'RCLinkDays' ),
'daysDefault' => 
$this->getDefaultDays(),
]
diff --git a/includes/specials/SpecialRecentchanges.php 
b/includes/specials/SpecialRecentchanges.php
index 547a1b0..3fee309 100644
--- a/includes/specials/SpecialRecentchanges.php
+++ b/includes/specials/SpecialRecentchanges.php
@@ -1010,6 +1010,6 @@
}
 
function getDefaultDays() {
-   return $this->getUser()->getIntOption( 'rcdays' );
+   return $this->getUser()->getOption( 'rcdays' );
}
 }
diff --git a/includes/specials/SpecialWatchlist.php 
b/includes/specials/SpecialWatchlist.php
index ec64869..b84c846 100644
--- a/includes/specials/SpecialWatchlist.php
+++ b/includes/specials/SpecialWatchlist.php
@@ -918,6 +918,6 @@
}
 
function getDefaultDays() {
-   return $this->getUser()->getIntOption( 'watchlistdays' );
+   return $this->getUser()->getOption( 'watchlistdays' );
}
 }

-- 
To view, visit https://gerrit.wikimedia.org/r/378124
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I14ba792f1cd435f89b2e09067b0a0e894a0a2557
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Mooeypoo 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: RCFilters: Output namespace class on log actions as well

2017-09-13 Thread Mooeypoo (Code Review)
Mooeypoo has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/377935 )

Change subject: RCFilters: Output namespace class on log actions as well
..

RCFilters: Output namespace class on log actions as well

Bug: T174732
Change-Id: Icaf7117d9566bb2bb31c69cf86078491d6c217cc
---
M includes/changes/ChangesList.php
1 file changed, 2 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/35/377935/1

diff --git a/includes/changes/ChangesList.php b/includes/changes/ChangesList.php
index cac4769..bc50096 100644
--- a/includes/changes/ChangesList.php
+++ b/includes/changes/ChangesList.php
@@ -182,9 +182,9 @@
$classes[] = self::CSS_CLASS_PREFIX . 'edit';
$classes[] = Sanitizer::escapeClass( 
self::CSS_CLASS_PREFIX . 'ns' .
$rc->mAttribs['rc_namespace'] . '-' . 
$rc->mAttribs['rc_title'] );
-   $classes[] = Sanitizer::escapeClass( 
self::CSS_CLASS_PREFIX . 'ns-' .
-   $rc->mAttribs['rc_namespace'] );
}
+   $classes[] = Sanitizer::escapeClass( self::CSS_CLASS_PREFIX . 
'ns-' .
+   $rc->mAttribs['rc_namespace'] );
 
// Indicate watched status on the line to allow for more
// comprehensive styling.

-- 
To view, visit https://gerrit.wikimedia.org/r/377935
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Icaf7117d9566bb2bb31c69cf86078491d6c217cc
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Mooeypoo 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: RCFilters: Allow empty saved query

2017-09-13 Thread Mooeypoo (Code Review)
Mooeypoo has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/377932 )

Change subject: RCFilters: Allow empty saved query
..

RCFilters: Allow empty saved query

For this, we also need to check for saved query visibility on the
saved query model initialization, because since the model starts
its life all-empty, if the saved query is also all-empty, it will
not trigger any item updates on the main model.

Bug: T172387
Change-Id: Ibc536b577e4c3abcc04fa229f9978b651b2f9e61
---
M 
resources/src/mediawiki.rcfilters/ui/mw.rcfilters.ui.FilterTagMultiselectWidget.js
1 file changed, 12 insertions(+), 5 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/32/377932/1

diff --git 
a/resources/src/mediawiki.rcfilters/ui/mw.rcfilters.ui.FilterTagMultiselectWidget.js
 
b/resources/src/mediawiki.rcfilters/ui/mw.rcfilters.ui.FilterTagMultiselectWidget.js
index b15b034..97e0002 100644
--- 
a/resources/src/mediawiki.rcfilters/ui/mw.rcfilters.ui.FilterTagMultiselectWidget.js
+++ 
b/resources/src/mediawiki.rcfilters/ui/mw.rcfilters.ui.FilterTagMultiselectWidget.js
@@ -97,7 +97,10 @@
click: 'onSaveQueryButtonClick',
saveCurrent: 'setSavedQueryVisibility'
} );
-   this.queriesModel.connect( this, { itemUpdate: 
'onSavedQueriesItemUpdate' } );
+   this.queriesModel.connect( this, {
+   itemUpdate: 'onSavedQueriesItemUpdate',
+   initialize: 'onSavedQueriesInitialize'
+   } );
}
 
this.emptyFilterMessage = new OO.ui.LabelWidget( {
@@ -257,6 +260,13 @@
};
 
/**
+* Respond to save query model initialization
+*/
+   
mw.rcfilters.ui.FilterTagMultiselectWidget.prototype.onSavedQueriesInitialize = 
function () {
+   this.setSavedQueryVisibility();
+   };
+
+   /**
 * Respond to save query item change. Mainly this is done to update the 
label in case
 * a query item has been edited
 *
@@ -393,10 +403,7 @@
this.matchingQuery ? this.matchingQuery.getLabel() : ''
);
this.savedQueryTitle.toggle( !!this.matchingQuery );
-   this.saveQueryButton.toggle(
-   !this.isEmpty() &&
-   !this.matchingQuery
-   );
+   this.saveQueryButton.toggle(!this.matchingQuery );
 
if ( this.matchingQuery ) {
this.emphasize();

-- 
To view, visit https://gerrit.wikimedia.org/r/377932
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ibc536b577e4c3abcc04fa229f9978b651b2f9e61
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Mooeypoo 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...GuidedTour[master]: Check real RL list for existence

2017-09-13 Thread Mooeypoo (Code Review)
Mooeypoo has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/377919 )

Change subject: Check real RL list for existence
..

Check real RL list for existence

Change-Id: If43e31328750be28867f5ff1cd1a3e6ff8650346
---
M GuidedTourHooks.php
1 file changed, 1 insertion(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/GuidedTour 
refs/changes/19/377919/1

diff --git a/GuidedTourHooks.php b/GuidedTourHooks.php
index 0cc3076..3fae069 100644
--- a/GuidedTourHooks.php
+++ b/GuidedTourHooks.php
@@ -120,7 +120,7 @@
// extension-defined tours, but it's more conservative not to.
if ( $isUserJsAllowed && $tourName !== null && strpbrk( 
$tourName, '-.' ) === false ) {
$tourModuleName = "ext.guidedTour.tour.$tourName";
-   if ( isset( $wgResourceModules[$tourModuleName] ) ) {
+   if ( $out->getResourceLoader()->getModule( 
$tourModuleName ) ) {
// Add the tour itself for extension-defined 
tours.
$out->addModules( $tourModuleName );
} else {
@@ -130,7 +130,6 @@
*/
$out->addModules( 'ext.guidedTour' );
}
-
return true;
}
 

-- 
To view, visit https://gerrit.wikimedia.org/r/377919
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: If43e31328750be28867f5ff1cd1a3e6ff8650346
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/GuidedTour
Gerrit-Branch: master
Gerrit-Owner: Mooeypoo 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...WikimediaMessages[master]: [wip] RCFilters tours: Only load on specific page

2017-09-13 Thread Mooeypoo (Code Review)
Mooeypoo has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/377915 )

Change subject: [wip] RCFilters tours: Only load on specific page
..

[wip] RCFilters tours: Only load on specific page

Bug: T167262
Change-Id: Id5327bd8726610e4700acef5c7dabd6fd57e29af
---
M WikimediaMessages.hooks.php
1 file changed, 3 insertions(+), 3 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/WikimediaMessages 
refs/changes/15/377915/1

diff --git a/WikimediaMessages.hooks.php b/WikimediaMessages.hooks.php
index c0392fa..b5a2f49 100644
--- a/WikimediaMessages.hooks.php
+++ b/WikimediaMessages.hooks.php
@@ -1306,7 +1306,7 @@
$welcomeTourName = 
$special->isStructuredFilterUiEnabledByDefault() ?
'RcFiltersIntro' : 'RcFiltersBeta';
 
-   GuidedTourLauncher::launchTourByCookie( 
$welcomeTourName, 'Welcome' );
+   GuidedTourHooks::addTour( $out, 
$welcomeTourName );
$out->addJsConfigVars( 
'wgRCFiltersORESAvailable', self::isOresAvailable() );
}
 
@@ -1315,7 +1315,7 @@
}
 
if ( $user->getOption( 
'rcenhancedfilters-show-invite-confirmation' ) ) {
-   GuidedTourLauncher::launchTourByCookie( 
'RcFiltersInvite', 'Confirm' );
+   GuidedTourHooks::addTour( $out, 
'RcFiltersInvite' );
}
} elseif (
// If we're on Special:RecentChanges
@@ -1333,7 +1333,7 @@
!$user->getOption( 'rcenhancedfilters-seen-tour' )
) {
// Activate invite-to-beta tour
-   GuidedTourLauncher::launchTourByCookie( 
'RcFiltersInvite', 'Invite' );
+   GuidedTourHooks::addTour( $out, 'RcFiltersInvite' );
}
}
 

-- 
To view, visit https://gerrit.wikimedia.org/r/377915
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Id5327bd8726610e4700acef5c7dabd6fd57e29af
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/WikimediaMessages
Gerrit-Branch: master
Gerrit-Owner: Mooeypoo 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: RCFilters: Only selectively scroll to popup when it's focused

2017-09-13 Thread Mooeypoo (Code Review)
Mooeypoo has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/377911 )

Change subject: RCFilters: Only selectively scroll to popup when it's focused
..

RCFilters: Only selectively scroll to popup when it's focused

Bug: T175697
Change-Id: Id8f42332c661cf341953eb6af43e49a422181cc8
---
M 
resources/src/mediawiki.rcfilters/ui/mw.rcfilters.ui.FilterTagMultiselectWidget.js
1 file changed, 11 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/11/377911/1

diff --git 
a/resources/src/mediawiki.rcfilters/ui/mw.rcfilters.ui.FilterTagMultiselectWidget.js
 
b/resources/src/mediawiki.rcfilters/ui/mw.rcfilters.ui.FilterTagMultiselectWidget.js
index b15b034..0c1beef 100644
--- 
a/resources/src/mediawiki.rcfilters/ui/mw.rcfilters.ui.FilterTagMultiselectWidget.js
+++ 
b/resources/src/mediawiki.rcfilters/ui/mw.rcfilters.ui.FilterTagMultiselectWidget.js
@@ -310,11 +310,20 @@
 * @inheritdoc
 */
mw.rcfilters.ui.FilterTagMultiselectWidget.prototype.onInputFocus = 
function () {
+   var scrollTop = $( 'body' ).scrollTop(),
+   elementOffset = this.$element.offset().top,
+   distanceFromTop = ( elementOffset - scrollTop );
+
// Parent

mw.rcfilters.ui.FilterTagMultiselectWidget.parent.prototype.onInputFocus.call( 
this );
 
-   // Scroll to top
-   this.scrollToTop( this.$element );
+   // Only scroll to top if:
+   // - The widget is more than 20px from the top
+   // - The widget is not above the top (do not scroll downwards)
+   //   (This isn't represented because >20 is, anyways and 
always, bigger than 0)
+   if ( distanceFromTop > 20 ) {
+   this.scrollToTop( this.$element );
+   }
};
 
/**

-- 
To view, visit https://gerrit.wikimedia.org/r/377911
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Id8f42332c661cf341953eb6af43e49a422181cc8
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Mooeypoo 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...Echo[wmf/1.30.0-wmf.18]: Use "formatversion: 2" in notification fetching

2017-09-13 Thread Mooeypoo (Code Review)
Mooeypoo has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/377910 )

Change subject: Use "formatversion: 2" in notification fetching
..

Use "formatversion: 2" in notification fetching

This means booleans are actually true/false rather than value or
empty-string.

Bug: T175867
Change-Id: I3d33129d061a64012602a131741d20e2ff97d1be
---
M modules/api/mw.echo.api.APIHandler.js
1 file changed, 1 insertion(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Echo 
refs/changes/10/377910/1

diff --git a/modules/api/mw.echo.api.APIHandler.js 
b/modules/api/mw.echo.api.APIHandler.js
index 9177155..ad45cea 100644
--- a/modules/api/mw.echo.api.APIHandler.js
+++ b/modules/api/mw.echo.api.APIHandler.js
@@ -132,6 +132,7 @@
me = this,
params = $.extend( {
action: 'query',
+   formatversion: 2,
meta: 'notifications',
notsections: this.normalizedType[ type ],
notformat: 'model',

-- 
To view, visit https://gerrit.wikimedia.org/r/377910
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I3d33129d061a64012602a131741d20e2ff97d1be
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Echo
Gerrit-Branch: wmf/1.30.0-wmf.18
Gerrit-Owner: Mooeypoo 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...Echo[master]: Use "formatversion: 2" in notification fetching

2017-09-13 Thread Mooeypoo (Code Review)
Mooeypoo has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/377905 )

Change subject: Use "formatversion: 2" in notification fetching
..

Use "formatversion: 2" in notification fetching

This means booleans are actually true/false rather than value or
empty-string.

Bug: T175867
Change-Id: I3d33129d061a64012602a131741d20e2ff97d1be
---
M modules/api/mw.echo.api.APIHandler.js
1 file changed, 1 insertion(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Echo 
refs/changes/05/377905/1

diff --git a/modules/api/mw.echo.api.APIHandler.js 
b/modules/api/mw.echo.api.APIHandler.js
index 9177155..ad45cea 100644
--- a/modules/api/mw.echo.api.APIHandler.js
+++ b/modules/api/mw.echo.api.APIHandler.js
@@ -132,6 +132,7 @@
me = this,
params = $.extend( {
action: 'query',
+   formatversion: 2,
meta: 'notifications',
notsections: this.normalizedType[ type ],
notformat: 'model',

-- 
To view, visit https://gerrit.wikimedia.org/r/377905
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I3d33129d061a64012602a131741d20e2ff97d1be
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Echo
Gerrit-Branch: master
Gerrit-Owner: Mooeypoo 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: RCFilters: Actually apply proper classes to grouped pages

2017-09-12 Thread Mooeypoo (Code Review)
Mooeypoo has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/377682 )

Change subject: RCFilters: Actually apply proper classes to grouped pages
..

RCFilters: Actually apply proper classes to grouped pages

Bug: T174734
Change-Id: Ie0a8f5587103c3caed31d29585db78017ac4ab4c
---
M includes/changes/EnhancedChangesList.php
1 file changed, 2 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/82/377682/1

diff --git a/includes/changes/EnhancedChangesList.php 
b/includes/changes/EnhancedChangesList.php
index 8e24efe..a8e4bd9 100644
--- a/includes/changes/EnhancedChangesList.php
+++ b/includes/changes/EnhancedChangesList.php
@@ -383,7 +383,8 @@
) {
$classes[] = 'mw-enhanced-watched';
}
-   $classes = array_merge( $classes, 
$this->getHTMLClassesForFilters( $rcObj ) );
+
+   $classes = array_merge( $classes, $this->getHTMLClasses( $rcObj 
) );
 
$separator = ' . 
. ';
 

-- 
To view, visit https://gerrit.wikimedia.org/r/377682
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie0a8f5587103c3caed31d29585db78017ac4ab4c
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Mooeypoo 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...Echo[master]: Always place items outside menu if there's less than two of ...

2017-09-08 Thread Mooeypoo (Code Review)
Mooeypoo has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/376862 )

Change subject: Always place items outside menu if there's less than two of them
..

Always place items outside menu if there's less than two of them

Bug: T174927
Change-Id: I5a30cf4d5cdc3e7ea9ea7b0536e015de8825f785
---
M modules/ui/mw.echo.ui.NotificationItemWidget.js
1 file changed, 11 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Echo 
refs/changes/62/376862/1

diff --git a/modules/ui/mw.echo.ui.NotificationItemWidget.js 
b/modules/ui/mw.echo.ui.NotificationItemWidget.js
index 475b695..f553e7e 100644
--- a/modules/ui/mw.echo.ui.NotificationItemWidget.js
+++ b/modules/ui/mw.echo.ui.NotificationItemWidget.js
@@ -130,7 +130,17 @@
// prioritized explicitly, *except* for items inside a 
bundle
// (where all actions are inside the menu) or there are 
more than
// two prioritized actions (all others go into the menu)
-   isOutsideMenu = !this.bundle && urlObj.prioritized !== 
undefined && outsideMenuItemCounter < mw.echo.config.maxPrioritizedActions;
+   isOutsideMenu = !this.bundle &&
+   (
+   (
+   // Make sure we don't 
have too many prioritized items
+   urlObj.prioritized &&
+   outsideMenuItemCounter 
< mw.echo.config.maxPrioritizedActions
+   ) ||
+   // If there are only two items 
or less, they all go outside
+   // the menu
+   secondaryUrls.length <= 2;
+   );
 
linkButton = new mw.echo.ui.MenuItemWidget( {
type: urlObj.type,

-- 
To view, visit https://gerrit.wikimedia.org/r/376862
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I5a30cf4d5cdc3e7ea9ea7b0536e015de8825f785
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Echo
Gerrit-Branch: master
Gerrit-Owner: Mooeypoo 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: RCFilters: Add an initialization hook

2017-09-08 Thread Mooeypoo (Code Review)
Mooeypoo has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/376857 )

Change subject: RCFilters: Add an initialization hook
..

RCFilters: Add an initialization hook

Change-Id: I9adc529bee0d5e25566409cc98f7bbac8178c478
---
A resources/src/mediawiki.rcfilters/hooks.txt
M resources/src/mediawiki.rcfilters/mw.rcfilters.init.js
2 files changed, 5 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/57/376857/1

diff --git a/resources/src/mediawiki.rcfilters/hooks.txt 
b/resources/src/mediawiki.rcfilters/hooks.txt
new file mode 100644
index 000..4e87b31
--- /dev/null
+++ b/resources/src/mediawiki.rcfilters/hooks.txt
@@ -0,0 +1,3 @@
+This documents RCFilters' client-side hooks:
+
+* 'advanced-filters-ui-initialized': Fired when the construction of the 
filtering interface is initialized.
\ No newline at end of file
diff --git a/resources/src/mediawiki.rcfilters/mw.rcfilters.init.js 
b/resources/src/mediawiki.rcfilters/mw.rcfilters.init.js
index 67edb4f..f12493d 100644
--- a/resources/src/mediawiki.rcfilters/mw.rcfilters.init.js
+++ b/resources/src/mediawiki.rcfilters/mw.rcfilters.init.js
@@ -79,6 +79,8 @@
);
filtersWidget.setTopSection( 
wlTopSection.$element );
} // end Special:WL
+
+   mw.hook( 'advanced-filters-ui-initialized' ).fire();
}
};
 

-- 
To view, visit https://gerrit.wikimedia.org/r/376857
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I9adc529bee0d5e25566409cc98f7bbac8178c478
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Mooeypoo 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...Echo[master]: Consistently use the message when updating count

2017-09-01 Thread Mooeypoo (Code Review)
Mooeypoo has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/375482 )

Change subject: Consistently use the message when updating count
..

Consistently use the message when updating count

The current initial message in the button label is "Alerts (x)" or
"Notices (x)" but when the badge loaded, we changed that to only show
the rendered number. This is inconsistent; the badge should always
update the label properly, even if it's not visible in most cases.

Bug: T173970
Change-Id: I6a5e13fc36ddb1bf467c712fcf49af3b18e582d0
---
M modules/ext.echo.init.js
M modules/ui/mw.echo.ui.BadgeLinkWidget.js
M modules/ui/mw.echo.ui.NotificationBadgeWidget.js
3 files changed, 16 insertions(+), 10 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Echo 
refs/changes/82/375482/1

diff --git a/modules/ext.echo.init.js b/modules/ext.echo.init.js
index b4b82f9..b5e0962 100644
--- a/modules/ext.echo.init.js
+++ b/modules/ext.echo.init.js
@@ -76,7 +76,7 @@
numItems: Number( 
numMessages ),
hasUnseen: 
hasUnseenMessages,
badgeIcon: 'tray',
-   badgeLabel: 
badgeLabelMessages,
+   convertedNumber: 
badgeLabelMessages,
links: links,
href: 
$existingMessageLink.attr( 'href' )
}
@@ -93,7 +93,7 @@
alertModelManager,
{
numItems: Number( numAlerts ),
-   badgeLabel: badgeLabelAlerts,
+   convertedNumber: 
badgeLabelAlerts,
hasUnseen: hasUnseenAlerts,
badgeIcon: 'bell',
links: links,
diff --git a/modules/ui/mw.echo.ui.BadgeLinkWidget.js 
b/modules/ui/mw.echo.ui.BadgeLinkWidget.js
index dc59e09..3b4f812 100644
--- a/modules/ui/mw.echo.ui.BadgeLinkWidget.js
+++ b/modules/ui/mw.echo.ui.BadgeLinkWidget.js
@@ -10,6 +10,7 @@
 * @cfg {string} [type] The notification types this button represents;
 *  'message', 'alert' or 'all'
 * @cfg {string} [href] URL the badge links to
+* @cfg {string} [convertedNumber] A converted version of the initial 
count
 */
mw.echo.ui.BadgeLinkWidget = function MwEchoUiBadgeLinkWidget( config ) 
{
config = config || {};
@@ -28,7 +29,7 @@
 
this.count = 0;
this.type = config.type || 'alert';
-   this.setCount( config.numItems, config.label );
+   this.setCount( config.numItems, config.convertedNumber );
 
if ( config.href !== undefined && OO.ui.isSafeUrl( config.href 
) ) {
this.$element.attr( 'href', config.href );
@@ -47,16 +48,22 @@
 * Set the count labels for this button.
 *
 * @param {number} numItems Number of items
-* @param {string} [label] Label of the button. Defaults to the item 
number.
+* @param {string} [convertedNumber] Label of the button. Defaults to 
the default message
+*  showing the item number.
 */
-   mw.echo.ui.BadgeLinkWidget.prototype.setCount = function ( numItems, 
label ) {
-   label = label || numItems;
+   mw.echo.ui.BadgeLinkWidget.prototype.setCount = function ( numItems, 
convertedNumber ) {
+   convertedNumber = convertedNumber !== undefined ? 
convertedNumber : numItems;
 
this.$element
.toggleClass( 'mw-echo-notifications-badge-all-read', 
!numItems )
-   .toggleClass( 'mw-echo-notifications-badge-long-label', 
label.length > 2 )
+   .toggleClass( 'mw-echo-notifications-badge-long-label', 
convertedNumber.length > 2 )
.attr( 'data-counter-num', numItems )
-   .attr( 'data-counter-text', label );
+   .attr( 'data-counter-text', convertedNumber );
+
+   this.setLabel( mw.msg(
+   'echo-notification-' + ( this.type === 'alert' ? 
'alert' : 'notice' ),
+   convertedNumber
+   ) );
 
if ( this.count !== numItems ) {
this.count = numItems;
diff --git a/modules/ui/mw.echo.ui.NotificationBadgeWidget.js 
b/modules/ui/mw.echo.ui.NotificationBadgeWidget.js
index 25170f4..1bf9981 100644
--- a/modules/ui/mw.echo.ui

[MediaWiki-commits] [Gerrit] mediawiki...WikimediaMessages[master]: [wip] RCFilters: Add introduction tour when RCFilters comes ...

2017-08-31 Thread Mooeypoo (Code Review)
Mooeypoo has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/375097 )

Change subject: [wip] RCFilters: Add introduction tour when RCFilters comes out 
of beta
..

[wip] RCFilters: Add introduction tour when RCFilters comes out of beta

Bug: T169613
Change-Id: I9195e9a434b9d9ae0e928b089b7212ec2b779eba
---
M WikimediaMessages.hooks.php
M i18n/wikimedia/en.json
M i18n/wikimedia/qqq.json
A modules/rcfilters-intro-tour.js
A modules/rcfilters-intro-tour.less
5 files changed, 98 insertions(+), 1 deletion(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/WikimediaMessages 
refs/changes/97/375097/1

diff --git a/WikimediaMessages.hooks.php b/WikimediaMessages.hooks.php
index e1ee79f..a349893 100644
--- a/WikimediaMessages.hooks.php
+++ b/WikimediaMessages.hooks.php
@@ -1276,6 +1276,8 @@
}
 
public static function onBeforePageDisplay( OutputPage &$out, Skin 
&$skin ) {
+   global $wgUseStructuredChangeFilters;
+
if ( !class_exists( 'GuidedTourHooks' ) ) {
return;
}
@@ -1287,8 +1289,12 @@
$user->isLoggedIn()
) {
if ( $user->getOption( 'rcenhancedfilters' ) ) {
+   // $welcomeTourName = 
$wgUseStructuredChangeFilters ?
+   //  'RcFiltersIntro' : 'RcFiltersBeta';
+   $welcomeTourName = 'RcFiltersIntro';
+
if ( !$user->getOption( 
'rcenhancedfilters-seen-tour' ) ) {
-   GuidedTourLauncher::launchTourByCookie( 
'RcFiltersBeta', 'Welcome' );
+   GuidedTourLauncher::launchTourByCookie( 
$welcomeTourName, 'Welcome' );
$out->addJsConfigVars( 
'wgRCFiltersORESAvailable', self::isOresAvailable() );
}
 
@@ -1320,6 +1326,7 @@
'eri-rcfilters-tour-welcome-title',

'eri-rcfilters-tour-welcome-description',

'eri-rcfilters-tour-welcome-no-ores-description',
+   
'eri-rcfilters-tour-preferences-description',
'eri-rcfilters-tour-welcome-button',
],
'dependencies' => [
@@ -1327,6 +1334,24 @@
],
] );
 
+   $resourceLoader->register( 
'ext.guidedTour.tour.RcFiltersIntro', [
+   'localBasePath' => __DIR__ . '/modules',
+   'remoteExtPath' => 'WikimediaMessages/modules',
+   'scripts' => 'rcfilters-intro-tour.js',
+   'styles' => 'rcfilters-intro-tour.less',
+   'messages' => [
+
+
+   
'eri-rcfilters-intro-tour-welcome-title',
+   
'eri-rcfilters-intro-tour-welcome-description',
+   
'eri-rcfilters-intro-tour-welcome-no-ores-description',
+   
'eri-rcfilters-intro-tour-welcome-button',
+   ],
+   'dependencies' => [
+   'ext.guidedTour'
+   ],
+   ] );
+
$resourceLoader->register( 
'ext.guidedTour.tour.RcFiltersHighlight', [
'localBasePath' => __DIR__ . '/modules',
'remoteExtPath' => 'WikimediaMessages/modules',
diff --git a/i18n/wikimedia/en.json b/i18n/wikimedia/en.json
index e0c0948..4cfbcc6 100644
--- a/i18n/wikimedia/en.json
+++ b/i18n/wikimedia/en.json
@@ -287,7 +287,12 @@
"eri-rcfilters-tour-welcome-title": "Introducing: New Filters for Edit 
Review (beta)",
"eri-rcfilters-tour-welcome-description": "Combine improved tools, a 
new interface and the power of machine learning to fight vandalism and help new 
users.",
"eri-rcfilters-tour-welcome-no-ores-description": "Review edits using 
an easier and more powerful interface, additional filters, user-defined 
highlighting and other improvements.",
+   "eri-rcfilters-tour-preferences-description": "Access your preferences 
any time to disable the improved version of Recent Changes.",
"eri-rcfilters-tour-welcome-button": "OK, got it",
+   "eri-rcfilters-intro-tour-welcome-title": "Welcome to improved Recent 
Changes filtering",
+   "eri-rcfilters-intro-tour-welcome-description": "Review edits more 
efficiently using improved tools, a new interface and the power of machine 
learning.",
+   "eri-rc

[MediaWiki-commits] [Gerrit] mediawiki/core[master]: RCFilters: Make top links in RecentChanges expand to full-width

2017-08-30 Thread Mooeypoo (Code Review)
Mooeypoo has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/374911 )

Change subject: RCFilters: Make top links in RecentChanges expand to full-width
..

RCFilters: Make top links in RecentChanges expand to full-width

Bug: T174617
Change-Id: Iff4c563b894eaaf713d3818a97928d0342b1ca23
---
M 
resources/src/mediawiki.rcfilters/styles/mw.rcfilters.ui.RcTopSectionWidget.less
M resources/src/mediawiki.rcfilters/styles/mw.rcfilters.ui.less
M resources/src/mediawiki.rcfilters/ui/mw.rcfilters.ui.RcTopSectionWidget.js
3 files changed, 68 insertions(+), 18 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/11/374911/1

diff --git 
a/resources/src/mediawiki.rcfilters/styles/mw.rcfilters.ui.RcTopSectionWidget.less
 
b/resources/src/mediawiki.rcfilters/styles/mw.rcfilters.ui.RcTopSectionWidget.less
index 38f6f28..9d1cc23 100644
--- 
a/resources/src/mediawiki.rcfilters/styles/mw.rcfilters.ui.RcTopSectionWidget.less
+++ 
b/resources/src/mediawiki.rcfilters/styles/mw.rcfilters.ui.RcTopSectionWidget.less
@@ -1,6 +1,17 @@
 .mw-rcfilters-ui-rcTopSectionWidget {
&-topLinks {
-   width: 100%;
+   &-table {
+   width: 100%;
+   }
+
+   &-top {
+   display: block;
+   width: 100%;
+
+   .mw-recentchanges-toplinks {
+   margin-bottom: 0.5em;
+   }
+   }
}
 
&-savedLinks {
diff --git a/resources/src/mediawiki.rcfilters/styles/mw.rcfilters.ui.less 
b/resources/src/mediawiki.rcfilters/styles/mw.rcfilters.ui.less
index 0bee2f1..f7081af 100644
--- a/resources/src/mediawiki.rcfilters/styles/mw.rcfilters.ui.less
+++ b/resources/src/mediawiki.rcfilters/styles/mw.rcfilters.ui.less
@@ -2,6 +2,10 @@
&-table {
display: table;
width: 100%;
+
+   &-placeholder {
+   width: 100%;
+   }
}
 
&-row {
diff --git 
a/resources/src/mediawiki.rcfilters/ui/mw.rcfilters.ui.RcTopSectionWidget.js 
b/resources/src/mediawiki.rcfilters/ui/mw.rcfilters.ui.RcTopSectionWidget.js
index 706c888..623f266 100644
--- a/resources/src/mediawiki.rcfilters/ui/mw.rcfilters.ui.RcTopSectionWidget.js
+++ b/resources/src/mediawiki.rcfilters/ui/mw.rcfilters.ui.RcTopSectionWidget.js
@@ -12,14 +12,18 @@
mw.rcfilters.ui.RcTopSectionWidget = function 
MwRcfiltersUiRcTopSectionWidget(
savedLinksListWidget, $topLinks, config
) {
-   var topLinksCookieName = 'rcfilters-toplinks-collapsed-state',
+   var toplinksTitle,
+   topLinksCookieName = 
'rcfilters-toplinks-collapsed-state',
topLinksCookie = mw.cookie.get( topLinksCookieName ),
topLinksCookieValue = topLinksCookie || 'collapsed',
-   toplinksTitle;
+   widget = this;
+
config = config || {};
 
// Parent
mw.rcfilters.ui.RcTopSectionWidget.parent.call( this, config );
+
+   this.$topLinks = $topLinks;
 
toplinksTitle = new OO.ui.ButtonWidget( {
framed: false,
@@ -28,7 +32,8 @@
label: $( '' ).append( mw.message( 
'rcfilters-other-review-tools' ).parse() ).contents()
} );
 
-   $topLinks
+
+   this.$topLinks
.addClass( 'mw-rcfilters-ui-ready' )
.makeCollapsible( {
collapsed: topLinksCookieValue === 'collapsed',
@@ -37,38 +42,68 @@
.on( 'beforeExpand.mw-collapsible', function () {
mw.cookie.set( topLinksCookieName, 'expanded' );
toplinksTitle.setIndicator( 'up' );
+   widget.switchTopLinks( 'expanded' );
} )
.on( 'beforeCollapse.mw-collapsible', function () {
mw.cookie.set( topLinksCookieName, 'collapsed' 
);
toplinksTitle.setIndicator( 'down' );
+   widget.switchTopLinks( 'collapsed' );
} );
 
-   $topLinks.find( '.mw-recentchanges-toplinks-title' 
).replaceWith( toplinksTitle.$element );
+   this.$topLinks.find( '.mw-recentchanges-toplinks-title' 
).replaceWith( toplinksTitle.$element );
 
+   // Create two positions for the toplinks to toggle between
+   // in the table (first cell) or up above it
+   this.$top = $( '' )
+   .addClass( 
'mw-rcfilters-ui-rcTopSectionWidget-topLinks-top' );
+   this.$tableTopLinks = $( '' )
+ 

[MediaWiki-commits] [Gerrit] mediawiki/core[master]: RCFilters: Include invert param when reading default saved q...

2017-08-29 Thread Mooeypoo (Code Review)
Mooeypoo has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/374647 )

Change subject: RCFilters: Include invert param when reading default saved query
..

RCFilters: Include invert param when reading default saved query

Bug: T174506
Change-Id: Ibca0e0c80d8069ac3e73533f1f342c2946cce6ca
---
M resources/src/mediawiki.rcfilters/mw.rcfilters.Controller.js
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/47/374647/1

diff --git a/resources/src/mediawiki.rcfilters/mw.rcfilters.Controller.js 
b/resources/src/mediawiki.rcfilters/mw.rcfilters.Controller.js
index a520bdb..81bfb47 100644
--- a/resources/src/mediawiki.rcfilters/mw.rcfilters.Controller.js
+++ b/resources/src/mediawiki.rcfilters/mw.rcfilters.Controller.js
@@ -1055,7 +1055,7 @@
}
} );
 
-   return $.extend( true, {}, savedParams, savedHighlights 
);
+   return $.extend( true, {}, savedParams, 
savedHighlights, { invert: String( Number( data.invert || 0 ) ) } );
}
 
return this.filtersModel.getDefaultParams();

-- 
To view, visit https://gerrit.wikimedia.org/r/374647
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ibca0e0c80d8069ac3e73533f1f342c2946cce6ca
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Mooeypoo 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: RCFilters: Target pushPin icon for size, not all icons

2017-08-28 Thread Mooeypoo (Code Review)
Mooeypoo has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/374434 )

Change subject: RCFilters: Target pushPin icon for size, not all icons
..

RCFilters: Target pushPin icon for size, not all icons

Whoops.

Bug: T173264
Change-Id: Icb92c55a5b067d77138bae93f4db96309c72a223
---
M 
resources/src/mediawiki.rcfilters/styles/mw.rcfilters.ui.SavedLinksListItemWidget.less
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/34/374434/1

diff --git 
a/resources/src/mediawiki.rcfilters/styles/mw.rcfilters.ui.SavedLinksListItemWidget.less
 
b/resources/src/mediawiki.rcfilters/styles/mw.rcfilters.ui.SavedLinksListItemWidget.less
index e7433e2..9dccc24 100644
--- 
a/resources/src/mediawiki.rcfilters/styles/mw.rcfilters.ui.SavedLinksListItemWidget.less
+++ 
b/resources/src/mediawiki.rcfilters/styles/mw.rcfilters.ui.SavedLinksListItemWidget.less
@@ -12,7 +12,7 @@
vertical-align: middle;
}
 
-   .oo-ui-iconElement-icon {
+   .mw-rcfilters-ui-savedLinksListItemWidget-icon .oo-ui-iconElement-icon {
// Since we made the rows narrower (height smaller than usual)
// then the icon needs to be slightly smaller as well, so that
// when we toggle 'default' the icon doesn't bounce the option

-- 
To view, visit https://gerrit.wikimedia.org/r/374434
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Icb92c55a5b067d77138bae93f4db96309c72a223
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Mooeypoo 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: RCFilters: Minimize saved query before comparison

2017-08-28 Thread Mooeypoo (Code Review)
Mooeypoo has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/374402 )

Change subject: RCFilters: Minimize saved query before comparison
..

RCFilters: Minimize saved query before comparison

Bug: T174193
Change-Id: I8e9345e8899fd27565930896e62c4d3be235ad58
---
M resources/src/mediawiki.rcfilters/dm/mw.rcfilters.dm.SavedQueriesModel.js
1 file changed, 32 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/02/374402/1

diff --git 
a/resources/src/mediawiki.rcfilters/dm/mw.rcfilters.dm.SavedQueriesModel.js 
b/resources/src/mediawiki.rcfilters/dm/mw.rcfilters.dm.SavedQueriesModel.js
index a7f3d23..d87ef734 100644
--- a/resources/src/mediawiki.rcfilters/dm/mw.rcfilters.dm.SavedQueriesModel.js
+++ b/resources/src/mediawiki.rcfilters/dm/mw.rcfilters.dm.SavedQueriesModel.js
@@ -18,6 +18,7 @@
OO.EmitterList.call( this );
 
this.default = config.default;
+   this.baseState = {};
 
// Events
this.aggregate( { update: 'itemUpdate' } );
@@ -171,15 +172,45 @@
 * @return {mw.rcfilters.dm.SavedQueryItemModel} Matching item model
 */
mw.rcfilters.dm.SavedQueriesModel.prototype.findMatchingQuery = 
function ( fullQueryComparison ) {
+   var model = this;
+
+   fullQueryComparison = this.getDifferenceFromBase( 
fullQueryComparison );
+
return this.getItems().filter( function ( item ) {
+   var comparedData = model.getDifferenceFromBase( 
item.getData() );
return OO.compare(
-   item.getData(),
+   comparedData,
fullQueryComparison
);
} )[ 0 ];
};
 
/**
+* Get a minimal representation of the state for comparison
+*
+* @param {Object} state Given state
+* @return {Object} Minimal state
+*/
+   mw.rcfilters.dm.SavedQueriesModel.prototype.getDifferenceFromBase = 
function ( state ) {
+   var result = { filters: {}, highlights: {}, invert: 
state.invert },
+   baseState = this.baseState;
+
+   // XOR results
+   $.each( state.filters, function ( name, value ) {
+   if ( baseState.filters !== undefined && 
baseState.filters[ name ] !== value ) {
+   result.filters[ name ] = value;
+   }
+   } );
+
+   $.each( state.highlights, function ( name, value ) {
+   if ( baseState.highlights !== undefined && 
baseState.highlights[ name ] !== value && name !== 'highlight' ) {
+   result.highlights[ name ] = value;
+   }
+   } );
+
+   return result;
+   };
+   /**
 * Get query by its identifier
 *
 * @param {string} queryID Query identifier

-- 
To view, visit https://gerrit.wikimedia.org/r/374402
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I8e9345e8899fd27565930896e62c4d3be235ad58
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Mooeypoo 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: RCFilters: Adjust highlight for seen/unseen states in Watchlist

2017-08-25 Thread Mooeypoo (Code Review)
Mooeypoo has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/373991 )

Change subject: RCFilters: Adjust highlight for seen/unseen states in Watchlist
..

RCFilters: Adjust highlight for seen/unseen states in Watchlist

Bug: T171235
Change-Id: I33d059d2be83e4730e6dc82f689f49a514286874
---
M includes/specials/SpecialWatchlist.php
M resources/Resources.php
M resources/src/mediawiki.rcfilters/styles/mw.rcfilters.mixins.less
A 
resources/src/mediawiki.rcfilters/styles/mw.rcfilters.ui.ChangesListWrapperWidget.highlightCircles.seenunseen.less
M 
resources/src/mediawiki.rcfilters/styles/mw.rcfilters.ui.ChangesListWrapperWidget.less
M resources/src/mediawiki.rcfilters/styles/mw.rcfilters.variables.less
M 
resources/src/mediawiki.rcfilters/ui/mw.rcfilters.ui.ChangesListWrapperWidget.js
7 files changed, 90 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/91/373991/1

diff --git a/includes/specials/SpecialWatchlist.php 
b/includes/specials/SpecialWatchlist.php
index cecc182..412a195 100644
--- a/includes/specials/SpecialWatchlist.php
+++ b/includes/specials/SpecialWatchlist.php
@@ -96,7 +96,10 @@
 
parent::execute( $subpage );
 
+
if ( $this->isStructuredFilterUiEnabled() ) {
+   $output->addModuleStyles( [ 
'mediawiki.rcfilters.highlightCircles.seenunseen.styles' ] );
+
$output->addJsConfigVars( 
'wgStructuredChangeFiltersLiveUpdateSupported', false );
$output->addJsConfigVars(

'wgStructuredChangeFiltersSavedQueriesPreferenceName',
diff --git a/resources/Resources.php b/resources/Resources.php
index 4a7f3e4..7b0a75e 100644
--- a/resources/Resources.php
+++ b/resources/Resources.php
@@ -1748,6 +1748,11 @@

'resources/src/mediawiki.rcfilters/styles/mw.rcfilters.less',
],
],
+   'mediawiki.rcfilters.highlightCircles.seenunseen.styles' => [
+   'styles' => [
+   
'resources/src/mediawiki.rcfilters/styles/mw.rcfilters.ui.ChangesListWrapperWidget.highlightCircles.seenunseen.less',
+   ],
+   ],
'mediawiki.rcfilters.filters.dm' => [
'scripts' => [
'resources/src/mediawiki.rcfilters/mw.rcfilters.js',
diff --git a/resources/src/mediawiki.rcfilters/styles/mw.rcfilters.mixins.less 
b/resources/src/mediawiki.rcfilters/styles/mw.rcfilters.mixins.less
index 5a885ec..27acd75 100644
--- a/resources/src/mediawiki.rcfilters/styles/mw.rcfilters.mixins.less
+++ b/resources/src/mediawiki.rcfilters/styles/mw.rcfilters.mixins.less
@@ -8,8 +8,7 @@
 }
 
 // This is a general mixin for a color circle
-.mw-rcfilters-mixin-circle( @color: #fff, @diameter: 2em, @padding: 0.5em, 
@border: false ) {
-   background-color: @color;
+.mw-rcfilters-mixin-circle( @color: #fff, @diameter: 2em, @padding: 0.5em, 
@border: false, @borderColor: #54595d, @emptyBackground: false ) {
.box-sizing( border-box );
min-width: @diameter;
width: @diameter;
@@ -18,8 +17,15 @@
margin: @padding;
border-radius: 50%;
 
+   & when ( @emptyBackground = false ) {
+   background-color: @color;
+   }
+   & when ( @emptyBackground = true ) {
+   background-color: @highlight-none;
+   }
+
& when ( @border = true ) {
-   border: 1px solid #54595d;
+   border: 1px solid @borderColor;
}
 }
 
diff --git 
a/resources/src/mediawiki.rcfilters/styles/mw.rcfilters.ui.ChangesListWrapperWidget.highlightCircles.seenunseen.less
 
b/resources/src/mediawiki.rcfilters/styles/mw.rcfilters.ui.ChangesListWrapperWidget.highlightCircles.seenunseen.less
new file mode 100644
index 000..f4ca717
--- /dev/null
+++ 
b/resources/src/mediawiki.rcfilters/styles/mw.rcfilters.ui.ChangesListWrapperWidget.highlightCircles.seenunseen.less
@@ -0,0 +1,66 @@
+@import 'mw.rcfilters.mixins';
+
+.mw-rcfilters-ui-changesListWrapperWidget {
+   ul {
+   list-style: none;
+
+   li {
+   list-style: none;
+   }
+   }
+
+   // Make more specific for the overrides
+   div&-highlights {
+   display: inline-block;
+
+   &-color {
+   &-none {
+   display: inline-block;
+   li.mw-changeslist-watchedseen & {
+   
.mw-rcfilters-ui-changesListWrapperWidget.mw-rcfilters-ui-changesListWrapperWidget-highlighted
 & {
+   .mw-rcfilters-mixin-circle( 
@highlight-none, @result-circle-diameter, 0, true, @highlight-grey, true );
+   }
+
+   
.mw-rcfilters-ui-changesListWrapperWid

[MediaWiki-commits] [Gerrit] mediawiki/core[master]: RCFilters: Minimize vertical spacing; get rid of legend and ...

2017-08-24 Thread Mooeypoo (Code Review)
Mooeypoo has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/373716 )

Change subject: RCFilters: Minimize vertical spacing; get rid of legend and 
s
..

RCFilters: Minimize vertical spacing; get rid of legend and s

Bug: T174121
Change-Id: I2249bf3d313232fe2f0dff6e34c5140885a13735
---
M resources/src/mediawiki.rcfilters/styles/mw.rcfilters.less
M resources/src/mediawiki.rcfilters/ui/mw.rcfilters.ui.FormWrapperWidget.js
2 files changed, 17 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/16/373716/1

diff --git a/resources/src/mediawiki.rcfilters/styles/mw.rcfilters.less 
b/resources/src/mediawiki.rcfilters/styles/mw.rcfilters.less
index c667bac..ec5ea3a 100644
--- a/resources/src/mediawiki.rcfilters/styles/mw.rcfilters.less
+++ b/resources/src/mediawiki.rcfilters/styles/mw.rcfilters.less
@@ -41,6 +41,14 @@
display: none;
}
}
+
+   fieldset.rcoptions {
+   padding: 0;
+
+   .rcshowhide span {
+   display: block;
+   }
+   }
}
 
.rcfilters-container {
diff --git 
a/resources/src/mediawiki.rcfilters/ui/mw.rcfilters.ui.FormWrapperWidget.js 
b/resources/src/mediawiki.rcfilters/ui/mw.rcfilters.ui.FormWrapperWidget.js
index ad99e22..1b85503 100644
--- a/resources/src/mediawiki.rcfilters/ui/mw.rcfilters.ui.FormWrapperWidget.js
+++ b/resources/src/mediawiki.rcfilters/ui/mw.rcfilters.ui.FormWrapperWidget.js
@@ -142,17 +142,23 @@
this.$element.find( 'hr' ).detach();
}
 
+   // Get rid of all s, which are inside rcshowhide
+   // If we still have content in rcshowhide, the s are
+   // gone. Instead, the CSS now has a rule to mark all s
+   // inside .rcshowhide with display:block; to simulate newlines
+   // where they're actually needed.
+   this.$element.find( 'br' ).detach();
if ( !this.$element.find( '.rcshowhide' ).contents().length ) {
this.$element.find( '.rcshowhide' ).detach();
-   // If we're hiding rcshowhide, the ''s are around 
it,
-   // there's no need for them either.
-   this.$element.find( 'br' ).detach();
}
 
if ( this.$element.find( '.cloption' ).text().trim() === '' ) {
this.$element.find( '.cloption-submit' ).detach();
}
 
+   // Get rid of the legend
+   this.$element.find( 'legend' ).detach();
+
this.$element.find(
'.rclistfrom, .rcnotefrom, .rcoptions-listfromreset'
).detach();

-- 
To view, visit https://gerrit.wikimedia.org/r/373716
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I2249bf3d313232fe2f0dff6e34c5140885a13735
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Mooeypoo 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: RCFilters: Hide saved queries from anonymous users

2017-08-23 Thread Mooeypoo (Code Review)
Mooeypoo has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/373402 )

Change subject: RCFilters: Hide saved queries from anonymous users
..

RCFilters: Hide saved queries from anonymous users

Bug: T173992
Change-Id: I5acb9ca4dd20de83da5db42c7c9053fccb091da0
---
M resources/src/mediawiki.rcfilters/mw.rcfilters.Controller.js
M 
resources/src/mediawiki.rcfilters/ui/mw.rcfilters.ui.FilterTagMultiselectWidget.js
M resources/src/mediawiki.rcfilters/ui/mw.rcfilters.ui.FilterWrapperWidget.js
3 files changed, 55 insertions(+), 43 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/02/373402/1

diff --git a/resources/src/mediawiki.rcfilters/mw.rcfilters.Controller.js 
b/resources/src/mediawiki.rcfilters/mw.rcfilters.Controller.js
index 209e7c8..9906119 100644
--- a/resources/src/mediawiki.rcfilters/mw.rcfilters.Controller.js
+++ b/resources/src/mediawiki.rcfilters/mw.rcfilters.Controller.js
@@ -212,21 +212,23 @@
this.filtersModel
);
 
-   try {
-   parsedSavedQueries = JSON.parse( mw.user.options.get( 
this.savedQueriesPreferenceName ) || '{}' );
-   } catch ( err ) {
-   parsedSavedQueries = {};
-   }
+   if ( !mw.user.isAnon() ) {
+   try {
+   parsedSavedQueries = JSON.parse( 
mw.user.options.get( this.savedQueriesPreferenceName ) || '{}' );
+   } catch ( err ) {
+   parsedSavedQueries = {};
+   }
 
-   // The queries are saved in a minimized state, so we need
-   // to send over the base state so the saved queries model
-   // can normalize them per each query item
-   this.savedQueriesModel.initialize(
-   parsedSavedQueries,
-   this._getBaseFilterState(),
-   // This is for backwards compatibility - delete all 
excluded filter states
-   Object.keys( 
this.filtersModel.getExcludedFiltersState() )
-   );
+   // The queries are saved in a minimized state, so we 
need
+   // to send over the base state so the saved queries 
model
+   // can normalize them per each query item
+   this.savedQueriesModel.initialize(
+   parsedSavedQueries,
+   this._getBaseFilterState(),
+   // This is for backwards compatibility - delete 
all excluded filter states
+   Object.keys( 
this.filtersModel.getExcludedFiltersState() )
+   );
+   }
 
// Check whether we need to load defaults.
// We do this by checking whether the current URI query
@@ -238,7 +240,7 @@
// or on request
this.initializing = true;
if (
-   this.savedQueriesModel.getDefault() &&
+   !mw.user.isAnon() && 
this.savedQueriesModel.getDefault() &&
!this.uriProcessor.doesQueryContainRecognizedParams( 
uri.query )
) {
// We have defaults from a saved query.
@@ -1039,7 +1041,7 @@
var data, queryHighlights,
savedParams = {},
savedHighlights = {},
-   defaultSavedQueryItem = 
this.savedQueriesModel.getItemByID( this.savedQueriesModel.getDefault() );
+   defaultSavedQueryItem = !mw.user.isAnon() && 
this.savedQueriesModel.getItemByID( this.savedQueriesModel.getDefault() );
 
if ( defaultSavedQueryItem ) {
data = defaultSavedQueryItem.getData();
diff --git 
a/resources/src/mediawiki.rcfilters/ui/mw.rcfilters.ui.FilterTagMultiselectWidget.js
 
b/resources/src/mediawiki.rcfilters/ui/mw.rcfilters.ui.FilterTagMultiselectWidget.js
index 3aa7161..b15b034 100644
--- 
a/resources/src/mediawiki.rcfilters/ui/mw.rcfilters.ui.FilterTagMultiselectWidget.js
+++ 
b/resources/src/mediawiki.rcfilters/ui/mw.rcfilters.ui.FilterTagMultiselectWidget.js
@@ -85,17 +85,20 @@
classes: [ 
'mw-rcfilters-ui-filterTagMultiselectWidget-resetButton' ]
} );
 
-   this.saveQueryButton = new 
mw.rcfilters.ui.SaveFiltersPopupButtonWidget(
-   this.controller,
-   this.queriesModel
-   );
+   if ( !mw.user.isAnon() ) {
+   this.saveQueryButton = new 
mw.rcfilters.ui.SaveFiltersPopupButtonWidget(
+   this.controller,
+   this.queriesModel
+   );
 
-   

[MediaWiki-commits] [Gerrit] mediawiki/core[master]: RCFilters: Adjust puspin 'default' icon behavior and style

2017-08-23 Thread Mooeypoo (Code Review)
Mooeypoo has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/373399 )

Change subject: RCFilters: Adjust puspin 'default' icon behavior and style
..

RCFilters: Adjust puspin 'default' icon behavior and style

Bug: T173264
Change-Id: I8d977bb97e91a19c24527c66120f142738135730
---
M 
resources/src/mediawiki.rcfilters/styles/mw.rcfilters.ui.SavedLinksListItemWidget.less
M 
resources/src/mediawiki.rcfilters/ui/mw.rcfilters.ui.SavedLinksListItemWidget.js
2 files changed, 16 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/99/373399/1

diff --git 
a/resources/src/mediawiki.rcfilters/styles/mw.rcfilters.ui.SavedLinksListItemWidget.less
 
b/resources/src/mediawiki.rcfilters/styles/mw.rcfilters.ui.SavedLinksListItemWidget.less
index 2daa76e..e7433e2 100644
--- 
a/resources/src/mediawiki.rcfilters/styles/mw.rcfilters.ui.SavedLinksListItemWidget.less
+++ 
b/resources/src/mediawiki.rcfilters/styles/mw.rcfilters.ui.SavedLinksListItemWidget.less
@@ -17,8 +17,11 @@
// then the icon needs to be slightly smaller as well, so that
// when we toggle 'default' the icon doesn't bounce the option
// height up a little
-   width: 1.7em;
-   height: 1.7em;
+   width: 1.2em;
+   height: 1.2em;
+   min-width: 16px;
+   min-height: 16px;
+   opacity: 0.5;
}
 
&-icon span {
diff --git 
a/resources/src/mediawiki.rcfilters/ui/mw.rcfilters.ui.SavedLinksListItemWidget.js
 
b/resources/src/mediawiki.rcfilters/ui/mw.rcfilters.ui.SavedLinksListItemWidget.js
index 3655c16..ab0abb3 100644
--- 
a/resources/src/mediawiki.rcfilters/ui/mw.rcfilters.ui.SavedLinksListItemWidget.js
+++ 
b/resources/src/mediawiki.rcfilters/ui/mw.rcfilters.ui.SavedLinksListItemWidget.js
@@ -93,6 +93,7 @@
} );
this.$element.on( { click: this.onClick.bind( this ) } );
this.$label.on( { click: this.onClick.bind( this ) } );
+   this.$icon.on( { click: this.onDefaultIconClick.bind( this ) } 
);
// Prevent propagation on mousedown for the save button
// so the menu doesn't close
this.saveButton.$element.on( { mousedown: function () { return 
false; } } );
@@ -178,6 +179,16 @@
this.emit( 'click' );
}
};
+
+   /**
+* Respond to click on the 'default' icon. Open the submenu where the
+* default state can be changed.
+*/
+   mw.rcfilters.ui.SavedLinksListItemWidget.prototype.onDefaultIconClick = 
function () {
+   this.menu.toggle();
+   return false;
+   };
+
/**
 * Respond to popup button click event
 */

-- 
To view, visit https://gerrit.wikimedia.org/r/373399
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I8d977bb97e91a19c24527c66120f142738135730
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Mooeypoo 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: RCFilters: Minimize vertical space

2017-08-22 Thread Mooeypoo (Code Review)
Mooeypoo has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/373160 )

Change subject: RCFilters: Minimize vertical space
..

RCFilters: Minimize vertical space

Bug: T173265
Change-Id: I38821571450c59b18c753c8b20ad9f19f01b6276
---
M resources/src/mediawiki.rcfilters/styles/mw.rcfilters.less
M 
resources/src/mediawiki.rcfilters/styles/mw.rcfilters.ui.ChangesListWrapperWidget.less
M 
resources/src/mediawiki.rcfilters/styles/mw.rcfilters.ui.FilterWrapperWidget.less
3 files changed, 2 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/60/373160/1

diff --git a/resources/src/mediawiki.rcfilters/styles/mw.rcfilters.less 
b/resources/src/mediawiki.rcfilters/styles/mw.rcfilters.less
index d5528e1..c667bac 100644
--- a/resources/src/mediawiki.rcfilters/styles/mw.rcfilters.less
+++ b/resources/src/mediawiki.rcfilters/styles/mw.rcfilters.less
@@ -31,8 +31,7 @@
}
 
.rcfilters-head {
-   min-height: 220px;
-   margin-top: 1em;
+   min-height: 200px;
 
&:not( .mw-rcfilters-ui-ready ) {
opacity: 0.5;
diff --git 
a/resources/src/mediawiki.rcfilters/styles/mw.rcfilters.ui.ChangesListWrapperWidget.less
 
b/resources/src/mediawiki.rcfilters/styles/mw.rcfilters.ui.ChangesListWrapperWidget.less
index 31f3f1d..0c8bc58 100644
--- 
a/resources/src/mediawiki.rcfilters/styles/mw.rcfilters.ui.ChangesListWrapperWidget.less
+++ 
b/resources/src/mediawiki.rcfilters/styles/mw.rcfilters.ui.ChangesListWrapperWidget.less
@@ -13,7 +13,7 @@
 
&-newChanges {
min-height: 34px;
-   margin: 10px 0;
+   margin: 8px 0;
text-align: center;
}
 
diff --git 
a/resources/src/mediawiki.rcfilters/styles/mw.rcfilters.ui.FilterWrapperWidget.less
 
b/resources/src/mediawiki.rcfilters/styles/mw.rcfilters.ui.FilterWrapperWidget.less
index 87d09e0..a89b69c 100644
--- 
a/resources/src/mediawiki.rcfilters/styles/mw.rcfilters.ui.FilterWrapperWidget.less
+++ 
b/resources/src/mediawiki.rcfilters/styles/mw.rcfilters.ui.FilterWrapperWidget.less
@@ -1,5 +1,4 @@
 .mw-rcfilters-ui-filterWrapperWidget {
-   margin-top: 1em;
width: 100%;
// Make sure this uses the interface direction, not the content 
direction
direction: ltr;

-- 
To view, visit https://gerrit.wikimedia.org/r/373160
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I38821571450c59b18c753c8b20ad9f19f01b6276
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Mooeypoo 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: RCFilters: Truncate long saved query titles

2017-08-22 Thread Mooeypoo (Code Review)
Mooeypoo has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/373158 )

Change subject: RCFilters: Truncate long saved query titles
..

RCFilters: Truncate long saved query titles

Bug: T171901
Change-Id: Ibb03d3aafe4b3b083a5da064f2a2e809ecd108ad
---
M 
resources/src/mediawiki.rcfilters/styles/mw.rcfilters.ui.FilterTagMultiselectWidget.less
1 file changed, 4 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/58/373158/1

diff --git 
a/resources/src/mediawiki.rcfilters/styles/mw.rcfilters.ui.FilterTagMultiselectWidget.less
 
b/resources/src/mediawiki.rcfilters/styles/mw.rcfilters.ui.FilterTagMultiselectWidget.less
index 076636c..f3e1351 100644
--- 
a/resources/src/mediawiki.rcfilters/styles/mw.rcfilters.ui.FilterTagMultiselectWidget.less
+++ 
b/resources/src/mediawiki.rcfilters/styles/mw.rcfilters.ui.FilterTagMultiselectWidget.less
@@ -42,6 +42,10 @@
color: #222; // Base10
font-weight: bold;
margin-left: 1em;
+   width: ~'calc( 100% - 10em )';
+   overflow: hidden;
+   text-overflow: ellipsis;
+   white-space: nowrap;
}
}
}

-- 
To view, visit https://gerrit.wikimedia.org/r/373158
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ibb03d3aafe4b3b083a5da064f2a2e809ecd108ad
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Mooeypoo 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: RCFilters: Ignore sticky filters when emptying all filters

2017-08-21 Thread Mooeypoo (Code Review)
Mooeypoo has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/372891 )

Change subject: RCFilters: Ignore sticky filters when emptying all filters
..

RCFilters: Ignore sticky filters when emptying all filters

Also, as a bonus, actually connect the 'update' event to the already
existing method that was supposed to respond to an update event on
the 'enhanced' filter.

Bug: T172580
Change-Id: I4db5689d1d2ef627bbb5ec34f8af772157d1ff09
---
M resources/src/mediawiki.rcfilters/dm/mw.rcfilters.dm.FiltersViewModel.js
M 
resources/src/mediawiki.rcfilters/ui/mw.rcfilters.ui.ChangesLimitPopupWidget.js
2 files changed, 4 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/91/372891/1

diff --git 
a/resources/src/mediawiki.rcfilters/dm/mw.rcfilters.dm.FiltersViewModel.js 
b/resources/src/mediawiki.rcfilters/dm/mw.rcfilters.dm.FiltersViewModel.js
index cf226da..a8ee06b 100644
--- a/resources/src/mediawiki.rcfilters/dm/mw.rcfilters.dm.FiltersViewModel.js
+++ b/resources/src/mediawiki.rcfilters/dm/mw.rcfilters.dm.FiltersViewModel.js
@@ -793,7 +793,9 @@
 */
mw.rcfilters.dm.FiltersViewModel.prototype.emptyAllFilters = function 
() {
this.getItems().forEach( function ( filterItem ) {
-   this.toggleFilterSelected( filterItem.getName(), false 
);
+   if ( !filterItem.getGroupModel().isSticky() ) {
+   this.toggleFilterSelected( 
filterItem.getName(), false );
+   }
}.bind( this ) );
};
 
diff --git 
a/resources/src/mediawiki.rcfilters/ui/mw.rcfilters.ui.ChangesLimitPopupWidget.js
 
b/resources/src/mediawiki.rcfilters/ui/mw.rcfilters.ui.ChangesLimitPopupWidget.js
index a8c6c28..7248bd7 100644
--- 
a/resources/src/mediawiki.rcfilters/ui/mw.rcfilters.ui.ChangesLimitPopupWidget.js
+++ 
b/resources/src/mediawiki.rcfilters/ui/mw.rcfilters.ui.ChangesLimitPopupWidget.js
@@ -32,6 +32,7 @@
// Events
this.valuePicker.connect( this, { choose: [ 'emit', 'limit' ] } 
);
this.groupByPageCheckbox.connect( this, { change: [ 'emit', 
'groupByPage' ] } );
+   this.groupByPageItemModel.connect( this, { update: 
'onGroupByPageModelUpdate' } );
 
// Initialize
this.$element

-- 
To view, visit https://gerrit.wikimedia.org/r/372891
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I4db5689d1d2ef627bbb5ec34f8af772157d1ff09
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Mooeypoo 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...Echo[master]: Fix 'unread' dot top padding regression

2017-08-21 Thread Mooeypoo (Code Review)
Mooeypoo has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/372865 )

Change subject: Fix 'unread' dot top padding regression
..

Fix 'unread' dot top padding regression

All frameless buttons seemed to have recieved a generous padding-top
in the latest OOUI release. This fix overrides that.

Bug: T173059
Change-Id: Ia1f1bbc48410555163afabc84a199e7a69bb95dc
---
M modules/styles/mw.echo.ui.ToggleReadCircleButtonWidget.less
1 file changed, 5 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Echo 
refs/changes/65/372865/1

diff --git a/modules/styles/mw.echo.ui.ToggleReadCircleButtonWidget.less 
b/modules/styles/mw.echo.ui.ToggleReadCircleButtonWidget.less
index 5c99044..ecee641 100644
--- a/modules/styles/mw.echo.ui.ToggleReadCircleButtonWidget.less
+++ b/modules/styles/mw.echo.ui.ToggleReadCircleButtonWidget.less
@@ -22,6 +22,11 @@
}
}
 
+   // Override OOUI specific rule for frameless buttons that adds a ~2.5em 
padding-top
+   
&.oo-ui-widget.oo-ui-widget-enabled.oo-ui-buttonElement.oo-ui-buttonElement-frameless
 > .oo-ui-buttonElement-button {
+   padding-top: 0;
+   }
+
&:hover .mw-echo-ui-toggleReadCircleButtonWidget-circle {
// Mark as read
background-color: #447ff5;

-- 
To view, visit https://gerrit.wikimedia.org/r/372865
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia1f1bbc48410555163afabc84a199e7a69bb95dc
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Echo
Gerrit-Branch: master
Gerrit-Owner: Mooeypoo 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: RCFilters: Fix highlight circle misalignment

2017-08-18 Thread Mooeypoo (Code Review)
Mooeypoo has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/372590 )

Change subject: RCFilters: Fix highlight circle misalignment
..

RCFilters: Fix highlight circle misalignment

Bug: T172820
Change-Id: I44b91529e8edb6a3fcc65ae9159211dbd2d7f4f1
---
M 
resources/src/mediawiki.rcfilters/styles/mw.rcfilters.ui.HighlightColorPickerWidget.less
1 file changed, 7 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/90/372590/1

diff --git 
a/resources/src/mediawiki.rcfilters/styles/mw.rcfilters.ui.HighlightColorPickerWidget.less
 
b/resources/src/mediawiki.rcfilters/styles/mw.rcfilters.ui.HighlightColorPickerWidget.less
index 4a7c3f8..4fca8d0 100644
--- 
a/resources/src/mediawiki.rcfilters/styles/mw.rcfilters.ui.HighlightColorPickerWidget.less
+++ 
b/resources/src/mediawiki.rcfilters/styles/mw.rcfilters.ui.HighlightColorPickerWidget.less
@@ -9,6 +9,13 @@
 
&-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
+   margin-top: 0.5em !important;
+
// Make the rule much more specific to override OOUI
.oo-ui-iconElement-icon.oo-ui-icon-check {
// Override OOUI icon dimensions

-- 
To view, visit https://gerrit.wikimedia.org/r/372590
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I44b91529e8edb6a3fcc65ae9159211dbd2d7f4f1
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Mooeypoo 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] oojs/ui[master]: Add 'title' attribute to the 'remove' button in TagItemWidget

2017-08-18 Thread Mooeypoo (Code Review)
Mooeypoo has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/372589 )

Change subject: Add 'title' attribute to the 'remove' button in TagItemWidget
..

Add 'title' attribute to the 'remove' button in TagItemWidget

Bug: T173608
Change-Id: I83e2c305f689f163b8c201b7ca5d912a942ed985
---
M i18n/en.json
M i18n/qqq.json
M src/core.js
M src/widgets/CapsuleItemWidget.js
M src/widgets/TagItemWidget.js
5 files changed, 8 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/oojs/ui refs/changes/89/372589/1

diff --git a/i18n/en.json b/i18n/en.json
index be00832..6fb5f44 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -22,6 +22,7 @@
"ooui-toolbar-more": "More",
"ooui-toolgroup-expand": "More",
"ooui-toolgroup-collapse": "Fewer",
+   "ooui-tag-remove": "Remove",
"ooui-dialog-message-accept": "OK",
"ooui-dialog-message-reject": "Cancel",
"ooui-dialog-process-error": "Something went wrong",
diff --git a/i18n/qqq.json b/i18n/qqq.json
index 1a096ef..d11dc0a 100644
--- a/i18n/qqq.json
+++ b/i18n/qqq.json
@@ -26,6 +26,7 @@
"ooui-toolbar-more": "Label for the toolbar group that contains a list 
of all other available tools.\n{{Identical|More}}",
"ooui-toolgroup-expand": "Label for the fake tool that expands the full 
list of tools in a toolbar group.\n\nSee also:\n* 
{{msg-mw|Ooui-toolgroup-collapse}}\n{{Identical|More}}",
"ooui-toolgroup-collapse": "Label for the fake tool that collapses the 
full list of tools in a toolbar group.\n\nSee also:\n* 
{{msg-mw|Ooui-toolgroup-expand}}\n{{Identical|Fewer}}",
+   "ooui-tag-remove": "Text for the tooltip for the button that removes a 
tag in the tag widget",
"ooui-dialog-message-accept": "Default label for the accept button of a 
message dialog\n{{Identical|OK}}",
"ooui-dialog-message-reject": "Default label for the reject button of a 
message dialog\n{{Identical|Cancel}}",
"ooui-dialog-process-error": "Title for process dialog error 
description",
diff --git a/src/core.js b/src/core.js
index 5e0b2a4..7bb3356 100644
--- a/src/core.js
+++ b/src/core.js
@@ -348,6 +348,8 @@
'ooui-toolgroup-expand': 'More',
// Label for the fake tool that collapses the full list of 
tools in a toolbar group
'ooui-toolgroup-collapse': 'Fewer',
+   // Default label for the tooltip for the button that removes a 
tag item
+   'ooui-tag-remove': 'Remove',
// Default label for the accept button of a confirmation dialog
'ooui-dialog-message-accept': 'OK',
// Default label for the reject button of a confirmation dialog
diff --git a/src/widgets/CapsuleItemWidget.js b/src/widgets/CapsuleItemWidget.js
index e304767..66722ef 100644
--- a/src/widgets/CapsuleItemWidget.js
+++ b/src/widgets/CapsuleItemWidget.js
@@ -29,7 +29,8 @@
this.closeButton = new OO.ui.ButtonWidget( {
framed: false,
icon: 'close',
-   tabIndex: -1
+   tabIndex: -1,
+   title: OO.ui.msg( 'ooui-tag-remove' )
} ).on( 'click', this.onCloseClick.bind( this ) );
 
this.on( 'disable', function ( disabled ) {
diff --git a/src/widgets/TagItemWidget.js b/src/widgets/TagItemWidget.js
index 5666446..03e9631 100644
--- a/src/widgets/TagItemWidget.js
+++ b/src/widgets/TagItemWidget.js
@@ -32,7 +32,8 @@
this.closeButton = new OO.ui.ButtonWidget( {
framed: false,
icon: 'close',
-   tabIndex: -1
+   tabIndex: -1,
+   title: OO.ui.msg( 'ooui-tag-remove' )
} );
this.closeButton.setDisabled( this.isDisabled() );
 

-- 
To view, visit https://gerrit.wikimedia.org/r/372589
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I83e2c305f689f163b8c201b7ca5d912a942ed985
Gerrit-PatchSet: 1
Gerrit-Project: oojs/ui
Gerrit-Branch: master
Gerrit-Owner: Mooeypoo 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: RCFilters: Add title attribute to [x] button

2017-08-18 Thread Mooeypoo (Code Review)
Mooeypoo has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/372588 )

Change subject: RCFilters: Add title attribute to [x] button
..

RCFilters: Add title attribute to [x] button

For accessibility, add title attribute to the remove button in
the active filters area.

Bug: T173608
Change-Id: Idcf735e3b610345a8206f83fe5f8115900455cc2
---
M languages/i18n/en.json
M languages/i18n/qqq.json
M resources/Resources.php
M resources/src/mediawiki.rcfilters/ui/mw.rcfilters.ui.TagItemWidget.js
4 files changed, 7 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/88/372588/1

diff --git a/languages/i18n/en.json b/languages/i18n/en.json
index 6126bbd..0b80c9e 100644
--- a/languages/i18n/en.json
+++ b/languages/i18n/en.json
@@ -1350,6 +1350,7 @@
"recentchanges-legend-unpatrolled": 
"{{int:recentchanges-label-unpatrolled}}",
"recentchanges-legend-plusminus": "(±123)",
"recentchanges-submit": "Show",
+   "rcfilters-tag-remove": "Remove",
"rcfilters-legend-heading": "List of abbreviations:",
"rcfilters-other-review-tools": "Other review tools",
"rcfilters-group-results-by-page": "Group results by page",
diff --git a/languages/i18n/qqq.json b/languages/i18n/qqq.json
index bc0fe2c..dd70ba2 100644
--- a/languages/i18n/qqq.json
+++ b/languages/i18n/qqq.json
@@ -1540,6 +1540,7 @@
"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.",
"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.",
diff --git a/resources/Resources.php b/resources/Resources.php
index c0c5d9e..6be211e 100644
--- a/resources/Resources.php
+++ b/resources/Resources.php
@@ -1832,6 +1832,7 @@
],
],
'messages' => [
+   'rcfilters-tag-remove',
'rcfilters-activefilters',
'rcfilters-advancedfilters',
'rcfilters-group-results-by-page',
diff --git 
a/resources/src/mediawiki.rcfilters/ui/mw.rcfilters.ui.TagItemWidget.js 
b/resources/src/mediawiki.rcfilters/ui/mw.rcfilters.ui.TagItemWidget.js
index bf75149..d5cf405 100644
--- a/resources/src/mediawiki.rcfilters/ui/mw.rcfilters.ui.TagItemWidget.js
+++ b/resources/src/mediawiki.rcfilters/ui/mw.rcfilters.ui.TagItemWidget.js
@@ -48,6 +48,10 @@
this.$highlight = $( '' )
.addClass( 'mw-rcfilters-ui-tagItemWidget-highlight' );
 
+   // HACK: This should go upstream
+   // Add title attribute to 'x' button
+   this.closeButton.$element.attr( 'title', mw.msg( 
'rcfilters-tag-remove' ) );
+
// Events
this.model.connect( this, { update: 'onModelUpdate' } );
 

-- 
To view, visit https://gerrit.wikimedia.org/r/372588
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Idcf735e3b610345a8206f83fe5f8115900455cc2
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Mooeypoo 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: RCFilters: Add title attribute to highlighted rows

2017-08-18 Thread Mooeypoo (Code Review)
Mooeypoo has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/372587 )

Change subject: RCFilters: Add title attribute to highlighted rows
..

RCFilters: Add title attribute to highlighted rows

For accessibility and screen readers, add the actual highlighted
filter names to a title attribute in rows that are highlighted.

Change-Id: Id71a45621e545897988010acfd054760a617b1f1
---
M languages/i18n/en.json
M languages/i18n/qqq.json
M resources/Resources.php
M 
resources/src/mediawiki.rcfilters/ui/mw.rcfilters.ui.ChangesListWrapperWidget.js
4 files changed, 32 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/87/372587/1

diff --git a/languages/i18n/en.json b/languages/i18n/en.json
index 6126bbd..b5cc6a5 100644
--- a/languages/i18n/en.json
+++ b/languages/i18n/en.json
@@ -1362,6 +1362,7 @@
"rcfilters-hours-title": "Recent hours",
"rcfilters-days-show-days": "$1 {{PLURAL:$1|day|days}}",
"rcfilters-days-show-hours": "$1 {{PLURAL:$1|hour|hours}}",
+   "rcfilters-highlighted-filters-list": "Highlighted: $1",
"rcfilters-quickfilters": "Saved filters",
"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.",
diff --git a/languages/i18n/qqq.json b/languages/i18n/qqq.json
index bc0fe2c..0e28161 100644
--- a/languages/i18n/qqq.json
+++ b/languages/i18n/qqq.json
@@ -1552,6 +1552,7 @@
"rcfilters-hours-title": "Title for the options to change the number of 
hours for the results shown.",
"rcfilters-days-show-days": "Title for the button that opens the 
operation to control the day range for the results. \n\nParameters: $1 - Number 
of days shown",
"rcfilters-days-show-hours": "Title for the button that opens the 
operation to control the hour range for the results. \n\nParameters: $1 - 
Number of hours shown",
+   "rcfilters-highlighted-filters-list": "Text for the tooltip that is 
displayed over highlighted results, specifying which filter the result matches 
in [[Special:RecentChanges]] when RCFilters are enabled. \n\nParameters: $1 - A 
comma separated list of matching filter names.",
"rcfilters-quickfilters": "Label for the button that opens the saved 
filter settings menu in [[Special:RecentChanges]]",
"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.",
diff --git a/resources/Resources.php b/resources/Resources.php
index c0c5d9e..0216471 100644
--- a/resources/Resources.php
+++ b/resources/Resources.php
@@ -1842,6 +1842,7 @@
'rcfilters-hours-title',
'rcfilters-days-show-days',
'rcfilters-days-show-hours',
+   'rcfilters-highlighted-filters-list',
'rcfilters-quickfilters',
'rcfilters-quickfilters-placeholder-title',
'rcfilters-quickfilters-placeholder-description',
diff --git 
a/resources/src/mediawiki.rcfilters/ui/mw.rcfilters.ui.ChangesListWrapperWidget.js
 
b/resources/src/mediawiki.rcfilters/ui/mw.rcfilters.ui.ChangesListWrapperWidget.js
index 28a80cc..9825108 100644
--- 
a/resources/src/mediawiki.rcfilters/ui/mw.rcfilters.ui.ChangesListWrapperWidget.js
+++ 
b/resources/src/mediawiki.rcfilters/ui/mw.rcfilters.ui.ChangesListWrapperWidget.js
@@ -303,10 +303,33 @@
}
 
this.filtersViewModel.getHighlightedItems().forEach( function ( 
filterItem ) {
+   var $elements = this.$element.find( '.' + 
filterItem.getCssClass() );
+
// Add highlight class to all highlighted list items
-   this.$element.find( '.' + filterItem.getCssClass() )
+   $elements
.addClass( 'mw-rcfilters-highlight-color-' + 
filterItem.getHighlightColor() );
+
+   $elements.each( function () {
+   var filterString = $( this ).attr( 
'data-highlightedFilters' ) || '',
+   filters = filterString ? 
filterString.split( '|' ) : [];
+
+   if ( filters.indexOf( filterItem.getLabel() ) 
=== -1 ) {
+   filters.push( filterItem.getLabel() );
+   }
+
+   $( this )
+   .attr( 'data-highlightedFilters', 
filters

[MediaWiki-commits] [Gerrit] mediawiki/core[master]: RCFilters: Load default saved query if it exists

2017-08-18 Thread Mooeypoo (Code Review)
Mooeypoo has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/372573 )

Change subject: RCFilters: Load default saved query if it exists
..

RCFilters: Load default saved query if it exists

Bug: T166908
Change-Id: Ic3931bc0d67b340db11ed100aad836e8d867fa56
---
M includes/specialpage/ChangesListSpecialPage.php
1 file changed, 36 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/73/372573/1

diff --git a/includes/specialpage/ChangesListSpecialPage.php 
b/includes/specialpage/ChangesListSpecialPage.php
index 645fbb2..17cb3bb 100644
--- a/includes/specialpage/ChangesListSpecialPage.php
+++ b/includes/specialpage/ChangesListSpecialPage.php
@@ -519,12 +519,47 @@
public function execute( $subpage ) {
$this->rcSubpage = $subpage;
 
+   $opts = $this->getOptions();
+   $recognizedParamsExist = false;
+   foreach ( $opts as $key => $val ) {
+   // TODO: Remove 'sticky' things, like 'days' and 
'limit', and 'enhanced'
+   if ( $this->getRequest()->getCheck( $key ) ) {
+   $recognizedParamsExist = true;
+   break;
+   }
+   }
+
+   if (
+   !$recognizedParamsExist &&
+   $this->getUser()->getOption( 'rcenhancedfilters' )
+   ) {
+   $savedQueriesString = $this->getUser()->getOption( 
'rcfilters-saved-queries' );
+   $savedQueries = json_decode( $savedQueriesString );
+   if ( $savedQueries && isset( $savedQueries[ 'default' ] 
) ) {
+   // Redirect to saved queries default
+   $defaultQuery = $savedQueries[ 'queries' ][ 
$savedQueries[ 'default' ] ];
+   // Build the entire parameter list:
+   $query = array_merge(
+   $defaultQuery[ 'filters' ],
+   $defaultQuery[ 'highlights' ],
+   [
+   'highlight' => $defaultQuery[ 
'highlight' ],
+   'invert' => $defaultQuery[ 
'invert' ],
+   ],
+   'urlversion' => '2',
+   );
+
+   // Redirect
+   $this->getOutput()->redirect( 
$this->getPageTitle()->getCanonicalURL( $query ) );
+   }
+   }
+
+
$this->setHeaders();
$this->outputHeader();
$this->addModules();
 
$rows = $this->getRows();
-   $opts = $this->getOptions();
if ( $rows === false ) {
$rows = new FakeResultWrapper( [] );
}

-- 
To view, visit https://gerrit.wikimedia.org/r/372573
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic3931bc0d67b340db11ed100aad836e8d867fa56
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Mooeypoo 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: RCFilters: Convert saved queries from filters to parameters

2017-08-18 Thread Mooeypoo (Code Review)
Mooeypoo has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/372572 )

Change subject: RCFilters: Convert saved queries from filters to parameters
..

RCFilters: Convert saved queries from filters to parameters

This will allow us to load them in the backend, and to keep
consistency between RecentChanges and Watchlist if needed.

Bug: T166908
Change-Id: I8e26b66e43bd16282b7bdb52abc152f92a9c877d
---
M resources/src/mediawiki.rcfilters/dm/mw.rcfilters.dm.FilterGroup.js
M resources/src/mediawiki.rcfilters/dm/mw.rcfilters.dm.FiltersViewModel.js
M resources/src/mediawiki.rcfilters/dm/mw.rcfilters.dm.SavedQueriesModel.js
M resources/src/mediawiki.rcfilters/mw.rcfilters.Controller.js
M resources/src/mediawiki.rcfilters/mw.rcfilters.UriProcessor.js
M resources/src/mediawiki.rcfilters/mw.rcfilters.init.js
6 files changed, 253 insertions(+), 192 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/72/372572/1

diff --git 
a/resources/src/mediawiki.rcfilters/dm/mw.rcfilters.dm.FilterGroup.js 
b/resources/src/mediawiki.rcfilters/dm/mw.rcfilters.dm.FilterGroup.js
index 6acc44d..5a2d9b1 100644
--- a/resources/src/mediawiki.rcfilters/dm/mw.rcfilters.dm.FilterGroup.js
+++ b/resources/src/mediawiki.rcfilters/dm/mw.rcfilters.dm.FilterGroup.js
@@ -812,6 +812,19 @@
};
 
/**
+* Check whether this group is represented by a single parameter
+* or whether each item is its own parameter
+*
+* @return {boolean} This group is a single parameter
+*/
+   mw.rcfilters.dm.FilterGroup.prototype.isGroupParameter = function () {
+   return (
+   this.getType() === 'string_options' ||
+   this.getType() === 'single_option'
+   );
+   };
+
+   /**
 * Get display group
 *
 * @return {string} Display group
diff --git 
a/resources/src/mediawiki.rcfilters/dm/mw.rcfilters.dm.FiltersViewModel.js 
b/resources/src/mediawiki.rcfilters/dm/mw.rcfilters.dm.FiltersViewModel.js
index cf226da..6963160 100644
--- a/resources/src/mediawiki.rcfilters/dm/mw.rcfilters.dm.FiltersViewModel.js
+++ b/resources/src/mediawiki.rcfilters/dm/mw.rcfilters.dm.FiltersViewModel.js
@@ -599,6 +599,31 @@
};
 
/**
+* Get the parameter names that represent filters that are excluded
+* from saved queries.
+*
+* @return {string[]} Parameter names
+*/
+   mw.rcfilters.dm.FiltersViewModel.prototype.getExcludedParams = function 
() {
+   var result = [];
+
+   $.each( this.groups, function ( name, model ) {
+   if ( model.isExcludedFromSavedQueries() ) {
+   if ( model.isGroupParameter() ) {
+   result.push( name );
+   } else {
+   // Each filter is its own param
+   result.concat( model.getItems().map( 
function ( filterItem ) {
+   return 
filterItem.getParamName();
+   } ) );
+   }
+   }
+   } );
+
+   return result;
+   };
+
+   /**
 * Analyze the groups and their filters and output an object 
representing
 * the state of the parameters they represent.
 *
diff --git 
a/resources/src/mediawiki.rcfilters/dm/mw.rcfilters.dm.SavedQueriesModel.js 
b/resources/src/mediawiki.rcfilters/dm/mw.rcfilters.dm.SavedQueriesModel.js
index a7f3d23..91b0d4b 100644
--- a/resources/src/mediawiki.rcfilters/dm/mw.rcfilters.dm.SavedQueriesModel.js
+++ b/resources/src/mediawiki.rcfilters/dm/mw.rcfilters.dm.SavedQueriesModel.js
@@ -8,9 +8,10 @@
 *
 * @constructor
 * @param {Object} [config] Configuration options
+* @param {mw.rcfilters.dm.FiltersViewModel} filtersModel Filters model
 * @cfg {string} [default] Default query ID
 */
-   mw.rcfilters.dm.SavedQueriesModel = function 
MwRcfiltersDmSavedQueriesModel( config ) {
+   mw.rcfilters.dm.SavedQueriesModel = function 
MwRcfiltersDmSavedQueriesModel( config, filtersModel ) {
config = config || {};
 
// Mixin constructor
@@ -18,6 +19,7 @@
OO.EmitterList.call( this );
 
this.default = config.default;
+   this.filtersModel = filtersModel;
 
// Events
this.aggregate( { update: 'itemUpdate' } );
@@ -50,6 +52,9 @@
 * Initialize the saved queries model by reading it from the user's 
settings.
 * The structure of the saved queries is:
 * {
+*version: (string) Version number; if version 2, the query 
represents
+* parameters. Ot

[MediaWiki-commits] [Gerrit] mediawiki/core[wmf/1.30.0-wmf.14]: RCFilters: Fix validation for single_option groups

2017-08-17 Thread Mooeypoo (Code Review)
Mooeypoo has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/372449 )

Change subject: RCFilters: Fix validation for single_option groups
..

RCFilters: Fix validation for single_option groups

The single_option groups have a base definition that means they
always must have a value, and must never have more than one value.
The previous way we attempted to do that was confusing and missed
a case where after resetting filters, two values were selected before
one could be unselected, which then broke the behavior in the
entire group.

This fix reorganizes the validation when an item in the group is
selected or unselected to make sure the group retains its promised
behavior.

Bug: T173303
Change-Id: I5758ec324a26c0e5e6f5c473d206e818a1d22523
(cherry picked from commit 4f6624451aa979a49840a10071cac75a1a5aae80)
---
M resources/src/mediawiki.rcfilters/dm/mw.rcfilters.dm.FilterGroup.js
1 file changed, 31 insertions(+), 26 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/49/372449/1

diff --git 
a/resources/src/mediawiki.rcfilters/dm/mw.rcfilters.dm.FilterGroup.js 
b/resources/src/mediawiki.rcfilters/dm/mw.rcfilters.dm.FilterGroup.js
index 6acc44d..4dc86f6 100644
--- a/resources/src/mediawiki.rcfilters/dm/mw.rcfilters.dm.FilterGroup.js
+++ b/resources/src/mediawiki.rcfilters/dm/mw.rcfilters.dm.FilterGroup.js
@@ -222,34 +222,39 @@
mw.rcfilters.dm.FilterGroup.prototype.onFilterItemUpdate = function ( 
item ) {
// Update state
var changed = false,
-   active = this.areAnySelected();
+   active = this.areAnySelected(),
+   model = this;
 
-   if (
-   item.isSelected() &&
-   this.getType() === 'single_option' &&
-   this.currSelected &&
-   this.currSelected !== item
-   ) {
-   this.currSelected.toggleSelected( false );
-   }
+   if ( this.getType() === 'single_option' ) {
+   // This group must have one item selected always
+   // and must never have more than one item selected at a 
time
+   if ( this.getSelectedItems().length === 0 ) {
+   // Nothing is selected anymore
+   // Select the default or the first item
+   this.currSelected = this.getItemByParamName( 
this.defaultParams[ this.getName() ] ) ||
+   this.getItems()[ 0 ];
+   this.currSelected.toggleSelected( true );
+   changed = true;
+   } else if ( this.getSelectedItems().length > 1 ) {
+   // There is more than one item selected
+   // This should only happen if the item given
+   // is the one that is selected, so unselect
+   // all items that is not it
+   this.getSelectedItems().forEach( function ( 
itemModel ) {
+   // Note that in case the given item is 
actually
+   // not selected, this loop will end up 
unselecting
+   // all items, which would trigger the 
case above
+   // when the last item is unselected 
anyways
+   var selected = itemModel.getName() === 
item.getName() &&
+   item.isSelected();
 
-   // For 'single_option' groups, check if we just unselected all
-   // items. This should never be the result. If we did unselect
-   // all (like resetting all filters to false) then this group
-   // must choose its default item or the first item in the group
-   if (
-   this.getType() === 'single_option' &&
-   !this.getItems().some( function ( filterItem ) {
-   return filterItem.isSelected();
-   } )
-   ) {
-   // Single option means there must be a single option
-   // selected, so we have to either select the default
-   // or select the first option
-   this.currSelected = this.getItemByParamName( 
this.defaultParams[ this.getName() ] ) ||
-   this.getItems()[ 0 ];
-   this.currSelected.toggleSelected( true );
-   changed = true;
+   itemModel.toggleSelected( selected );
+   if ( select

[MediaWiki-commits] [Gerrit] mediawiki/core[master]: RCFilters: Fix validation for single_option groups

2017-08-17 Thread Mooeypoo (Code Review)
Mooeypoo has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/372428 )

Change subject: RCFilters: Fix validation for single_option groups
..

RCFilters: Fix validation for single_option groups

The single_option groups have a base definition that means they
always must have a value, and must never have more than one value.
The previous way we attempted to do that was confusing and missed
a case where after resetting filters, two values were selected before
one could be unselected, which then broke the behavior in the
entire group.

This fix reorganizes the validation when an item in the group is
selected or unselected to make sure the group retains its promised
behavior.

Bug: T173303
Change-Id: I5758ec324a26c0e5e6f5c473d206e818a1d22523
---
M resources/src/mediawiki.rcfilters/dm/mw.rcfilters.dm.FilterGroup.js
1 file changed, 27 insertions(+), 26 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/28/372428/1

diff --git 
a/resources/src/mediawiki.rcfilters/dm/mw.rcfilters.dm.FilterGroup.js 
b/resources/src/mediawiki.rcfilters/dm/mw.rcfilters.dm.FilterGroup.js
index 6acc44d..23ceffe 100644
--- a/resources/src/mediawiki.rcfilters/dm/mw.rcfilters.dm.FilterGroup.js
+++ b/resources/src/mediawiki.rcfilters/dm/mw.rcfilters.dm.FilterGroup.js
@@ -224,32 +224,33 @@
var changed = false,
active = this.areAnySelected();
 
-   if (
-   item.isSelected() &&
-   this.getType() === 'single_option' &&
-   this.currSelected &&
-   this.currSelected !== item
-   ) {
-   this.currSelected.toggleSelected( false );
-   }
-
-   // For 'single_option' groups, check if we just unselected all
-   // items. This should never be the result. If we did unselect
-   // all (like resetting all filters to false) then this group
-   // must choose its default item or the first item in the group
-   if (
-   this.getType() === 'single_option' &&
-   !this.getItems().some( function ( filterItem ) {
-   return filterItem.isSelected();
-   } )
-   ) {
-   // Single option means there must be a single option
-   // selected, so we have to either select the default
-   // or select the first option
-   this.currSelected = this.getItemByParamName( 
this.defaultParams[ this.getName() ] ) ||
-   this.getItems()[ 0 ];
-   this.currSelected.toggleSelected( true );
-   changed = true;
+   if ( this.getType() === 'single_option' ) {
+   // This group must have one item selected always
+   // and must never have more than one item selected at a 
time
+   if ( this.getSelectedItems().length === 0 ) {
+   // Nothing is selected anymore
+   // Select the default or the first item
+   this.currSelected = this.getItemByParamName( 
this.defaultParams[ this.getName() ] ) ||
+   this.getItems()[ 0 ];
+   this.currSelected.toggleSelected( true );
+   changed = true;
+   } else if ( this.getSelectedItems().length > 1 ) {
+   // There is more than one item selected
+   // This should only happen if the item given
+   // is the one that is selected, so unselect
+   // all items that is not it
+   this.getSelectedItems().forEach( function ( 
itemModel ) {
+   // Note that in case the given item is 
actually
+   // not selected, this loop will end up 
unselecting
+   // all items, which would trigger the 
case above
+   // when the last item is unselected 
anyways
+   itemModel.toggleSelected(
+   itemModel.getName() === 
item.getName() &&
+   item.isSelected()
+   );
+   } );
+   changed = true;
+   }
}
 
if (

-- 
To view, visit https://gerrit.wikimedia.org/r/372428
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-C

[MediaWiki-commits] [Gerrit] mediawiki/core[master]: [WIP-like-seriously] Make a scoped mixin for highlight colors

2017-08-03 Thread Mooeypoo (Code Review)
Mooeypoo has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/370136 )

Change subject: [WIP-like-seriously] Make a scoped mixin for highlight colors
..

[WIP-like-seriously] Make a scoped mixin for highlight colors

Change-Id: I64796fd350b4c9914fea07c5e175ea5c6ade2fcd
---
M resources/src/mediawiki.rcfilters/styles/mw.rcfilters.mixins.less
M 
resources/src/mediawiki.rcfilters/styles/mw.rcfilters.ui.ChangesListWrapperWidget.less
2 files changed, 41 insertions(+), 40 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/36/370136/1

diff --git a/resources/src/mediawiki.rcfilters/styles/mw.rcfilters.mixins.less 
b/resources/src/mediawiki.rcfilters/styles/mw.rcfilters.mixins.less
index 526f035..587f756 100644
--- a/resources/src/mediawiki.rcfilters/styles/mw.rcfilters.mixins.less
+++ b/resources/src/mediawiki.rcfilters/styles/mw.rcfilters.mixins.less
@@ -36,16 +36,16 @@
 // so it is before the rest of the rule; we need the li& to be in
 // between the wrapper scope and the color-cX class, which doesn't
 // work if the rules are inside the above widget LESS scope
-.highlight-changesListWrapperWidget( @bgcolor ) {
-   .mw-rcfilters-ui-changesListWrapperWidget li&,
-   .mw-rcfilters-ui-changesListWrapperWidget & tr:first-child,
-   .mw-rcfilters-ui-changesListWrapperWidget & td:not( :nth-child( -n+3 ) 
) {
-   background-color: @bgcolor;
+.highlight-changesListWrapperWidget( @scope, @bgcolor ) {
+   .@{scope} li&,
+   .@{scope} & tr:first-child,
+   .@{scope} & td:not( :nth-child( -n+3 ) ) {
+   background-color: @{bgcolor};
}
 }
 
 // This mixin produces color mixes for two, three and four colors
-.highlight-color-mix( @color1, @color2, @color3: false, @color4: false ) {
+.highlight-color-mix( @scope, @color1, @color2, @color3: false, @color4: false 
) {
@highlight-color-class-var: 
~'.mw-rcfilters-highlight-color-@{color1}.mw-rcfilters-highlight-color-@{color2}';
 
// The nature of these variables and them being inside
@@ -58,18 +58,18 @@
 
// Two colors
@{highlight-color-class-var} when ( @color3 = false ) and ( @color4 = 
false ) and not ( @color1 = false ), ( @color2 = false ) {
-   .highlight-changesListWrapperWidget( tint( average( @@c1var, 
@@c2var ), 50% ) );
+   .highlight-changesListWrapperWidget( @scope, tint( average( 
@@c1var, @@c2var ), 50% ) );
}
// Three colors
@{highlight-color-class-var}.mw-rcfilters-highlight-color-@{color3} 
when ( @color4 = false ) and not ( @color3 = false ) {
@c3var: ~'highlight-@{color3}';
-   .highlight-changesListWrapperWidget( tint( mix( @@c1var, 
average( @@c2var, @@c3var ), 33% ), 30% ) );
+   .highlight-changesListWrapperWidget( @scope, tint( mix( 
@@c1var, average( @@c2var, @@c3var ), 33% ), 30% ) );
}
 
// Four colors

@{highlight-color-class-var}.mw-rcfilters-highlight-color-@{color3}.mw-rcfilters-highlight-color-@{color4}
 when not ( @color4 = false ) {
@c3var: ~'highlight-@{color3}';
@c4var: ~'highlight-@{color4}';
-   .highlight-changesListWrapperWidget( tint( mix( @@c1var, mix( 
@@c2var, average( @@c3var, @@c4var ), 25% ), 25% ), 25% ) );
+   .highlight-changesListWrapperWidget( @scope, tint( mix( 
@@c1var, mix( @@c2var, average( @@c3var, @@c4var ), 25% ), 25% ), 25% ) );
}
 }
diff --git 
a/resources/src/mediawiki.rcfilters/styles/mw.rcfilters.ui.ChangesListWrapperWidget.less
 
b/resources/src/mediawiki.rcfilters/styles/mw.rcfilters.ui.ChangesListWrapperWidget.less
index 4d0b0f1..3aa1434 100644
--- 
a/resources/src/mediawiki.rcfilters/styles/mw.rcfilters.ui.ChangesListWrapperWidget.less
+++ 
b/resources/src/mediawiki.rcfilters/styles/mw.rcfilters.ui.ChangesListWrapperWidget.less
@@ -114,64 +114,65 @@
}
 }
 
+@changesListWrapperWidgetScope: ~"mw-rcfilters-ui-changesListWrapperWidget";
 // One color
 .mw-rcfilters-highlight-color-c1 {
-   .highlight-changesListWrapperWidget( tint( @highlight-c1, 70% ); );
+   .highlight-changesListWrapperWidget( @changesListWrapperWidgetScope, 
tint( @highlight-c1, 70% ); );
 }
 
 .mw-rcfilters-highlight-color-c2 {
-   .highlight-changesListWrapperWidget( tint( @highlight-c2, 70% ); );
+   .highlight-changesListWrapperWidget( @changesListWrapperWidgetScope, 
tint( @highlight-c2, 70% ); );
 }
 
 .mw-rcfilters-highlight-color-c3 {
-   .highlight-changesListWrapperWidget( tint( @highlight-c3, 70% ); );
+   .highlight-changesListWrapperWidget( @changesListWrapperWidgetScope, 
tint( @highlight-c3, 70% ); );
 }
 
 .mw-rcfilters-highlight-color-c4 {
-   .highlight-changesListWrapperWidget( tint( @highlight-c4, 70% ); );
+   .highlight-changesListWrapperWidget( @changesListWrapperWidgetScope, 
tint( @highlight-c4, 70% 

[MediaWiki-commits] [Gerrit] mediawiki/core[master]: RCFilters: Allow non-sticky filters to be excluded from save...

2017-08-03 Thread Mooeypoo (Code Review)
Mooeypoo has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/369995 )

Change subject: RCFilters: Allow non-sticky filters to be excluded from saved 
queries
..

RCFilters: Allow non-sticky filters to be excluded from saved queries

Bug: T172427
Change-Id: Ifda2ea617a8232a4c30261b6fce90f0b1217bdb4
---
M resources/src/mediawiki.rcfilters/dm/mw.rcfilters.dm.FilterGroup.js
M resources/src/mediawiki.rcfilters/dm/mw.rcfilters.dm.FiltersViewModel.js
M resources/src/mediawiki.rcfilters/mw.rcfilters.Controller.js
3 files changed, 46 insertions(+), 11 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/95/369995/1

diff --git 
a/resources/src/mediawiki.rcfilters/dm/mw.rcfilters.dm.FilterGroup.js 
b/resources/src/mediawiki.rcfilters/dm/mw.rcfilters.dm.FilterGroup.js
index f7021e2..b835c40 100644
--- a/resources/src/mediawiki.rcfilters/dm/mw.rcfilters.dm.FilterGroup.js
+++ b/resources/src/mediawiki.rcfilters/dm/mw.rcfilters.dm.FilterGroup.js
@@ -13,6 +13,10 @@
 *  is a part of.
 * @cfg {boolean} [isSticky] This group is using a 'sticky' default; 
meaning
 *  that every time a value is changed, it becomes the new default
+* @cfg {boolean} [excludedFromSavedQueries] A specific requirement to 
exclude
+*  this filter from saved queries. This is always true if the filter 
is 'sticky'
+*  but can be used for non-sticky filters as an additional 
requirement. Similarly
+*  to 'sticky' it works for the entire group as a whole.
 * @cfg {string} [title] Group title
 * @cfg {boolean} [hidden] This group is hidden from the regular menu 
views
 * @cfg {boolean} [allowArbitrary] Allows for an arbitrary value to be 
added to the
@@ -44,6 +48,7 @@
this.type = config.type || 'send_unselected_if_any';
this.view = config.view || 'default';
this.sticky = !!config.isSticky;
+   this.excludedFromSavedQueries = this.sticky || 
!!config.excludedFromSavedQueries;
this.title = config.title || name;
this.hidden = !!config.hidden;
this.allowArbitrary = !!config.allowArbitrary;
@@ -870,4 +875,13 @@
mw.rcfilters.dm.FilterGroup.prototype.isSticky = function () {
return this.sticky;
};
+
+   /**
+* Check whether the group value is excluded from saved queries
+*
+* @return {boolean} Group value is excluded from saved queries
+*/
+   mw.rcfilters.dm.FilterGroup.prototype.isExcludedFromSavedQueries = 
function () {
+   return this.sticky || this.excludedFromSavedQueries;
+   };
 }( mediaWiki ) );
diff --git 
a/resources/src/mediawiki.rcfilters/dm/mw.rcfilters.dm.FiltersViewModel.js 
b/resources/src/mediawiki.rcfilters/dm/mw.rcfilters.dm.FiltersViewModel.js
index 52c5bb0..cf226da 100644
--- a/resources/src/mediawiki.rcfilters/dm/mw.rcfilters.dm.FiltersViewModel.js
+++ b/resources/src/mediawiki.rcfilters/dm/mw.rcfilters.dm.FiltersViewModel.js
@@ -581,6 +581,24 @@
};
 
/**
+* Get a filter representation of all parameters that are marked
+* as being excluded from saved query.
+*
+* @return {Object} Excluded filters values
+*/
+   mw.rcfilters.dm.FiltersViewModel.prototype.getExcludedFiltersState = 
function () {
+   var result = {};
+
+   $.each( this.groups, function ( name, model ) {
+   if ( model.isExcludedFromSavedQueries() ) {
+   $.extend( true, result, 
model.getSelectedState() );
+   }
+   } );
+
+   return result;
+   };
+
+   /**
 * Analyze the groups and their filters and output an object 
representing
 * the state of the parameters they represent.
 *
diff --git a/resources/src/mediawiki.rcfilters/mw.rcfilters.Controller.js 
b/resources/src/mediawiki.rcfilters/mw.rcfilters.Controller.js
index e9981bd..9867220 100644
--- a/resources/src/mediawiki.rcfilters/mw.rcfilters.Controller.js
+++ b/resources/src/mediawiki.rcfilters/mw.rcfilters.Controller.js
@@ -119,6 +119,7 @@
// we should remove all sticky behavior 
methods completely
// See T172156
// isSticky: true,
+   excludedFromSavedQueries: true,
filters: displayConfig.limitArray.map( 
function ( num ) {
return 
controller._createFilterDataFromNumber( num, num );
} )
@@ -143,6 +144,7 @@
'default': mw.user.options.get( 
'rcdays', '30' ),
// Te

[MediaWiki-commits] [Gerrit] mediawiki/core[master]: RCFilters: Prevent live update fetch if model is in conflict

2017-08-02 Thread Mooeypoo (Code Review)
Mooeypoo has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/369828 )

Change subject: RCFilters: Prevent live update fetch if model is in conflict
..

RCFilters: Prevent live update fetch if model is in conflict

Change-Id: I52df598036a33fe203d6411fa9cfb6a485a8504d
---
M resources/src/mediawiki.rcfilters/mw.rcfilters.Controller.js
1 file changed, 1 insertion(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/28/369828/1

diff --git a/resources/src/mediawiki.rcfilters/mw.rcfilters.Controller.js 
b/resources/src/mediawiki.rcfilters/mw.rcfilters.Controller.js
index 16822d8..f3ea248 100644
--- a/resources/src/mediawiki.rcfilters/mw.rcfilters.Controller.js
+++ b/resources/src/mediawiki.rcfilters/mw.rcfilters.Controller.js
@@ -540,6 +540,7 @@
new mw.Uri().query.liveupdate;
 
return !document.hidden &&
+   !this.filtersModel.hasConflict() &&
!this.changesListModel.getNewChangesExist() &&
!this.updatingChangesList &&
liveUpdateFeatureFlag;

-- 
To view, visit https://gerrit.wikimedia.org/r/369828
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I52df598036a33fe203d6411fa9cfb6a485a8504d
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Mooeypoo 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: [wip] Fix highlight display for enhanced mode

2017-08-02 Thread Mooeypoo (Code Review)
Mooeypoo has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/369819 )

Change subject: [wip] Fix highlight display for enhanced mode
..

[wip] Fix highlight display for enhanced mode

Bug: T170875
Change-Id: Ibd7d447aba1ae5576ea637a2d5ef06cb3f622b26
---
M 
resources/src/mediawiki.rcfilters/ui/mw.rcfilters.ui.ChangesListWrapperWidget.js
1 file changed, 53 insertions(+), 6 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/19/369819/1

diff --git 
a/resources/src/mediawiki.rcfilters/ui/mw.rcfilters.ui.ChangesListWrapperWidget.js
 
b/resources/src/mediawiki.rcfilters/ui/mw.rcfilters.ui.ChangesListWrapperWidget.js
index 42fb5cc..e8fa39c 100644
--- 
a/resources/src/mediawiki.rcfilters/ui/mw.rcfilters.ui.ChangesListWrapperWidget.js
+++ 
b/resources/src/mediawiki.rcfilters/ui/mw.rcfilters.ui.ChangesListWrapperWidget.js
@@ -28,6 +28,7 @@
this.filtersViewModel = filtersViewModel;
this.changesListViewModel = changesListViewModel;
this.controller = controller;
+   this.highlightClasses = null;
 
// Events
this.filtersViewModel.connect( this, {
@@ -45,8 +46,8 @@
// We handle our own display/hide of the empty results 
message
.removeClass( 'mw-changeslist-empty' );
 
-   // Set up highlight containers
-   this.setupHighlightContainers( this.$element );
+   // // Set up highlight containers
+   // this.setupHighlightContainers( this.$element );
 
this.setupNewChangesButtonContainer( this.$element );
};
@@ -54,6 +55,22 @@
/* Initialization */
 
OO.inheritClass( mw.rcfilters.ui.ChangesListWrapperWidget, OO.ui.Widget 
);
+
+   /**
+* Get all available highlight classes
+*
+* @return {string[]} An array of available highlight class names
+*/
+   mw.rcfilters.ui.ChangesListWrapperWidget.prototype.getHighlightClasses 
= function () {
+   if ( !this.highlightClasses ) {
+   this.highlightClasses = 
this.filtersViewModel.getItemsSupportingHighlights()
+   .map( function ( filterItem ) {
+   return filterItem.getCssClass();
+   } );
+   }
+
+   return this.highlightClasses;
+   };
 
/**
 * Respond to the highlight feature being toggled on and off
@@ -235,7 +252,9 @@
 * @param {jQuery|string} $content The content of the updated changes 
list
 */

mw.rcfilters.ui.ChangesListWrapperWidget.prototype.setupHighlightContainers = 
function ( $content ) {
-   var uri = new mw.Uri(),
+   var $enhancedCells,
+   widget = this,
+   uri = new mw.Uri(),
highlightClass = 
'mw-rcfilters-ui-changesListWrapperWidget-highlights',
$highlights = $( '' )
.addClass( highlightClass )
@@ -262,13 +281,41 @@
( uri.query.enhanced !== undefined && Number( 
uri.query.enhanced ) ) ||
( uri.query.enhanced === undefined && Number( 
mw.user.options.get( 'usenewrc' ) ) )
) {
-   // Enhanced RC
-   $content.find( 'td.mw-enhanced-rc' )
-   .parent()
+   $enhancedTopPageCell = $content.find( 
'table.mw-enhanced-rc.mw-collapsible' );
+   $enhancedNestedPagesCell = $content.find( 
'td.mw-enhanced-rc-nested' );
+
+   // Enhanced RC highlight containers
+   $enhancedTopPageCell
+   .find( 'tr:first-child' )
.prepend(
$( '' )
.append( $highlights.clone() )
);
+
+debugger;
+   $enhancedNestedPagesCell
+   .before(
+   $( '' )
+   .append( $highlights.clone() )
+   );
+
+   // Go over pages that have sub results
+   // HACK: We really only can collect those by targetting 
the collapsible class
+   $enhancedTopPageCell.each( function () {
+   var collectedClasses = [],
+   $table = $( this );
+   // Go over s and pick up all recognized 
classes
+   widget.getHighlightClasses().forEach( function 
( className ) {
+ 

[MediaWiki-commits] [Gerrit] mediawiki/core[master]: RCFilters: Adjust styling of 'other review tools' button

2017-08-02 Thread Mooeypoo (Code Review)
Mooeypoo has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/369812 )

Change subject: RCFilters: Adjust styling of 'other review tools' button
..

RCFilters: Adjust styling of 'other review tools' button

Bug: T172237
Bug: T166919
Change-Id: Id13414274d099c2f9bb151b0b793eff172209929
---
M languages/i18n/en.json
M resources/src/mediawiki.rcfilters/styles/mw.rcfilters.less
2 files changed, 5 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/12/369812/1

diff --git a/languages/i18n/en.json b/languages/i18n/en.json
index 497c87b..8f0ebb1 100644
--- a/languages/i18n/en.json
+++ b/languages/i18n/en.json
@@ -1350,7 +1350,7 @@
"recentchanges-legend-plusminus": "(±123)",
"recentchanges-submit": "Show",
"rcfilters-legend-heading": "List of abbreviations:",
-   "rcfilters-other-review-tools": "Other review tools:",
+   "rcfilters-other-review-tools": "Other review tools",
"rcfilters-group-results-by-page": "Group results by page",
"rcfilters-grouping-title": "Grouping",
"rcfilters-activefilters": "Active filters",
diff --git a/resources/src/mediawiki.rcfilters/styles/mw.rcfilters.less 
b/resources/src/mediawiki.rcfilters/styles/mw.rcfilters.less
index 7f0d34e..d48d52d 100644
--- a/resources/src/mediawiki.rcfilters/styles/mw.rcfilters.less
+++ b/resources/src/mediawiki.rcfilters/styles/mw.rcfilters.less
@@ -7,6 +7,10 @@
.mw-recentchanges-toplinks {
padding: 0 0.5em;
 
+   
.oo-ui-widget-enabled.oo-ui-buttonElement.oo-ui-buttonElement-frameless 
.oo-ui-buttonElement-button {
+   padding: 0 2.5em 0 0.5em;
+   }
+
&-title,
.mw-collapsible-text {
// Same as the legend

-- 
To view, visit https://gerrit.wikimedia.org/r/369812
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Id13414274d099c2f9bb151b0b793eff172209929
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Mooeypoo 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: RCFilters: Normalize 'limit' to minimum 0, like the backend ...

2017-08-02 Thread Mooeypoo (Code Review)
Mooeypoo has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/369810 )

Change subject: RCFilters: Normalize 'limit' to minimum 0, like the backend does
..

RCFilters: Normalize 'limit' to minimum 0, like the backend does

Bug: T172026
Change-Id: I7b5b0d7ef34b0702a55572591da2a11942e8c5d9
---
M resources/src/mediawiki.rcfilters/mw.rcfilters.Controller.js
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/10/369810/1

diff --git a/resources/src/mediawiki.rcfilters/mw.rcfilters.Controller.js 
b/resources/src/mediawiki.rcfilters/mw.rcfilters.Controller.js
index 16822d8..decab47 100644
--- a/resources/src/mediawiki.rcfilters/mw.rcfilters.Controller.js
+++ b/resources/src/mediawiki.rcfilters/mw.rcfilters.Controller.js
@@ -105,7 +105,7 @@
allowArbitrary: true,
validate: $.isNumeric,
range: {
-   min: 1,
+   min: 0, // The server 
normalizes negative numbers to 0 results
max: 1000
},
sortFunc: function ( a, b ) { return 
Number( a.name ) - Number( b.name ); },

-- 
To view, visit https://gerrit.wikimedia.org/r/369810
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I7b5b0d7ef34b0702a55572591da2a11942e8c5d9
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Mooeypoo 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: RCFilters: Adjust server default variable names for limit/days

2017-08-02 Thread Mooeypoo (Code Review)
Mooeypoo has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/369747 )

Change subject: RCFilters: Adjust server default variable names for limit/days
..

RCFilters: Adjust server default variable names for limit/days

Change-Id: I4a204e1a61516cff505e6e0a71aa702034cea4dc
---
M includes/specials/SpecialRecentchanges.php
M resources/src/mediawiki.rcfilters/mw.rcfilters.Controller.js
2 files changed, 6 insertions(+), 6 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/47/369747/1

diff --git a/includes/specials/SpecialRecentchanges.php 
b/includes/specials/SpecialRecentchanges.php
index 46f7927..6ef75e0 100644
--- a/includes/specials/SpecialRecentchanges.php
+++ b/includes/specials/SpecialRecentchanges.php
@@ -196,9 +196,9 @@
$out->addJsConfigVars(
'StructuredChangeFiltersDisplayConfig',
[
-   'maxLimit' => 
(int)$this->getConfig()->get( 'RCMaxAge' ) / ( 24 * 3600 ), // Translate to days
-   'arrayLimit' => 
$this->getConfig()->get( 'RCLinkLimits' ),
-   'arrayDays' => $this->getConfig()->get( 
'RCLinkDays' ),
+   'maxDays' => 
(int)$this->getConfig()->get( 'RCMaxAge' ) / ( 24 * 3600 ), // Translate to days
+   'limitArray' => 
$this->getConfig()->get( 'RCLinkLimits' ),
+   'daysArray' => $this->getConfig()->get( 
'RCLinkDays' ),
]
);
}
diff --git a/resources/src/mediawiki.rcfilters/mw.rcfilters.Controller.js 
b/resources/src/mediawiki.rcfilters/mw.rcfilters.Controller.js
index f07d3f1..864e397 100644
--- a/resources/src/mediawiki.rcfilters/mw.rcfilters.Controller.js
+++ b/resources/src/mediawiki.rcfilters/mw.rcfilters.Controller.js
@@ -115,7 +115,7 @@
// we should remove all sticky behavior 
methods completely
// See T172156
// isSticky: true,
-   filters: displayConfig.arrayLimit.map( 
function ( num ) {
+   filters: displayConfig.limitArray.map( 
function ( num ) {
return 
controller._createFilterDataFromNumber( num, num );
} )
},
@@ -128,7 +128,7 @@
validate: $.isNumeric,
range: {
min: 0,
-   max: displayConfig.maxLimit
+   max: displayConfig.maxDays
},
sortFunc: function ( a, b ) { return 
Number( a.name ) - Number( b.name ); },
numToLabelFunc: function ( i ) {
@@ -143,7 +143,7 @@
// Hours (1, 2, 6, 12)
0.04166, 0.0833, 0.25, 0.5
// Days
-   ].concat( displayConfig.arrayDays )
+   ].concat( displayConfig.daysArray )
.map( function ( num ) {
return 
controller._createFilterDataFromNumber(
num,

-- 
To view, visit https://gerrit.wikimedia.org/r/369747
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I4a204e1a61516cff505e6e0a71aa702034cea4dc
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Mooeypoo 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: RCFilters: Normalize user-generated default values

2017-08-02 Thread Mooeypoo (Code Review)
Mooeypoo has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/369730 )

Change subject: RCFilters: Normalize user-generated default values
..

RCFilters: Normalize user-generated default values

Bug: T172026
Change-Id: Id75116cf22a31f8b762801fc0a6aee554a9ca6b2
---
M resources/src/mediawiki.rcfilters/dm/mw.rcfilters.dm.FilterGroup.js
M resources/src/mediawiki.rcfilters/mw.rcfilters.Controller.js
2 files changed, 18 insertions(+), 10 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/30/369730/1

diff --git 
a/resources/src/mediawiki.rcfilters/dm/mw.rcfilters.dm.FilterGroup.js 
b/resources/src/mediawiki.rcfilters/dm/mw.rcfilters.dm.FilterGroup.js
index c4cce8d..f7021e2 100644
--- a/resources/src/mediawiki.rcfilters/dm/mw.rcfilters.dm.FilterGroup.js
+++ b/resources/src/mediawiki.rcfilters/dm/mw.rcfilters.dm.FilterGroup.js
@@ -736,11 +736,11 @@
this.getType() === 'single_option' &&
!oneWasSelected
) {
+   item = this.getItems()[ 0 ];
if ( defaultParams[ this.getName() ] ) {
item = this.getItemByParamName( defaultParams[ 
this.getName() ] );
-   } else {
-   item = this.getItems()[ 0 ];
}
+
result[ item.getName() ] = true;
}
 
diff --git a/resources/src/mediawiki.rcfilters/mw.rcfilters.Controller.js 
b/resources/src/mediawiki.rcfilters/mw.rcfilters.Controller.js
index f07d3f1..ede8ad7 100644
--- a/resources/src/mediawiki.rcfilters/mw.rcfilters.Controller.js
+++ b/resources/src/mediawiki.rcfilters/mw.rcfilters.Controller.js
@@ -280,20 +280,28 @@
 * @param {string|string[]} arbitraryValues An array of arbitrary 
values to add to the group
 */
mw.rcfilters.Controller.prototype.addNumberValuesToGroup = function ( 
groupData, arbitraryValues ) {
-   var controller = this;
+   var controller = this,
+   normalizeWithinRange = function ( range, val ) {
+   if ( val < 0 ) {
+   return range.min; // Min
+   } else if ( val >= range.max ) {
+   return range.max; // Max
+   }
+   return val;
+   };
 
arbitraryValues = Array.isArray( arbitraryValues ) ? 
arbitraryValues : [ arbitraryValues ];
 
-   // Normalize the arbitrary values
+   // Normalize the arbitrary values and the default value for a 
range
if ( groupData.range ) {
arbitraryValues = arbitraryValues.map( function ( val ) 
{
-   if ( val < 0 ) {
-   return groupData.range.min; // Min
-   } else if ( val >= groupData.range.max ) {
-   return groupData.range.max; // Max
-   }
-   return val;
+   return normalizeWithinRange( groupData.range, 
val );
} );
+
+   // Normalize the default, since that's user defined
+   if ( groupData.default !== undefined ) {
+   groupData.default = String( 
normalizeWithinRange( groupData.default ) );
+   }
}
 
// This is only true for single_option group

-- 
To view, visit https://gerrit.wikimedia.org/r/369730
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Id75116cf22a31f8b762801fc0a6aee554a9ca6b2
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Mooeypoo 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: RCFilters: Don't reload results for redundant requests

2017-08-01 Thread Mooeypoo (Code Review)
Mooeypoo has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/369571 )

Change subject: RCFilters: Don't reload results for redundant requests
..

RCFilters: Don't reload results for redundant requests

Ignore reloading if the requests are:
- Change of inverted namespaces if there are no namespace items
  selected.
- Reloading of new saved query if that same query is already loaded

Bug: T172138
Change-Id: Id43bef8a08aab3412a6c5cb538d048935a178114
---
M resources/src/mediawiki.rcfilters/mw.rcfilters.Controller.js
1 file changed, 22 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/71/369571/1

diff --git a/resources/src/mediawiki.rcfilters/mw.rcfilters.Controller.js 
b/resources/src/mediawiki.rcfilters/mw.rcfilters.Controller.js
index 4051eda..2220957 100644
--- a/resources/src/mediawiki.rcfilters/mw.rcfilters.Controller.js
+++ b/resources/src/mediawiki.rcfilters/mw.rcfilters.Controller.js
@@ -394,7 +394,17 @@
 */
mw.rcfilters.Controller.prototype.toggleInvertedNamespaces = function 
() {
this.filtersModel.toggleInvertedNamespaces();
-   this.updateChangesList();
+
+   if (
+   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();
+   }
};
 
/**
@@ -596,9 +606,18 @@
 */
mw.rcfilters.Controller.prototype.applySavedQuery = function ( queryID 
) {
var data, highlights,
-   queryItem = this.savedQueriesModel.getItemByID( queryID 
);
+   queryItem = this.savedQueriesModel.getItemByID( queryID 
),
+   currentMatchingQuery = 
this.findQueryMatchingCurrentState();
 
-   if ( queryItem ) {
+   if (
+   queryItem &&
+   (
+   // If therre's already a query, don't reload it
+   // if it's the same as the one that already 
exists
+   !currentMatchingQuery ||
+   currentMatchingQuery.getID() !== 
queryItem.getID()
+   )
+   ) {
data = queryItem.getData();
highlights = data.highlights;
 

-- 
To view, visit https://gerrit.wikimedia.org/r/369571
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Id43bef8a08aab3412a6c5cb538d048935a178114
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Mooeypoo 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: RCFilters: Add 'advanced filters' label to the view selection

2017-08-01 Thread Mooeypoo (Code Review)
Mooeypoo has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/369563 )

Change subject: RCFilters: Add 'advanced filters' label to the view selection
..

RCFilters: Add 'advanced filters' label to the view selection

Bug: T171894
Change-Id: I595d7d4a66eaedb76c9a4e4690be4ec4ef696a2d
---
M languages/i18n/en.json
M resources/Resources.php
M 
resources/src/mediawiki.rcfilters/styles/mw.rcfilters.ui.FilterTagMultiselectWidget.less
M 
resources/src/mediawiki.rcfilters/ui/mw.rcfilters.ui.FilterTagMultiselectWidget.js
4 files changed, 12 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/63/369563/1

diff --git a/languages/i18n/en.json b/languages/i18n/en.json
index d9bbf9a..039d617 100644
--- a/languages/i18n/en.json
+++ b/languages/i18n/en.json
@@ -1451,6 +1451,7 @@
"rcfilters-tag-prefix-tags": "#$1",
"rcfilters-exclude-button-off": "Exclude selected",
"rcfilters-exclude-button-on": "Excluding selected",
+   "rcfilters-view-advanced-filters-label": "Advanced filters",
"rcfilters-view-tags": "Tagged edits",
"rcfilters-view-namespaces-tooltip": "Filter results by namespace",
"rcfilters-view-tags-tooltip": "Filter results using edit tags",
diff --git a/resources/Resources.php b/resources/Resources.php
index 82f285e..5c29e83 100644
--- a/resources/Resources.php
+++ b/resources/Resources.php
@@ -1878,6 +1878,7 @@
'rcfilters-tag-prefix-tags',
'rcfilters-exclude-button-off',
'rcfilters-exclude-button-on',
+   'rcfilters-view-advanced-filters-label',
'rcfilters-view-tags',
'rcfilters-view-namespaces-tooltip',
'rcfilters-view-tags-tooltip',
diff --git 
a/resources/src/mediawiki.rcfilters/styles/mw.rcfilters.ui.FilterTagMultiselectWidget.less
 
b/resources/src/mediawiki.rcfilters/styles/mw.rcfilters.ui.FilterTagMultiselectWidget.less
index a5cf744..076636c 100644
--- 
a/resources/src/mediawiki.rcfilters/styles/mw.rcfilters.ui.FilterTagMultiselectWidget.less
+++ 
b/resources/src/mediawiki.rcfilters/styles/mw.rcfilters.ui.FilterTagMultiselectWidget.less
@@ -70,6 +70,9 @@
margin-left: 0;
}
 
+   
.oo-ui-labelElement.oo-ui-optionWidget.oo-ui-buttonElement:first-child {
+   margin-left: 0;
+   }
}
}
}
diff --git 
a/resources/src/mediawiki.rcfilters/ui/mw.rcfilters.ui.FilterTagMultiselectWidget.js
 
b/resources/src/mediawiki.rcfilters/ui/mw.rcfilters.ui.FilterTagMultiselectWidget.js
index 934c7c4..08beacd 100644
--- 
a/resources/src/mediawiki.rcfilters/ui/mw.rcfilters.ui.FilterTagMultiselectWidget.js
+++ 
b/resources/src/mediawiki.rcfilters/ui/mw.rcfilters.ui.FilterTagMultiselectWidget.js
@@ -141,6 +141,13 @@
items: [
new OO.ui.ButtonOptionWidget( {
framed: false,
+   data: '',
+   disabled: true,
+   classes: [ 
'mw-rcfilters-ui-filterTagMultiselectWidget-views-select-widget-label' ],
+   label: mw.msg( 
'rcfilters-view-advanced-filters-label' )
+   } ),
+   new OO.ui.ButtonOptionWidget( {
+   framed: false,
data: 'namespaces',
icon: 'article',
title: mw.msg( 
'rcfilters-view-namespaces-tooltip' )

-- 
To view, visit https://gerrit.wikimedia.org/r/369563
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I595d7d4a66eaedb76c9a4e4690be4ec4ef696a2d
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Mooeypoo 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: RCFilters: Trim results to allow searching for spaces after ...

2017-08-01 Thread Mooeypoo (Code Review)
Mooeypoo has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/369557 )

Change subject: RCFilters: Trim results to allow searching for spaces after 
trigger
..

RCFilters: Trim results to allow searching for spaces after trigger

Recognize a search string even if there are spaces after the trigger,
for example, '#   sometag' as 'sometag' in the 'tags' view.

Bug: T168225
Change-Id: Ic31b73396d9afe8cd62398b4cf5116f8aee25e67
---
M resources/src/mediawiki.rcfilters/dm/mw.rcfilters.dm.FiltersViewModel.js
1 file changed, 3 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/57/369557/1

diff --git 
a/resources/src/mediawiki.rcfilters/dm/mw.rcfilters.dm.FiltersViewModel.js 
b/resources/src/mediawiki.rcfilters/dm/mw.rcfilters.dm.FiltersViewModel.js
index a6a22ef..52c5bb0 100644
--- a/resources/src/mediawiki.rcfilters/dm/mw.rcfilters.dm.FiltersViewModel.js
+++ b/resources/src/mediawiki.rcfilters/dm/mw.rcfilters.dm.FiltersViewModel.js
@@ -848,6 +848,9 @@
if ( view !== 'default' ) {
query = query.substr( 1 );
}
+   // Trim again to also intercept cases where the spaces were 
after the trigger
+   // eg: '#   str'
+   query = query.trim();
 
// Check if the search if actually empty; this can be a problem 
when
// we use prefixes to denote different views

-- 
To view, visit https://gerrit.wikimedia.org/r/369557
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic31b73396d9afe8cd62398b4cf5116f8aee25e67
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Mooeypoo 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: RCFilters: Scroll widget to top when switching view

2017-08-01 Thread Mooeypoo (Code Review)
Mooeypoo has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/369556 )

Change subject: RCFilters: Scroll widget to top when switching view
..

RCFilters: Scroll widget to top when switching view

Bug: T170651
Change-Id: I19865b0af73e88c2893ba688476aa505d7730947
---
M 
resources/src/mediawiki.rcfilters/ui/mw.rcfilters.ui.FilterTagMultiselectWidget.js
1 file changed, 6 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/56/369556/1

diff --git 
a/resources/src/mediawiki.rcfilters/ui/mw.rcfilters.ui.FilterTagMultiselectWidget.js
 
b/resources/src/mediawiki.rcfilters/ui/mw.rcfilters.ui.FilterTagMultiselectWidget.js
index 934c7c4..530429e 100644
--- 
a/resources/src/mediawiki.rcfilters/ui/mw.rcfilters.ui.FilterTagMultiselectWidget.js
+++ 
b/resources/src/mediawiki.rcfilters/ui/mw.rcfilters.ui.FilterTagMultiselectWidget.js
@@ -29,6 +29,7 @@
this.queriesModel = savedQueriesModel;
this.$overlay = config.$overlay || this.$element;
this.matchingQuery = null;
+   this.currentView = this.model.getCurrentView();
 
// Parent
mw.rcfilters.ui.FilterTagMultiselectWidget.parent.call( this, 
$.extend( true, {
@@ -360,6 +361,11 @@
 
// Update input
this.input.setValue( inputValue );
+
+   if ( this.currentView !== view ) {
+   this.scrollToTop( this.$element );
+   this.currentView = view;
+   }
};
 
/**

-- 
To view, visit https://gerrit.wikimedia.org/r/369556
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I19865b0af73e88c2893ba688476aa505d7730947
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Mooeypoo 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: RCFilters: Unsticky the 'limit' preference temporarily

2017-08-01 Thread Mooeypoo (Code Review)
Mooeypoo has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/369538 )

Change subject: RCFilters: Unsticky the 'limit' preference temporarily
..

RCFilters: Unsticky the 'limit' preference temporarily

Bug: T172156
Bug: T171514
Change-Id: I0bed6de70655a4a8a90ceb2f900ffbe98e643d33
---
M resources/src/mediawiki.rcfilters/mw.rcfilters.Controller.js
1 file changed, 11 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/38/369538/1

diff --git a/resources/src/mediawiki.rcfilters/mw.rcfilters.Controller.js 
b/resources/src/mediawiki.rcfilters/mw.rcfilters.Controller.js
index 4051eda..a573ca4 100644
--- a/resources/src/mediawiki.rcfilters/mw.rcfilters.Controller.js
+++ b/resources/src/mediawiki.rcfilters/mw.rcfilters.Controller.js
@@ -105,7 +105,11 @@
validate: $.isNumeric,
sortFunc: function ( a, b ) { return 
Number( a.name ) - Number( b.name ); },
'default': String( limitDefault ),
-   isSticky: true,
+   // Temporarily making this not sticky 
until we resolve the proble
+   // with the misleading preference. Note 
that if this is to be permanent
+   // we should remove all sticky behavior 
methods completely
+   // See T172156
+   // isSticky: true,
filters: [ 50, 100, 250, 500 ].map( 
function ( num ) {
return 
controller._createFilterDataFromNumber( num, num );
} )
@@ -813,6 +817,10 @@
 * @param {number} newValue New value
 */
mw.rcfilters.Controller.prototype.updateLimitDefault = function ( 
newValue ) {
+   // HACK: Temporarily remove this from being sticky
+   // See T172156
+
+   /*
if ( !$.isNumeric( newValue ) ) {
return;
}
@@ -825,6 +833,8 @@
// Update the preference for this session
mw.user.options.set( 'rcfilters-rclimit', newValue );
}
+   */
+   return;
};
 
/**

-- 
To view, visit https://gerrit.wikimedia.org/r/369538
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I0bed6de70655a4a8a90ceb2f900ffbe98e643d33
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Mooeypoo 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: RCFilters: Pluralize 'show last X changes' message

2017-08-01 Thread Mooeypoo (Code Review)
Mooeypoo has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/369462 )

Change subject: RCFilters: Pluralize 'show last X changes' message
..

RCFilters: Pluralize 'show last X changes' message

Bug: T171047
Change-Id: I353140a2aeb8a383fe439baf887676857ae99321
---
M languages/i18n/en.json
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/62/369462/1

diff --git a/languages/i18n/en.json b/languages/i18n/en.json
index 8c295b2..d9bbf9a 100644
--- a/languages/i18n/en.json
+++ b/languages/i18n/en.json
@@ -1354,7 +1354,7 @@
"rcfilters-activefilters": "Active filters",
"rcfilters-advancedfilters": "Advanced filters",
"rcfilters-limit-title": "Changes to show",
-   "rcfilters-limit-shownum": "Show last $1 changes",
+   "rcfilters-limit-shownum": "Show last {{PLURAL:$1|change|$1 changes}}",
"rcfilters-days-title": "Recent days",
"rcfilters-hours-title": "Recent hours",
"rcfilters-days-show-days": "$1 {{PLURAL:$1|day|days}}",

-- 
To view, visit https://gerrit.wikimedia.org/r/369462
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I353140a2aeb8a383fe439baf887676857ae99321
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Mooeypoo 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: RCFilters: Normalize arbitrary values before adding them

2017-07-31 Thread Mooeypoo (Code Review)
Mooeypoo has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/368955 )

Change subject: RCFilters: Normalize arbitrary values before adding them
..

RCFilters: Normalize arbitrary values before adding them

Bug: T172026
Change-Id: Iba0e20b6d4266e22b3e894742dd182291f741eb1
---
M resources/src/mediawiki.rcfilters/mw.rcfilters.Controller.js
1 file changed, 21 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/55/368955/1

diff --git a/resources/src/mediawiki.rcfilters/mw.rcfilters.Controller.js 
b/resources/src/mediawiki.rcfilters/mw.rcfilters.Controller.js
index 4051eda..432e787 100644
--- a/resources/src/mediawiki.rcfilters/mw.rcfilters.Controller.js
+++ b/resources/src/mediawiki.rcfilters/mw.rcfilters.Controller.js
@@ -104,6 +104,14 @@
allowArbitrary: true,
validate: $.isNumeric,
sortFunc: function ( a, b ) { return 
Number( a.name ) - Number( b.name ); },
+   normalizeFunc: function ( a ) {
+   if ( a < 0 ) {
+   return 0; // Min
+   } else if ( a >= 1000 ) {
+   return 500; // Max
+   }
+   return a;
+   },
'default': String( limitDefault ),
isSticky: true,
filters: [ 50, 100, 250, 500 ].map( 
function ( num ) {
@@ -118,6 +126,14 @@
allowArbitrary: true,
validate: $.isNumeric,
sortFunc: function ( a, b ) { return 
Number( a.name ) - Number( b.name ); },
+   normalizeFunc: function ( a ) {
+   if ( a < 0 ) {
+   return 0; // Min
+   } else if ( a >= 80 ) {
+   return 30; // Max
+   }
+   return a;
+   },
numToLabelFunc: function ( i ) {
return Number( i ) < 1 ?
( Number( i ) * 24 
).toFixed( 2 ) :
@@ -252,6 +268,11 @@
 
arbitraryValues = Array.isArray( arbitraryValues ) ? 
arbitraryValues : [ arbitraryValues ];
 
+   // Normalize the arbitrary values
+   if ( groupData.normalizeFunc ) {
+   arbitraryValues = arbitraryValues.map( 
groupData.normalizeFunc( val ) );
+   }
+
// This is only true for single_option group
// We assume these are the only groups that will allow for
// arbitrary, since it doesn't make any sense for the other

-- 
To view, visit https://gerrit.wikimedia.org/r/368955
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iba0e20b6d4266e22b3e894742dd182291f741eb1
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Mooeypoo 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: [propose] RCFilters: Use the base default for 'rclimit'

2017-07-31 Thread Mooeypoo (Code Review)
Mooeypoo has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/368949 )

Change subject: [propose] RCFilters: Use the base default for 'rclimit'
..

[propose] RCFilters: Use the base default for 'rclimit'

Bug: T172156
Bug: T171202
Change-Id: Iea14bec6399bd84c40aeda5e6e180a1882949c1c
---
M resources/src/mediawiki.rcfilters/mw.rcfilters.Controller.js
1 file changed, 4 insertions(+), 9 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/49/368949/1

diff --git a/resources/src/mediawiki.rcfilters/mw.rcfilters.Controller.js 
b/resources/src/mediawiki.rcfilters/mw.rcfilters.Controller.js
index 4051eda..109e5cb 100644
--- a/resources/src/mediawiki.rcfilters/mw.rcfilters.Controller.js
+++ b/resources/src/mediawiki.rcfilters/mw.rcfilters.Controller.js
@@ -88,11 +88,6 @@
};
}
 
-   // Convert the default from the old preference
-   // since the limit preference actually affects more
-   // than just the RecentChanges page
-   limitDefault = Number( mw.user.options.get( 
'rcfilters-rclimit', mw.user.options.get( 'rclimit', '50' ) ) );
-
// Add parameter range operations
views.range = {
groups: [
@@ -104,7 +99,7 @@
allowArbitrary: true,
validate: $.isNumeric,
sortFunc: function ( a, b ) { return 
Number( a.name ) - Number( b.name ); },
-   'default': String( limitDefault ),
+   'default': String( mw.user.options.get( 
'rclimit', '50' ) ),
isSticky: true,
filters: [ 50, 100, 250, 500 ].map( 
function ( num ) {
return 
controller._createFilterDataFromNumber( num, num );
@@ -819,11 +814,11 @@
 
newValue = Number( newValue );
 
-   if ( mw.user.options.get( 'rcfilters-rclimit' ) !== newValue ) {
+   if ( mw.user.options.get( 'rclimit' ) !== newValue ) {
// Save the preference
-   new mw.Api().saveOption( 'rcfilters-rclimit', newValue 
);
+   new mw.Api().saveOption( 'rclimit', newValue );
// Update the preference for this session
-   mw.user.options.set( 'rcfilters-rclimit', newValue );
+   mw.user.options.set( 'rclimit', newValue );
}
};
 

-- 
To view, visit https://gerrit.wikimedia.org/r/368949
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iea14bec6399bd84c40aeda5e6e180a1882949c1c
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Mooeypoo 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: RCFilters: Open limit/days popups the other way

2017-07-28 Thread Mooeypoo (Code Review)
Mooeypoo has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/368525 )

Change subject: RCFilters: Open limit/days popups the other way
..

RCFilters: Open limit/days popups the other way

Bug: T171968
Change-Id: I83127f43cef02194c839cd0ac531ae43fa386e9a
---
M 
resources/src/mediawiki.rcfilters/ui/mw.rcfilters.ui.ChangesLimitButtonWidget.js
M resources/src/mediawiki.rcfilters/ui/mw.rcfilters.ui.DateButtonWidget.js
2 files changed, 2 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/25/368525/1

diff --git 
a/resources/src/mediawiki.rcfilters/ui/mw.rcfilters.ui.ChangesLimitButtonWidget.js
 
b/resources/src/mediawiki.rcfilters/ui/mw.rcfilters.ui.ChangesLimitButtonWidget.js
index b85a89f..32d2097 100644
--- 
a/resources/src/mediawiki.rcfilters/ui/mw.rcfilters.ui.ChangesLimitButtonWidget.js
+++ 
b/resources/src/mediawiki.rcfilters/ui/mw.rcfilters.ui.ChangesLimitButtonWidget.js
@@ -67,7 +67,7 @@
width: 300,
padded: true,
anchor: false,
-   align: 'backwards',
+   align: 'forwards',
$autoCloseIgnore: this.$overlay,
$content: 
changesLimitPopupWidget.$element
}
diff --git 
a/resources/src/mediawiki.rcfilters/ui/mw.rcfilters.ui.DateButtonWidget.js 
b/resources/src/mediawiki.rcfilters/ui/mw.rcfilters.ui.DateButtonWidget.js
index 647e42d..af81883 100644
--- a/resources/src/mediawiki.rcfilters/ui/mw.rcfilters.ui.DateButtonWidget.js
+++ b/resources/src/mediawiki.rcfilters/ui/mw.rcfilters.ui.DateButtonWidget.js
@@ -63,7 +63,7 @@
width: 300,
padded: true,
anchor: false,
-   align: 'backwards',
+   align: 'forwards',
$autoCloseIgnore: this.$overlay,
$content: datePopupWidget.$element
}

-- 
To view, visit https://gerrit.wikimedia.org/r/368525
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I83127f43cef02194c839cd0ac531ae43fa386e9a
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Mooeypoo 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: RCFilters: Remember legend expand/collapse state

2017-07-28 Thread Mooeypoo (Code Review)
Mooeypoo has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/368521 )

Change subject: RCFilters: Remember legend expand/collapse state
..

RCFilters: Remember legend expand/collapse state

Bug: T168043
Change-Id: I2f22f4211cfcbd9e81ee20f013fde921635e5ebc
---
M resources/src/mediawiki.special/mediawiki.special.changeslist.legend.js
1 file changed, 1 insertion(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/21/368521/1

diff --git 
a/resources/src/mediawiki.special/mediawiki.special.changeslist.legend.js 
b/resources/src/mediawiki.special/mediawiki.special.changeslist.legend.js
index ea63e39..a991d36 100644
--- a/resources/src/mediawiki.special/mediawiki.special.changeslist.legend.js
+++ b/resources/src/mediawiki.special/mediawiki.special.changeslist.legend.js
@@ -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' );

-- 
To view, visit https://gerrit.wikimedia.org/r/368521
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I2f22f4211cfcbd9e81ee20f013fde921635e5ebc
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Mooeypoo 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


  1   2   3   4   5   6   7   8   9   10   >