« Utilisateur:Tractopelle-jaune/Toolbar.js » : différence entre les versions

Une page de Wikipédia, l'encyclopédie libre.
Contenu supprimé Contenu ajouté
m retouche de la modification précédente (ajout regex pour nettoyer blancs intempestifs)
m retouche de la modification précédente (j'avais oublié une partie) + ajout "ownline: true"
Ligne 455 : Ligne 455 :
peri: 'EXEMPLE',
peri: 'EXEMPLE',
post: '\n}}',
post: '\n}}',
regex: /^\s*(.+?)\s*$/s,
regex: /^\s*(.+?)\s*?(\n)?$/s,
regexReplace: '$1' }}}, {
regexReplace: '{{Méta cadre\n | fond = #F8FFF8\n | contenu = $1\n}}$2',
ownline: true }}}, {
label: 'VIDE',
label: 'VIDE',

Version du 21 mai 2022 à 18:23

//<nowiki>

/* Boutons supplémentaires pour la barre d'outils WikiEditor (barre d'outils par défaut) */
// [[mw:Extension:WikiEditor/Toolbar customization]]

/* Check if view is in edit mode and that the required modules are available. Then, customize the toolbar … */
if ( $.inArray( mw.config.get( 'wgAction' ), [ 'edit', 'submit' ] ) !== -1 ) {
	mw.loader.using( 'user.options' ).then( function () {
		// This can be the string "0" if the user disabled the preference ([[phab:T54542#555387]])
		if ( mw.user.options.get( 'usebetatoolbar' ) == 1 ) {
			$.when(
				mw.loader.using( 'ext.wikiEditor' ), $.ready
			).then( customizeToolbar );
		}
	} );
}

/* Barre d'outils supplémentaires */

// Boutons supplémentaires
var customizeToolbar = function() { $('#wpTextbox1').wikiEditor('addToToolbar',
{
	section: 'main',
	group: 'format',
	tools: [ {
		type: 'button',
		label: 'Ajouter <u></u>',
		icon: '//upload.wikimedia.org/wikipedia/commons/thumb/a/a1/OOjs_UI_icon_underline-a.svg/22px-OOjs_UI_icon_underline-a.svg.png',
		action:	{
			type: 'encapsulate',
			options: {
				pre: '<u>',
				post: '</u>' }}}, {
		
		type: 'button',
		label: 'Ajouter <u>\'\'\'texte\'\'\'</u>',
		icon: '//upload.wikimedia.org/wikipedia/commons/thumb/1/10/OOjs_UI_icon_text-style.svg/22px-OOjs_UI_icon_text-style.svg.png',
		action:	{
			type: 'encapsulate',
			options: {
				pre: '<u>\'\'\'',
				post: '\'\'\'</u>' }}}, {
		
		type: 'button',
		label: 'Ajouter <small></small>',
		icon: '//upload.wikimedia.org/wikipedia/commons/1/10/Toolbar_Format_small.png',
		action:	{
			type: 'encapsulate',
			options: {
				pre: '<small>',
				post: '</small>' }}}, {
		
		type: 'button',
		label: 'Supprimer les liens internes',
		icon: '//upload.wikimedia.org/wikipedia/commons/thumb/5/54/OOjs_UI_icon_noWikiText-ltr.svg/22px-OOjs_UI_icon_noWikiText-ltr.svg.png',
		action:	{
			type: 'encapsulate',
			options: {
				regex: /(?:\[\[([^<>\[\]|{}#]+)\]\]|\[\[[^<>\[\]|{}]+\|([^\[\]#]+)\]\])/g,
				regexReplace: '$1$2' }}}
	]
});

$('#wpTextbox1').wikiEditor('addToToolbar',
{
	sections: {
		'tracto-tools': {
			type: 'toolbar',
			label: 'Tracto-Tools',
			groups: {
				'code': { label: 'Code' },
				'date': { label: 'Date' },
				'list': { label: 'Liste' }}}
	},
	
	section: 'tracto-tools',
	group: 'code',
	tools: [ { //</nowiki>
		type: 'button',
		label: 'Ajouter balises <code></code>',
		icon: '//upload.wikimedia.org/wikipedia/commons/thumb/4/45/Farm-Fresh_script_code.png/22px-Farm-Fresh_script_code.png',
		action:	{
			type: 'encapsulate',
			options: {
				pre: '<code>',
				post: '</code>' }}}, {
		
		type: 'button',
		label: 'Ajouter balises <code id=""></code> avec l\'id contenant le texte séléctionné',
		icon: '//upload.wikimedia.org/wikipedia/commons/thumb/9/9b/Farm-Fresh_script_go.png/22px-Farm-Fresh_script_go.png',
		action: {
			type: 'encapsulate',
			options: {
				pre: '<code id="param-xxx">',
				post: '</code>',
				regex: /(?:<code>|\'{2,5}|\"|^( *))([^<>|{}\[\]#]+?)(?:<\/code>|\'{2,5}|\"|( *)$)/g,
				regexReplace: '$1<code id="param-$2">$2</code>$3' }}}, {
		
		type: 'button',
		label: 'Ajouter balises <code>[[#param-xxx|...]]</code> avec lien vers le paramètre séléctionné',
		icon: '//upload.wikimedia.org/wikipedia/commons/thumb/6/68/Farm-Fresh_script_link.png/22px-Farm-Fresh_script_link.png',
		action: {
			type: 'encapsulate',
			options: {
				pre: '<code>[[#param-xxx|',
				post: ']]</code>',
				regex: /(?:<code>|\'{2,5}|\"|^( *))([^<>|{}\[\]#]+?)(?:<\/code>|\'{2,5}|\"|( *)$)/g,
				regexReplace: '$1<code>[[#param-$2|$2]]</code>$3' }}}, {
		
		type: 'button',
		label: 'Ajout balises code + lien vers Aide:Mot magique',
		icon: '//upload.wikimedia.org/wikipedia/commons/thumb/6/61/Farm-Fresh_script_palette.png/22px-Farm-Fresh_script_palette.png',
		action:	{
			type: 'encapsulate',
			options: {
				pre: '<code>[[Aide:Mot magique#XXX|<nowiki>',
				peri: 'XXX',
				post: '</nowiki>]]</code>',
				/*                               1       2   3       4    5     6                  7      8        9                10     11                                             12   */
				regex: /(?:<code>(?:<nowiki>)?|^( *))(?:(__)([A-Z]+)(__)|(\{\{)([A-Za-z0-9 _!]+):?(\}\})|(\{\{)m\|([A-Za-z0-9 _!]+)(\}\})|([A-Za-z0-9 _!]+):?)(?:(?:<\/nowiki>)?<\/code>|( *)$)/g,
				regexReplace: '$1<code>[[Aide:Mot magique#$3$6$9$11|<nowiki>$2$3$4$5$6$7$8$9$10$11</nowiki>]]</code>$12' }}}, {
		
		type: 'button',
		label: 'Ajouter balises <code><nowiki></nowiki></code>',
		icon: '//upload.wikimedia.org/wikipedia/commons/thumb/a/ac/Farm-Fresh_script_visual_studio.png/22px-Farm-Fresh_script_visual_studio.png',
		action: {
			type: 'encapsulate',
			options: {
				pre: '<code><nowiki>',
				post: '</nowiki></code>' }}}, {
		
		type: 'button',
		label: 'Ajouter balises <nowiki></nowiki>',
		icon: '//upload.wikimedia.org/wikipedia/commons/thumb/f/f3/Farm-Fresh_script_code_red.png/22px-Farm-Fresh_script_code_red.png',
		action: {
			type: 'encapsulate',
			options: {
				pre: '<nowiki>',
				post: '</nowiki>' }}}, {
		
		type: 'button',
		label: 'De-code',
		icon: '//upload.wikimedia.org/wikipedia/commons/thumb/8/87/Farm-Fresh_script_delete.png/22px-Farm-Fresh_script_delete.png',
		action: {
			type: 'replace',
			options: {
				pre: '',
				regex: /(?:<code>|<nowiki>)+(.+?)(?:<\/nowiki>|<\/code>)+/g,
				regexReplace: '$1' }}}, {
		
		type: 'button',
		label: 'Remplacer \'\'\'texte\'\'\' par <code>texte</code>',
		icon: '//upload.wikimedia.org/wikipedia/commons/thumb/b/be/Farm-Fresh_script_flash.png/22px-Farm-Fresh_script_flash.png',
		action: {
			type: 'encapsulate',
			options: {
				pre: '<code>',
				post: '</code>',
				regex: /(?:\'{2,5}(?:<code>)?(.+?)(?:<\/code>)?\'{2,5}|« *(?:<code>)?([^«»\n]+?)(?:<\/code>)? *»|\" *(?:<code>)?([^«»\n]+?)(?:<\/code>)? *\")/g,
				regexReplace: '<code>$1$2$3</code>' }}}, {
		
		type: 'button',
		label: 'Remplacer "* \'\'\'<code>param</code>\'\'\' : " par "; <code>param</code> : " sur toutes les lignes sélectionnées',
		icon: '//upload.wikimedia.org/wikipedia/commons/thumb/8/89/Farm-Fresh_macro_show_all_actions.png/22px-Farm-Fresh_macro_show_all_actions.png',
		action: {
			type: 'encapsulate',
			options: {
				pre: '; <code>',
				post: '</code> : ',
				regex: /^[*;]+ *(?:\'{2,5} *([^<>=\n;*]+?) *(?:[:=—–] *| +- +)?\'{2,5} *(?:[:=—–] *| +- +)?|(?:\'{2,5})?<code>((?:<nowiki>)?[^<>=\n;*]+?(?:<\/nowiki>)?)<\/code>(?:\'{2,5})? *(?:[:=—–] *| +- +)?|([^<>:=\n—–;*]+?) *[:=—–] *| +- +)/mg,
				regexReplace: '; <code>$1$2$3</code> : ' }}}
	] //<nowiki>
});

$('#wpTextbox1').wikiEditor('addToToolbar',
{
	section: 'tracto-tools',
	group: 'date',
	tools: [ {
		type: 'button',
		label: 'Ajouter {{date-}}',
		icon: '//upload.wikimedia.org/wikipedia/commons/thumb/c/cb/Farm-Fresh_date_add.png/22px-Farm-Fresh_date_add.png',
		action:	{
			type: 'encapsulate',
			options: {
				pre: '{{date-|',
				post: '}}',
				regex: /(?:\{\{date-?\|)?(?:(?:\{\{)?(\d+)(?:er|er\}\}|\{\{er\}\})?[ |]+)?(janvier|février|mars|avril|mai|juin|juillet|août|septembre|octobre|novembre|décembre)[ |]+(\d{4})(?:\}\})?/gi,
				regexReplace: '{{date-|$1 $2 $3}}' }}}, {
		
		type: 'button',
		label: 'Ajouter {{date}}',
		icon: '//upload.wikimedia.org/wikipedia/commons/thumb/f/fc/Farm-Fresh_date_link.png/22px-Farm-Fresh_date_link.png',
		action:	{
			type: 'encapsulate',
			options: {
				pre: '{{date|',
				post: '}}',
				regex: /(?:\{\{date-?\|)?(?:(?:\{\{)?(\d+)(?:er|er\}\}|\{\{er\}\})?[ |]+)?(janvier|février|mars|avril|mai|juin|juillet|août|septembre|octobre|novembre|décembre)[ |]+(\d{4})(?:\}\})?/gi,
				regexReplace: '{{date|$1 $2 $3}}' }}}, {
		
		type: 'button',
		label: 'Supprimer {{date}}',
		icon: '//upload.wikimedia.org/wikipedia/commons/thumb/6/60/Farm-Fresh_date_delete.png/22px-Farm-Fresh_date_delete.png',
		action:	{
			type: 'encapsulate',
			options: {
				regex: /\{\{date-?\|(?:(?:\{\{)?(\d{1,2})(?:er|er\}\}|\{\{er\}\})?)?[ |]+(janvier|février|mars|avril|mai|juin|juillet|août|septembre|octobre|novembre|décembre)[ |]+(\d{4})(?:\|[^{}|\n]+)?\}\}/gi,
				regexReplace: '$1 $2 $3' }}}
	]
});

/** Tracto-Tools - Listes **/
$('#wpTextbox1').wikiEditor('addToToolbar',
{
	section: 'tracto-tools',
	group: 'list',
	tools: [ {
		type: 'button',
		label: 'Ajout puce à chaque ligne / conversion # → * / conversion {{Liste éléments}} en {{Liste horizontale}}',
		icon: '//upload.wikimedia.org/wikipedia/commons/thumb/7/71/Farm-Fresh_text_list_bullets.png/22px-Farm-Fresh_text_list_bullets.png',
		action:	{
			type: 'encapsulate',
			options: {
				regex: /^(?: *[*#|:] *)?([^\n*#]+?) *$/mg,
				regexReplace: '* $1' }}}, {
		
		type: 'button',
		label: 'Ajout puce numérotée à chaque ligne / conversion * → # / conversion {{Liste éléments}} en {{Liste horizontale}}',
		icon: '//upload.wikimedia.org/wikipedia/commons/thumb/f/f3/Farm-Fresh_text_list_numbers.png/22px-Farm-Fresh_text_list_numbers.png',
		action:	{
			type: 'encapsulate',
			options: {
				regex: /^(?: *[*#|:] *)?([^\n*#]+?) *$/mg,
				regexReplace: '# $1' }}}, {
		
		type: 'button',
		label: 'Ajouter liens sur tous les éléments de la liste',
		icon: '//upload.wikimedia.org/wikipedia/commons/thumb/9/9e/Farm-Fresh_database_repeat_insert.png/22px-Farm-Fresh_database_repeat_insert.png',
		action:	{
			type: 'encapsulate',
			options: {
				regex: /^( *[*#|] *)?([^\[\]\n*#{}|]+?) *$/mg,
				regexReplace: '$1[[$2]]' }}}
	]
});
/** Fin Tracto-Tools - Listes **/



/** Tableaux **/
$('#wpTextbox1').wikiEditor('addToToolbar',
{
	sections: {
		'table': {
			type: 'toolbar',
			label: 'Tables',
			groups: {
				'header': { label: 'En-tête' },
				'cell': { label: 'Cellule' },
				'style': { label: 'CSS' }}}
	},
	
	section: 'table',
	group: 'header',
	tools: [ {
		type: 'button',
		label: 'Ajouter titre de tableau (caption)',
		icon: '//upload.wikimedia.org/wikipedia/commons/thumb/f/f4/Farm-Fresh_query_make_table.png/22px-Farm-Fresh_query_make_table.png',
		action:	{
			type: 'encapsulate',
			options: {
				pre: '|+ ',
				regex: /^ *(.+) *$/,
				regexReplace: '|+ $1',
				ownline: true }}}, {
		
		type: 'button',
		label: 'Ajouter scope="col"',
		icon: '//upload.wikimedia.org/wikipedia/commons/thumb/6/69/Farm-Fresh_imex_run_import.png/22px-Farm-Fresh_imex_run_import.png',
		action:	{
			type: 'encapsulate',
			options: {
				pre: '! scope="col" | ',
				peri: 'CONTENU',
				regex: /^[!|] *(?:([^\[\]{}|!\n]+ ?) *?\|(?!\|))? *(''')?(.+)\2/gm,
				regexReplace: '! scope="col" $1| $3' }}}, {
		
		type: 'button',
		label: 'Ajouter scope="row"',
		icon: '//upload.wikimedia.org/wikipedia/commons/thumb/e/eb/Farm-Fresh_imex_run_export.png/22px-Farm-Fresh_imex_run_export.png',
		action:	{
			type: 'encapsulate',
			options: {
				pre: '! scope="row" | ',
				peri: 'CONTENU',
				regex: /^[!|] *(?:([^\[\]{}|!\n]+ ?) *?\|(?!\|))? *(''')?(.+?)\2 *(?:\|(\|.+)(\n)|$)/gm, /* La dernière partie "(?:\|(\|.+)(\n)|$)" permet de gérer les cas où plusieurs cellules sont sur la même ligne, car cela nécéssite de casser la ligne au niveau du "||" ; en bricolant avec des captures optionelles de retours à la ligne, on arrive gérer ce cas en renvoyant sur une nouvelle ligne les autres cellules, tout en n'ajoutant pas de nouvelle ligne si il n'y a pas d'autres cellules */
				regexReplace: '! scope="row" $1| $3$5$4$5' }}}, {
		
		type: 'button',
		label: 'Ajouter scope="row" sur toutes les cellules de la 1re colonne',
		icon: '//upload.wikimedia.org/wikipedia/commons/thumb/d/df/Farm-Fresh_more_exports.png/22px-Farm-Fresh_more_exports.png',
		action:	{
			type: 'encapsulate',
			options: {
				regex: /^\|-([^\n|]*)\n\| *(?:([^\[\]{}|!\n]+ ?) *?\|(?!\|))? *(''')?(.+?)\3 *(?:\|(\|.+)(\n)|$)/gm, /* La dernière partie "(?:\|(\|.+)(\n)|$)" permet de gérer les cas où plusieurs cellules sont sur la même ligne, car cela nécéssite de casser la ligne au niveau du "||" ; en bricolant avec des captures optionelles de retours à la ligne, on arrive gérer ce cas en renvoyant sur une nouvelle ligne les autres cellules, tout en n'ajoutant pas de nouvelle ligne si il n'y a pas d'autres cellules */
				regexReplace: '|-$1\n! scope="row" $2| $4$6$5$6' }}}
	]
});
	
$('#wpTextbox1').wikiEditor('addToToolbar',
{
	section: 'table',
	group: 'cell',
	tools: [ {
		type: 'button',
		label: 'Mettre les cellules sur une seule ligne',
		icon: '//upload.wikimedia.org/wikipedia/commons/thumb/f/f3/Farm-Fresh_consolidate.png/22px-Farm-Fresh_consolidate.png',
		action:	{
			type: 'encapsulate',
			options: {
				regex: /^(\|-[^\n]*)\n([!|])(?:\2)?(?![|!+-\}])( *)([^\n]*)(?:\n(\2)(?:\2)?(?![|!+-\}])( *)([^\n]*)(?:\n(\2)(?:\2)?(?![|!+-\}])( *)([^\n]*)(?:\n(\2)(?:\2)?(?![|!+-\}])( *)([^\n]*)(?:\n(\2)(?:\2)?(?![|!+-\}])( *)([^\n]*)(?:\n(\2)(?:\2)?(?![|!+-\}])( *)([^\n]*)(?:\n(\2)(?:\2)?(?![|!+-\}])( *)([^\n]*)(?:\n(\2)(?:\2)?(?![|!+-\}])( *)([^\n]*)(?:\n(\2)(?:\2)?(?![|!+-\}])( *)([^\n]*)(?:\n(\2)(?:\2)?(?![|!+-\}])( *)([^\n]*))?)?)?)?)?)?)?)?)?/gm,
				regexReplace: '$1\n$2$3$4$6$5$5$6$7$9$8$8$9$10$12$11$11$12$13$15$14$14$15$16$18$17$17$18$19$21$20$20$21$22$24$23$23$24$25$27$26$26$27$28$30$29$29$30$31' }}}, {
		
		type: 'button',
		label: 'Mettre une cellule par ligne',
		icon: '//upload.wikimedia.org/wikipedia/commons/thumb/3/33/Farm-Fresh_table_chart.png/22px-Farm-Fresh_table_chart.png',
		action:	{
			type: 'encapsulate',
			options: {
				regex: / *([|!])\1 */g,
				regexReplace: '\n$1 ' }}}
	]
});
	
$('#wpTextbox1').wikiEditor('addToToolbar',
{
	section: 'table',
	group: 'style',
	tools: [ {
		type: 'button',
		label: 'Ajouter/convertir width vers propriété CSS width:',
		icon: '//upload.wikimedia.org/wikipedia/commons/thumb/2/21/Farm-Fresh_merge_cells.png/22px-Farm-Fresh_merge_cells.png',
		action:	{
			type: 'encapsulate',
			options: {
				peri: 'style="width:100%;"',
				regex: /width=\"?(\d+(?:px|%))\"?/g,
				regexReplace: 'style="width:$1;"' }}}, {
		
		type: 'button',
		label: 'Ajouter/convertir align vers propriété CSS text-align:',
		icon: '//upload.wikimedia.org/wikipedia/commons/thumb/f/f2/Farm-Fresh_table_select_row.png/22px-Farm-Fresh_table_select_row.png',
		action:	{
			type: 'encapsulate',
			options: {
				peri: 'style="text-align:center;"',
				regex: /align=\"?(left|center|right|justify)\"?/g,
				regexReplace: 'style="text-align:$1;"' }}}, {
		
		type: 'button',
		label: 'Ajouter/convertir bgcolor vers propriété CSS background:',
		icon: '//upload.wikimedia.org/wikipedia/commons/thumb/8/8f/Farm-Fresh_table_heatmap_cell.png/22px-Farm-Fresh_table_heatmap_cell.png',
		action:	{
			type: 'encapsulate',
			options: {
				peri: 'style="background:XXX;"',
				regex: /bgcolor=\"?([a-zA-Z]+|#[0-9A-Fa-f]+)\"?/g,
				regexReplace: 'style="background:$1;"' }}}, {
		
		type: 'button',
		label: 'Fusionner les différents attributs style=""',
		icon: '//upload.wikimedia.org/wikipedia/commons/thumb/f/f4/Farm-Fresh_query_design.png/22px-Farm-Fresh_query_design.png',
		action:	{
			type: 'encapsulate',
			options: {
				regex: / *style=\"([^\"|!\n]+)\"([^|!\n]*?) *style=\"([^\"|!\n]+)\"/g,
				regexReplace: '$2 style="$1 $3"' }}}
	]
});



$('#wpTextbox1').wikiEditor('addToToolbar',
{
	sections: {
		'menu-autres': {
			type: 'booklet',
			label: 'Menu autres',
			pages: {
				'syntaxhighlight': { label: 'SyntaxHighlight', layout: 'characters' },
				'documentation': { label: 'Documentation', layout: 'characters' }
	}}},
	
	section: 'menu-autres',
	page: 'syntaxhighlight',
	characters: [ {
		label: '<syntaxhighlight lang="xxx">',
		action: {
			type: 'encapsulate',
			options: {
				pre: '<syntaxhighlight lang="xxx">\n',
				post: '\n</syntaxhighlight>',
				regex: /(?:<code><nowiki>|<code>|<pre>)([\D\d]+?)(?:<\/pre>|<\/nowiki><\/code>|<\/code>)/g,
				regexReplace: '<syntaxhighlight lang="xxx">\n$1\n</syntaxhighlight>' }}}, {
		
		label: '<syntaxhighlight lang="xxx" inline>',
		action: {
			type: 'encapsulate',
			options: {
				pre: '<syntaxhighlight lang="xxx" inline>',
				post: '</syntaxhighlight>',
				regex: /(?:<code><nowiki>|<code>|<pre>)([\D\d]+?)(?:<\/pre>|<\/nowiki><\/code>|<\/code>)/g,
				regexReplace: '<syntaxhighlight lang="xxx" inline>$1</syntaxhighlight>' }}}, {
		
		label: '<syntaxhighlight lang="xxx" line>',
		action: {
			type: 'encapsulate',
			options: {
				pre: '<syntaxhighlight lang="xxx" line>\n',
				post: '\n</syntaxhighlight>',
				regex: /(?:<code><nowiki>|<code>|<pre>)([\D\d]+?)(?:<\/pre>|<\/nowiki><\/code>|<\/code>)/g,
				regexReplace: '<syntaxhighlight lang="xxx" line>\n$1\n</syntaxhighlight>' }}}, {
		
		label: '<syntaxhighlight lang="xxx" highlight="">',
		action: {
			type: 'encapsulate',
			options: {
				pre: '<syntaxhighlight lang="xxx" highlight="x,x-x">\n',
				post: '\n</syntaxhighlight>',
				regex: /(?:<code><nowiki>|<code>|<pre>)([\D\d]+?)(?:<\/pre>|<\/nowiki><\/code>|<\/code>)/g,
				regexReplace: '<syntaxhighlight lang="xxx" highlight="">\n$1\n</syntaxhighlight>' }}}, {
		
		label: '<syntaxhighlight lang="xxx" line start="x">',
		action: {
			type: 'encapsulate',
			options: {
				pre: '<syntaxhighlight lang="xxx" line start="x">\n',
				post: '\n</syntaxhighlight>',
				regex: /(?:<code><nowiki>|<code>|<pre>)([\D\d]+?)(?:<\/pre>|<\/nowiki><\/code>|<\/code>)/g,
				regexReplace: '<syntaxhighlight lang="xxx" line start="x">\n$1\n</syntaxhighlight>' }}}
	]
});

$('#wpTextbox1').wikiEditor('addToToolbar',
{
	section: 'menu-autres',
	page: 'documentation',
	characters: [ {
		label: '{{Méta cadre}} pour exemple',
		action: {
			type: 'encapsulate',
			options: {
				pre: '{{Méta cadre\n | fond    = #F8FFF8\n | contenu = ',
				peri: 'EXEMPLE',
				post: '\n}}',
				regex: /^\s*(.+?)\s*?(\n)?$/s,
				regexReplace: '{{Méta cadre\n | fond    = #F8FFF8\n | contenu = $1\n}}$2',
				ownline: true }}}, {
		
		label: 'VIDE',
		action: {
			type: 'encapsulate',
			options: {
				pre: 'VIDE',
				post: 'VIDE' }}}
	]
});
};
// </nowiki>