Diferencia entre revisiones de «MediaWiki:Common.js»
De EIFA - Estudios Interdisciplinares de las Fuentes Avilistas
| Etiqueta: Revertido | Etiqueta: Revertido | ||
| Línea 1: | Línea 1: | ||
| mw.loader.using( [ 'ext.visualEditor. | mw.loader.using( [ 'ext.visualEditor.targetLoader' ] ).then(function () { | ||
| 	mw.libs.ve.targetLoader.addPlugin( function () { | |||
| 		var nowikiLabel = 'Disable markup'; | |||
| 		ve.ui.wikitextCommandRegistry.register( | |||
| 			new ve.ui.Command( | |||
| 				'nowiki', 'mwWikitext', 'toggleWrapSelection', | |||
| 				{ args: [ '<nowiki>', '</nowiki>', 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 ); | |||
| 		for ( i in ve.init.mw.targetFactory.registry ) { | |||
| 			return  | 			var targetClass = ve.init.mw.targetFactory.registry[ i ]; | ||
| 			try { | |||
| 				targetClass.static.toolbarGroups.find( function ( group ) { return group.name === 'style' } ).demote.push( 'nowiki' ); | |||
| 			} catch ( err ) {} | |||
| 		} | 		} | ||
| 	} ); | |||
| 	} | |||
| } ); | } ); | ||
Revisión del 13:09 20 ene 2022
mw.loader.using( [ 'ext.visualEditor.targetLoader' ] ).then(function () {
	
	mw.libs.ve.targetLoader.addPlugin( function () {
		var nowikiLabel = 'Disable markup';
		ve.ui.wikitextCommandRegistry.register(
			new ve.ui.Command(
				'nowiki', 'mwWikitext', 'toggleWrapSelection',
				{ args: [ '<nowiki>', '</nowiki>', 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 );
		for ( i in ve.init.mw.targetFactory.registry ) {
			var targetClass = ve.init.mw.targetFactory.registry[ i ];
			try {
				targetClass.static.toolbarGroups.find( function ( group ) { return group.name === 'style' } ).demote.push( 'nowiki' );
			} catch ( err ) {}
		}
	} );
} );

