Diferencia entre revisiones de «MediaWiki:Gadget-Versalitas.js»
De EIFA - Estudios Interdisciplinares de las Fuentes Avilistas
| Línea 1: | Línea 1: | ||
ve.ui.VersalitasCommand = function VeUiVersalitasCommand() {  | |||
	ve.ui.VersalitasCommand.super.call(	this, 'Versalitas' );  | |||
function   | };  | ||
OO.inheritClass( ve.ui.VersalitasCommand, ve.ui.Command );  | |||
ve.ui.VersalitasCommand.prototype.execute = function ( surface ) {  | |||
	var model = surface.getModel(),  | |||
		doc = model.getDocument(),  | |||
		range = model.getSelection().getRange(),  | |||
		docRange = doc.shallowCloneFromRange( range );  | |||
	ve.init.target.getWikitextFragment( docRange, false ).done( function ( wikitext ) {  | |||
		model.getFragment().insertContent([  | |||
			{  | |||
				type: 'mwTransclusionInline',  | |||
				attributes: {  | |||
					mw: {  | |||
						parts: [{  | |||
							template: {  | |||
								target: {  | |||
									href: 'Template:Versales',  | |||
									wt: 'Versales'  | |||
								},  | |||
								params: {  | |||
									1: {  | |||
										wt: wikitext  | |||
									}  | |||
								}  | |||
							}  | 							}  | ||
						}  | 						}]  | ||
					}  | 					}  | ||
				}   | 				}  | ||
			} , {  | |||
				type: '/mwTransclusionInline'  | |||
			} ] );  | |||
	} );  | |||
};  | |||
	}  | |||
ve.ui.commandRegistry.register( new ve.ui.VersalitasCommand() );  | |||
}());  | ve.ui.VersalitasTool = function VeUiVersalitasTool() {  | ||
	ve.ui.VersalitasTool.super.apply( this, arguments );  | |||
};  | |||
OO.inheritClass( ve.ui.VersalitasTool, ve.ui.Tool );  | |||
ve.ui.VersalitasTool.static.name = 'Versalitas';  | |||
ve.ui.VersalitasTool.static.icon = 'strikethrough';  | |||
ve.ui.VersalitasTool.static.title = OO.ui.deferMsg('Versalitas');  | |||
ve.ui.VersalitasTool.static.commandName = 'Versalitas';  | |||
ve.ui.toolFactory.register( ve.ui.VersalitasTool );  | |||
Revisión del 17:18 22 ene 2022
ve.ui.VersalitasCommand = function VeUiVersalitasCommand() {
	ve.ui.VersalitasCommand.super.call(	this, 'Versalitas' );
};
OO.inheritClass( ve.ui.VersalitasCommand, ve.ui.Command );
ve.ui.VersalitasCommand.prototype.execute = function ( surface ) {
	var model = surface.getModel(),
		doc = model.getDocument(),
		range = model.getSelection().getRange(),
		docRange = doc.shallowCloneFromRange( range );
	ve.init.target.getWikitextFragment( docRange, false ).done( function ( wikitext ) {
		model.getFragment().insertContent([
			{
				type: 'mwTransclusionInline',
				attributes: {
					mw: {
						parts: [{
							template: {
								target: {
									href: 'Template:Versales',
									wt: 'Versales'
								},
								params: {
									1: {
										wt: wikitext
									}
								}
							}
						}]
					}
				}
			} , {
				type: '/mwTransclusionInline'
			} ] );
	} );
};
ve.ui.commandRegistry.register( new ve.ui.VersalitasCommand() );
ve.ui.VersalitasTool = function VeUiVersalitasTool() {
	ve.ui.VersalitasTool.super.apply( this, arguments );
};
OO.inheritClass( ve.ui.VersalitasTool, ve.ui.Tool );
ve.ui.VersalitasTool.static.name = 'Versalitas';
ve.ui.VersalitasTool.static.icon = 'strikethrough';
ve.ui.VersalitasTool.static.title = OO.ui.deferMsg('Versalitas');
ve.ui.VersalitasTool.static.commandName = 'Versalitas';
ve.ui.toolFactory.register( ve.ui.VersalitasTool );