define('application/widgets/login/intro', [
'rofl/widgets/container',
'rofl/widgets/label',
'rofl/lib/l10n',
'application/managers/feature'
], function (
Container,
Label,
L10N,
FeatureManager
) {
'use strict';
var l10n = L10N.getInstance(),
featureManager = FeatureManager.getInstance();
return Container.extend({
/**
* Initialises the input widget.
*/
init: function init () {
init.base.call(this);
this.addClass('intro');
this._build();
},
/**
* Builds the widget.
*/
_build: function () {
if (featureManager.isBrandingEnabled()) {
this._buildLogo();
}
this._buildTitle();
this._buildSubtitle();
},
/**
* Builds the logo.
*/
_buildLogo: function () {
var logo = new Container();
logo.addClass('logo');
this.appendChildWidget(logo);
},
/**
* Builds the title.
*/
_buildTitle: function () {
var title = this._title = new Label({ text: l10n.get('login.intro.title'), classNames: ['title'] });
this.appendChildWidget(title);
},
/**
* Builds the subtitle.
*/
_buildSubtitle: function () {
var subtitle = new Label({ text: l10n.get('login.intro.subtitle'), classNames: ['subtitle'] });
this.appendChildWidget(subtitle);
}
});
});