1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50
| <html>
<body onLoad="document.form.input.focus();">
<head>
<title>Mon bot</title>
<script type="text/javascript">
// Remplace toutes les occurences d'une chaîne
function replaceAll(str, search, repl) {
while (str.indexOf(search) != -1)
str = str.replace(search, repl);
return str;
}
// Remplace les caractères accentués
function AccentToNoAccent(str) {
alert('avant: '+str);
var norm = new Array('À','Á','Â','Ã','Ä','Å','Æ','Ç','È','É','Ê','Ë',
'Ì','Í','Î','Ï', 'Ð','Ñ','Ò','Ó','Ô','Õ','Ö','Ø','Ù','Ú','Û','Ü','Ý',
'Þ','ß', 'à','á','â','ã','ä','å','æ','ç','è','é','ê','ë','ì','í','î',
'ï','ð','ñ', 'ò','ó','ô','õ','ö','ø','ù','ú','û','ü','ý','ý','þ','ÿ');
var spec = new Array('A','A','A','A','A','A','A','C','E','E','E','E',
'I','I','I','I', 'D','N','O','O','O','0','O','O','U','U','U','U','Y',
'b','s', 'a','a','a','a','a','a','a','c','e','e','e','e','i','i','i',
'i','d','n', 'o','o','o','o','o','o','u','u','u','u','y','y','b','y');
for (var i = 0; i < spec.length; i++)
str = replaceAll(str, norm[i], spec[i]);
alert('après: '+str);
return str;
}
</script>
</head>
<div id="titre" style="text-align:center;">Mon bot</div>
<div id="output">
<font class="output"></font>
</div>
<div id="input">
<form method="POST" name="form">
<input type="hidden" name="botcust2" value="df23192518a841a5">
dis: <input type="TEXT" autocomplete="off" name="input">
</form>
</div>
<script>
// var out = document.getElementById("output");
var count_output = document.getElementsByTagName("font");
var output = document.getElementsByTagName("font")[0].innerHTML;
alert(count_output.length+"\n"+output);
document.getElementsByTagName("font")[0].innerHTML = AccentToNoAccent(output);
</script>
</body>
</html> |
Partager