User:Chaotic Enby/Unblock wizard.js: Difference between revisions
From Test Wiki
Content deleted Content added
Chaotic Enby (talk | contribs) No edit summary |
Chaotic Enby (talk | contribs) No edit summary |
||
| Line 421: | Line 421: | ||
} |
} |
||
var text = prepareUserTalkText( |
var text = prepareUserTalkText(); |
||
setMainStatus('process', msg('status-saving')); |
setMainStatus('process', msg('status-saving')); |
||
| Line 427: | Line 427: | ||
setMainStatus('success', text); |
setMainStatus('success', text); |
||
} else { |
} else { |
||
saveUserTalkPage(userTalk, text).then(function () { |
saveUserTalkPage(userTalk, apiPage.revisions[0].slots.main.content + text).then(function () { |
||
setMainStatus('success', msg('status-redirecting')); |
setMainStatus('success', msg('status-redirecting')); |
||
mw.track('counter.gadget_afcsw.submit_succeeded'); |
mw.track('counter.gadget_afcsw.submit_succeeded'); |
||
| Line 506: | Line 506: | ||
* @returns {string} final talk page text to save |
* @returns {string} final talk page text to save |
||
*/ |
*/ |
||
function prepareUserTalkText( |
function prepareUserTalkText() { |
||
var text = page.revisions[0].slots.main.content; |
|||
var unblock = ''; |
var unblock = ''; |
||
| Line 537: | Line 535: | ||
} |
} |
||
| ⚫ | |||
// insert it at the bottom |
|||
text = text + unblock; |
|||
| ⚫ | |||
} |
} |
||