Source

cyrs60v5 / Russian Keyboard.htm

Full commit
<html>
<head>
<meta name="Author" content="RussianKeyboard.com">
<meta content="text/html; charset=windows-1251" 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',',','.','/','\\','Rus/Lat','Undo',' ','Clear');
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','<','>','?','|','Rus/Lat','Undo',' ','Clear');
var r_letter = new Array('�','1','2','3','4','5','6','7','8','9','0','-','=','�','�','�','�','�','�','�','�','�','�','�','�','BackSpace','Shift','�','�','�','�','�','�','�','�','�','�','�','Enter','CapsLock','�','�','�','�','�','�','�','�','�','.','\\','Rus/Lat','Undo',' ','Clear');
var rb_letter = new Array('�','!','"','�',';','%',':','?','*','(',')','_','+','�','�','�','�','�','�','�','�','�','�','�','�','BackSpace','Shift','�','�','�','�','�','�','�','�','�','�','�','Enter','CapsLock','�','�','�','�','�','�','�','�','�',',','\\','Rus/Lat','Undo',' ','Clear');
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,0,0,3,3,3,3);
var letter = new Array(l_letter, lb_letter, r_letter, rb_letter);
var dec1 = new Array(1040,1041,1062,1044,1045,1060,1043,1061,1048,1049,1050,1051,1052,1053,1054,1055,1070,1056,1057,1058,1059,1042,1065,1061,1067,1047,1072,1073,1094,1076,1077,1092,1075,1093,1080,1081,1082,1083,1084,1085,1086,1087,1102,1088,1089,1090,1091,1074,1097,1093,1099,1079,1100,1098);
var dec2 = new Array(1071,1041,1063,1044,1069,1060,1046,1065,1048,1049,1050,1051,1052,1053,1025,1055,1070,1056,1064,1058,1070,1042,1065,1061,1067,1046,1103,1073,1095,1076,1101,1092,1078,1097,1080,1081,1082,1083,1084,1085,1105,1087,1102,1088,1096,1090,1102,1074,1097,1093,1099,1078,1068,1066);
var dec3 = new Array(1060,1048,1057,1042,1059,1040,1055,1056,1064,1054,1051,1044,1068,1058,1065,1047,1049,1050,1067,1045,1043,1052,1062,1063,1053,1071,1092,1080,1089,1074,1091,1072,1087,1088,1096,1086,1083,1076,1100,1090,1097,1079,1081,1082,1099,1077,1075,1084,1094,1095,1085,1103,1093,1098,1078,1101,1073,1102,46,1061,1066,1046,1069,1041,1070,44,1105,1025);
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 saveres()
{
 if(savemode == 0 || savemode == 1) op.document.forms[formname].elements[textname].value = document.keyb.text.value;
 else if (savemode == 2) op.document.forms[formname].elements[textname].value = op.document.forms[formname].elements[textname].value + document.keyb.text.value;
 else if (savemode == 3) op.document.forms[formname].elements[textname].value = document.keyb.text.value + op.document.forms[formname].elements[textname].value;
 
 window.close(); 
 return false;
}

function clr()
{
 undotext = document.keyb.text.value;
 document.keyb.text.value = "";

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

function undo()
{
 var s;
 s = document.keyb.text.value;
 document.keyb.text.value = undotext;
 undotext = s;

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

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 delLetter()
{
 var str = new String(document.keyb.text.value); 
 var del=1;
 if(str.charAt(str.length-1) == '\n') del=2;
 document.keyb.text.value = str.substr(0, str.length-del);

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

function addLetter(but)
{
 var chr = but.value;
 if( chr == 'Enter' ) chr='\n';
 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 decode()
{
 if((document.keyb.decflag.type != "select-one") || (document.keyb.decflag.value == 0)) return true;

 var code = event.keyCode, i = -1;
 
 if(code >= 65 && code <=90) i = code - 65;
 else if(code >= 97 && code <=122) i = code - 71;

 if(document.keyb.decflag.value == 1)
 {
  if(i == -1)
   switch (code)
   {
    case 91:  i = 52; break;
    case 93:  i = 53; break;
    case 39:  apostr = !apostr; return !apostr;
   }	

  if(i != -1) event.keyCode = (apostr)?dec2[i]:dec1[i];
  apostr = false;
 }
 else
 {
  if(i == -1)
   switch (code)
   {
    case 91:  i = (capslock)?59:52; break;
    case 93:  i = (capslock)?60:53; break;
    case 59:  i = (capslock)?61:54; break;
    case 39:  i = (capslock)?62:55; break;
    case 44:  i = (capslock)?63:56; break;
    case 46:  i = (capslock)?64:57; break;
    case 47:  i = 58; break;
    case 123: i = (capslock)?52:59; break;
    case 125: i = (capslock)?53:60; break;
    case 58:  i = (capslock)?54:61; break;
    case 34:  i = (capslock)?55:62; break;
    case 60:  i = (capslock)?56:63; break;
    case 62:  i = (capslock)?57:64; break;
    case 63:  i = 65; break;
    case 96:  i = (capslock)?67:66; break;
    case 126: i = (capslock)?66:67; break;
   }
  else
  {
   if(i < 26) capslock = !event.shiftKey;
   else capslock = event.shiftKey;
  }  
  if(i != -1) event.keyCode = dec3[i];

 }
 return true;

}

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=590 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" onKeyPress="return decode();"></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>
<input type=button value="" onClick="return undo();" width=80 class=b80>
<input type=button value="" onClick="return addLetter(this);" width=300 class=b300>
<input type=button value="" onClick="return clr();" width=80 class=b80>
</font>

<script>
var sag = new String(navigator.userAgent);
if(navigator.appName == "Microsoft Internet Explorer" && sag.indexOf("pera") == -1) document.write("<font class='mes'>��������� ������� ���� �� ����������: <select name='decflag' onChange='return cfocus();' style='font-size:10px;'><option value=0>�����������<option value=1 selected>��������<option value=2>������������</select>&nbsp;&nbsp;&nbsp;&nbsp;<a href='rules.html' onClick=\"document.keyb.text.focus(); window.open('rules.html','keybrules','height=440,width=420,toolbar=no,menubar=no,location=no,scrollbars=no,focus=yes,top=100,left=270'); return false;\" class='mes'>������� ������</a></font><br>");
else document.write("<input type=hidden name='decflag' value=''>");
</script>

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

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

<script><!--
init();
// --></script>

</body>
</html>