Jump to content

User:Genewikiplus/SWL editor.js

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Xaosflux (talk | contribs) at 11:03, 24 March 2021 (Fix requested on WP:IANB). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
Note: After saving, you have to bypass your browser's cache to see the changes. Google Chrome, Firefox, Microsoft Edge and Safari: Hold down the ⇧ Shift key and click the Reload toolbar button. For details and instructions about other browsers, see Wikipedia:Bypass your cache.
// <nowiki>
//
// SWL editor
//
 
//for use with the semantic wiki link (SWL) template
//based on ... importScript('User:NerdyScienceDude/Scripts/extratoolbarbuttons.js')
 
if ( typeof $j != 'undefined' && typeof $j.fn.wikiEditor != 'undefined' ) {
	$j(document).ready( function() {
 
		$j( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
			'section': 'advanced',
			'group': 'format',
			'tools': {
				'transclude': {
					label: 'Add Semantic Wiki Link',
					type: 'button',
					icon: '/media/wikipedia/en/6/67/Swl_green_edit_button.png',
					action: {
						type: 'encapsulate',
						options: {
							pre: "{{SWL|target=",
							post: "|type=associated_with}}"
						}
					}
				}
			}
		} );
	} );
}