<commit_before>$(document).ready(function () {
    $("#btnChangeColour").click(function () {
        // Example of chaining the output from the greenify function.
        //$("a").greenify().addClass("greenified");

        // Examples of specifying settings. Pass an anonymous object with name/value pairs
        // that match the format of what is specified in the function.
        // Pass just color
        //$("a").greenify({
        //    color: "orange"
        //});

        // Pass color and backgroundColor
        //$("a").greenify({
        //    color: "orange",
        //    backgroundColor: "black"
        //});

        // Pass neither (defaults defined in the function will be used)
        $("a").greenify();
    });

    $("#btnLocation").click(function() {
        $("a").showLinkLocation();
    });

    $("#btnPopup").click(function() {
        $.fn.showPopup("show");
    });
});

(function($) {
    $.fn.greenify = function (options) {

        // Create an anonymous object with two properties - color and backgroundColor.
        // Give the properties default values and use extend() to merge the function parameter
        // called options into it.
        var settings = $.extend({
            color: "#00FF00",
            backgroundColor: "white"
        }, options);
        
        console.log("Changed link colour to " + settings.color);
        return this.css({
            color: settings.color,
            backgroundColor: settings.backgroundColor
        });
    };
}(jQuery));

(function ($) {
    $.fn.showPopup = function (action) {
        // Check the passed variable, logging any errors. <commit_msg>Added variation on default settings.<commit_after>$(document).ready(function () {

    $("#btnChangeColour").click(function () {
        // Example of chaining the output from the greenify function.
        //$("a").greenify().addClass("greenified");

        // Examples of specifying settings. Pass an anonymous object with name/value pairs
        // that match the format of what is specified in the function.
        // Pass just color
        //$("a").greenify({
        //    color: "orange"
        //});

        // Pass color and backgroundColor
        //$("a").greenify({
        //    color: "orange",
        //    backgroundColor: "black"
        //});

        // Pass neither (defaults defined in the function will be used)
        $("a").greenify();
    });

    $("#btnLocation").click(function() {
        $("a").showLinkLocation();
    });

    $("#btnPopup").click(function() {
        $.fn.showPopup("show");
    });
});

(function($) {
    $.fn.greenify = function (options) {

        // Create an anonymous object with two properties - color and backgroundColor.
        // Give the properties default values and use extend() to merge the function parameter
        // called options into it.
        //var settings = $.extend({
        //    color: "#00FF00",
        //    backgroundColor: "white"
        //}, options);

        // From the Advanced Concepts page
        // Providing public access to default settings.
        var settings = $.extend({}, $.fn.greenify.defaults, options);
        
        console.log("Changed link colour to " + settings.color);

        return this.css({
            color: settings.color,
            backgroundColor: settings.backgroundColor
        });
    };

    // These default values can seemingly go in a few places. Here in the function, below the 
    // function or in document.ready().
    $.fn.greenify.defaults = {
        color: "red",
        backgroundColor: "yellow"
    };

}(jQuery));

// It's not clear where this setting can go. The page says it doesn't have to be in 
// document.ready() but I can't get it to be picked up regardless.
//$.fn.greenify.defaults.foreground = "blue";

(function ($) {
    $.fn.showPopup = function (action) {
        // Check the passed variable, logging any errors. 
{'fraction_non_alphanumeric': 0.1431835491241432, 'fraction_numerical': 0.002030972328002031, 'mean_word_length': 2.054263565891473, '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': '1254483', 'n_tokens_mistral': 1028, 'n_tokens_neox': 1007, 'n_words': 327}