mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Echo
synced 2024-11-23 23:44:53 +00:00
Consistent Casing for "iconUrl"
Replaced all occurrences of "iconURL" in the extension's repo with "iconUrl" after spotting a typo in `mw.echo.dm.NotificationItem.js#13`, "iconUrl" (find the correct "iconURL" in `mw.echo.Controller.js#394` in the diff). Thankfully the typo was only in the documentation block, but given the casing of other config object properties like "primaryUrl" and "secondaryUrl", it would be best to make them all consistent to prevent any bug that could happen in the future. Change-Id: I56e6a1d2c7695204b35e767679a27ee22b3fe4bc
This commit is contained in:
parent
f38a43f58d
commit
14b06b78e5
|
@ -18,7 +18,7 @@ class EchoFlyoutFormatter extends EchoEventFormatter {
|
|||
'img',
|
||||
[
|
||||
'class' => 'mw-echo-icon',
|
||||
'src' => $this->getIconURL( $model ),
|
||||
'src' => $this->getIconUrl( $model ),
|
||||
]
|
||||
);
|
||||
|
||||
|
@ -70,7 +70,7 @@ class EchoFlyoutFormatter extends EchoEventFormatter {
|
|||
);
|
||||
}
|
||||
|
||||
private function getIconURL( EchoEventPresentationModel $model ) {
|
||||
private function getIconUrl( EchoEventPresentationModel $model ) {
|
||||
return EchoIcon::getUrl(
|
||||
$model->getIconType(),
|
||||
$this->language->getDir()
|
||||
|
|
|
@ -23,7 +23,7 @@ class SpecialNotificationsFormatter extends EchoEventFormatter {
|
|||
'img',
|
||||
[
|
||||
'class' => 'mw-echo-icon',
|
||||
'src' => $this->getIconURL( $model ),
|
||||
'src' => $this->getIconUrl( $model ),
|
||||
]
|
||||
);
|
||||
|
||||
|
@ -112,7 +112,7 @@ class SpecialNotificationsFormatter extends EchoEventFormatter {
|
|||
);
|
||||
}
|
||||
|
||||
private function getIconURL( EchoEventPresentationModel $model ) {
|
||||
private function getIconUrl( EchoEventPresentationModel $model ) {
|
||||
return EchoIcon::getUrl(
|
||||
$model->getIconType(),
|
||||
$this->language->getDir()
|
||||
|
|
|
@ -391,7 +391,7 @@
|
|||
compactHeader: content.compactHeader,
|
||||
body: content.body
|
||||
},
|
||||
iconURL: content.iconUrl,
|
||||
iconUrl: content.iconUrl,
|
||||
iconType: content.icon,
|
||||
primaryUrl: OO.getProp( content.links, 'primary', 'url' ),
|
||||
secondaryUrls: OO.getProp( content.links, 'secondary' ) || [],
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
// bundled notifications use the compact header and do not have icons
|
||||
bundledNotificationModels.forEach( ( bundled ) => {
|
||||
bundled.content.header = bundled.content.compactHeader;
|
||||
delete bundled.iconURL;
|
||||
delete bundled.iconUrl;
|
||||
} );
|
||||
|
||||
this.list = new mw.echo.dm.NotificationsList();
|
||||
|
|
|
@ -57,7 +57,7 @@
|
|||
this.bundled = !!config.bundled;
|
||||
this.source = config.source || '';
|
||||
this.iconType = config.iconType;
|
||||
this.iconURL = config.iconURL;
|
||||
this.iconUrl = config.iconUrl;
|
||||
|
||||
this.read = !!config.read;
|
||||
this.seen = !!config.seen;
|
||||
|
@ -242,8 +242,8 @@
|
|||
*
|
||||
* @return {string} Notification icon URL
|
||||
*/
|
||||
mw.echo.dm.NotificationItem.prototype.getIconURL = function () {
|
||||
return this.iconURL;
|
||||
mw.echo.dm.NotificationItem.prototype.getIconUrl = function () {
|
||||
return this.iconUrl;
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
|
@ -39,7 +39,7 @@
|
|||
} );
|
||||
|
||||
let $icon;
|
||||
const iconUrl = this.model.getIconURL();
|
||||
const iconUrl = this.model.getIconUrl();
|
||||
// Icon
|
||||
if ( iconUrl ) {
|
||||
// Only invert non colored images
|
||||
|
@ -52,7 +52,7 @@
|
|||
$icon = $( '<div>' )
|
||||
.addClass( `mw-echo-ui-notificationItemWidget-icon ${ invertIconClass }` )
|
||||
.append( $( '<img>' ).attr( {
|
||||
src: this.model.getIconURL(),
|
||||
src: this.model.getIconUrl(),
|
||||
role: 'presentation',
|
||||
alt: ' '
|
||||
} ) );
|
||||
|
|
|
@ -80,7 +80,7 @@ QUnit.module( 'ext.echo.dm - NotificationItem', ( hooks ) => {
|
|||
isBundled: false,
|
||||
getTimestamp: nowFormatted,
|
||||
getPrimaryUrl: undefined,
|
||||
getIconURL: undefined,
|
||||
getIconUrl: undefined,
|
||||
getIconType: undefined,
|
||||
getSecondaryUrls: [],
|
||||
getModelName: 'local',
|
||||
|
|
Loading…
Reference in a new issue