Difference between revisions 271760 and 271764 on ptwikibooks

/**
 * TemplateScript
 * Adds a menu of configurable templates and scripts to the sidebar
 * @author: [[m:user:Pathoschild]] ([[meta:User:Pathoschild/Scripts/TemplateScript]])
 * @update-token: [[File:pathoschild/templatescript.js]]
 * @author: [[User:Helder.wiki]] (this configuration file)
 * @tracking: [[Special:GlobalUsage/User:Helder.wiki/Tools/TemplateScript.js]] ([[File:User:Helder.wiki/Tools/TemplateScript.js]])
 */
(contracted; show full)		find: /<tt>(.+?)<\/tt>/g,
		replace: '<code>$1</code>'
	},{
		// <center>...</center>
		find: /<center>(.+?)<\/center>/g,
		replace: '<div style="text-align: center;">$1</div>'
	},{

		// <big>...</big>
		find: /<big>(.+?)<\/big>/g,
		replace: '<div style="font-size: larger;">$1</div>'
	},{
		find: /\n\|-\s*bgcolor\s*=\s*#([0-9a-f]{6}|[0-9a-f]{3})\s*\n/gi,
		replace: '\n|- style="background: #$1;"\n'
	}];
	regex( context, list, '-código HTML obsoleto' );
	if( oldText !== context.$target.val() ){
		oldText = context.$target.val();
		regex( context, {
			// Simplify color hex codes
(contracted; show full)			script: usingRegex
		});
	}
}

$.getScript('//tools.wmflabs.org/pathoschild-contrib/scripts/pathoschild.templatescript.js', loadMyRegexTools );

}( mediaWiki, jQuery ) );