MediaWiki:Wikia.js/AdminNotify.js

if (wgPageName === "Special:AdminNotify") { if (wgUserGroups.indexOf("sysop") > -1) { $('#WikiaArticle').html('Notify'); } }

function openAdminNotify { var windowHTMLWindow = $.showCustomModal("Message Form", ' Message title:   Message:    ', {        id: "messageWindow",        width: 600,        buttons: [            {            id: "cancel",            message: "Cancel",            handler: function {                cancelMessage;            }        },            {            id: "submit",            defaultButton: true,            message: "Submit",            handler: function {                submitMessage;            }        }        ]    }); }

function cancelMessage { $('#messageWindow').closeModal; }

function submitMessage { var adminList = ["41488p", "Bushcraft Medic", "ClericofMadness", "Furbearingbrick", "Glaze112", "Kill1mes", "LOLSKELETONS", "MooseJuice", "Mr.Zalgopasta", "Princess Platinum", "Shinigami.Eyes", "Sloshedtrain", "Temmington", "WhyAmIReadingThis", "XanCrews"], header = document.getElementById("message-header").value || 'null', body = document.getElementById("message-body").value || 'null', EditToken = mw.user.tokens.values.editToken, url;

for (var i = 0; i < adminList.length; i++) { url = wgServer + '/api.php?action=edit&title=User_talk:' + encodeURIComponent(adminList[i]) + '&section=new&sectiontitle=' + encodeURIComponent(header) + '&text=' + encodeURIComponent(body) + '&token=' + encodeURIComponent(EditToken); $.post(url); }   $('#messageWindow').closeModal; }