<commit_before>$(function() {
	
});

var TwisterOptions = function()
{
    this.getOption = function(optionName, defaultValue) {
        var keyName = "options:" + optionName;
        if( $.localStorage.isSet(keyName) )
            return $.localStorage.get(keyName);
        else
            return defaultValue;
    }

    this.setOption = function(optionName, value) {
        var keyName = "options:" + optionName;
        $.localStorage.set(keyName, value);
    }
    
    this.soundNotifOptions = function() {
        $('#notifyForm select').each(function(){
            this.value = $.Options.getOption(this.id, "false");
        });
        
        var player = $('#player');
        player[0].pause();
        $('#player').empty();

        $('form#notifyForm').on('change','select',function(){
            $.Options.setOption(this.id, this.value);
            
            if(this.value == false) {player[0].pause(); return;}
            if (player[0].canPlayType('audio/mpeg;')) {
                player.attr('type', 'audio/mpeg');
                player.attr('src', 'sound/'+this.value+'.mp3');
            } else {
                player.attr('type', 'audio/ogg');
                player.attr('src', 'sound/'+this.value+'.ogg');
            }
            
            player[0].play();
        });
    }
    
    this.volumeControl = function() {
        var playerVol = $('#playerVol');
        playerVol[0].value = $.Options.getOption(playerVol[0].id, 100);
        $('.volValue').text((playerVol[0].value * 100).toFixed());

        playerVol.on('change',function(){
            $.Options.setOption(this.id, this.value);
            $('#player')[0].volume = (this.value);
            $('.volValue').text((this.value * 100).toFixed());
        });
    }

    this.DMsNotif = function() {
        var sndDM = $.Options.getOption('sndDM', "false");
        if( sndDM == "false") return;
        var player = $('#player');
        $('#player').empty();

        if (player[0].canPlayType('audio/mpeg;')) {
            player.attr('type', 'audio/mpeg');
            player.attr('src', 'sound/'+sndDM+'.mp3');
        } else {
            player.attr('type', 'audio/ogg');
            player.attr('src', 'sound/'+sndDM+'.ogg');
        }
        player[0].volume = $.Options.getOption('playerVol',100);
        player[0].play();
    }

    this.mensNotif = function() {
        var sndMention = $.Options.getOption('sndMention', "false");
        if(sndMention == "false") return;
        var player = $('#player');
        $('#playerSec').empty();

        if (player[0].canPlayType('audio/mpeg;')) {
            player.attr('type', 'audio/mpeg');
            player.attr('src', 'sound/'+sndMention+'.mp3');
        } else {
            player.attr('type', 'audio/ogg');
            player.attr('src', 'sound/'+sndMention+'.ogg');
        }
        player[0].volume = $.Options.getOption('playerVol',100);
        player[0].play();
    }

    this.keysSend = function() {
        $('#keysOpt select')[0].value = $.Options.getOption('keysSend',"enter");

        $('#keysOpt select').on('change', function(){
            $.Options.setOption(this.id, this.value);
        })
    }
    
    this.keyEnterToSend = function() {
        return $.Options.getOption('keysSend',"enter") == "enter";
    }

    this.setLang = function() {
        $('#language').val($.Options.getOption('locLang','auto'))
        $('#language').on('change', function(){
            $.Options.setOption('locLang', $(this).val());
        })<commit_msg>change default keysSend to ctrlenter<commit_after>$(function() {
	
});

var TwisterOptions = function()
{
    this.getOption = function(optionName, defaultValue) {
        var keyName = "options:" + optionName;
        if( $.localStorage.isSet(keyName) )
            return $.localStorage.get(keyName);
        else
            return defaultValue;
    }

    this.setOption = function(optionName, value) {
        var keyName = "options:" + optionName;
        $.localStorage.set(keyName, value);
    }
    
    this.soundNotifOptions = function() {
        $('#notifyForm select').each(function(){
            this.value = $.Options.getOption(this.id, "false");
        });
        
        var player = $('#player');
        player[0].pause();
        $('#player').empty();

        $('form#notifyForm').on('change','select',function(){
            $.Options.setOption(this.id, this.value);
            
            if(this.value == false) {player[0].pause(); return;}
            if (player[0].canPlayType('audio/mpeg;')) {
                player.attr('type', 'audio/mpeg');
                player.attr('src', 'sound/'+this.value+'.mp3');
            } else {
                player.attr('type', 'audio/ogg');
                player.attr('src', 'sound/'+this.value+'.ogg');
            }
            
            player[0].play();
        });
    }
    
    this.volumeControl = function() {
        var playerVol = $('#playerVol');
        playerVol[0].value = $.Options.getOption(playerVol[0].id, 100);
        $('.volValue').text((playerVol[0].value * 100).toFixed());

        playerVol.on('change',function(){
            $.Options.setOption(this.id, this.value);
            $('#player')[0].volume = (this.value);
            $('.volValue').text((this.value * 100).toFixed());
        });
    }

    this.DMsNotif = function() {
        var sndDM = $.Options.getOption('sndDM', "false");
        if( sndDM == "false") return;
        var player = $('#player');
        $('#player').empty();

        if (player[0].canPlayType('audio/mpeg;')) {
            player.attr('type', 'audio/mpeg');
            player.attr('src', 'sound/'+sndDM+'.mp3');
        } else {
            player.attr('type', 'audio/ogg');
            player.attr('src', 'sound/'+sndDM+'.ogg');
        }
        player[0].volume = $.Options.getOption('playerVol',100);
        player[0].play();
    }

    this.mensNotif = function() {
        var sndMention = $.Options.getOption('sndMention', "false");
        if(sndMention == "false") return;
        var player = $('#player');
        $('#playerSec').empty();

        if (player[0].canPlayType('audio/mpeg;')) {
            player.attr('type', 'audio/mpeg');
            player.attr('src', 'sound/'+sndMention+'.mp3');
        } else {
            player.attr('type', 'audio/ogg');
            player.attr('src', 'sound/'+sndMention+'.ogg');
        }
        player[0].volume = $.Options.getOption('playerVol',100);
        player[0].play();
    }

    this.keysSend = function() {
        $('#keysOpt select')[0].value = $.Options.getOption('keysSend',"ctrlenter");

        $('#keysOpt select').on('change', function(){
            $.Options.setOption(this.id, this.value);
        })
    }
    
    this.keyEnterToSend = function() {
        return $.Options.getOption('keysSend',"enter") == "enter";
    }

    this.setLang = function() {
        $('#language').val($.Options.getOption('locLang','auto'))
        $('#language').on('change', function(){
            $.Options.setOption('locLang', $(this).val());
        })
{'fraction_non_alphanumeric': 0.2011550922665164, 'fraction_numerical': 0.0092970840963516, 'mean_word_length': 2.1236251649802025, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 8, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5779988', 'n_tokens_mistral': 2126, 'n_tokens_neox': 2087, 'n_words': 308}