( function () { /** * An option widget for the page filter in PageFilterWidget * * @class * @extends OO.ui.OptionWidget * @mixins OO.ui.mixin.IconElement * @mixins OO.ui.mixin.TitledElement * * @constructor * @param {Object} [config] Configuration object * @cfg {number} [count] Number of unread notifications * @cfg {boolean} [isCapped] The count for this widget is capped */ mw.echo.ui.PageNotificationsOptionWidget = function MwEchoUiPageNotificationsOptionWidget( config ) { var countLabel, $row; config = config || {}; // Parent constructor mw.echo.ui.PageNotificationsOptionWidget.super.call( this, config ); // Mixin constructors OO.ui.mixin.IconElement.call( this, config ); OO.ui.mixin.TitledElement.call( this, config ); this.$label .addClass( 'mw-echo-ui-pageNotificationsOptionWidget-title-label' ); this.count = config.count !== undefined ? config.count : 0; countLabel = mw.language.convertNumber( this.count ); countLabel = config.isCapped ? mw.msg( 'echo-badge-count', countLabel ) : countLabel; this.unreadCountLabel = new OO.ui.LabelWidget( { classes: [ 'mw-echo-ui-pageNotificationsOptionWidget-label-count' ], label: countLabel } ); $row = $( '