mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Echo
synced 2024-11-28 01:30:15 +00:00
Merge "Replace .parent with .super"
This commit is contained in:
commit
c6f3909a6f
|
@ -16,7 +16,7 @@
|
|||
config = config || {};
|
||||
|
||||
// Parent constructor
|
||||
mw.echo.api.ForeignAPIHandler.parent.call( this, config );
|
||||
mw.echo.api.ForeignAPIHandler.super.call( this, config );
|
||||
|
||||
this.api = new mw.ForeignApi( apiUrl );
|
||||
this.unreadOnly = config.unreadOnly !== undefined ? !!config.unreadOnly : false;
|
||||
|
|
|
@ -9,10 +9,8 @@
|
|||
* @param {Object} [config] Configuration object
|
||||
*/
|
||||
mw.echo.api.LocalAPIHandler = function MwEchoApiLocalAPIHandler( config ) {
|
||||
config = config || {};
|
||||
|
||||
// Parent constructor
|
||||
mw.echo.api.LocalAPIHandler.parent.call( this,
|
||||
mw.echo.api.LocalAPIHandler.super.call( this,
|
||||
new mw.Api( { ajax: { cache: false } } ),
|
||||
config
|
||||
);
|
||||
|
|
|
@ -12,9 +12,8 @@
|
|||
* @param {Object} [config] Configuration object
|
||||
*/
|
||||
mw.echo.dm.BundleNotificationItem = function MwEchoDmBundleNotificationItem( id, bundledNotificationModels, config ) {
|
||||
config = config || {};
|
||||
|
||||
mw.echo.dm.BundleNotificationItem.parent.call( this, id, config );
|
||||
// Parent constructor
|
||||
mw.echo.dm.BundleNotificationItem.super.call( this, id, config );
|
||||
|
||||
this.getSecondaryUrls().forEach( function ( link ) {
|
||||
// hack: put all secondary actions in the menu for now
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
mw.echo.dm.CrossWikiNotificationItem = function MwEchoDmCrossWikiNotificationItem( id, config ) {
|
||||
config = config || {};
|
||||
|
||||
mw.echo.dm.CrossWikiNotificationItem.parent.call( this, id, config );
|
||||
mw.echo.dm.CrossWikiNotificationItem.super.call( this, id, config );
|
||||
|
||||
this.foreign = true;
|
||||
this.source = null;
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
config = config || {};
|
||||
|
||||
// Parent constructor
|
||||
mw.echo.dm.NotificationGroupsList.parent.call( this );
|
||||
mw.echo.dm.NotificationGroupsList.super.call( this );
|
||||
|
||||
// Sorting callback
|
||||
this.setSortingCallback( function ( a, b ) {
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
config = config || {};
|
||||
|
||||
// Parent constructor
|
||||
mw.echo.dm.NotificationsList.parent.call( this );
|
||||
mw.echo.dm.NotificationsList.super.call( this );
|
||||
|
||||
this.name = config.name || 'local';
|
||||
this.source = config.source || 'local';
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
config = config || {};
|
||||
|
||||
// Parent constructor
|
||||
mw.echo.ui.ActionMenuPopupWidget.parent.call( this, config );
|
||||
mw.echo.ui.ActionMenuPopupWidget.super.call( this, config );
|
||||
|
||||
this.$overlay = config.$overlay || this.$element;
|
||||
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
config = config || {};
|
||||
|
||||
// Parent constructor
|
||||
mw.echo.ui.BadgeLinkWidget.parent.call( this, config );
|
||||
mw.echo.ui.BadgeLinkWidget.super.call( this, config );
|
||||
|
||||
// Mixin constructors
|
||||
OO.ui.mixin.LabelElement.call( this, $.extend( { $label: this.$element }, config ) );
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
config = config || {};
|
||||
|
||||
// Parent constructor
|
||||
mw.echo.ui.BundleNotificationItemWidget.parent.call( this, controller, model, config );
|
||||
mw.echo.ui.BundleNotificationItemWidget.super.call( this, controller, model, config );
|
||||
|
||||
this.toggleMarkAsReadButtons( true );
|
||||
|
||||
|
|
|
@ -18,8 +18,8 @@
|
|||
mw.echo.ui.ClonedNotificationItemWidget = function MwEchoUiClonedNotificationItemWidget( $element, config ) {
|
||||
config = config || {};
|
||||
|
||||
// Parent
|
||||
mw.echo.ui.ClonedNotificationItemWidget.parent.call( this, config );
|
||||
// Parent constructor
|
||||
mw.echo.ui.ClonedNotificationItemWidget.super.call( this, config );
|
||||
|
||||
this.$element = $element;
|
||||
this.timestamp = config.timestamp || moment.utc().format( 'YYYY-MM-DD[T]HH:mm:ss[Z]' );
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
config = config || {};
|
||||
|
||||
// Parent constructor
|
||||
mw.echo.ui.ConfirmationPopupWidget.parent.call( this, config );
|
||||
mw.echo.ui.ConfirmationPopupWidget.super.call( this, config );
|
||||
|
||||
this.labelWidget = new OO.ui.LabelWidget( config );
|
||||
this.iconWidget = new OO.ui.IconWidget( $.extend( { icon: 'checkAll' }, config ) );
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
config = config || {};
|
||||
|
||||
// Parent constructor
|
||||
mw.echo.ui.CrossWikiNotificationItemWidget.parent.call( this, controller, model, config );
|
||||
mw.echo.ui.CrossWikiNotificationItemWidget.super.call( this, controller, model, config );
|
||||
// Mixin constructors
|
||||
OO.ui.mixin.PendingElement.call( this, config );
|
||||
|
||||
|
@ -143,8 +143,8 @@
|
|||
this.controller.getTypeString() // The type of the list in general
|
||||
);
|
||||
|
||||
// Parent
|
||||
return mw.echo.ui.CrossWikiNotificationItemWidget.parent.prototype.onMarkAsReadButtonClick.call( this );
|
||||
// Parent method
|
||||
return mw.echo.ui.CrossWikiNotificationItemWidget.super.prototype.onMarkAsReadButtonClick.call( this );
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
|
@ -16,8 +16,8 @@
|
|||
|
||||
config = config || {};
|
||||
|
||||
// Parent
|
||||
mw.echo.ui.CrossWikiUnreadFilterWidget.parent.call( this,
|
||||
// Parent constructor
|
||||
mw.echo.ui.CrossWikiUnreadFilterWidget.super.call( this,
|
||||
// Sorting callback
|
||||
function ( a, b ) {
|
||||
var diff;
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
config = config || {};
|
||||
|
||||
// Parent constructor
|
||||
mw.echo.ui.DatedNotificationsWidget.parent.call( this, config );
|
||||
mw.echo.ui.DatedNotificationsWidget.super.call( this, config );
|
||||
// Mixin constructors
|
||||
OO.ui.mixin.PendingElement.call( this, config );
|
||||
|
||||
|
|
|
@ -22,10 +22,8 @@
|
|||
.addClass( 'mw-echo-ui-datedSubGroupListWidget-title' )
|
||||
.append( $primaryDate, $secondaryDate );
|
||||
|
||||
config = config || {};
|
||||
|
||||
// Parent constructor
|
||||
mw.echo.ui.DatedSubGroupListWidget.parent.call( this, controller, listModel, $.extend( {
|
||||
mw.echo.ui.DatedSubGroupListWidget.super.call( this, controller, listModel, $.extend( {
|
||||
// Since this widget is defined as a dated list, we sort
|
||||
// its items according to timestamp without consideration
|
||||
// of read state or foreignness.
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
config = config || {};
|
||||
|
||||
// Parent constructor
|
||||
mw.echo.ui.FooterNoticeWidget.parent.call( this, config );
|
||||
mw.echo.ui.FooterNoticeWidget.super.call( this, config );
|
||||
|
||||
if ( config.iconUrl ) {
|
||||
$icon = $( '<div>' )
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
this.isLink = config.url && !this.isDynamicAction();
|
||||
|
||||
// Parent constructor
|
||||
mw.echo.ui.MenuItemWidget.parent.call( this, config );
|
||||
mw.echo.ui.MenuItemWidget.super.call( this, config );
|
||||
|
||||
// Mixin constructors
|
||||
OO.ui.mixin.PendingElement.call( this, config );
|
||||
|
@ -77,7 +77,7 @@
|
|||
// If we have a link force selectability to false, otherwise defer to parent method
|
||||
// Without a link (for dynamic actions or specific internal actions) we need this widget
|
||||
// to be selectable so it emits the 'choose' event
|
||||
return !this.isLink && mw.echo.ui.MenuItemWidget.parent.prototype.isSelectable.apply( this, arguments );
|
||||
return !this.isLink && mw.echo.ui.MenuItemWidget.super.prototype.isSelectable.apply( this, arguments );
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
|
@ -31,7 +31,7 @@
|
|||
config = config || {};
|
||||
|
||||
// Parent constructor
|
||||
mw.echo.ui.NotificationBadgeWidget.parent.call( this, config );
|
||||
mw.echo.ui.NotificationBadgeWidget.super.call( this, config );
|
||||
|
||||
// Mixin constructors
|
||||
OO.ui.mixin.PendingElement.call( this, config );
|
||||
|
|
|
@ -22,8 +22,8 @@
|
|||
|
||||
config = config || {};
|
||||
|
||||
// Parent
|
||||
mw.echo.ui.NotificationItemWidget.parent.call( this, $.extend( { data: model.getId() }, config ) );
|
||||
// Parent constructor
|
||||
mw.echo.ui.NotificationItemWidget.super.call( this, $.extend( { data: model.getId() }, config ) );
|
||||
|
||||
this.controller = controller;
|
||||
this.model = model;
|
||||
|
|
|
@ -18,8 +18,8 @@
|
|||
|
||||
config = config || {};
|
||||
|
||||
// Parent
|
||||
mw.echo.ui.NotificationsInboxWidget.parent.call( this, config );
|
||||
// Parent constructor
|
||||
mw.echo.ui.NotificationsInboxWidget.super.call( this, config );
|
||||
// Mixin constructors
|
||||
OO.ui.mixin.PendingElement.call( this, config );
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
mw.echo.ui.NotificationsListWidget = function MwEchoUiNotificationsListWidget( controller, manager, config ) {
|
||||
config = config || {};
|
||||
// Parent constructor
|
||||
mw.echo.ui.NotificationsListWidget.parent.call(
|
||||
mw.echo.ui.NotificationsListWidget.super.call(
|
||||
this,
|
||||
// Sorting callback
|
||||
function ( a, b ) {
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
config = config || {};
|
||||
|
||||
// Parent constructor
|
||||
mw.echo.ui.NotificationsWrapper.parent.call( this, config );
|
||||
mw.echo.ui.NotificationsWrapper.super.call( this, config );
|
||||
|
||||
// Mixin constructor
|
||||
OO.ui.mixin.PendingElement.call( this, config );
|
||||
|
|
|
@ -17,8 +17,8 @@
|
|||
mw.echo.ui.PageFilterWidget = function MwEchoUiPageFilterWidget( filterModel, source, config ) {
|
||||
config = config || {};
|
||||
|
||||
// Parent
|
||||
mw.echo.ui.PageFilterWidget.parent.call( this, config );
|
||||
// Parent constructor
|
||||
mw.echo.ui.PageFilterWidget.super.call( this, config );
|
||||
|
||||
this.model = filterModel;
|
||||
this.source = source;
|
||||
|
|
|
@ -17,8 +17,8 @@
|
|||
|
||||
config = config || {};
|
||||
|
||||
// Parent
|
||||
mw.echo.ui.PageNotificationsOptionWidget.parent.call( this, 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 );
|
||||
|
@ -85,7 +85,7 @@
|
|||
};
|
||||
|
||||
mw.echo.ui.PageNotificationsOptionWidget.prototype.setPressed = function ( state ) {
|
||||
mw.echo.ui.PageNotificationsOptionWidget.parent.prototype.setPressed.call( this, state );
|
||||
mw.echo.ui.PageNotificationsOptionWidget.super.prototype.setPressed.call( this, state );
|
||||
if ( this.pressed ) {
|
||||
this.setFlags( 'progressive' );
|
||||
} else if ( !this.selected ) {
|
||||
|
@ -95,7 +95,7 @@
|
|||
};
|
||||
|
||||
mw.echo.ui.PageNotificationsOptionWidget.prototype.setSelected = function ( state ) {
|
||||
mw.echo.ui.PageNotificationsOptionWidget.parent.prototype.setSelected.call( this, state );
|
||||
mw.echo.ui.PageNotificationsOptionWidget.super.prototype.setSelected.call( this, state );
|
||||
if ( this.selected ) {
|
||||
this.setFlags( 'progressive' );
|
||||
} else {
|
||||
|
|
|
@ -20,8 +20,8 @@
|
|||
mw.echo.ui.PaginationWidget = function MwEchoUiPaginationWidget( paginationModel, config ) {
|
||||
config = config || {};
|
||||
|
||||
// Parent
|
||||
mw.echo.ui.PaginationWidget.parent.call( this, config );
|
||||
// Parent constructor
|
||||
mw.echo.ui.PaginationWidget.super.call( this, config );
|
||||
|
||||
this.model = paginationModel;
|
||||
|
||||
|
@ -135,8 +135,8 @@
|
|||
* @chainable
|
||||
*/
|
||||
mw.echo.ui.PaginationWidget.prototype.setDisabled = function ( disabled ) {
|
||||
// Parent
|
||||
mw.echo.ui.PaginationWidget.parent.prototype.setDisabled.call( this, disabled );
|
||||
// Parent method
|
||||
mw.echo.ui.PaginationWidget.super.prototype.setDisabled.call( this, disabled );
|
||||
|
||||
if (
|
||||
this.dirSelectWidget &&
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
config = config || {};
|
||||
|
||||
// Parent constructor
|
||||
mw.echo.ui.PlaceholderItemWidget.parent.call( this, $.extend( { data: null }, config ) );
|
||||
mw.echo.ui.PlaceholderItemWidget.super.call( this, $.extend( { data: null }, config ) );
|
||||
|
||||
// Mixin constructor
|
||||
OO.ui.mixin.LabelElement.call( this, config );
|
||||
|
|
|
@ -9,10 +9,8 @@
|
|||
* @param {Object} [config] Configuration object
|
||||
*/
|
||||
mw.echo.ui.ReadStateButtonSelectWidget = function MwEchoUiReadStateButtonSelectWidget( config ) {
|
||||
config = config || {};
|
||||
|
||||
// Parent
|
||||
mw.echo.ui.ReadStateButtonSelectWidget.parent.call( this, $.extend( config, {
|
||||
// Parent constructor
|
||||
mw.echo.ui.ReadStateButtonSelectWidget.super.call( this, $.extend( config, {
|
||||
items: [
|
||||
new OO.ui.ButtonOptionWidget( {
|
||||
data: 'all',
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
config = config || {};
|
||||
|
||||
// Parent constructor
|
||||
mw.echo.ui.SingleNotificationItemWidget.parent.call( this, controller, model, config );
|
||||
mw.echo.ui.SingleNotificationItemWidget.super.call( this, controller, model, config );
|
||||
// Mixin constructors
|
||||
OO.ui.mixin.PendingElement.call( this, config );
|
||||
|
||||
|
@ -83,8 +83,8 @@
|
|||
mw.echo.ui.SingleNotificationItemWidget.prototype.toggleRead = function ( read ) {
|
||||
var oldState = this.read;
|
||||
|
||||
// Parent
|
||||
mw.echo.ui.SingleNotificationItemWidget.parent.prototype.toggleRead.call( this, read );
|
||||
// Parent method
|
||||
mw.echo.ui.SingleNotificationItemWidget.super.prototype.toggleRead.call( this, read );
|
||||
|
||||
if ( oldState !== read ) {
|
||||
this.emit( 'sortChange' );
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
config = config || {};
|
||||
|
||||
// Parent constructor
|
||||
mw.echo.ui.SortedListWidget.parent.call( this, config );
|
||||
mw.echo.ui.SortedListWidget.super.call( this, config );
|
||||
// Mixin constructor
|
||||
OO.SortedEmitterList.call( this, sortingCallback );
|
||||
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
config = config || {};
|
||||
|
||||
// Parent constructor
|
||||
mw.echo.ui.SpecialHelpMenuWidget.parent.call( this, $.extend( {
|
||||
mw.echo.ui.SpecialHelpMenuWidget.super.call( this, $.extend( {
|
||||
icon: 'advanced',
|
||||
indicator: 'down',
|
||||
popup: {
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
this.model = listModel;
|
||||
|
||||
// Parent constructor
|
||||
mw.echo.ui.SubGroupListWidget.parent.call( this, $.extend( { data: this.getSource() }, config ) );
|
||||
mw.echo.ui.SubGroupListWidget.super.call( this, $.extend( { data: this.getSource() }, config ) );
|
||||
|
||||
this.showTitle = !!config.showTitle;
|
||||
this.showMarkAllRead = !!config.showMarkAllRead;
|
||||
|
|
|
@ -13,8 +13,8 @@
|
|||
mw.echo.ui.ToggleReadCircleButtonWidget = function MwEchoUiToggleReadCircleButtonWidget( config ) {
|
||||
config = config || {};
|
||||
|
||||
// Parent
|
||||
mw.echo.ui.ToggleReadCircleButtonWidget.parent.call( this, config );
|
||||
// Parent constructor
|
||||
mw.echo.ui.ToggleReadCircleButtonWidget.super.call( this, config );
|
||||
|
||||
this.$circle = $( '<div>' )
|
||||
.addClass( 'mw-echo-ui-toggleReadCircleButtonWidget-circle' );
|
||||
|
|
Loading…
Reference in a new issue