1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
|
( function ( mw ) {
/**
* Top section (between page title and filters) on Special:Watchlist
*
* @extends OO.ui.Widget
*
* @constructor
* @param {mw.rcfilters.Controller} controller
* @param {mw.rcfilters.dm.ChangesListViewModel} changesListModel
* @param {mw.rcfilters.ui.SavedLinksListWidget} savedLinksListWidget
* @param {jQuery} $watchlistDetails Content of the 'details' section that includes watched pages count
* @param {Object} [config] Configuration object
*/
mw.rcfilters.ui.WatchlistTopSectionWidget = function MwRcfiltersUiWatchlistTopSectionWidget(
controller, changesListModel, savedLinksListWidget, $watchlistDetails, config
) {
var editWatchlistButton,
markSeenButton,
$topTable,
$bottomTable,
$separator;
config = config || {};
// Parent
mw.rcfilters.ui.WatchlistTopSectionWidget.parent.call( this, config );
editWatchlistButton = new OO.ui.ButtonWidget( {
label: mw.msg( 'rcfilters-watchlist-edit-watchlist-button' ),
icon: 'edit',
href: mw.config.get( 'wgStructuredChangeFiltersEditWatchlistUrl' )
} );
markSeenButton = new mw.rcfilters.ui.MarkSeenButtonWidget( controller, changesListModel );
$topTable = $( '<div>' )
.addClass( 'mw-rcfilters-ui-table' )
.append(
$( '<div>' )
.addClass( 'mw-rcfilters-ui-row' )
.append(
$( '<div>' )
.addClass( 'mw-rcfilters-ui-cell' )
.addClass( 'mw-rcfilters-ui-watchlistTopSectionWidget-watchlistDetails' )
.append( $watchlistDetails )
)
.append(
$( '<div>' )
.addClass( 'mw-rcfilters-ui-cell' )
.addClass( 'mw-rcfilters-ui-watchlistTopSectionWidget-editWatchlistButton' )
.append( editWatchlistButton.$element )
)
);
$bottomTable = $( '<div>' )
.addClass( 'mw-rcfilters-ui-table' )
.addClass( 'mw-rcfilters-ui-watchlistTopSectionWidget-savedLinksTable' )
.append(
$( '<div>' )
.addClass( 'mw-rcfilters-ui-row' )
.append(
$( '<div>' )
.addClass( 'mw-rcfilters-ui-cell' )
.append( markSeenButton.$element )
)
.append(
$( '<div>' )
.addClass( 'mw-rcfilters-ui-cell' )
.addClass( 'mw-rcfilters-ui-watchlistTopSectionWidget-savedLinks' )
.append( savedLinksListWidget.$element )
)
);
$separator = $( '<div>' )
.addClass( 'mw-rcfilters-ui-watchlistTopSectionWidget-separator' );
this.$element
.addClass( 'mw-rcfilters-ui-watchlistTopSectionWidget' )
.append( $topTable, $separator, $bottomTable );
};
/* Initialization */
OO.inheritClass( mw.rcfilters.ui.WatchlistTopSectionWidget, OO.ui.Widget );
}( mediaWiki ) );
|