Difference between revisions 237200 and 237224 on ptwikibooks/** * TemplateScript * Adds a menu of configurable templates and scripts to the sidebar * @author: [[m:user:Pathoschild]] ([[meta:User:Pathoschild/Scripts/TemplateScript]]) * @author: [[User:Helder.wiki]] (this configuration file) * @tracking: [[Special:GlobalUsage/User:Helder.wiki/Tools/TemplateScript.js]] ([[File:User:Helder.wiki/Tools/TemplateScript.js]]) */ /*global jQuery, mediaWiki, LanguageConverter, pathoschild */ (contracted; show full)SeaGreen|SlateBlue|SpringGreen|Turquoise|VioletRed)|MidnightBlue|MintCream|MistyRose|Moccasin|NavajoWhite|Navy|OldLace|Olive(?:Drab)?|Orange(?:Red)?|Orchid|Pale(?:GoldenRod|Green|Turquoise|VioletRed)|PapayaWhip|PeachPuff|Peru|Pink|Plum|PowderBlue|Purple|Red|RosyBrown|RoyalBlue|SaddleBrown|Salmon|SandyBrown|SeaGreen|SeaShell|Sienna|Silver|SkyBlue|Slate(?:Blue|Gray|Grey)|Snow|SpringGreen|SteelBlue|Tan|Teal|Thistle|Tomato|Turquoise|Violet|Wheat|White(?:Smoke)?|Yellow(?:Green)?)', colorCodes = '(?: \\#?(?:[a-f0-9]{6}|[a-f0-9]{3}))'; oldText = context.$target.val(); list = [{ find: new RegExp( '<font\\s+color\\s*=\\s*(["\']?)(' + colorNames + '|' + colorCodes + ')\\1\\s*>(\\s*\\[\\[[^\\|\\]]+\\|)([^\\]]+)(\\]\\]\\s*)<\\/font>', 'gi' ), replace: '$3<span style="color:$2;">$4</span>$5' },{ find: new RegExp( '<font\\s+color\\s*=\\s*(["\']?)\\#?(' + colorCodes + ')\\1\\s*>(\\s*\\[\\[[^\\|\\]]+\\|)([^\\]]+)(\\]\\]\\s*)<\\/font>', 'gi' ), replace: '$3<span style="color:#$2;">$4</span>$5' },{ find: new RegExp(⏎ '<font\\s+color\\s*=\\s*(["\']?)(' + colorNames + '|' + colorCodes + ')\\1\\s*>(.+?)<\\/font>', 'gi' ), replace: '<span style="color:$2;">$3</span>' },{ find: new RegExp( '<font\\s+color\\s*=\\s*(["\']?)\\#?(' + colorCodes + ')\\1\\s*>(.+?)<\\/font>', 'gi' ), replace: '<span style="color:#$2;">$3</span>'⏎ }]; regex( context, list, '-código HTML obsoleto' ); } function fixHTTPLinks( context ){ var relativeLink = '[$1]', // TODO: Converter links do servidor antigo (https://secure.wikimedia.org/wikipedia/pt) // Ver também: [[Special:SiteMatrix]], [[meta:User:Nemo bis/HTTPS]] (contracted; show full) script: usingRegex }); } } $.getScript( '//meta.wikimedia.org/w/index.php?title=User:Pathoschild/Scripts/TemplateScript/dev.js&action=raw&ctype=text/javascript&smaxage=21600&maxage=86400', loadMyRegexTools ); }( jQuery, mediaWiki ) ); All content in the above text box is licensed under the Creative Commons Attribution-ShareAlike license Version 4 and was originally sourced from https://pt.wikibooks.org/w/index.php?diff=prev&oldid=237224.
![]() ![]() This site is not affiliated with or endorsed in any way by the Wikimedia Foundation or any of its affiliates. In fact, we fucking despise them.
|