User:DarthPhallus: Difference between revisions

3,474 editsJoined 5 November 2021
No edit summary
No edit summary
Line 13: Line 13:
** https://www.mediawiki.org/wiki/Template:If
** https://www.mediawiki.org/wiki/Template:If
** https://en.wikipedia.org/wiki/Help:Conditional_expressions#Using_#if
** https://en.wikipedia.org/wiki/Help:Conditional_expressions#Using_#if
* Regex for find and replace of GGST Move Cards:
** Find: <pre><div class="attack-container">(.|\n)+?\|\}((.|\n)+?)\{\{CloseCard\}\}</pre>
** Replace: <pre>{{GGST Move Card
|input=
|description=
$2
}}</pre>


<div class="mw-collapsible mw-collapsed">
<div class="mw-collapsible mw-collapsed">

Revision as of 16:04, 2 September 2022

Sandbox 1: User:DarthPhallus/Sandbox

Sandbox 2: User:DarthPhallus/Sandbox 2

Useful Dustloop Stuff

|input= |description= $2 }}


Input Coloring script

<!DOCTYPE html> <html> <body style="background-color:#333333"> <script> function ColorText(){ const str = document.getElementById("textFromUser").value; const regex = [ /(?<![\]\#\"\%\=\{{clr|[0-9]|\{{clr|L|])(\bd.L+\b|\bd.[0-9]+L+\b|\bj.L+\b|\bc.L+\b|\bf.L+\b|\bj.[0-9]+L+\b(?!})|\bfl.[0-9]+L+\b(?!})|\[[0-9]+\][0-9]+L\b(?!})|\b[0-9]+\[L\](?!})|\bj.[0-9]+\[L\](?!})|[0-9]+L+\b(?!})|L+\b(?=\+)|\b(?<=[\`\~\/])L\b(?!\")|\b(?<=[\+\'\~])\bL+\b(?!\"))(?!\.[L-z]+)(?![\"\}}])/gm , /(?<![\]\#\"\%\=\{{clr|[0-9]|\{{clr|M|])(\bd.M+\b|\bd.[0-9]+M+\b|\bj.M+\b|\bc.M+\b|\bf.M+\b|\bj.[0-9]+M+\b(?!})|\bfl.[0-9]+M+\b(?!})|\[[0-9]+\][0-9]+M\b(?!})|\b[0-9]+\[M\](?!})|\bj.[0-9]+\[M\](?!})|[0-9]+M+\b(?!})|M+\b(?=\+)|\b(?<=[\`\~\/])M\b(?!\")|\b(?<=[\+\'\~])\b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\[[0-9]+\][0-9]+A2\b(?!})|\b[0-9]+\[A2\](?!})|[0-9]+A2+\b(?!})|A2+\b(?=\+)|\b(?<=[\`\~\/])A2\b(?!\")|\b(?<=[\+\'\~])\bA2+\b(?!\"))(?!\.[A2-z]+)(?![\"\}}])/gm ]; const subst = [ `{{clr|L|$1}}` , `{{clr|M|$1}}` , `{{clr|H|$1}}` , `{{clr|S|$1}}` , `{{clr|A1|$1}}` , `{{clr|A2|$1}}` ]; var result=str; for (i = 0; i < regex.length; i++) { result = result.replace(regex[i], subst[i]);} navigator.clipboard.writeText(result); document.getElementById("textFromUser").value = ""; } </script> <h1 style="white-space: pre-wrap; color:white"><span style="font-size:50px">This is to convert Wiki from<br>non-colored inputs to colored inputs.</span><br> Copy and paste the text in here, click "Convert Text", and the color coded text will automatically be saved to your clipboard. Just paste it over the non-colored text and save changes. Remember: This will cover MOST cases, but not all. Before saving changes, manually review it with "Show Preview". This will work for: UMvC3 Adapted from Wakeup720's script for Dustloop Wiki</h1> <textarea id="textFromUser" style="white-space: pre-wrap" rows="20" cols="80"></textarea><br> <button id="TextFromUserButton" onclick="ColorText()">Convert Text</button> </body> </html>