Content deleted Content added
Polygnotus (talk | contribs) No edit summary |
Polygnotus (talk | contribs) use OOUI |
||
(6 intermediate revisions by the same user not shown) | |||
Line 25:
},
refIdeas: {
type: 'element',
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.focus();
$(textarea).trigger('input');
$('#wpSummary').val('Added {{refideas}} template');
}
} );
return button.$element;
}
},
wpPolicy: {
type: 'element',
var button = new OO.ui.ButtonInputWidget( {
label: 'ReadThis',
icon: 'articles'
button.connect( null, {
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;
}
},
exlinkInBody: {
filters: [ 'body.ns-3' ],
icon: '//upload.wikimedia.org/wikipedia/commons/0/05/IUCN_EX.svg'
var text = '{{subst:' + 'User:Polygnotus/Templates/exlink}} ~~' + '~~';
context.$textarea.textSelection('encapsulateSelection', {
});
}
} );
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'
button.connect( null,
var text = '{{subst:' + 'uw-spam}} ~~' + '~~';
context.$textarea.textSelection('encapsulateSelection', {
pre: text
});
}
} );
return button.$element;
}
},
|