User:Chaotic Enby/Unblock wizard.js: Difference between revisions
From Test Wiki
Content deleted Content added
Chaotic Enby (talk | contribs) yay |
Chaotic Enby (talk | contribs) info levels |
||
| Line 75: | Line 75: | ||
"error-main": "An error occurred ($1). Please try again or ask for help on your talk page.", |
"error-main": "An error occurred ($1). Please try again or ask for help on your talk page.", |
||
"copyright-notice": "<small>By publishing changes, you agree to the [[:foundation:Special:MyLanguage/Policy:Terms of Use|Terms of Use]], and you irrevocably agree to release your contribution under the [[Wikipedia:Text of the Creative Commons Attribution-ShareAlike 4.0 International License|CC BY-SA 4.0 License]] and the [[Wikipedia:Text of the GNU Free Documentation License|GFDL]]. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.</small>" |
"copyright-notice": "<small>By publishing changes, you agree to the [[:foundation:Special:MyLanguage/Policy:Terms of Use|Terms of Use]], and you irrevocably agree to release your contribution under the [[Wikipedia:Text of the Creative Commons Attribution-ShareAlike 4.0 International License|CC BY-SA 4.0 License]] and the [[Wikipedia:Text of the GNU Free Documentation License|GFDL]]. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.</small>" |
||
}; |
|||
var infoLevels = { |
|||
"process": "Eo circle blue caret-double-right.svg", |
|||
"notice": "Eo circle amber info.svg", |
|||
"success": "Eo circle green checkmark.svg", |
|||
"warning": "Eo circle amber info.svg", |
|||
"error": "Eo circle blue no-entry.svg" |
|||
}; |
}; |
||
| Line 350: | Line 358: | ||
ui.fieldset.addItems([ |
ui.fieldset.addItems([ |
||
ui.mainStatusLayout = new OO.ui.FieldLayout(ui.mainStatusArea = new OO.ui.LabelWidget({ |
ui.mainStatusLayout = new OO.ui.FieldLayout(ui.mainStatusArea = new OO.ui.LabelWidget({ |
||
label: $('<div>') |
label: "[[File:" + infoLevels[type] + "|30px]] " + $('<div>').append(linkify(message)) |
||
| ⚫ | |||
.append(linkify(message)) |
|||
| ⚫ | |||
| ⚫ | |||
| ⚫ | |||
| ⚫ | |||
| ⚫ | |||
]); |
]); |
||
debug(ui.fieldset); |
debug(ui.fieldset); |
||
| Line 361: | Line 368: | ||
debug("ee"); |
debug("ee"); |
||
debug($('<div>').append(linkify(message))); |
debug($('<div>').append(linkify(message))); |
||
ui.mainStatusArea.setLabel($('<div>').append(linkify(message))); |
ui.mainStatusArea.setLabel("[[File:" + infoLevels[type] + "|30px]] " + $('<div>').append(linkify(message))); |
||
debug(ui.mainStatusArea); |
debug(ui.mainStatusArea); |
||
debug(ui.mainStatusLayout); |
debug(ui.mainStatusLayout); |
||
| Line 371: | Line 378: | ||
function handleSubmit() { |
function handleSubmit() { |
||
setMainStatus(' |
setMainStatus('process', 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 425: | Line 432: | ||
debug("text[0] = " + text[0]); |
debug("text[0] = " + text[0]); |
||
setMainStatus(' |
setMainStatus('process', msg('status-saving')); |
||
saveUserTalkPage(userTalk, text).then(function () { |
saveUserTalkPage(userTalk, text).then(function () { |
||
setMainStatus('success', msg('status-redirecting')); |
setMainStatus('success', msg('status-redirecting')); |
||