<commit_before>//On page load it checks/unchecks the checkbox
document.addEventListener("DOMContentLoaded", function() {
    var intShowHighlight = localStorage.getItem("ext-etheraddresslookup-show_style");
    if(intShowHighlight == 1) {
        document.getElementById("ext-etheraddresslookup-show_style").checked = true;
        //Notify the tab to do a class method
        chrome.tabs.query({active: true, currentWindow: true}, function(tabs) {
            //Construct & send message
            chrome.tabs.sendMessage(tabs[0].id, {
                "func":"addHighlightStyle"
            }, function(response) {
                console.log(response);
            });
        });
    } else {
        document.getElementById("ext-etheraddresslookup-show_style").checked = false;
        //Notify the tab to do a class method
        chrome.tabs.query({active: true, currentWindow: true}, function(tabs) {
            //Construct & send message
            chrome.tabs.sendMessage(tabs[0].id, {
                "func":"removeHighlightStyle"
            }, function(response) {
                console.log(response);
            });
        });
    }
});

//Sets the local storage to remember their match highlight settings
function toggleMatchHighlight() {
    var objShowHighlight = document.getElementById("ext-etheraddresslookup-show_style");
    var intShowHighlight = objShowHighlight.checked ? 1 : 0;
    localStorage.setItem("ext-etheraddresslookup-show_style", intShowHighlight);

    //Notify the tab to do a class method
    if(intShowHighlight == 1) {
        chrome.tabs.query({active: true, currentWindow: true}, function(tabs) {
            //Construct & send message
            chrome.tabs.sendMessage(tabs[0].id, {
                "func":"addHighlightStyle"
            }, function(response) {<commit_msg>Cleaned code up a little to remove duplication<commit_after>//On page load it checks/unchecks the checkbox
(function() {
    var intShowHighlight = localStorage.getItem("ext-etheraddresslookup-show_style");
    document.getElementById("ext-etheraddresslookup-show_style").checked = (intShowHighlight == 1 ? true : false);
    //Notify the tab to do a class method
    var strMethod = (intShowHighlight == 1 ? "addHighlightStyle" : "removeHighlightStyle");
    chrome.tabs.query({active: true, currentWindow: true}, function(tabs) {
        //Construct & send message
        chrome.tabs.sendMessage(tabs[0].id, {
            "func":strMethod
        }, function(response) {
            console.log(response);
        });
    });
})();

//Sets the local storage to remember their match highlight settings
function toggleMatchHighlight() {
    var objShowHighlight = document.getElementById("ext-etheraddresslookup-show_style");
    var intShowHighlight = objShowHighlight.checked ? 1 : 0;
    localStorage.setItem("ext-etheraddresslookup-show_style", intShowHighlight);

    //Notify the tab to do a class method
    if(intShowHighlight == 1) {
        chrome.tabs.query({active: true, currentWindow: true}, function(tabs) {
            //Construct & send message
            chrome.tabs.sendMessage(tabs[0].id, {
                "func":"addHighlightStyle"
            }, function(response) {
{'fraction_non_alphanumeric': 0.11656823127137084, 'fraction_numerical': 0.004351880634131178, 'mean_word_length': 2.8585131894484412, 'pattern_counts': {'":': 5, '<': 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': '6784194', 'n_tokens_mistral': 867, 'n_tokens_neox': 813, 'n_words': 194}