<commit_before>$(function () {
    //adding selected class on click
    $(".popper_prime").click(function () {
        if ($(this).hasClass('selected')) {
            $(this).removeClass('selected');
        } else {
            $(this).addClass('selected');
        }
    });

    //initiating the chars
    var bird = false;
    var sinkeil = false;
    var Switched = 0;
    var Slct = "";
    var Url = ["url(svg/pointer_hover.svg)", "url(svg/birdskull.svg)", "url(svg/sinkeil.svg)"];

    //setting the switch depending on the selected char
    function Switch() {
        if (bird == true) {
            Switched = 1;
        } else {
            if (sinkeil == true) {
                Switched = 2;
            } else {
                Switched = 0;
            }
        }
    }

    //adding class representing selected char on click
    function CharOnClick(elem) {
        console.log(Switched);
        if ($(elem).hasClass('selected')) {
            if (Switched == 1) {
                $(elem).addClass('bird');
                $(elem).removeClass('sinkeil');
                $(elem).removeClass('pointer');

            } else {
                if (Switched == 2) {
                    $(elem).addClass('sinkeil');
                    $(elem).removeClass('bird');
                    $(elem).removeClass('pointer');

                } else {
                    $(elem).addClass('pointer');
                }
            }
        } else {
            if (Switched == 1) {
                $(elem).removeClass('bird');
            } else {
                if (Switched == 2) {
                    $(elem).removeClass('sinkeil');
                } else {
                    $(elem).removeClass('pointer');
                }
            }
        }
    }




    //defining wich character is selected
    function charslct() {
        if (Switched == 1) {
            Slct = "url(svg/birdskull.svg)"
        } else {
            if (Switched == 2) {
                Slct = "url(svg/sinkeil.svg)"
            } else {
                Slct = "url(svg/pointer_hover.svg)"
            }
        }
    };


    //activating the bird
    $('#birdskull').click(function () {
        sinkeil = false;
        bird = true;
        Switch();
    });

    //activating the keil
    $('#sinkeil').click(function () {
        bird = false;
        sinkeil = true;
        Switch();
    });


    //show the selected char on hover
    $('.popper_prime').mouseenter(function () {
        charslct();
        if ($(this).hasClass('selected')) {
            if ($(this).hasClass('bird')) {
                $('.support', this).attr({
                    style: "content:" + Url[1] + ";transform:rotateX(-50deg) rotateY(40deg) rotateZ(-30deg) translateY(-60%) translateX(0%) translateZ(45px);"
                });
            } else {
                if ($(this).hasClass('sinkeil')) {
                    $('.support', this).attr({
                        style: "content:" + Url[2] + ";transform:rotateX(-50deg) rotateY(40deg) rotateZ(-30deg) translateY(-60%) translateX(0%) translateZ(45px);"
                    });
                } else {
                    $('.support', this).attr({
                        style: "content:" + Url[0] + ";transform:rotateX(-50deg) rotateY(40deg) rotateZ(-30deg) translateY(-60%) translateX(0%) translateZ(45px);"
                    });
                }
            }
        } else {
            $('.support', this).attr({
                style: "content:" + Slct + ";transform:rotateX(-50deg) rotateY(40deg) rotateZ(-30deg) translateY(-60%) translateX(0%) translateZ(45px);"
            });
        }

    });
    //manage the tile's state on mouse out
    $('.popper_prime').mouseleave(function () {
        if ($(this).hasClass('selected')) {
            if ($(this).hasClass('bird')) {
                $('.support', this).attr({
                    style: "content:" + Url[1] + ";transform:rotateX(-50deg) rotateY(40deg) rotateZ(-30deg) translateY(-30%) translateX(0%) translateZ(0px);"
                });
            } else {
                if ($(this).hasClass('sinkeil')) {
                    $('.support', this).attr({
                        style: "content:" + Url[2] + ";transform:rotateX(-50deg) rotateY(40deg) rotateZ(-30deg) translateY(-30%) translateX(0%) translateZ(0px);"
                    });
                } else {
                    $('.support', this).attr({
                        style: "content:" + Url[0] + ";transform:rotateX(-50deg) rotateY(40deg) rotateZ(-30deg) translateY(-30%) translateX(0%) translateZ(0px);"
                    });
                }
            }

        } else {
            $('.support', this).attr({
                style: "content:'';transform:rotateX(-50deg) rotateY(40deg) rotateZ(-30deg) translateY(-30%) translateX(0%) translateZ(0px);"
            });
        }

    });

    //Set the character selected on the clicked tile
    $('.popper_prime').click(function () {
        CharOnClick(this);
        charslct();
        $('.support', this).attr({
            style: "content:" + Slct + ";transform:rotateX(-50deg) rotateY(40deg) rotateZ(-30deg) translateY(-60%) translateX(0%) translateZ(0px);"
        })
    });
    charslct();
});<commit_msg>cleaning code, need tile not change on click while occupied<commit_after>$(function () {


    //initiating the chars
    var bird = false;
    var sinkeil = false;
    var Switched = 0;
    var Slct = "";
    var Url = ["url(svg/pointer_hover.svg)", "url(svg/birdskull.svg)", "url(svg/sinkeil.svg)"];

    var Sync = false;

    //checking if the selected element is the same as the hovered tile's content
    function synCheck(elem) {
        console.log("sinkeil " + sinkeil);
        console.log("bird " + bird);
        if (($(elem).hasClass('bird') && bird == true) || ($(elem).hasClass('sinkeil') && sinkeil == true)) {
            Sync = true;
        } else {
            Sync = false;
        }
    }


    //setting the switch depending on the selected char
    function Switch() {
        if (bird == true) {
            Switched = 1;
        } else {
            if (sinkeil == true) {
                Switched = 2;
            } else {
                Switched = 0;
            }
        }
    }


    //adding class representing selected char on click
    function CharOnClick(elem) {
        console.log(Switched);
        if ($(elem).hasClass('selected') && Sync == true) {
            if (Switched == 1) {
                $(elem).addClass('bird');
                $(elem).removeClass('sinkeil');
                $(elem).removeClass('pointer');

            } else {
                if (Switched == 2) {
                    $(elem).addClass('sinkeil');
                    $(elem).removeClass('bird');
                    $(elem).removeClass('pointer');

                } else {
                    $(elem).addClass('pointer');
                }
            }
        } else {
                if (Switched == 1) {
                    $(elem).removeClass('bird');
                } else {
                    if (Switched == 2) {
                        $(elem).removeClass('sinkeil');
                    } else {
                        $(elem).removeClass('pointer');
                    }
                }
            }
        }




    //defining wich character is selected
    function charslct() {
        if (Switched == 1) {
            Slct = "url(svg/birdskull.svg)"
        } else {
            if (Switched == 2) {
                Slct = "url(svg/sinkeil.svg)"
            } else {
                Slct = "url(svg/pointer_hover.svg)"
            }
        }
    };


    //activating the bird
    $('#birdskull').click(function () {
        sinkeil = false;
        bird = true;
        Switch();
    });

    //activating the keil
    $('#sinkeil').click(function () {
        bird = false;
        sinkeil = true;
        Switch();
    });


    //adding selected class on click
    $(".popper_prime").click(function () {
        if ($(this).hasClass('selected')) {
            charslct();
            if (Sync == false) {
                return;
            } else {
                $(this).removeClass('selected');
            }
        } else {
            $(this).addClass('selected');
        }
    });


    //Set the character selected on the clicked tile
    $('.popper_prime').click(function () {
        synCheck($(this));
        CharOnClick(this);
        charslct();
        if (Sync == false) {
            return;
        } else {
            $('.support', this).attr({
                style: "content:" + Slct + ";transform:rotateX(-50deg) rotateY(40deg) rotateZ(-30deg) translateY(-60%) translateX(0%) translateZ(0px);"
            })
        }
        console.log(Sync);


    });

    //show the selected char on hover
    $('.popper_prime').mouseenter(function () {
        charslct();
        if ($(this).hasClass('selected')) {
            if ($(this).hasClass('bird')) {
                $('.support', this).attr({
                    style: "content:" + Url[1] + ";transform:rotateX(-50deg) rotateY(40deg) rotateZ(-30deg) translateY(-60%) translateX(0%) translateZ(45px);"
                });
            } else {
                if ($(this).hasClass('sinkeil')) {
                    $('.support', this).attr({
                        style: "content:" + Url[2] + ";transform:rotateX(-50deg) rotateY(40deg) rotateZ(-30deg) translateY(-60%) translateX(0%) translateZ(45px);"
                    });
                } else {
                    $('.support', this).attr({
                        style: "content:" + Url[0] + ";transform:rotateX(-50deg) rotateY(40deg) rotateZ(-30deg) translateY(-60%) translateX(0%) translateZ(45px);"
                    });
                }
            }
        } else {
            $('.support', this).attr({
                style: "content:" + Slct + ";transform:rotateX(-50deg) rotateY(40deg) rotateZ(-30deg) translateY(-60%) translateX(0%) translateZ(45px);"
            });
        }

    });
    //manage the tile's state on mouse out
    $('.popper_prime').mouseleave(function () {
        if ($(this).hasClass('selected')) {
            if ($(this).hasClass('bird')) {
                $('.support', this).attr({
                    style: "content:" + Url[1] + ";transform:rotateX(-50deg) rotateY(40deg) rotateZ(-30deg) translateY(-30%) translateX(0%) translateZ(0px);"
                });
            } else {
                if ($(this).hasClass('sinkeil')) {
                    $('.support', this).attr({
                        style: "content:" + Url[2] + ";transform:rotateX(-50deg) rotateY(40deg) rotateZ(-30deg) translateY(-30%) translateX(0%) translateZ(0px);"
                    });
                } else {
                    $('.support', this).attr({
                        style: "content:" + Url[0] + ";transform:rotateX(-50deg) rotateY(40deg) rotateZ(-30deg) translateY(-30%) translateX(0%) translateZ(0px);"
                    });
                }
            }

        } else {
            $('.support', this).attr({
                style: "content:'';transform:rotateX(-50deg) rotateY(40deg) rotateZ(-30deg) translateY(-30%) translateX(0%) translateZ(0px);"
            });
        }

    });


    charslct();
});
{'fraction_non_alphanumeric': 0.1649256373937677, 'fraction_numerical': 0.019475920679886686, 'mean_word_length': 1.5054335772898648, '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': '856970', 'n_tokens_mistral': 3410, 'n_tokens_neox': 3110, 'n_words': 610}