Content deleted Content added
Polygnotus (talk | contribs) No edit summary |
Polygnotus (talk | contribs) No edit summary |
||
Line 25:
},
refIdeas: {▼
filters: [ 'body.ns-1' ],▼
element: function ( context ) {▼
var button = new OO.ui.ButtonInputWidget( {▼
label: '',
icon: 'lightbulb',
title: 'refideas'▼
} );▼
button.connect( null, {▼
click: function ( e ) {▼
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).trigger('input');
$('#wpSummary').val('Added {{refideas}} template');▼
}▼
} );▼
return button.$element;▼
}
},
type: 'element',
▲ filters: [ 'body.ns-1' ],
▲ element: function ( context ) {
▲ var button = new OO.ui.ButtonInputWidget( {
▲ title: 'refideas'
▲ } );
▲ button.connect( null, {
▲ click: function ( e ) {
▲ var text = '{{refideas\n|1=\n}}';
} );
▲ textarea.value = currentText.substring(0, start) + text + currentText.substring(end);
}
▲ textarea.selectionStart = textarea.selectionEnd = start + text.length;
▲ $(textarea).trigger('input');
▲ $('#wpSummary').val('Added {{refideas}} template');
▲ }
▲ } );
▲ return button.$element;
▲ type: 'element',
▲ element: function ( context ) {
▲ var button = new OO.ui.ButtonInputWidget( {
▲ label: 'WP Policy',
▲ 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', {
▲ return button.$element;
exlinkInBody: {
|