Diferencia entre revisiones de «MediaWiki:Gadget-Versalitas.js»

De EIFA - Estudios Interdisciplinares de las Fuentes Avilistas
Etiqueta: Revertido
 
(No se muestran 32 ediciones intermedias del mismo usuario)
Línea 1: Línea 1:
/**
ve.ui.VersalitasCommand = function VeUiVersalitasCommand() {
* Adds direction mark tool to VE (for adding RLM)
ve.ui.VersalitasCommand.super.call( this, 'Versalitas' );
*/
};
(function () {
OO.inheritClass( ve.ui.VersalitasCommand, ve.ui.Command );
// localization for button name
if(!mw.messages.exists('DirectionTool-toolname')){
mw.messages.set('DirectionTool-toolname', 'תו כיווניות');
}
// localization for rlm template name
if(!mw.config.exists('rlmTemplateName')){
mw.config.set('rlmTemplateName', 'כ');
}
//end of localization


function DirectionTool( toolGroup, config ) {
ve.ui.VersalitasCommand.prototype.execute = function ( surface ) {
OO.ui.Tool.call( this, toolGroup, config );
var model = surface.getModel(),
}
doc = model.getDocument(),
OO.inheritClass( DirectionTool, OO.ui.Tool );
range = model.getSelection().getRange(),
docRange = doc.shallowCloneFromRange( range );


DirectionTool.static.name = 'DirectionTool';
ve.init.target.getWikitextFragment( docRange, false ).done( function ( wikitext ) {
DirectionTool.static.title = mw.msg('DirectionTool-toolname');
model.getFragment().insertContent([
 
{
DirectionTool.prototype.onSelect = function () {
type: 'mwTransclusionInline',
this.toolbar.getSurface().getModel().getFragment().collapseToEnd().insertContent([{
attributes: {
'type': 'mwTransclusionInline',
mw: {
'attributes': {
parts: [{
'mw': {
template: {
parts: [ {
target: {
template: {
href: 'Template:Versales',
target: {
wt: 'Versales'
href: mw.config.get('wgFormattedNamespaces')[10]+ ':'+ mw.config.get('rlmTemplateName'),
},
wt: mw.config.get('rlmTemplateName')
params: {
},
1: {
params: {}
wt: wikitext
}
}
}
}]
}
}
}]
}
}
} , {
}
type: '/mwTransclusionInline'
}]);
} ] );
} );
};
};


DirectionTool.prototype.onUpdateState = function () {
ve.ui.commandRegistry.register( new ve.ui.VersalitasCommand() );
this.setActive( false );
 
ve.ui.VersalitasTool = function VeUiVersalitasTool() {
ve.ui.VersalitasTool.super.apply( this, arguments );
};
};
 
OO.inheritClass( ve.ui.VersalitasTool, ve.ui.Tool );
ve.ui.toolFactory.register( DirectionTool );
ve.ui.VersalitasTool.static.name = 'Versalitas';
 
ve.ui.VersalitasTool.static.group = 'textStyle';
})();
ve.ui.VersalitasTool.static.icon = 'largerText';
ve.ui.VersalitasTool.static.title = 'Versalitas';
ve.ui.VersalitasTool.static.commandName = 'Versalitas';
ve.ui.toolFactory.register( ve.ui.VersalitasTool );

Revisión actual - 17:48 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.group = 'textStyle';
ve.ui.VersalitasTool.static.icon = 'largerText';
ve.ui.VersalitasTool.static.title = 'Versalitas';
ve.ui.VersalitasTool.static.commandName = 'Versalitas';
ve.ui.toolFactory.register( ve.ui.VersalitasTool );