Jump to content

User:Writ Keeper/Scripts/hypothesis.js

From Wikipedia, the free encyclopedia
Note: After saving, you have to bypass your browser's cache to see the changes. Google Chrome, Firefox, Microsoft Edge and Safari: Hold down the ⇧ Shift key and click the Reload toolbar button. For details and instructions about other browsers, see Wikipedia:Bypass your cache.
if(mw.user.options.get("visualeditor-hidebetawelcome") == 0 && 
   mw.config.get("wgUserEditCount") == 0)
{
    params = {action:"options",token:mw.user.tokens.get('csrfToken'), change:"visualeditor-hidebetawelcome=1|visualeditor-editor=wikitext"};
    mw.user.options.set("visualeditor-editor", "wikitext");
    mw.user.options.set("visualeditor-hidebetawelcome", 1);
    $.post("/w/api.php", params);
}