User:Chaotic Enby/Unblock wizard.js: Difference between revisions
From Test Wiki
Content deleted Content added
Chaotic Enby (talk | contribs) consistency |
Chaotic Enby (talk | contribs) by aasim |
||
| Line 69: | Line 69: | ||
"status-redirecting": "Submission succeeded. Redirecting you to your talk page ...", |
"status-redirecting": "Submission succeeded. Redirecting you to your talk page ...", |
||
"status-redirecting-utrs": "Redirecting you to UTRS ...", |
"status-redirecting-utrs": "Redirecting you to UTRS ...", |
||
"status-not-blocked": "You are not currently blocked.", |
"status-not-blocked": "You are not currently blocked. Click \"Confirm\" to activate demo mode, which will allow you to check out the workflow without posting a block request.", |
||
"status-error": "Due to an error, your unblock request could not be parsed. You can try to submit an unblock request manually by pasting the following on [[Special:MyTalk|your talk page]]:<br /><code>{{unblock | reason=Your reason here ~~" + "~~}}</code><br />If you are having difficulties, please [https://utrs-beta.wmflabs.org/ make a request through UTRS] and inform them of the issues you are encountering.", |
"status-error": "Due to an error, your unblock request could not be parsed. You can try to submit an unblock request manually by pasting the following on [[Special:MyTalk|your talk page]]:<br /><code>{{unblock | reason=Your reason here ~~" + "~~}}</code><br />If you are having difficulties, please [https://utrs-beta.wmflabs.org/ make a request through UTRS] and inform them of the issues you are encountering.", |
||
"captcha-label": "Please enter the letters appearing in the box below", |
"captcha-label": "Please enter the letters appearing in the box below", |
||
| Line 130: | Line 130: | ||
} |
} |
||
console.log(blockType) |
console.log(blockType) |
||
| ⚫ | |||
blockType = blockType[blockType.length - 1]; |
blockType = blockType[blockType.length - 1]; |
||
| ⚫ | |||
| ⚫ | |||
} |
|||
| ⚫ | |||
switch (blockType) { |
switch (blockType) { |
||
case "Sockpuppet": |
case "Sockpuppet": |
||
| Line 360: | Line 363: | ||
mainPosition = ui.fieldset.items.length; |
mainPosition = ui.fieldset.items.length; |
||
ui.fieldset.addItems([ |
ui.fieldset.addItems([ |
||
ui.mainStatusLayout = new OO.ui. |
ui.mainStatusLayout = new OO.ui.FieldsetLayout( { |
||
| ⚫ | |||
label: $('<tr>').append('<td style="vertical-align:top; padding-right: 5px;">' + imglink(infoLevels[type]) + '</td><td style="vertical-align:middle;">' + linkify(message)+ '</td>') |
|||
icon: type, |
|||
label: $("<span/>").append(linkify(message)) |
|||
| ⚫ | |||
}) |
}) |
||
]); |
]); |
||
} else { |
} else { |
||
ui.mainStatusLayout.setIcon(type); |
|||
ui.mainStatusArea.setLabel($('<tr>').append('<td style="vertical-align:top; padding-right: 5px;">' + imglink(infoLevels[type]) + '</td><td style="vertical-align:middle;">' + linkify(message)+ '</td>')); |
|||
ui.mainStatusLayout.setLabel($('<span/>').append(linkify(message))); |
|||
} |
} |
||
} |
} |
||
| Line 373: | Line 377: | ||
function handleSubmit() { |
function handleSubmit() { |
||
setMainStatus(' |
setMainStatus('ellipsis', msg('status-processing')); |
||
mw.track('counter.gadget_afcsw.submit_attempted'); |
mw.track('counter.gadget_afcsw.submit_attempted'); |
||
ui.submitButton.setDisabled(true); |
ui.submitButton.setDisabled(true); |
||
| Line 385: | Line 389: | ||
location.href = "https://utrs-beta.wmflabs.org/public/appeal/account"; |
location.href = "https://utrs-beta.wmflabs.org/public/appeal/account"; |
||
}, config.redirectionDelay); |
}, config.redirectionDelay); |
||
| ⚫ | |||
| ⚫ | |||
} else { |
} else { |
||
for(var [i, label] of questionLabels.entries()){ |
for(var [i, label] of questionLabels.entries()){ |
||
| Line 394: | Line 396: | ||
} |
} |
||
if (emptyFields && !emptyFieldsWarned) { |
if (emptyFields && !emptyFieldsWarned) { |
||
setMainStatus(' |
setMainStatus('alert', msg('status-blank')); |
||
emptyFieldsWarned = true; |
emptyFieldsWarned = true; |
||
ui.submitButton.setDisabled(false); |
ui.submitButton.setDisabled(false); |
||
| Line 424: | Line 426: | ||
var text = prepareUserTalkText(); |
var text = prepareUserTalkText(); |
||
setMainStatus(' |
setMainStatus('ellipsis', msg('status-saving')); |
||
if (demoMode) { |
if (demoMode) { |
||
setMainStatus('success', '<code style="display: block">' + text + '</code>'); |
setMainStatus('success', '<code style="display: block">' + text + '</code>'); |
||