<commit_before>$(document).ready(function () {
    $(".before .unselected").click(function () {
        cssmod($(this));
        beforeLevel = (parseInt(this.textContent));
        if (afterLevel != 0) {
            calculateValor();
        };
    });
    $(".after .unselected").click(function () {
        cssmod($(this));
        afterLevel = (parseInt(this.textContent));
        if (beforeLevel != 0) {
            calculateValor();
        };
    });
    $(".atype .unselected").click(function () {
        cssmod($(this));
        armortype = (this.textContent.trim());
        if (beforeLevel != 0) {
            calculateValor();
        };
    });
});

// Defaults
var beforeLevel = 0;
var afterLevel = 0;
var armortype = "Shield / Offhand / Ring / Cloak / Bracer / Neck"
var atype = new Map();

atype.set("Shield / Offhand / Ring / Cloak / Bracer / Neck", 250);
atype.set("Trinket / Belt / Shoulder / Gloves / Boots", 400);
atype.set("Helm / Legs / Chest", 475);
atype.set("1h Agi/Str Weapon", 500);
atype.set("1h Int Weapon", 750);
atype.set("2h Weapon", 1000);

var levelsPossible = [184, 187, 190, 194, 197, 200, 203, 207, 210, 213, 216, 220];

function cssmod(element) {
    element.parent().children().removeClass('selected');
    element.addClass('selected');
};

function calculateValor() {
    stages = levelsPossible.indexOf(afterLevel) - levelsPossible.indexOf(beforeLevel)
    if (stages > 0) {
        final = stages * atype.get(armortype);
        $(".result").text("You need : " + final + " Valor");
    } else {
        $(".result").text("You can't downgrade dipshit");
    };
};<commit_msg>js fix<commit_after>$(document).ready(function () {
    $(".before .unselected").click(function () {
        cssmod($(this));
        beforeLevel = (parseInt(this.textContent));
        if (afterLevel != 0) {
            calculateValor();
        };
    });
    $(".after .unselected").click(function () {
        cssmod($(this));
        afterLevel = (parseInt(this.textContent));
        if (beforeLevel != 0) {
            calculateValor();
        };
    });
    $(".atype .unselected").click(function () {
        cssmod($(this));
        armortype = (this.textContent.trim());
        if (beforeLevel != 0) {
            calculateValor();
        };
    });
});

// Defaults
var beforeLevel = 0;
var afterLevel = 0;
var armortype = "Shield / Offhand / Ring / Cloak / Bracer / Neck"
var atype = new Map();

atype.set("Shield / Offhand / Ring / Cloak / Bracer / Neck", 250);
atype.set("Trinket / Belt / Shoulder / Gloves / Boots", 400);
atype.set("Helm / Legs / Chest", 475);
atype.set("1h Agi/Str Weapon", 500);
atype.set("1h Int Weapon", 750);
atype.set("2h Weapon", 1000);

var levelsPossible = [
210,
213,
216,
220,
223,
226,
229,
233,
236,
239,
242,
246
];

function cssmod(element) {
    element.parent().children().removeClass('selected');
    element.addClass('selected');
};

function calculateValor() {
    stages = levelsPossible.indexOf(afterLevel) - levelsPossible.indexOf(beforeLevel)
    if (stages > 0) {
        final = stages * atype.get(armortype);
        $(".result").text("You need : " + final + " Valor");
    } else {
        $(".result").text("You can't downgrade dipshit");
    };
};
{'fraction_non_alphanumeric': 0.18322500773754255, 'fraction_numerical': 0.03961621788919839, 'mean_word_length': 2.689497716894977, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2425308', 'n_tokens_mistral': 1156, 'n_tokens_neox': 1048, 'n_words': 227}