MediaWiki:Common.js/User:Fumple/PatrolTool.js

new mw.Api.get({   "action": "query",    "format": "json",    "meta": "userinfo",    "uiprop": "rights" }).done((data) => {    console.log(data);    if (data.query.userinfo.rights.includes("patrolmarks") && data.query.userinfo.rights.includes("patrol")) {        console.log("You can use")    }    else if (data.query.userinfo.id != 0) {        $("#funpl-patroltool").css("display", "none");        $("#funpl-patroltool-error").css("display", "");        $("#funpl-patroltool-error-text").html("You can't use this tool as you don't have the correct rights");    }    else {        $("#funpl-patroltool").css("display", "none");        $("#funpl-patroltool-error").css("display", "");        $("#funpl-patroltool-error-text").html("You can't use this tool as you don't have the correct rights You're also logged out, maybe you want to log in"); } })