<commit_before>/**
 * A plugin to visualize alt-text for images.
 */

var $ = require("jquery");
var Plugin = require("./plugin-base");

class AltText extends Plugin {
    getTitle() {
        return "Image alt-text";
    }

    getDescription() {
        return "Displays alt-text in place of images";
    }

    run() {
        $("img").each(function() {
            $(this).fadeOut(1000, () => {
                var $altText = $("<span>")
                    .addClass("tota11y-alt-text")
                    .text($(this).prop("alt"));

                $(this).after($altText);
            });
        });
    }

    cleanup() {
        $(".tota11y-alt-text").remove();
        $("img").fadeIn(1000);
    }
}

module.exports = AltText;<commit_msg>place static text on black square<commit_after>/**
 * A plugin to visualize alt-text for images.
 */

var $ = require("jquery");
var Plugin = require("./plugin-base");
var annotate = require("./shared/annotate");

class AltText extends Plugin {
    getTitle() {
        return "Image alt-text";
    }

    getDescription() {
        return "Displays alt-text in place of images";
    }

    run() {
        $("img").each(function() {
            var $highlight = annotate.highlight($(this), "black", 1.0);
            $highlight.append(
                $("<div>")
                    .css({ color: "white" })
                    .text($(this).prop("alt")));
        });
    }

    cleanup() {
        $(".tota11y-highlight").remove();
    }
}

module.exports = AltText;
{'fraction_non_alphanumeric': 0.18026315789473685, 'fraction_numerical': 0.010526315789473684, 'mean_word_length': 1.8644067796610169, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 6, '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': '3269707', 'n_tokens_mistral': 484, 'n_tokens_neox': 445, 'n_words': 96}