Documentation may be created at User:ITechieGamer/welcome.js/doc.
Note: After saving, you have to bypass your browser's cache to see the changes.
Google Chrome, Firefox, Microsoft Edge, and Safari: Hold down the ⇧ Shift key and click the Reload toolbar button.
For details and instructions about other browsers, see Wikipedia:Bypass your cache.
$(document).ready(function() {
// Add a new portal before the social profiles in the toolbox
var $welcomeGroup = $('<div class="portal collapsed" role="navigation" id="p-welcome" aria-labelledby="p-welcome-label"></div>').append($('<h3 id="p-welcome-label">Welcoming users</h3>')),
$welcomeBody = $('<div class="body"></div>'),
$goodWelcomeLink = $('<a id="t-goodwelcome" href="#" title="Welcome a user">Good welcome</a>'),
$badWelcomeLink = $('<a id="t-badwelcome" href="#" title="Welcome a user">Bad welcome</a>'),
$newUserLink = $('<a id="t-newusers" href="/index.php?title=Special:ListAllUsers&group=&username=&editsOnly=0&creationSort=1" title="List of new users">New users</a>');
$($welcomeGroup.append($welcomeBody.html($('<ul id="p-welcome-list"></ul>').append($('<li/>').html($goodWelcomeLink)).append($('<li/>').html($badWelcomeLink)).append($('<li/>').html($newUserLink))))).insertBefore('#p-socialProfiles');
$('#t-goodwelcome').click( function() {
// Notify the user for the username
var username = prompt('Who would you like to good welcome?');
if(username == '' || username == null) return;
// Welcome the user
window.open('/index.php?action=edit§ion=new&title=User_talk:'+username+'&preload=User:Dentedharp90041/welcome/good&preloadtitle=Welcome%21&preloadparams%5b%5d='+username+'&preloadparams%5b%5d=%7e', '_blank');
});
$('#t-badwelcome').click( function() {
// Notify the user for the username
var username = prompt('Who would you like to bad welcome?');
if(username == '' || username == null) return;
// Welcome the user
window.open('/index.php?action=edit§ion=new&title=User_talk:'+username+'&preload=User:Dentedharp90041/welcome/bad&preloadtitle=Welcome&preloadparams%5b%5d=%7e', '_blank');
});
});