Huggle/JS/invisible changes.js

From MediaWiki.org
< Huggle‎ | JS
Jump to navigation Jump to search
function ext_is_working()
{
    return true;
}

function ext_init()
{
    huggle.register_hook("render_edit", "check");
    return true;
}

function check()
{
    var edit = huggle_ui.get_current_wiki_edit();
    if (edit === null)
        return;
    var new_text = edit["DiffText_New"];
    var old_text = edit["DiffText_Old"];
    if (new_text.includes("ln ") && old_text.includes("In "))
    {
        huggle_ui.show_tooltip_message("<b><big>Possible replacement of In (IN) with ln (LN)</big></b>");
    }
}

function ext_get_info()
{
    var info = {};
    info["name"] = "Invisible changes";
    info["version"] = "1.0.0";
    info["description"] = "Looks for changes that are hard to spot";
    info["author"] = "Petr Bena";
    // info["min_huggle_version"] = "3.4.0";
    // info["required_context"] = "huggle_ui";
    // info["requires_unsafe"] = false;
    return info;
}