Source: widgets/player/buttons/replay.js

define('application/widgets/player/buttons/replay', [
    'application/widgets/pointerfocusablebutton',
    'rofl/widgets/label',
    'rofl/lib/l10n'
], function (
    Button,
    Label,
    L10n
) {
    'use strict';

    var RESTART_CLASS = 'icon-playback',
        l10n = L10n.getInstance(),
        ReplayButton;

    ReplayButton = Button.extend({

        /**
         * Initialises the widget.
         *
         * @param {string} id - The id.
         */
        init: function init (id) {
            init.base.call(this, id);

            this.addClass(['control', 'replay']);
            this._build();
        },

        /**
         * Builds the widget.
         *
         * @private
         */
        _build: function () {
            var icon = this._icon = new Label({ text: '', classNames: ['v-align-target', 'icon', RESTART_CLASS] }),
                helper = new Label({ text: '', classNames: ['v-align-helper'] }),
                restartText = new Label({ text: l10n.get('player.buttons.restart'), classNames: ['restartBtn-text', 'v-align-helper'] });

            this.appendChildWidget(helper);
            this.appendChildWidget(icon);
            this.appendChildWidget(restartText);
        }
    });

    return ReplayButton;
});