Huggle/JS/unscore.js

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

function rescore(edit)
{
    var property_bag = huggle_edit.get_edit_meta_data(edit);
    var preserved_score = 0;
    // Preserve the ORES score
    if ("ORES Score" in property_bag)
        preserved_score += parseFloat(property_bag["ORES Score"]);
    var result = (edit["Score"] * -1) + preserved_score;
    return result;
}

function ext_init()
{
    huggle.register_hook("edit_rescore", "rescore");
    return true;
}

function ext_get_info()
{
    var info = {};
    info["name"] = "unscore";
    info["version"] = "1.0.1";
    info["description"] = "disables internal scoring mechanism which can be useful for testing of external scoring mechanisms";
    info["author"] = "Petr Bena";
    info["min_huggle_version"] = "3.4.5";
    info["requires_unsafe"] = false;
    return info;
}