<commit_before>//META{"name":"emoteBlacklist"}*//

var emoteBlacklist = function () {};

emoteBlacklist.prototype.onMessage = function () {
};
emoteBlacklist.prototype.onSwitch = function () {
};
emoteBlacklist.prototype.start = function () {
    window.ebEnabled = true;
    var self = this;
    var em = bdPluginStorage.get("emoteBlacklist", "blacklist");
    if(em == undefined) return;
    JSON.parse(em).forEach(function(emote) {
        self.remove(emote);
        self.add(emote);
    });
};
emoteBlacklist.prototype.add = function(emote) {
    window.bemotes.push(emote);
};
emoteBlacklist.prototype.remove = function(emote) {
    var index = bemotes.indexOf(emote);
    if(index > -1) {
        window.bemotes.splice(index, 1);
    }
}

emoteBlacklist.prototype.load = function () {};
emoteBlacklist.prototype.unload = function () {
};
emoteBlacklist.prototype.stop = function () {
    window.ebEnabled = false;
    this.clear();
};
emoteBlacklist.prototype.clear = function() {
    var self = this;
    var em = bdPluginStorage.get("emoteBlacklist", "blacklist");
    if(em == undefined) return;
    var em = JSON.parse(em);
    em.forEach(function(emote) {
        self.remove(emote);
    });
};
emoteBlacklist.prototype.getSettingsPanel = function () {
    var em = bdPluginStorage.get("emoteBlacklist", "blacklist");

    var html = '';
    html += '<h2>Emote Blacklist</2>';
    html += '<textarea id="emoteBlistTa" style="width:100%; min-height:200px;">';
    if(em != undefined) {
        JSON.parse(em).forEach(function(item) { 
            html += item + "\n";
        });
    }
    html += '</textarea>';
    html += '<button onclick="emoteBlacklist.prototype.save()">Save</button>';
    html += '<span>Add emote names here to blacklist(1 per line)</span>';
    return html;
};
emoteBlacklist.prototype.save = function() {
    this.clear();
    var blist = [];
    $("#emoteBlistTa").val().split("\n").forEach(function(item) { 
        blist.push(item);
    });
    bdPluginStorage.set("emoteBlacklist", "blacklist", blist);
    if(window.ebEnabled) {
        this.start();
    }
};

emoteBlacklist.prototype.getName = function () {
    return "Emote Blacklist";
};
emoteBlacklist.prototype.getDescription = function () {
    return "Blacklist emotes locally";
};
emoteBlacklist.prototype.getVersion = function () {
    return "0.1.0";<commit_msg>Updated to comply with the new storage spec<commit_after>//META{"name":"emoteBlacklist"}*//

var emoteBlacklist = function () {};

emoteBlacklist.prototype.onMessage = function () {
};
emoteBlacklist.prototype.onSwitch = function () {
};
emoteBlacklist.prototype.start = function () {
    window.ebEnabled = true;
    var self = this;
    var em = bdPluginStorage.get("emoteBlacklist", "blacklist");

    if(em === null) return;
    em.forEach(function(emote) {
        self.remove(emote);
        self.add(emote);
    });
};
emoteBlacklist.prototype.add = function(emote) {
    window.bemotes.push(emote);
};
emoteBlacklist.prototype.remove = function(emote) {
    var index = bemotes.indexOf(emote);
    if(index > -1) {
        window.bemotes.splice(index, 1);
    }
}

emoteBlacklist.prototype.load = function () {};
emoteBlacklist.prototype.unload = function () {
};
emoteBlacklist.prototype.stop = function () {
    window.ebEnabled = false;
    this.clear();
};
emoteBlacklist.prototype.clear = function() {
    var self = this;
    var em = bdPluginStorage.get("emoteBlacklist", "blacklist");
    if(em === null) return;
    em.forEach(function(emote) {
        self.remove(emote);
    });
};
emoteBlacklist.prototype.getSettingsPanel = function () {
    var em = bdPluginStorage.get("emoteBlacklist", "blacklist");

    var html = '';
    html += '<h2>Emote Blacklist</2>';
    html += '<textarea id="emoteBlistTa" style="width:100%; min-height:200px;">';
    if(em !== null) {
        em.forEach(function(item) { 
            html += item + "\n";
        });
    }
    html += '</textarea>';
    html += '<button onclick="emoteBlacklist.prototype.save()">Save</button>';
    html += '<span>Add emote names here to blacklist(1 per line)</span>';
    return html;
};
emoteBlacklist.prototype.save = function() {
    this.clear();
    var blist = [];
    $("#emoteBlistTa").val().split("\n").forEach(function(item) { 
        blist.push(item);
    });
    bdPluginStorage.set("emoteBlacklist", "blacklist", blist);
    if(window.ebEnabled) {
        this.start();
    }
};

emoteBlacklist.prototype.getName = function () {
    return "Emote Blacklist";
};
emoteBlacklist.prototype.getDescription = function () {
    return "Blacklist emotes locally";
};
emoteBlacklist.prototype.getVersion = function () {
    return "0.1.0";
{'fraction_non_alphanumeric': 0.16943380161770966, 'fraction_numerical': 0.005959982971477224, 'mean_word_length': 3.4837786259541983, 'pattern_counts': {'":': 2, '<': 19, '<?xml version=': 0, '>': 21, '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': '6623545', 'n_tokens_mistral': 1538, 'n_tokens_neox': 1506, 'n_words': 259}