View source for User:BZPN/Email.js
Jump to navigation
Jump to search
You do not have permission to edit this page, for the following reason:
You can view and copy the source of this page.
mw.loader.using(['mediawiki.api', 'jquery'], function () {
$(function () {
if (mw.config.get('wgCanonicalSpecialPageName') !== 'EmailUser') return;
var $copyField = $('label[for="ooui-php-6"]').closest('.mw-htmlform-field-HTMLCheckField');
if (!$copyField.length) return;
var $notifyCheckbox = $('<div class="mw-htmlform-field-HTMLCheckField">' +
'<div class="oo-ui-fieldLayout-field">' +
'<input type="checkbox" id="notifyOnTalk" name="notifyOnTalk" value="1"> ' +
'<label for="notifyOnTalk">Notify user on talk page</label>' +
'</div>' +
'</div>');
$copyField.after($notifyCheckbox);
$('form.mw-htmlform').on('submit', function (e) {
if ($('#notifyOnTalk').is(':checked')) {
e.preventDefault();
var targetUser = $('#mw-input-wpTarget').val();
if (!targetUser) return this.submit();
000
1:0
Template used on this page:
Return to User:BZPN/Email.js.