Source

cyrs60v5 / Russian Keyboard.htm

<html>
<head>
<meta name="Author" content="RussianKeyboard.com">
<meta content="text/html; charset=utf8" http-equiv="Content-Type">
<title>Russian Keyboard Online @ RussianKeyboard.com</title>
</head>

<style>
.b30 { color=black; width: 30px; background-color: #CCCCCC; font-family: Tahoma, Arial; font-size: 12px;}
.b80 { color=black; width: 80px; background-color: #CCCCCC; font-family: Tahoma, Arial; font-size: 12px;}
.b100 { color=black; width: 100px; background-color: #CCCCCC; font-family: Tahoma, Arial; font-size: 12px;}
.b300 { color=black; width: 300px; background-color: #CCCCCC; font-family: Tahoma, Arial; font-size: 12px;}
.com {color: white; font-family: Tahoma, Arial; font-size: 12px;}
.mes {color: black; font-family: Tahoma, Arial; font-size: 11px;}
</style>

<script>
var l_letter = new Array('`','1','2','3','4','5','6','7','8','9','0','-','=','q','w','e','r','t','y','u','i','o','p','[',']','BackSpace','Shift','a','s','d','f','g','h','j','k','l',';',"'",'Enter','CapsLock','z','x','c','v','b','n','m',',','.');
var lb_letter = new Array('~','!','@','#','$','%','^','&','*','(',')','_','+','Q','W','E','R','T','Y','U','I','O','P','{','}','BackSpace','Shift','A','S','D','F','G','H','J','K','L',':','"','Enter','CapsLock','Z','X','C','V','B','N','M','<','>');
var r_letter = new Array('ё','1','2','3','4','5','6','7','8','9','0','-','=','й','ц','у','к','е','н','г','ш','щ','з','х','ъ','BackSpace','Shift','ф','ы','в','а','п','р','о','л','д','ж','э','Enter','CapsLock','я','ч','с','м','и','т','ь','б','ю');
var rb_letter = new Array('Ё','!','"','№',';','%',':','?','*','(',')','_','+','Й','Ц','У','К','Е','Н','Г','Ш','Щ','З','Х','Ъ','BackSpace','Shift','Ф','Ы','В','А','П','Р','О','Л','Д','Ж','Э','Enter','CapsLock','Я','Ч','С','М','И','Т','Ь','Б','Ю');
var ltype = new Array(2,0,0,0,0,0,0,0,0,0,0,0,0,3,3,3,3,3,3,3,3,3,3,2,2,3,3,3,3,3,3,3,3,3,3,3,2,2,3,3,3,3,3,3,3,3,3,2,2);
var letter = new Array(l_letter, lb_letter, r_letter, rb_letter);

var off = 1;
var keymode = 2;
var savemode = 0;
var qn = 55;
var shift = false;
var capslock = false;
var apostr = false;
var formname = "", textname = "";
var undotext = "";
var op;
var par = new String(location.search);

function changeLetter(n)
{
 var i;

 if((n != 5) && shift) keymode ^=1;
 keymode ^= n & 3;
 shift = ((n == 5) && !shift);
  
 for(i=0;i<qn;i++) document.keyb.elements[i+off].value = letter[(shift)?(keymode | (((ltype[i] >> (keymode >> 1)) & 1)^1)):(keymode & ((ltype[i] >> (keymode >> 1)) | 2))][i];

 document.keyb.text.focus(); 
 return false;
}

function addLetter(but)
{
 var chr = but.value;
 document.keyb.text.value += chr;
 if(shift)
 {
  shift=false;
  changeLetter(1);  
 } 

<!--  document.keyb.text.focus(); -->
 return false;
}

function getpar(parname)
{
 var j,k;
 j = par.indexOf(parname + "=")
 if(j == -1) return null;
 k = par.indexOf("&", j + parname.length + 1);
 return par.substring(j + parname.length + 1, (k == -1) ? par.length : k);
}

function init()
{
 var i, s;
 var domain;

 if((s=getpar("form")) != null) formname = s; 
 if((s=getpar("text")) != null) textname = s; 
 if((s=getpar("savemode")) != null)
 {
  savemode = parseInt(s);
  if(isNaN(savemode) || savemode < 0 || savemode > 3) savemode = 0;
 }
 if((s=getpar("keymode")) != null) 
 {
  keymode = parseInt(s);
  if(isNaN(keymode) || keymode < 0 || keymode > 3) keymode = 2;
 }
 
 undotext = document.keyb.text.value;
 
 changeLetter(0);
 return false;
}

function cfocus()
{
 document.keyb.text.focus(); 
 return true;
}

</script>

<body bgcolor="#FFFFFF" leftmargin=4 topmargin=4 marginwidth=4 marginheight=4>


<table width=100% height=100% cellpadding=0 cellspacing=0 border=0>
<form name="keyb"><tr><td align=left valign=top>

<table width=100% cellspacing=0 cellpadding=1 border=0 bgcolor="#CCCCCC"><tr><td>
<table width=100% cellspacing=0 cellpadding=10 border=0 bgcolor="#F7F7F7"><tr><td align=center>
<textarea rows=5 cols=68 name="text" wrap="physical"></textarea>

<br>

<font size=-1>
<input type=button value="" onClick="return addLetter(this);" width=30 class=b30>
<input type=button value="" onClick="return addLetter(this);" width=30 class=b30>
<input type=button value="" onClick="return addLetter(this);" width=30 class=b30>
<input type=button value="" onClick="return addLetter(this);" width=30 class=b30>
<input type=button value="" onClick="return addLetter(this);" width=30 class=b30>
<input type=button value="" onClick="return addLetter(this);" width=30 class=b30>
<input type=button value="" onClick="return addLetter(this);" width=30 class=b30>
<input type=button value="" onClick="return addLetter(this);" width=30 class=b30>
<input type=button value="" onClick="return addLetter(this);" width=30 class=b30>
<input type=button value="" onClick="return addLetter(this);" width=30 class=b30>
<input type=button value="" onClick="return addLetter(this);" width=30 class=b30>
<input type=button value="" onClick="return addLetter(this);" width=30 class=b30>
<input type=button value="" onClick="return addLetter(this);" width=30 class=b30>
<br>
<input type=button value="" onClick="return addLetter(this);" width=30 class=b30>
<input type=button value="" onClick="return addLetter(this);" width=30 class=b30>
<input type=button value="" onClick="return addLetter(this);" width=30 class=b30>
<input type=button value="" onClick="return addLetter(this);" width=30 class=b30>
<input type=button value="" onClick="return addLetter(this);" width=30 class=b30>
<input type=button value="" onClick="return addLetter(this);" width=30 class=b30>
<input type=button value="" onClick="return addLetter(this);" width=30 class=b30>
<input type=button value="" onClick="return addLetter(this);" width=30 class=b30>
<input type=button value="" onClick="return addLetter(this);" width=30 class=b30>
<input type=button value="" onClick="return addLetter(this);" width=30 class=b30>
<input type=button value="" onClick="return addLetter(this);" width=30 class=b30>
<input type=button value="" onClick="return addLetter(this);" width=30 class=b30>
<input type=button value="" onClick="return delLetter();" width=80 class=b80>
<br>
<input type=button value="" onClick="return changeLetter(5);" width=80 class=b80>
<input type=button value="" onClick="return addLetter(this);" width=30 class=b30>
<input type=button value="" onClick="return addLetter(this);" width=30 class=b30>
<input type=button value="" onClick="return addLetter(this);" width=30 class=b30>
<input type=button value="" onClick="return addLetter(this);" width=30 class=b30>
<input type=button value="" onClick="return addLetter(this);" width=30 class=b30>
<input type=button value="" onClick="return addLetter(this);" width=30 class=b30>
<input type=button value="" onClick="return addLetter(this);" width=30 class=b30>
<input type=button value="" onClick="return addLetter(this);" width=30 class=b30>
<input type=button value="" onClick="return addLetter(this);" width=30 class=b30>
<input type=button value="" onClick="return addLetter(this);" width=30 class=b30>
<input type=button value="" onClick="return addLetter(this);" width=30 class=b30>
<input type=button value="" onClick="return addLetter(this);" width=100 class=b100>
<br>
<input type=button value="" onClick="return changeLetter(1);" width=80 class=b80>
<input type=button value="" onClick="return addLetter(this);" width=30 class=b30>
<input type=button value="" onClick="return addLetter(this);" width=30 class=b30>
<input type=button value="" onClick="return addLetter(this);" width=30 class=b30>
<input type=button value="" onClick="return addLetter(this);" width=30 class=b30>
<input type=button value="" onClick="return addLetter(this);" width=30 class=b30>
<input type=button value="" onClick="return addLetter(this);" width=30 class=b30>
<input type=button value="" onClick="return addLetter(this);" width=30 class=b30>
<input type=button value="" onClick="return addLetter(this);" width=30 class=b30>
<input type=button value="" onClick="return addLetter(this);" width=30 class=b30>
<input type=button value="" onClick="return addLetter(this);" width=30 class=b30>
<input type=button value="" onClick="return addLetter(this);" width=30 class=b30>
<input type=button value="" onClick="return changeLetter(2);" width=80 class=b80>
<br>
<!-- changeletter:
1 - capslock
2 - rus/lat 
5 - shift
-->

</td></tr></table>
</td></tr></table>

</td></tr></form></table>

<script>
init();
</script>

</body>
</html>