PageSourceSearch

https://www.ioerj.com.br/js/teclado.js

js ioerj.com.br collected 2026-09-24 18:46:37 UTC 5,929 bytes, 166 lines download raw bytes

1
2var imgTcd;
3var imgTcdCaps;
4var imgTcdShift;
5var imgTcdCapsShift;
6var vSaida = '';
7var vCampoSenha;
8var vIE;
9
10var indCaps = false;
11var indShift = false;
12var arrTecladoAtivo = new Array();
13
14var arrTeclado = new Array();
15arrTeclado[0] = new Array('\'','1','2','3','4','5','6','7','8','9','0','-','=');
16arrTeclado[1] = new Array('q','w','e','r','t','y','u','i','o','p','´','\[');
17arrTeclado[2] = new Array('a','s','d','f','g','h','j','k','l','ç','~','\]');
18arrTeclado[3] = new Array('','z','x','c','v','b','n','m',',','.',';','/');
19
20var arrTecladoCaps = new Array();
21arrTecladoCaps[0] = new Array('\'','1','2','3','4','5','6','7','8','9','0','-','=');
22arrTecladoCaps[1] = new Array('Q','W','E','R','T','Y','U','I','O','P','´','\[');
23arrTecladoCaps[2] = new Array('A','S','D','F','G','H','J','K','L','Ç','~','\]');
24arrTecladoCaps[3] = new Array('','Z','X','C','V','B','N','M',',','.',';','/');
25
26var arrTecladoShift = new Array();
27arrTecladoShift[0] = new Array('','!','@','#','$','%','¨','&','*','(',')','_','+');
28arrTecladoShift[1] = new Array('Q','W','E','R','T','Y','U','I','O','P','`','\{');
29arrTecladoShift[2] = new Array('A','S','D','F','G','H','J','K','L','Ç','^','\}');
30arrTecladoShift[3] = new Array('|','Z','X','C','V','B','N','M','\<','\>',':','?');
31
32var arrTecladoCapsShift = new Array();
33arrTecladoCapsShift[0] = new Array('','!','@','#','$','%','¨','&','*','(',')','_','+');
34arrTecladoCapsShift[1] = new Array('Q','W','E','R','T','Y','U','I','O','P','`','\{');
35arrTecladoCapsShift[2] = new Array('A','S','D','F','G','H','J','K','L','Ç','^','\}');
36arrTecladoCapsShift[3] = new Array('|','Z','X','C','V','B','N','M','\<','\>',':','?');
37
38function getSaida(){
39    vIE = false;
40    if (document.all || document.getElementById){
41        vIE = true;
42        document.write('<span name="countupie" id="countupie" width="80" height="7"></span>');
43        if(document.getElementById && !document.all){
44            vSaida = document.getElementById("countupie")
45        }else{
46            vSaida = document.all.countupie;
47        }
48    }else{
49        document.write('<ilayer id="countupnsmain" width="80" height="7">')
50        document.write('<layer id="countupnssub" width="80" height="7" left="0" top="0"></layer>')
51        document.write('</ilayer>')
52        vSaida = document.countupnsmain.document.countupnssub.document;
53    }
54}
55
56function setSaida(vpSaida){
57//    var vStrSaisa = '';
58//    for(x=0;x<vpSaida.length;x++)
59//        vStrSaisa = vStrSaisa + '*';
60//    if(vIE){
61//        vSaida.innerHTML = vStrSaisa;
62//    }else{
63//       vSaida.open()
64//        vSaida.write(vStrSaisa)
65//        vSaida.close()
66//   }
67}
68
69function setCampoSenha(vpCampoSenha){
70    vCampoSenha = vpCampoSenha;
71    vCampoSenha.value = ''
72}
73
74function setImgsTeclado(vpImgTcd, vpImgTcdCaps, vpImgTcdShift, vpImgTcdCapsShift){
75    imgTcd = vpImgTcd;
76    imgTcdCaps = vpImgTcdCaps;
77    imgTcdShift = vpImgTcdShift;
78    imgTcdCapsShift = vpImgTcdCapsShift;
79}
80
81function montaTeclado(vpLargura, vpAltura, vpColunas, vpLinhas){
82    var vAlturaLinha;
83    var vLarguraColuna;
84    var x1, x2, y1, y2;
85    arrTecladoAtivo = arrTeclado;
86
87    vAlturaLinha = vpAltura / vpLinhas;
88    vLarguraColuna = vpLargura / vpColunas;
89    document.write('<MAP NAME=\"mapTeclado\">')
90    for(l=0;l<vpLinhas;l++){
91        x1 = l*vAlturaLinha;
92        x2 = (l+1)*vAlturaLinha;
93        //alert('altura: ' + x1 + ' à ' + x2)
94        for(c=0;c<vpColunas;c++){
95            y1 = c*vLarguraColuna;
96            y2 = (c+1)*vLarguraColuna;
97            //alert('largura: ' + y1 + ' à ' + y2)
98            document.write('<AREA NAME=\"topColor\" SHAPE=\"RECT\" ')
99            document.write('      COORDS=\"' + y1 + ',' + x1 + ',' + y2 + ',' + x2 + '\"')
100            document.write('      HREF=\"javaScript:teclado_onClick('+ l +','+ c +')\">')
101        }
102    }
103    document.write('</MAP>')
104}
105
106function replaceTeclado(){
107    if (indCaps && indShift){
108        document.imgTecladoVirtual.src = imgTcdCapsShift;
109        arrTecladoAtivo = arrTecladoCapsShift;
110    }else{
111        if (indCaps){
112            document.imgTecladoVirtual.src = imgTcdCaps;
113            arrTecladoAtivo = arrTecladoCaps;
114        }else{
115            if (indShift){
116                document.imgTecladoVirtual.src = imgTcdShift;
117                arrTecladoAtivo = arrTecladoShift;
118            }else{
119                document.imgTecladoVirtual.src = imgTcd;
120                arrTecladoAtivo = arrTeclado;
121            }
122        }
123    }
124}
125
126function teclado_onClick(vpL, vpC){
127    if(vpL == 4){
128        //verifica a posição do CAPS LOCK
129        if(vpC >= 0 && vpC <= 2){
130            if (indCaps)
131                indCaps = false
132            else
133                indCaps = true;
134            replaceTeclado()
135        }else{
136            //verifica a posição do SHIFT
137            if(vpC >= 3 && vpC <= 5){
138                if (indShift)
139                    indShift = false
140                else
141                    indShift = true;
142                replaceTeclado()
143            }else{
144                //verifica a posição do APAGAR --ESPAÇO
145                if(vpC >= 6 && vpC <= 12){
146                    vCampoSenha.value = '';
147                    setSaida(vCampoSenha.value)
148                }
149            }
150        }
151    }else{
152        if ((vpL == 1 || vpL == 2 || vpL == 3) && vpC == 12){
153            vCampoSenha.value = vCampoSenha.value.substr(0, vCampoSenha.value.length - 1);
154            setSaida(vCampoSenha.value)
155        }else{
156            if (vCampoSenha.value.length < 20){
157                vCampoSenha.value = vCampoSenha.value + arrTecladoAtivo[vpL][vpC];
158                setSaida(vCampoSenha.value);
159                if (indShift){
160                    indShift = false;
161                    replaceTeclado()
162                }
163            }
164        }
165    }
166}

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.