Jump to content

User:Technical 13/SandBox/EmailHelper.js

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Technical 13 (talk | contribs) at 01:11, 23 January 2014 (Just some notes thrown together to start building a script to assist with sending email from Wikipedia including a checkbox to post a {{YGM}} automatically and a built in parser to correct internal wikilinks and ~~~~). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
(diff) ← Previous revision | Latest revision (diff) | Newer revision → (diff)
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.
if(mw.config.get("wgCanonicalSpecialPageName") === "Emailuser"){
	var emailSender = mw.config.get("wgUserName");// Person sending the email
	var wikiTimestamp = new Date();
	$("label[for='mw-input-wpCCMe']").after('<input type="checkbox" checked="checked" value="1" id="YGM" />&nbsp;<label for="YGM">Leave {{<a href="/wiki/Template:You%27ve_got_mail">You\'ve got mail</a>}} on talkpage.</label>');
	$("tr.mw-htmlform-field-HTMLTextAreaField").after('<tr class="mw-htmlform-field-HTMLPreviewField"><td class="mw-label"><label for="mw-input-wpPreview">    Preview:</label></td><td class="mw-input"></td></tr>');
	$("input.mw-htmlform-submit").before('<input class="mw-htmlform-reset" type="reset" value="Reset"></input>');
	$("textarea#mw-input-wpText");// Textarea window of Special:EmailUser
}