Commits

Pavlo Shchelokovskyy committed 8ac198a

cleaned unneded variables for simplified original code

  • Participants
  • Parent commits 276f290

Comments (0)

Files changed (1)

Russian Keyboard.htm

 </style>
 
 <script>
-var l_letter = new Array('`','3','q','w','e','r','t','y','u','i','o','p','[',']','a','s','d','f','g','h','j','k','l',';',"'",'z','x','c','v','b','n','m',',','.','/','Shift','CapsLock',' ');
-var lb_letter = new Array('~','#','Q','W','E','R','T','Y','U','I','O','P','{','}','A','S','D','F','G','H','J','K','L',':','"','Z','X','C','V','B','N','M','<','>','?','Shift','CapsLock',' ');
-var r_letter = new Array('ё',"'",'й','ц','у','к','е','н','г','ш','щ','з','х','ъ','ф','ы','в','а','п','р','о','л','д','ж','э','я','ч','с','м','и','т','ь','б','ю','.','Shift','CapsLock',' ');
-var rb_letter = new Array('Ё','№','Й','Ц','У','К','Е','Н','Г','Ш','Щ','З','Х','Ъ','Ф','Ы','В','А','П','Р','О','Л','Д','Ж','Э','Я','Ч','С','М','И','Т','Ь','Б','Ю',',','Shift','CapsLock',' ');
-var ltype = new Array(2,0,3,3,3,3,3,3,3,3,3,3,2,2,3,3,3,3,3,3,3,3,3,2,2,3,3,3,3,3,3,3,2,2,0,3,3,3);
+var l_letter = new Array('`','3','q','w','e','r','t','y','u','i','o','p','[',']','a','s','d','f','g','h','j','k','l',';',"'",'z','x','c','v','b','n','m',',','.','/','SHIFT',' ');
+var lb_letter = new Array('~','#','Q','W','E','R','T','Y','U','I','O','P','{','}','A','S','D','F','G','H','J','K','L',':','"','Z','X','C','V','B','N','M','<','>','?','SHIFT',' ');
+var r_letter = new Array('ё',"'",'й','ц','у','к','е','н','г','ш','щ','з','х','ъ','ф','ы','в','а','п','р','о','л','д','ж','э','я','ч','с','м','и','т','ь','б','ю','.','SHIFT',' ');
+var rb_letter = new Array('Ё','№','Й','Ц','У','К','Е','Н','Г','Ш','Щ','З','Х','Ъ','Ф','Ы','В','А','П','Р','О','Л','Д','Ж','Э','Я','Ч','С','М','И','Т','Ь','Б','Ю',',','SHIFT',' ');
+var ltype = new Array(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,3,3,3,3,3,3,3,2,2,3,3,3);
 var letter = new Array(l_letter, lb_letter, r_letter, rb_letter);
 
 var off = 1;
 var keymode = 2;
-var savemode = 0;
-var qn = 38;
+var qn = 37;
 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)
  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;
- if( chr == 'Enter' ) chr='\n';
- document.keyb.text.value += chr;
- if(shift)
- {
-  shift=false;
-  changeLetter(1);  
- } 
-
-<!--  document.keyb.text.focus(); -->
+ document.keyb.text.value += but.value;
  return false;
 }
 
 
 function init()
 {
- var i, s;
- var domain;
+ var s;
 
  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>
 <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 changeLetter(5);" width=80 class=b80>
 <input type=button value="" onClick="return changeLetter(1);" width=80 class=b80>
 <input type=button value="" onClick="return addLetter(this);" width=300 class=b300>
 </font>