User:Chaotic Enby/Unblock wizard.js: Difference between revisions

From Test Wiki
Content deleted Content added
figuring out what happened
more tests
Line 15: Line 15:
/* globals mw, $, OO */
/* globals mw, $, OO */
/* <nowiki> */
/* <nowiki> */

console.log("a");


(async function () {
(async function () {

console.log("a");


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");

console.log("b");


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() {
console.log("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 ) {
console.log("init?");
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 } '
);
);
console.log("???");
constructUI();
constructUI();
});
});