| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
function ErrorLayout( config ) { |
| 10 |
config = config || {}; |
| 11 |
ErrorLayout.super.call( this, config ); |
| 12 |
|
| 13 |
var $image = $( '<div>' ).addClass( 'ext-WikiEditor-image-realtimepreview-error' ); |
| 14 |
var $title = $( '<h3>' ).text( mw.msg( 'wikieditor-realtimepreview-error' ) ); |
| 15 |
this.$message = $( '<div>' ).addClass( 'ext-WikiEditor-realtimepreview-error-msg' ); |
| 16 |
this.reloadButton = new OO.ui.ButtonWidget( { |
| 17 |
icon: 'reload', |
| 18 |
label: mw.msg( 'wikieditor-realtimepreview-reload' ), |
| 19 |
framed: false |
| 20 |
} ); |
| 21 |
|
| 22 |
this.$element.addClass( 'ext-WikiEditor-realtimepreview-ErrorLayout' ); |
| 23 |
this.$element.append( $image, $title, this.$message, this.reloadButton.$element ); |
| 24 |
} |
| 25 |
|
| 26 |
OO.inheritClass( ErrorLayout, OO.ui.Layout ); |
| 27 |
|
| 28 |
|
| 29 |
|
| 30 |
|
| 31 |
|
| 32 |
ErrorLayout.prototype.getReloadButton = function () { |
| 33 |
return this.reloadButton; |
| 34 |
}; |
| 35 |
|
| 36 |
|
| 37 |
|
| 38 |
|
| 39 |
|
| 40 |
|
| 41 |
|
| 42 |
ErrorLayout.prototype.setMessage = function ( $errorMsg ) { |
| 43 |
this.$message |
| 44 |
.empty() |
| 45 |
.append( $errorMsg ); |
| 46 |
}; |
| 47 |
|
| 48 |
module.exports = ErrorLayout; |