All files / mobile.startup MessageBox.js

100% Statements 6/6
100% Branches 0/0
100% Functions 1/1
100% Lines 6/6

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45  1x 1x 1x             1x     1x                                                           1x  
var
	View = require( './View' ),
	util = require( './util' ),
	mfExtend = require( './mfExtend' );
 
/**
 * @class MessageBox
 * @extends View
 */
function MessageBox() {
	View.apply( this, arguments );
}
 
mfExtend( MessageBox, View, {
	/**
	 * @inheritdoc
	 * @memberof MessageBox
	 * @instance
	 */
	isTemplateMode: true,
	/**
	 * @memberof MessageBox
	 * @instance
	 * @mixes View#defaults
	 * @property {Object} defaults Default options hash.
	 * @property {string} [defaults.heading] heading to show along with message (text)
	 * @property {string} defaults.msg message to show (html)
	 * @property {string} defaults.className either mw-message-box-error,
	 *   mw-message-box-notice or mw-message-box-warning
	 */
	defaults: {},
	/**
	 * @memberof MessageBox
	 * @instance
	 */
	template: util.template( `
<div class="{{className}} mw-message-box">
	{{#heading}}<h2>{{heading}}</h2>{{/heading}}
	{{{msg}}}
</div>
	` )
} );
 
module.exports = MessageBox;