1 const RclToOrFromWidget = require( './RclToOrFromWidget.js' );
2 const RclTargetPageWidget = require( './RclTargetPageWidget.js' );
5 * Top section (between page title and filters) on Special:RecentChangesLinked (AKA RelatedChanges).
7 * @class mw.rcfilters.ui.RclTopSectionWidget
9 * @extends OO.ui.Widget
11 * @param {mw.rcfilters.ui.SavedLinksListWidget} savedLinksListWidget
12 * @param {mw.rcfilters.Controller} controller
13 * @param {mw.rcfilters.dm.FilterItem} showLinkedToModel Model for 'showlinkedto' parameter
14 * @param {mw.rcfilters.dm.FilterItem} targetPageModel Model for 'target' parameter
15 * @param {Object} [config] Configuration object
17 const RclTopSectionWidget = function MwRcfiltersUiRclTopSectionWidget(
18 savedLinksListWidget, controller, showLinkedToModel, targetPageModel, config
20 config = config || {};
23 RclTopSectionWidget.super.call( this, config );
25 this.controller = controller;
27 const toOrFromWidget = new RclToOrFromWidget( controller, showLinkedToModel );
28 const targetPage = new RclTargetPageWidget( controller, targetPageModel );
32 .addClass( 'mw-rcfilters-ui-rclTopSectionWidget' )
35 .addClass( 'mw-rcfilters-ui-table' )
38 .addClass( 'mw-rcfilters-ui-row' )
41 .addClass( 'mw-rcfilters-ui-cell' )
42 .append( toOrFromWidget.$element )
45 .addClass( 'mw-rcfilters-ui-row' )
48 .addClass( 'mw-rcfilters-ui-cell' )
49 .append( targetPage.$element ),
51 .addClass( 'mw-rcfilters-ui-table-placeholder' )
52 .addClass( 'mw-rcfilters-ui-cell' ),
55 .addClass( 'mw-rcfilters-ui-cell' )
56 .addClass( 'mw-rcfilters-ui-rclTopSectionWidget-savedLinks' )
57 .append( savedLinksListWidget.$element ) :
66 OO.inheritClass( RclTopSectionWidget, OO.ui.Widget );
68 module.exports = RclTopSectionWidget;