<commit_before>(function(define) {
'use strict';
// VideoVolumeControl module.
define(
'video/07_video_volume_control.js', [],
function() {
    /**
     * Video volume control module.
     * @exports video/07_video_volume_control.js
     * @constructor
     * @param {Object} state The object containing the state of the video
     * @param {Object} i18n The object containing strings with translations.
     * @return {jquery Promise}
     */
    var VolumeControl = function(state, i18n) {
        if (!(this instanceof VolumeControl)) {
            return new VolumeControl(state, i18n);
        }

        _.bindAll(this, 'keyDownHandler', 'updateVolumeSilently',
            'onVolumeChangeHandler', 'openMenu', 'closeMenu',
            'toggleMuteHandler', 'keyDownButtonHandler', 'destroy'
        );
        this.state = state;
        this.state.videoVolumeControl = this;
        this.i18n = i18n;
        this.initialize();

        return $.Deferred().resolve().promise();
    };

    VolumeControl.prototype = {
        /** Minimum value for the volume slider. */
        min: 0,
        /** Maximum value for the volume slider. */
        max: 100,
        /** Step to increase/decrease volume level via keyboard. */
        step: 20,

        template: [
            '<div class="volume" role="application">',
                '<button class="control" aria-disabled="false" aria-label="',
                    gettext('Volume: Click on this button to mute or unmute this video or press UP or ' +
                        'DOWN buttons to increase or decrease volume level.'),
                    '" aria-expanded="false">',
                    '<span class="icon-fallback-img">',
                        '<span class="icon fa fa-volume-up" aria-hidden="true"></span>',
                        '<span class="sr control-text">',
                            gettext('Volume'),
                        '</span>',
                    '</span>',
                '</button>',
                '<div class="volume-slider-container" aria-hidden="true">',
                    '<div class="volume-slider" ',
                        'role="slider"',
                        'aria-orientation="vertical" ',
                        'aria-valuemin="0" ',
                        'aria-valuemax="100" ',
                        'aria-valuenow=""></div>',
                '</div>',
            '</div>'
        ].join(''),

        destroy: function () {
            this.volumeSlider.slider('destroy');
            this.state.el.find('iframe').removeAttr('tabindex');
            this.a11y.destroy();
            this.cookie = this.a11y = null;
            this.closeMenu();

            this.state.el
                .off('play.volume')
                .off({
                    'keydown': this.keyDownHandler,
                    'volumechange': this.onVolumeChangeHandler
                });
            this.el.off({
                'mouseenter': this.openMenu,
                'mouseleave': this.closeMenu
            });
            this.button.off({
                'mousedown': this.toggleMuteHandler,
                'keydown': this.keyDownButtonHandler,
                'focus': this.openMenu,
                'blur': this.closeMenu
            });
            this.el.remove();
            delete this.state.videoVolumeControl;<commit_msg>AC-406 adding label to volume slider<commit_after>(function(define) {
'use strict';
// VideoVolumeControl module.
define(
'video/07_video_volume_control.js', [],
function() {
    /**
     * Video volume control module.
     * @exports video/07_video_volume_control.js
     * @constructor
     * @param {Object} state The object containing the state of the video
     * @param {Object} i18n The object containing strings with translations.
     * @return {jquery Promise}
     */
    var VolumeControl = function(state, i18n) {
        if (!(this instanceof VolumeControl)) {
            return new VolumeControl(state, i18n);
        }

        _.bindAll(this, 'keyDownHandler', 'updateVolumeSilently',
            'onVolumeChangeHandler', 'openMenu', 'closeMenu',
            'toggleMuteHandler', 'keyDownButtonHandler', 'destroy'
        );
        this.state = state;
        this.state.videoVolumeControl = this;
        this.i18n = i18n;
        this.initialize();

        return $.Deferred().resolve().promise();
    };

    VolumeControl.prototype = {
        /** Minimum value for the volume slider. */
        min: 0,
        /** Maximum value for the volume slider. */
        max: 100,
        /** Step to increase/decrease volume level via keyboard. */
        step: 20,

        template: [
            '<div class="volume" role="application">',
                '<button class="control" aria-disabled="false" aria-label="',
                    gettext('Volume: Click on this button to mute or unmute this video or press UP or ' +
                        'DOWN buttons to increase or decrease volume level.'),
                    '" aria-expanded="false">',
                    '<span class="icon-fallback-img">',
                        '<span class="icon fa fa-volume-up" aria-hidden="true"></span>',
                        '<span class="sr control-text">',
                            gettext('Volume'),
                        '</span>',
                    '</span>',
                '</button>',
                '<div class="volume-slider-container" aria-hidden="true" title="' + gettext('Adjust video volume') + '">', // jshint ignore: line
                    '<div class="volume-slider" ',
                        'role="slider"',
                        'aria-orientation="vertical" ',
                        'aria-valuemin="0" ',
                        'aria-valuemax="100" ',
                        'aria-valuenow="" ',
                        'aria-label="' + gettext('Adjust video volume')  + '"></div>',
                '</div>',
            '</div>'
        ].join(''),

        destroy: function () {
            this.volumeSlider.slider('destroy');
            this.state.el.find('iframe').removeAttr('tabindex');
            this.a11y.destroy();
            this.cookie = this.a11y = null;
            this.closeMenu();

            this.state.el
                .off('play.volume')
                .off({
                    'keydown': this.keyDownHandler,
                    'volumechange': this.onVolumeChangeHandler
                });
            this.el.off({
                'mouseenter': this.openMenu,
                'mouseleave': this.closeMenu
            });
            this.button.off({
                'mousedown': this.toggleMuteHandler,
                'keydown': this.keyDownButtonHandler,
                'focus': this.openMenu,
                'blur': this.closeMenu
            });
            this.el.remove();
            delete this.state.videoVolumeControl;
{'fraction_non_alphanumeric': 0.13370230119429072, 'fraction_numerical': 0.008593067288086223, 'mean_word_length': 1.55849478390462, 'pattern_counts': {'":': 0, '<': 31, '<?xml version=': 0, '>': 31, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6272225', 'n_tokens_mistral': 1817, 'n_tokens_neox': 1717, 'n_words': 388}