| 1 |
( function () { |
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
mw.echo.ui.PlaceholderItemWidget = function MwEchoUiPlaceholderItemWidget( config ) { |
| 14 |
config = config || {}; |
| 15 |
|
| 16 |
|
| 17 |
mw.echo.ui.PlaceholderItemWidget.super.call( this, Object.assign( { data: null }, config ) ); |
| 18 |
|
| 19 |
|
| 20 |
OO.ui.mixin.LabelElement.call( this, config ); |
| 21 |
|
| 22 |
this.$element.addClass( 'mw-echo-ui-placeholderItemWidget' ); |
| 23 |
|
| 24 |
this.setLink( config.link ); |
| 25 |
}; |
| 26 |
|
| 27 |
OO.inheritClass( mw.echo.ui.PlaceholderItemWidget, OO.ui.Widget ); |
| 28 |
OO.mixinClass( mw.echo.ui.PlaceholderItemWidget, OO.ui.mixin.LabelElement ); |
| 29 |
|
| 30 |
|
| 31 |
|
| 32 |
|
| 33 |
|
| 34 |
|
| 35 |
mw.echo.ui.PlaceholderItemWidget.prototype.setLink = function ( url ) { |
| 36 |
if ( url ) { |
| 37 |
const $link = $( '<a>' ) |
| 38 |
.addClass( 'mw-echo-ui-placeholderItemWidget-link' ) |
| 39 |
.attr( 'href', url ); |
| 40 |
this.$element.html( $link.append( this.$label ) ); |
| 41 |
} else { |
| 42 |
this.$element.html( this.$label ); |
| 43 |
} |
| 44 |
}; |
| 45 |
|
| 46 |
|
| 47 |
|
| 48 |
|
| 49 |
|
| 50 |
|
| 51 |
|
| 52 |
mw.echo.ui.PlaceholderItemWidget.prototype.isRead = function () { |
| 53 |
return false; |
| 54 |
}; |
| 55 |
|
| 56 |
|
| 57 |
|
| 58 |
|
| 59 |
|
| 60 |
|
| 61 |
|
| 62 |
mw.echo.ui.PlaceholderItemWidget.prototype.isForeign = function () { |
| 63 |
return false; |
| 64 |
}; |
| 65 |
|
| 66 |
|
| 67 |
|
| 68 |
|
| 69 |
|
| 70 |
|
| 71 |
|
| 72 |
mw.echo.ui.PlaceholderItemWidget.prototype.getTimestamp = function () { |
| 73 |
return 0; |
| 74 |
}; |
| 75 |
|
| 76 |
|
| 77 |
|
| 78 |
|
| 79 |
|
| 80 |
|
| 81 |
|
| 82 |
mw.echo.ui.PlaceholderItemWidget.prototype.getId = function () { |
| 83 |
return 0; |
| 84 |
}; |
| 85 |
|
| 86 |
|
| 87 |
|
| 88 |
|
| 89 |
mw.echo.ui.PlaceholderItemWidget.prototype.resetInitiallyUnseen = function () {}; |
| 90 |
|
| 91 |
}() ); |