Diferencia entre las páginas «Catálogo de fuentes» y «MediaWiki:Gadget-Biblia.js»
De EIFA - Estudios Interdisciplinares de las Fuentes Avilistas
(Diferencia entre las páginas)
(Mejora en la claridad y el estilo) |
(Página creada con «ve.ui.BibliaCommand = function VeUiBibliaCommand() { ve.ui.BibliaCommand.super.call( this, 'Biblia' ); }; OO.inheritClass( ve.ui.BibliaCommand, ve.ui.Command ); ve.ui.BibliaCommand.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 ) { var…») |
||
Línea 1: | Línea 1: | ||
ve.ui.BibliaCommand = function VeUiBibliaCommand() { | |||
ve.ui.BibliaCommand.super.call( this, 'Biblia' ); | |||
}; | |||
OO.inheritClass( ve.ui.BibliaCommand, ve.ui.Command ); | |||
ve.ui.BibliaCommand.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 ) { | ||
var htmlfrag = model.getFragment().insertHtml('<bible>'+wikitext+'</bible>'); | |||
} ); | |||
}; | |||
ve.ui.commandRegistry.register( new ve.ui.BibliaCommand() ); | |||
ve.ui.BibliaTool = function VeUiBibliaTool() { | |||
ve.ui.BibliaTool.super.apply( this, arguments ); | |||
}; | |||
OO.inheritClass( ve.ui.BibliaTool, ve.ui.Tool ); | |||
ve.ui.BibliaTool.static.name = 'Biblia'; | |||
ve.ui.BibliaTool.static.group = 'cite'; | |||
ve.ui.BibliaTool.static.icon = 'book'; | |||
ve.ui.BibliaTool.static.title = 'Biblia'; | |||
ve.ui.BibliaTool.static.commandName = 'Biblia'; | |||
ve.ui.toolFactory.register( ve.ui.BibliaTool ); |
Revisión del 22:34 4 ene 2023
ve.ui.BibliaCommand = function VeUiBibliaCommand() {
ve.ui.BibliaCommand.super.call( this, 'Biblia' );
};
OO.inheritClass( ve.ui.BibliaCommand, ve.ui.Command );
ve.ui.BibliaCommand.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 ) {
var htmlfrag = model.getFragment().insertHtml('<bible>'+wikitext+'</bible>');
} );
};
ve.ui.commandRegistry.register( new ve.ui.BibliaCommand() );
ve.ui.BibliaTool = function VeUiBibliaTool() {
ve.ui.BibliaTool.super.apply( this, arguments );
};
OO.inheritClass( ve.ui.BibliaTool, ve.ui.Tool );
ve.ui.BibliaTool.static.name = 'Biblia';
ve.ui.BibliaTool.static.group = 'cite';
ve.ui.BibliaTool.static.icon = 'book';
ve.ui.BibliaTool.static.title = 'Biblia';
ve.ui.BibliaTool.static.commandName = 'Biblia';
ve.ui.toolFactory.register( ve.ui.BibliaTool );