Content deleted Content added
Polygnotus (talk | contribs) No edit summary |
Polygnotus (talk | contribs) use OOUI |
||
(15 intermediate revisions by the same user not shown) | |||
Line 1:
//I should be able to combine these
//colours are weird in dark mode
//https://www.mediawiki.org/wiki/Extension:WikiEditor/Toolbar_customization
// <nowiki>
Line 24 ⟶ 26:
refIdeas: {
filters: [ 'body.ns-
var button = new OO.ui.ButtonInputWidget( {
icon: '//upload.wikimedia.org/wikipedia/commons/8/8c/Farm-Fresh_lightbulb_add.png',▼
}
var text = '{{refideas\n|1=\n}}';
var textarea = context.$textarea[0];
var start = textarea.selectionStart;
var end = textarea.selectionEnd;
var currentText = textarea.value;
textarea.value = currentText.substring(0, start) + text + currentText.substring(end);
textarea.selectionStart = textarea.selectionEnd = start + text.length;
textarea.focus();
$(textarea).trigger('input');
$('#wpSummary').val('Added {{refideas}} template');
}▼
return button.$element;
}▼
},
wpPolicy: {▼
element: function ( context ) {
var button = new OO.ui.ButtonInputWidget( {
label: 'ReadThis',
icon: 'articles'
} );
button.connect( null, {
click: function ( e ) {
var policy = prompt('Enter Wikipedia policy/guideline abbreviation (e.g., NPOV, V, RS):');▼
if (policy !== null && policy.trim() !== '') {▼
var text = '== [[WP:' + policy.trim() + ']] ==\nPlease read [[WP:' + policy.trim() + ']], thanks and have a nice day, ~~~~';▼
context.$textarea.textSelection('encapsulateSelection', {▼
pre: text
});
}
}
} );
return button.$element;
}
},
▲ wpPolicy: {
▲ execute: function( context ) {
▲ var policy = prompt('Enter Wikipedia policy/guideline abbreviation (e.g., NPOV, V, RS):');
▲ if (policy !== null && policy.trim() !== '') {
▲ var text = '== [[WP:' + policy.trim() + ']] ==\nPlease read [[WP:' + policy.trim() + ']], thanks and have a nice day, ~~~~';
▲ context.$textarea.textSelection('encapsulateSelection', {
▲ pre: text
▲ });
▲ }
▲ }
exlinkInBody: {
filters: [ 'body.ns-3' ],
▲ width: 26,
var text = '{{subst:' + 'User:Polygnotus/Templates/exlink}} ~~' + '~~';
▲ type: 'encapsulate',
context.$textarea.textSelection('encapsulateSelection', {
▲ options: {
});
}
} );
return button.$element;
}
},
uwSpam: {
filters: [ 'body.ns-3' ],
var button = new OO.ui.ButtonInputWidget( {
▲ icon: '//upload.wikimedia.org/wikipedia/commons/c/c8/No-spam.svg',
▲ type: 'encapsulate',
button.connect( null,
var text = '{{subst:' + 'uw-spam}} ~~' + '~~';
context.$textarea.textSelection('encapsulateSelection', {
pre: text
});
}
} );
return button.$element;
}
},
|