User:Matma Rex/nwe-nowiki.js

mw.loader.using( 'ext.visualEditor.targetLoader', function {	mw.libs.ve.targetLoader.addPlugin( function  { if ( !ve.ui.wikitextCommandRegistry ) { // If VE wikitext mode is not available, this will not exist return; }

var nowikiLabel = 'Disable markup';

ve.ui.wikitextCommandRegistry.register(			new ve.ui.Command( 'nowiki', 'mwWikitext', 'toggleWrapSelection', { args: [ ' ', ' ', nowikiLabel ], supportedSelections: [ 'linear' ] } )		);

ve.ui.NowikiTool = function { ve.ui.NowikiTool.super.apply( this, arguments ); };		OO.inheritClass( ve.ui.NowikiTool, ve.ui.Tool ); ve.ui.NowikiTool.static.name = 'nowiki'; ve.ui.NowikiTool.static.group = 'textStyle'; ve.ui.NowikiTool.static.icon = 'noWikiText'; ve.ui.NowikiTool.static.title = nowikiLabel; ve.ui.NowikiTool.static.commandName = 'nowiki'; ve.ui.toolFactory.register( ve.ui.NowikiTool ); } ); } );