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

Content deleted Content added
No edit summary
No edit summary
Line 36:
},
wpPolicy: {
type: 'element',
element: function ( context ) {
var button = new OO.ui.ButtonInputWidget( {
label: 'WP Policy',
icon: 'article'
} );
button.connect( null, {
click: function ( e ) {
OO.ui.prompt( 'Enter Wikipedia policy/guideline abbreviation (e.g., NPOV, V, RS):' ).done( function ( answer ) {
if ( answer !== null && answer.trim() !== '' ) {
var text = '== [[WP:' + answer + ']] ==\nPlease read [[WP:' + answer + ']], thanks and have a nice day, ~~~~';
// Use the textarea's wikiEditor method context.fn.encapsulateSelection( {instead
context.$textarea.wikiEditor('encapsulateSelection', {
pre: text
pre: } );text
});
} );
}
} );
return button.$element;
}
}, );
}
} );
return button.$element;
}
},
exlinkInBody: {