<commit_before>// ==UserScript==
// @name executeSkin
// @namespace skin
// @run-at document-start
// @include http://klavogonki.ru/*
// @require klavotools/foreground/userstyle-default.js
// ==/UserScript==
kango.invokeAsync('KlavoTools.Skin.getActive', true, function(answer) {console.log(answer);
    var skin_cache = kango.storage.getItem('skin-cache');
    var skin_pref = kango.storage.getItem('skin-pref');
    if(answer.skin == skin_pref)
        return applySkin(skin_cache);
    
    kango.xhr.send({
        method: 'GET',
        url: 'res/skins/'+answer.skin+'.css',
        async: true,
        contentType: 'text'
    }, function(res) {
        res = res.response.replace(/%FOLDER_([a-zA-Z0-9]+?)%/gm, answer.io);
        var css = res + json2css(default_style) + css_txt;
        kango.storage.setItem('skin-cache', css);
        kango.storage.setItem('skin-pref', answer.skin);
        applySkin(css);
    });
    
    function applySkin(css) {
        var s = document.createElement('style');
        s.innerHTML = css;        
        document.head.appendChild(s);
    }
});<commit_msg>(f) Fixed an issue with the default skin<commit_after>// ==UserScript==
// @name executeSkin
// @namespace skin
// @run-at document-start
// @include http://klavogonki.ru/*
// @require klavotools/foreground/userstyle-default.js
// ==/UserScript==
kango.invokeAsync('KlavoTools.Skin.getActive', true, function(answer) {console.log(answer);
    var skin_cache = kango.storage.getItem('skin-cache');
    var skin_pref = kango.storage.getItem('skin-pref');
    if(answer.skin == skin_pref)
        return applySkin(skin_cache);

    kango.xhr.send({
        method: 'GET',
        url: 'res/skins/'+answer.skin+'.css',
        async: true,
        contentType: 'text'
    }, function(res) {
        if (res.response === null) {
            res.response = '';
        }
        res = res.response.replace(/%FOLDER_([a-zA-Z0-9]+?)%/gm, answer.io);
        var css = res + json2css(default_style) + css_txt;
        kango.storage.setItem('skin-cache', css);
        kango.storage.setItem('skin-pref', answer.skin);
        applySkin(css);
    });

    function applySkin(css) {
        var s = document.createElement('style');
        s.innerHTML = css;
        document.head.appendChild(s);
    }
});

{'fraction_non_alphanumeric': 0.17, 'fraction_numerical': 0.0026086956521739132, 'mean_word_length': 2.7233009708737863, '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': '3726902', 'n_tokens_mistral': 769, 'n_tokens_neox': 761, 'n_words': 127}