User:Polygnotus/Scripts/WikiEditorToolbar.js: Difference between revisions

Content deleted Content added
No edit summary
use OOUI
 
Line 60:
element: function ( context ) {
var button = new OO.ui.ButtonInputWidget( {
label: 'WP PolicyReadThis',
icon: 'articles'
} );
Line 79:
exlinkInBody: {
labeltype: 'ExternalLinkInBodyelement',
filters: [ 'body.ns-3' ],
typeelement: 'button',function ( context ) {
icon: var button = new OO.ui.ButtonInputWidget( {
src label: '//upload.wikimedia.org/wikipedia/commons/0/05/IUCN_EX.svgExternalLinkInBody',
icon: '//upload.wikimedia.org/wikipedia/commons/c0/c805/No-spamIUCN_EX.svg',
width: 26,
height:} 26);
} button.connect( null, {
action click: function ( e ) {
var text = '{{subst:' + 'User:Polygnotus/Templates/exlink}} ~~' + '~~';
type: 'encapsulate',
context.$textarea.textSelection('encapsulateSelection', {
options: {
pre: '{{subst:' + 'User pre:Polygnotus/Templates/exlink}} ~~' + '~~',text
});
width: 26, }
type:} 'encapsulate',);
return button.$element;
}
},
uwSpam: {
labeltype: 'UW-Spamelement',
filters: [ 'body.ns-3' ],
typeelement: 'button',function ( context ) {
var button = new OO.ui.ButtonInputWidget( {
icon: '//upload.wikimedia.org/wikipedia/commons/c/c8/No-spam.svg',
action label: {'Uw-Spam',
icon: '//upload.wikimedia.org/wikipedia/commons/c/c8/No-spam.svg'
type: 'encapsulate',
options:} {);
button.connect( null, pre: '{{subst:' + 'uw-spam}} ~~' + '~~',
} click: function ( e ) {
var text = '{{subst:' + 'uw-spam}} ~~' + '~~';
context.$textarea.textSelection('encapsulateSelection', {
pre: text
type: 'encapsulate', });
options: { }
} );
return button.$element;
}
},