Advertisement
Guest User

KOD 1 OKNA!

a guest
Apr 9th, 2020
210
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <script type='text/javascript'>
  2. function send(){
  3.  var res = '';
  4.  var text = document.getElementById('text').value;
  5.  var transl = {А:'A', а:'a', Б:'B', б:'b', В:'V', в:'v', Г:'G', г:'g',
  6.  Д:'D', д:'d', Е:'E', е:'e', Ё:'Yo', ё:'yo', Ж:'Zh', ж:'zh', З:'Z', з:'z',
  7.  И:'I', и:'i', Й:'J', й:'j', К:'K', к:'k', Л:'L', л:'l', М:'M', м:'m',
  8.  Н:'N', н:'n', О:'O', о:'o', П:'P', п:'p', Р:'R', р:'r', С:'S', с:'s',
  9.  Т:'T', т:'t', У:'U', у:'u', Ф:'F', ф:'f', Х:'X', х:'x', Ц:'Cz', ц:'cz',
  10.  Ч:'Ch', ч:'ch', Ш:'Sh', ш:'sh', Щ:'Shh', щ:'shh', Ъ:'"', ъ:'"', Ы:'Y\'', ы:'y\'',
  11.  Ь:'\'', ь:'\'', Э:'E\'', э:'e\'', Ю:'Yu', ю:'yu', Я:'Ya', я:'ya', ' ':'_'};
  12.  
  13.  for(i=0;i<text.length;i++) {
  14.     if(transl[text[i]]!=undefined) res += transl[text[i]];
  15.     else res += text[i];
  16.  }
  17.  res = res.replace(/Cz(?=i|e|y|j|I|E|Y|J)/g, "C");
  18.  res = res.replace(/cz(?=i|e|y|j|I|E|Y|J)/g, "c");
  19.  document.getElementById('text').value = res;
  20. }
  21. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement