Huggle/JS/deletion log.js

From MediaWiki.org
< Huggle‎ | JS
Jump to navigation Jump to search
// NOTICE: this extension works only if log page already exists - it will append there but will not create it

// Configuration
var log_page = "/log-speedy";

function ext_is_working()
{
    return true;
}

function speedy_finish(edit, tags, success)
{
    if (!success)
        return;
    var log = "User:" + huggle.get_username() + log_page;
    huggle.debug_log("Logging speedy deletion of " + edit["Page"]["PageName"], 2);
    huggle_editing.append_text(log, "* Speedy of [[" + edit["Page"]["PageName"] + "]] tags: <nowiki>" + tags + "</nowiki> ~~~~", "Logging speedy deletion");
}

function ext_init()
{
    huggle.register_hook("speedy_finished", "speedy_finish");
    return true;
}

function ext_get_info()
{
    var info = {};
    info["name"] = "deletion log";
    info["version"] = "1.0.0";
    info["description"] = "Writes all speedy requests to your personal log";
    info["author"] = "Petr Bena";
    info["min_huggle_version"] = "3.4.0";
    info["required_context"] = "huggle_ui";
    info["requires_unsafe"] = false;
    return info;
}