Commit 93fc8ba2d254247f140cdbd1d104054a27410b4c

Authored by Edmar Moretti
1 parent fdcef82e

Correções na ferramenta tabela: layout, ordenamento de coluna, remoção de coluna

ferramentas/busca/index.js
... ... @@ -42,19 +42,19 @@ Class: i3GEOF.busca
42 42 i3GEOF.busca = {
43 43 /*
44 44 Variavel: nbuscas
45   -
  45 +
46 46 Número de buscas já feitas. Utilizado para posicionar as janelas de resultados.
47 47 */
48 48 nbuscas: 0,
49 49 /*
50 50 Variavel: aguarde
51   -
  51 +
52 52 Objeto DOM com a imagem de aguarde existente no cabeçalho da janela.
53 53 */
54 54 aguarde: "",
55 55 /*
56 56 Variavel: tema
57   -
  57 +
58 58 Código do tema utilizado na busca
59 59 */
60 60 tema: i3GEO.temaAtivo,
... ... @@ -66,11 +66,11 @@ i3GEOF.busca = {
66 66 },
67 67 /*
68 68 Function: iniciaDicionario
69   -
  69 +
70 70 Carrega o dicionário e chama a função que inicia a ferramenta
71   -
  71 +
72 72 O Javascript é carregado com o id i3GEOF.nomedaferramenta.dicionario_script
73   - */
  73 + */
74 74 iniciaDicionario: function(){
75 75 if(typeof(i3GEOF.busca.dicionario) === 'undefined'){
76 76 i3GEO.util.scriptTag(
... ... @@ -82,20 +82,20 @@ i3GEOF.busca = {
82 82 else{
83 83 i3GEOF.busca.iniciaJanelaFlutuante();
84 84 }
85   - },
  85 + },
86 86 /*
87 87 Function: inicia
88   -
  88 +
89 89 Inicia a ferramenta. É chamado por criaJanelaFlutuante
90   -
  90 +
91 91 Parametro:
92   -
  92 +
93 93 iddiv {String} - id do div que receberá o conteudo HTML da ferramenta
94 94 */
95 95 inicia: function(iddiv){
96 96 i3GEO.janela.comboCabecalhoTemas("i3GEOFbuscaComboCabeca","i3GEOFbuscaComboCabecaSel","busca","ligadosComTabela");
97 97 if(i3GEO.temaAtivo === ""){
98   - $i(iddiv).innerHTML = '<img src="../imagens/opcoes.gif" ><p style="position: relative; top: -35px; width: 180px; font-size: 15px; text-align: left; left: 35px;">Escolha um tema da lista</p>';
  98 + $i(iddiv).innerHTML = '<p style="position: relative; top: 0px; font-size: 15px; text-align: left;">'+$trad("x33")+'</p>';
99 99 return;
100 100 }
101 101 try{
... ... @@ -105,17 +105,17 @@ i3GEOF.busca = {
105 105 "i3GEObuscabotao1",
106 106 {onclick:{fn: i3GEOF.busca.procurar}}
107 107 );
108   - i3GEO.janela.comboCabecalhoTemas("i3GEOFbuscaComboCabeca","i3GEOFbuscaComboCabecaSel","busca","ligadosComTabela");
  108 + i3GEO.janela.comboCabecalhoTemas("i3GEOFbuscaComboCabeca","i3GEOFbuscaComboCabecaSel","busca","ligadosComTabela");
109 109 }
110 110 catch(erro){alert(erro);}
111 111 },
112 112 /*
113 113 Function: html
114   -
  114 +
115 115 Gera o c&oacute;digo html para apresenta&ccedil;&atilde;o das op&ccedil;&otilde;es da ferramenta
116   -
  116 +
117 117 Retorno:
118   -
  118 +
119 119 String com o c&oacute;digo html
120 120 */
121 121 html:function(){
... ... @@ -148,9 +148,9 @@ i3GEOF.busca = {
148 148 },
149 149 /*
150 150 Function: iniciaJanelaFlutuante
151   -
  151 +
152 152 Cria a janela flutuante para controle da ferramenta.
153   - */
  153 + */
154 154 iniciaJanelaFlutuante: function(){
155 155 var minimiza,cabecalho,janela,divid,temp,titulo;
156 156 if($i("i3GEOF.busca")){
... ... @@ -186,13 +186,13 @@ i3GEOF.busca = {
186 186 i3GEOF.busca.inicia(divid);
187 187 temp = function(){
188 188 if(i3GEO.eventos.ATUALIZAARVORECAMADAS.toString().search('i3GEO.janela.comboCabecalhoTemas("i3GEOFbuscaComboCabeca","i3GEOFbuscaComboCabecaSel","busca","ligadosComTabela")') > 0)
189   - {i3GEO.eventos.ATUALIZAARVORECAMADAS.remove('i3GEO.janela.comboCabecalhoTemas("i3GEOFbuscaComboCabeca","i3GEOFbuscaComboCabecaSel","busca","ligadosComTabela")');}
  189 + {i3GEO.eventos.ATUALIZAARVORECAMADAS.remove('i3GEO.janela.comboCabecalhoTemas("i3GEOFbuscaComboCabeca","i3GEOFbuscaComboCabecaSel","busca","ligadosComTabela")');}
190 190 };
191   - YAHOO.util.Event.addListener(janela[0].close, "click", temp);
  191 + YAHOO.util.Event.addListener(janela[0].close, "click", temp);
192 192 },
193 193 /*
194 194 Function: ativaFoco
195   -
  195 +
196 196 Refaz a interface da ferramenta quando a janela flutuante tem seu foco ativado
197 197 */
198 198 ativaFoco: function(){
... ... @@ -204,9 +204,9 @@ i3GEOF.busca = {
204 204 },
205 205 /*
206 206 Function: montaListaItens
207   -
  207 +
208 208 Monta a lista de itens que poder&atilde;o ser escolhidos.
209   -
  209 +
210 210 A lista &eacute; inserida no elemento html com id "i3GEObuscalistai"
211 211 */
212 212 montaListaItens: function(retorno){
... ... @@ -224,15 +224,15 @@ i3GEOF.busca = {
224 224 $i("i3GEObuscalistai").innerHTML = ins;
225 225 }
226 226 catch(e)
227   - {$i("i3GEObuscalistai").innerHTML = "<p style=color:red >Ocorreu um erro<br>"+e;}
  227 + {$i("i3GEObuscalistai").innerHTML = "<p style=color:red >Ocorreu um erro<br>"+e;}
228 228 },
229 229 /*
230 230 Function: procurar
231   -
  231 +
232 232 Executa a opera&ccedil;&atilde;o de busca
233   -
  233 +
234 234 Veja:
235   -
  235 +
236 236 <LISTAVALORESITENS>
237 237 */
238 238 procurar: function(){
... ... @@ -272,11 +272,11 @@ i3GEOF.busca = {
272 272 cp.set_response_type("json");
273 273 cp.call(p,"listavaloresitens",i3GEOF.busca.mostraBusca);
274 274 }
275   - }
  275 + }
276 276 },
277 277 /*
278 278 Function: mostraBusca
279   -
  279 +
280 280 Monta uma nova janela com os resultados da busca.
281 281 */
282 282 mostraBusca: function(retorno){
... ... @@ -298,7 +298,7 @@ i3GEOF.busca = {
298 298 tema,
299 299 posicaoleft = parseInt($i("i3GEOF.busca_c").style.left,10)+(i3GEOF.busca.nbuscas*10),
300 300 posicaotop = parseInt($i("i3GEOF.busca_c").style.top,10)+(i3GEOF.busca.nbuscas*10);
301   -
  301 +
302 302 i3GEOF.busca.nbuscas++;
303 303 i3GEO.janela.cria("200px","200px","",posicaoleft+290,posicaotop,palavra,idJanela);
304 304 if (retorno.data !== undefined)
... ... @@ -310,7 +310,7 @@ i3GEOF.busca = {
310 310 for (linha=0;linha<nlinha; linha++){
311 311 valores = (linhas[linha].box).split(" ");
312 312 x = (valores[0] * 1) + ((((valores[0] * -1) - (valores[2] * -1)) / 2) * 1);
313   - y = (valores[1] * 1) + ((((valores[1] * -1) - (valores[3] * -1)) / 2) * 1);
  313 + y = (valores[1] * 1) + ((((valores[1] * -1) - (valores[3] * -1)) / 2) * 1);
314 314 ins.push("<table><tr><td onclick='i3GEO.navega.zoomExt(\"\",\"\",\"\",\""+linhas[linha].box+"\")' style='cursor:pointer;color:navy'>zoom&nbsp;</td><td onclick='i3GEO.navega.zoomponto(\"\",\"\","+x+","+y+")' style='color:navy;cursor:pointer;'>&nbsp;localiza</td></tr></table>");
315 315 for (i=0;i<linhas[linha].valores.length; i++){
316 316 er = new RegExp(palavra, "gi");
... ...
ferramentas/filtro/index.js
... ... @@ -95,7 +95,7 @@ i3GEOF.filtro = {
95 95 inicia: function(iddiv){
96 96 i3GEO.janela.comboCabecalhoTemas("i3GEOFfiltroComboCabeca","i3GEOFfiltroComboCabecaSel","filtro","ligadosComTabela");
97 97 if(i3GEO.temaAtivo === ""){
98   - $i(iddiv).innerHTML = '<img src="../imagens/opcoes.gif" ><p style="position: relative; top: -35px; width: 180px; font-size: 15px; text-align: left; left: 35px;">Escolha um tema da lista</p>';
  98 + $i(iddiv).innerHTML = '<p style="position: relative; top: 0px; font-size: 15px; text-align: left;">'+$trad("x33")+'</p>';
99 99 return;
100 100 }
101 101 try{
... ...
ferramentas/graficotema/index.js
... ... @@ -86,7 +86,7 @@ i3GEOF.graficoTema = {
86 86 inicia: function(iddiv){
87 87 i3GEO.janela.comboCabecalhoTemas("i3GEOFgraficotemaComboCabeca","i3GEOFgraficotemaComboCabecaSel","graficoTema","ligadosComTabela");
88 88 if(i3GEO.temaAtivo === ""){
89   - $i(iddiv).innerHTML = '<img src="../imagens/opcoes.gif" ><p style="position: relative; top: -35px; width: 180px; font-size: 15px; text-align: left; left: 35px;">Escolha um tema da lista</p>';
  89 + $i(iddiv).innerHTML = '<p style="position: relative; top: 0px; font-size: 15px; text-align: left;">'+$trad("x33")+'</p>';
90 90 return;
91 91 }
92 92 try{
... ...
ferramentas/legenda/index.js
... ... @@ -135,7 +135,7 @@ i3GEOF.legenda = {
135 135 inicia: function(iddiv){
136 136 i3GEO.janela.comboCabecalhoTemas("i3GEOFlegendaComboCabeca","i3GEOFlegendaComboCabecaSel","legenda","ligados");
137 137 if(i3GEO.temaAtivo === ""){
138   - $i(iddiv).innerHTML = '<img src="../imagens/opcoes.gif" ><p style="position: relative; top: -35px; width: 180px; font-size: 15px; text-align: left; left: 35px;">Escolha um tema da lista</p>';
  138 + $i(iddiv).innerHTML = '<p style="position: relative; top: 0px; font-size: 15px; text-align: left;">'+$trad("x33")+'</p>';
139 139 return;
140 140 }
141 141 try{
... ...
ferramentas/tabela/index.js
... ... @@ -130,7 +130,7 @@ i3GEOF.tabela = {
130 130 inicia: function(iddiv){
131 131 i3GEO.janela.comboCabecalhoTemas("i3GEOFtabelaComboCabeca","i3GEOFtabelaComboCabecaSel","tabela","ligadosComTabela");
132 132 if(i3GEO.temaAtivo === ""){
133   - $i(iddiv).innerHTML = '<img src="../imagens/opcoes.gif" ><p style="position: relative; top: -35px; width: 180px; font-size: 15px; text-align: left; left: 35px;">'+$trad("x33")+'</p>';
  133 + $i(iddiv).innerHTML = '<p style="position: relative; top: 0px; font-size: 15px; text-align: left;">'+$trad("x33")+'</p>';
134 134 return;
135 135 }
136 136 try{
... ... @@ -193,15 +193,17 @@ i3GEOF.tabela = {
193 193 "i3GEOtabelabotaoLista",
194 194 {onclick:{fn: i3GEOF.tabela.pegaRegistros}}
195 195 );
  196 + /*
196 197 $i("i3GEOtabelabotao2-button").style.minHeight = "1em";
197 198 $i("i3GEOtabelabotao2-button").style.padding = "0px 15px";
198 199 $i("i3GEOtabelabotao3-button").style.minHeight = "1em";
199 200 $i("i3GEOtabelabotao3-button").style.padding = "0px 15px";
200 201 $i("i3GEOtabelabotao6-button").style.minHeight = "1em";
201 202 $i("i3GEOtabelabotao6-button").style.padding = "0px 15px";
  203 + */
202 204 $i("i3GEOtabelabotaoLista-button").style.minHeight = "1em";
203 205 $i("i3GEOtabelabotaoLista-button").style.padding = "0px 15px";
204   -
  206 + $i("i3GEOtabelabotaoLista-button").style.lineHeight = "1.2";
205 207 new YAHOO.widget.Button(
206 208 "i3GEOtabelabotao4",
207 209 {onclick:{fn: i3GEOF.tabela.estatistica}}
... ... @@ -268,9 +270,9 @@ i3GEOF.tabela = {
268 270 ins += ' </table>';
269 271 ins += ' </div>';
270 272 ins += ' <div id=i3GEOtabelaguia1obj style="width:99%">';
271   - ins += ' <div id=i3GEOtabelacombot style="position:relative;top:5px;left:0px;">';
  273 + ins += ' <div id=i3GEOtabelacombot style="position:relative;top:5px;left:0px;display:none;">';
272 274 ins += ' </div>';
273   - ins += ' <br><p class="paragrafo" ><input title="'+$trad(10,i3GEOF.tabela.dicionario)+'" id=i3GEOtabelabotao2 size=25 type=button value="'+$trad(11,i3GEOF.tabela.dicionario)+'" />';
  275 + ins += ' <input title="'+$trad(10,i3GEOF.tabela.dicionario)+'" id=i3GEOtabelabotao2 size=25 type=button value="'+$trad(11,i3GEOF.tabela.dicionario)+'" />';
274 276 ins += ' <input title="'+$trad(12,i3GEOF.tabela.dicionario)+'" id=i3GEOtabelabotao3 size=25 type=button value="'+$trad(13,i3GEOF.tabela.dicionario)+'"/>';
275 277 ins += ' <input title="'+$trad(14,i3GEOF.tabela.dicionario)+'" id=i3GEOtabelabotao6 size=30 type=button value="'+$trad(15,i3GEOF.tabela.dicionario)+'"/>';
276 278 ins += ' <div id=i3GEOtabelacontador style="background-color:rgb(240,240,240);width:100%;position:relative;top:15px;left:0px;text-align:left">';
... ... @@ -471,11 +473,11 @@ i3GEOF.tabela = {
471 473 imagem,
472 474 i3GEOtabelalegenda = $i("i3GEOtabelalegenda").checked;
473 475 //cabecalho da tabela
474   - ins = "<table id=i3GEOtabelatabelai class=lista2 >";
475   - ins += "<tr><td></td><td></td><td></td><td></td>";
  476 + ins = "<table id=i3GEOtabelatabelai class=lista8 >";
  477 + ins += "<tr><td style='background-color:yellow'></td><td style='background-color:yellow'></td><td style='background-color:yellow'></td><td style='background-color:yellow'></td>";
476 478 n = retorno.data[0].itens.length;
477 479 for (i=0;i<n;i++)
478   - {ins += "<td style='background-color:yellow' ><img style=cursor:pointer onclick='i3GEOF.tabela.excluiColuna(this,"+(i * 1 + 3)+")' src='"+i3GEO.configura.locaplic+"/imagens/x.gif' title='"+$trad("t12")+"' />&nbsp;<img style=cursor:pointer onclick='i3GEOF.tabela.ordenaColuna(this,"+(i * 1 + 3)+")' src='"+i3GEO.configura.locaplic+"/imagens/ordena1.gif' title='"+$trad(31,i3GEOF.tabela.dicionario)+"' /><br><span title='"+retorno.data[0].itens[i]+"'> "+retorno.data[0].alias[i]+"</span></td>";}
  480 + {ins += "<td accessKey='"+(i * 1 + 4)+"' style='background-color:yellow' ><img style=cursor:pointer onclick='i3GEOF.tabela.excluiColuna(this,"+(i * 1 + 4)+")' src='"+i3GEO.configura.locaplic+"/imagens/x.gif' title='"+$trad("t12")+"' />&nbsp;<img style=cursor:pointer onclick='i3GEOF.tabela.ordenaColuna(this,"+(i * 1 + 4)+")' src='"+i3GEO.configura.locaplic+"/imagens/ordena1.gif' title='"+$trad(31,i3GEOF.tabela.dicionario)+"' /><br><span title='"+retorno.data[0].itens[i]+"'> <b>"+retorno.data[0].alias[i]+"</b></span></td>";}
479 481 ins += "</tr>";
480 482 cor = "linha";
481 483 n = retorno.data[1].registros.length;
... ... @@ -554,21 +556,27 @@ i3GEOF.tabela = {
554 556 try{
555 557 var tabela = $i("i3GEOtabelatabelai"),
556 558 trs,
  559 + tds,
557 560 i,
558 561 t,
559 562 nt,
560 563 ni;
  564 + //pega o indice correto
  565 + tds = coluna.parentNode.parentNode.getElementsByTagName("td");
  566 + nt = tds.length;
  567 + for (t=0;t<nt;t++){
  568 + if(tds[t].accessKey == cid){
  569 + cid = t;
  570 + break;
  571 + }
  572 + }
561 573 trs = tabela.getElementsByTagName("tr");
562 574 nt = trs.length;
563 575 for (t=0;t<nt;t++){
564   - if(trs[t].childNodes){
565   - if(trs[t].childNodes[cid] !== undefined){
566   - ni = trs[t].childNodes[cid].childNodes.length;
567   - for (i = 0; i < ni;i++){
568   - trs[t].childNodes[cid].removeChild(trs[t].childNodes[cid].childNodes[0]);
569   - }
570   - trs[t].childNodes[cid].innerHTML = "";
571   - }
  576 + i = trs[t];
  577 + if(i.getElementsByTagName("td")[cid]){
  578 + ni = i.getElementsByTagName("td")[cid];
  579 + i.removeChild(ni);
572 580 }
573 581 }
574 582 i3GEOF.tabela.aguarde.visibility = "hidden";
... ... @@ -588,6 +596,8 @@ i3GEOF.tabela = {
588 596 var tabela = $i("i3GEOtabelatabelai"),
589 597 trs = tabela.getElementsByTagName("tr"),
590 598 ntrs = trs.length,
  599 + tds,
  600 + nt,
591 601 conta = 0,
592 602 psort = [],
593 603 t,
... ... @@ -596,6 +606,15 @@ i3GEOF.tabela = {
596 606 ins,
597 607 p,
598 608 e;
  609 + //pega o indice correto
  610 + tds = coluna.parentNode.parentNode.getElementsByTagName("td");
  611 + nt = tds.length;
  612 + for (t=0;t<nt;t++){
  613 + if(tds[t].accessKey == cid){
  614 + cid = t;
  615 + break;
  616 + }
  617 + }
599 618 for (t=0;t<ntrs;t++)
600 619 {
601 620 if (t < ntrs)
... ... @@ -611,7 +630,7 @@ i3GEOF.tabela = {
611 630 }
612 631 //recosntroi a tabela
613 632 psortfim = psort.sort();
614   - ins = "<table id=i3GEOtabelatabelai class=lista2 >";
  633 + ins = "<table id=i3GEOtabelatabelai class=lista8 >";
615 634 npsortfim = psortfim.length;
616 635 for (p=0;p<npsortfim;p++)
617 636 {
... ...
ferramentas/toponimia/index.js
... ... @@ -89,7 +89,7 @@ i3GEOF.toponimia = {
89 89 inicia: function(iddiv){
90 90 i3GEO.janela.comboCabecalhoTemas("i3GEOFtoponimiaComboCabeca","i3GEOFtoponimiaComboCabecaSel","toponimia","ligadosComTabela");
91 91 if(i3GEO.temaAtivo === ""){
92   - $i(iddiv).innerHTML = '<img src="../imagens/opcoes.gif" ><p style="position: relative; top: -35px; width: 180px; font-size: 15px; text-align: left; left: 35px;">Escolha um tema da lista</p>';
  92 + $i(iddiv).innerHTML = '<p style="position: relative; top: 0px; font-size: 15px; text-align: left;">'+$trad("x33")+'</p>';
93 93 return;
94 94 }
95 95 try{
... ...