<commit_before>FrontendCore.define('on-off-table', ['devicePackage' ], function () {
    return {
        onStart: function () {

            FrontendCore.requireAndStart('notification');

            $('.switch input').each( function(){

                var oTarget = this;

                $(oTarget).change( function() {

                    var oInput = this,
	                    sValue = oInput.checked,
	                    sUrl = this.checked === true ? document.getElementById('enable-' + this.id).value : document.getElementById('disable-' + this.id).value;

                    $.ajax({
                        url: sUrl,
                        type:  'post'
                    }).fail( function( response ) {

	                    if ( sValue === true ) {
		                    oInput.checked = false;
	                    } else {
		                    oInput.checked = true;
	                    }

                        var sMessage = response.responseJSON.message !== undefined ? response.responseJSON.message : 'Sorry, something was wrong.';
                        FrontendMediator.publish( 'notification', { type : 'ko', message: sMessage } );

                    });
                });
            });

        }
    };
});
<commit_msg>Reactivate master language if error<commit_after>FrontendCore.define('on-off-table', ['devicePackage' ], function () {
    return {
	    oMasterLanguage : '',
	    setMasterLanguage: function() {
		    this.oMasterLanguage = $('[name=language-master]:checked')[0];
	    },
        onStart: function () {

            FrontendCore.requireAndStart('notification');

	        var self = this;

	        self.setMasterLanguage();

            $('.switch input').each( function(){

                var oTarget = this;

                $(oTarget).change( function() {

                    var oInput = this,
	                    sValue = oInput.checked,
	                    sUrl = this.checked === true ? document.getElementById('enable-' + this.id).value : document.getElementById('disable-' + this.id).value;

                    $.ajax({
	                    url: sUrl,
	                    type: 'post'
                    }).done( function() {
	                    self.setMasterLanguage();
                    }).fail( function( response ) {

	                    if ( sValue === true ) {
		                    oInput.checked = false;
	                    } else {
		                    oInput.checked = true;
	                    }

	                    if ( oInput.name === 'language-master' ) {
		                    self.oMasterLanguage.checked = true;
	                    }

                        var sMessage = response.responseJSON.message !== undefined ? response.responseJSON.message : 'Sorry, something was wrong.';
                        FrontendMediator.publish( 'notification', { type : 'ko', message: sMessage } );

                    });
                });
            });

        }
    };
});

{'fraction_non_alphanumeric': 0.12386706948640483, 'fraction_numerical': 0.0003356831151393085, 'mean_word_length': 1.2507552870090635, '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': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6036989', 'n_tokens_mistral': 760, 'n_tokens_neox': 656, 'n_words': 137}