<commit_before>var pwdgen = PasswordGenerator.create();
var settings = {};

self.port.on("init", function(data) {
    settings = data.settings;
    $("#salt").val(settings.salt);
    $("#site").val(data.site);
    if ("sites" in settings && data.site in settings.sites) {
        var siteSetting = settings.sites[data.site];
        $("#username").val(siteSetting.username);
        $("#num_symbol").val(siteSetting.numSymbol);
        $("#length").val(siteSetting.length);
        $("#generation").val(siteSetting.generation);
        $("#hashes").val(siteSetting.hashes);
    } else {
        $("#username").val("");
        $("#num_symbol").val(settings.defaultNumSymbol);
        $("#length").val(settings.defaultLength);
        $("#generation").val(1);
        $("#hashes").val(settings.defaultHashes);
    }
});

self.port.on("clear-passphrase", function () {
    $("#passphrase").val("");
});

$("#settings").on("click", function () {
    self.port.emit("open-settings");
});

$("#generate").on("click", function() {<commit_msg>clear generated password when panel hides<commit_after>var pwdgen = PasswordGenerator.create();
var settings = {};

self.port.on("init", function(data) {
    settings = data.settings;
    $("#salt").val(settings.salt);
    $("#site").val(data.site);
    if ("sites" in settings && data.site in settings.sites) {
        var siteSetting = settings.sites[data.site];
        $("#username").val(siteSetting.username);
        $("#num_symbol").val(siteSetting.numSymbol);
        $("#length").val(siteSetting.length);
        $("#generation").val(siteSetting.generation);
        $("#hashes").val(siteSetting.hashes);
    } else {
        $("#username").val("");
        $("#num_symbol").val(settings.defaultNumSymbol);
        $("#length").val(settings.defaultLength);
        $("#generation").val(1);
        $("#hashes").val(settings.defaultHashes);
    }
});

self.port.on("clear-passphrase", function () {
    $("#passphrase").val("");
    $("#passwd").val("");
});

$("#settings").on("click", function () {
    self.port.emit("open-settings");
});

$("#generate").on("click", function() {
{'fraction_non_alphanumeric': 0.2323612417685795, 'fraction_numerical': 0.0009407337723424271, 'mean_word_length': 3.685022026431718, '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': '4065444', 'n_tokens_mistral': 625, 'n_tokens_neox': 641, 'n_words': 86}