User:Chaotic Enby/Unblock wizard.js: Difference between revisions
From Test Wiki
Content deleted Content added
Chaotic Enby (talk | contribs) figuring out what happened |
Chaotic Enby (talk | contribs) more tests |
||
| Line 15: | Line 15: | ||
/* globals mw, $, OO */ |
/* globals mw, $, OO */ |
||
/* <nowiki> */ |
/* <nowiki> */ |
||
| ⚫ | |||
(async function () { |
(async function () { |
||
| ⚫ | |||
var wizard = {}, ui = {}, block = {}; |
var wizard = {}, ui = {}, block = {}; |
||
| Line 33: | Line 29: | ||
var demoMode = !!mw.util.getParamValue("demoMode"); |
var demoMode = !!mw.util.getParamValue("demoMode"); |
||
var usernameBlock = mw.util.getParamValue("usernameBlock"); |
var usernameBlock = mw.util.getParamValue("usernameBlock"); |
||
| ⚫ | |||
await new mw.Api().loadMessagesIfMissing(['wikimedia-copyrightwarning', 'copyrightwarning']); |
await new mw.Api().loadMessagesIfMissing(['wikimedia-copyrightwarning', 'copyrightwarning']); |
||
console.log("c"); |
|||
// TODO: move to a separate JSON subpage, would be feasible once [[phab:T198758]] is resolved |
// TODO: move to a separate JSON subpage, would be feasible once [[phab:T198758]] is resolved |
||
var messages = { |
var messages = { |
||
| Line 112: | Line 105: | ||
function init() { |
function init() { |
||
| ⚫ | |||
for (var key in messages) { |
for (var key in messages) { |
||
mw.messages.set('ubw-' + key, messages[key]); |
mw.messages.set('ubw-' + key, messages[key]); |
||
| Line 141: | Line 135: | ||
"uiprop": "blockinfo" |
"uiprop": "blockinfo" |
||
}).then( setBlockData ).then( async function ( block ) { |
}).then( setBlockData ).then( async function ( block ) { |
||
| ⚫ | |||
blockType = mw.config.get('wgPageName').split('/'); |
blockType = mw.config.get('wgPageName').split('/'); |
||
if (blockType.includes("Demo")) { |
if (blockType.includes("Demo")) { |
||
| Line 190: | Line 185: | ||
'#catlinks { display: none } ' |
'#catlinks { display: none } ' |
||
); |
); |
||
| ⚫ | |||
constructUI(); |
constructUI(); |
||
}); |
}); |
||