implemented multiple characters CY

master
Boyana 2 years ago
parent f1a6c66fa5
commit 797b6969ba

@ -33,11 +33,54 @@
</tr>
</table>
</body>
<!-- adding the js converter function -->
<script>
var d = {
'a': 'a',
'b': 'b',
'c': 'ts',
'd': 'd',
'e': 'e',
'f': 'f',
'g': 'g',
'h': 'h',
'i': 'i',
'k': 'k',
'l': 'l',
'm': 'm',
'n': 'n',
'o': 'o',
'p': 'p',
'q': 'ya',
'r': 'r',
's': 's',
't': 't',
'u': 'u',
'v': 'dzh',
'w': 'v',
'y': 'y',
'z': 'zh',
'`': 'ch',
']': 'sht',
'[': 'sh',
'|': 'yu',
}
function convert(){
event.preventDefault();
var charles = document.getElementById("input").value;
console.log(charles,charles.charCodeAt(0).toString(2),charles.charCodeAt(0).toString(16),charles.charCodeAt(0).toString(10));
var charlesBinary="";
var charlesHex="";
var charlesDc="";
var charlesCY="";
for (var i=0;i<charles.length;i++){
console.log(i,charles.charCodeAt(i));
charlesBinary=charlesBinary+charles.charCodeAt(i).toString(2);
charlesHex=charlesHex+charles.charCodeAt(i).toString(16);
charlesDc=charlesDc+charles.charCodeAt(i).toString(10);
charlesCY=charlesCY+d[charles[i]];
}
console.log(charles,charlesBinary,charlesHex,charlesDc,charlesCY);
}
</script>
</html>

Loading…
Cancel
Save