Commit 5afa294a19a2a70af04daf0a31e3cc704836bbc0

Authored by Edmar Moretti
1 parent 75c24e4a

Reformulação da ferramenta de busca de atributos em um tema. Os resultados da bu…

…sca agora são mostrados em uma janela independente.
classesjs/classe_janela.js
@@ -103,6 +103,8 @@ i3GEO.janela = { @@ -103,6 +103,8 @@ i3GEO.janela = {
103 103
104 ny {Integer} - posição y da janela em pixels. Se for "" será fixada no centro 104 ny {Integer} - posição y da janela em pixels. Se for "" será fixada no centro
105 105
  106 + texto {String} - texto do cabeçalho
  107 +
106 id {String} - (opcional) nome que será dado ao id que conterá a janela. Se não for definido, será usado o id="wdoca". O 108 id {String} - (opcional) nome que será dado ao id que conterá a janela. Se não for definido, será usado o id="wdoca". O
107 id do iframe interno é sempre igual ao id + a letra i. Por default, será "wdocai". 109 id do iframe interno é sempre igual ao id + a letra i. Por default, será "wdocai".
108 O id do cabçalho será igual a id+"_cabecalho" e o id do corpo será id+"_corpo" 110 O id do cabçalho será igual a id+"_cabecalho" e o id do corpo será id+"_corpo"
@@ -114,8 +116,6 @@ i3GEO.janela = { @@ -114,8 +116,6 @@ i3GEO.janela = {
114 {Array} Array contendo: objeto YAHOO.panel criado,elemento HTML com o cabecalho, elemento HTML com o corpo 116 {Array} Array contendo: objeto YAHOO.panel criado,elemento HTML com o cabecalho, elemento HTML com o corpo
115 */ 117 */
116 cria: function(wlargura,waltura,wsrc,nx,ny,texto,id,modal){ 118 cria: function(wlargura,waltura,wsrc,nx,ny,texto,id,modal){
117 - //executa as funções de preparação  
118 - //YAHOO.log("Cria janela", "janela");  
119 if(i3GEO.janela.ANTESCRIA){ 119 if(i3GEO.janela.ANTESCRIA){
120 for(i=0;i<i3GEO.janela.ANTESCRIA.length;i++) 120 for(i=0;i<i3GEO.janela.ANTESCRIA.length;i++)
121 {eval(i3GEO.janela.ANTESCRIA[i]);} 121 {eval(i3GEO.janela.ANTESCRIA[i]);}
@@ -152,7 +152,6 @@ i3GEO.janela = { @@ -152,7 +152,6 @@ i3GEO.janela = {
152 with (wdocaiframe.style){width = "100%";height=waltura;}; 152 with (wdocaiframe.style){width = "100%";height=waltura;};
153 wdocaiframe.style.display = "block"; 153 wdocaiframe.style.display = "block";
154 wdocaiframe.src = wsrc; 154 wdocaiframe.src = wsrc;
155 - //i3GEO.janela.ANTESFECHA.push("$i('"+id+"i').src = ''");  
156 } 155 }
157 var fix = false; 156 var fix = false;
158 if(nx == "" || nx == "center"){var fix = true;} 157 if(nx == "" || nx == "center"){var fix = true;}
@@ -166,7 +165,6 @@ i3GEO.janela = { @@ -166,7 +165,6 @@ i3GEO.janela = {
166 } 165 }
167 YAHOO.janelaDoca.xp.panel.render(); 166 YAHOO.janelaDoca.xp.panel.render();
168 YAHOO.util.Event.addListener(YAHOO.janelaDoca.xp.panel.close, "click", i3GEO.janela.fecha,id); 167 YAHOO.util.Event.addListener(YAHOO.janelaDoca.xp.panel.close, "click", i3GEO.janela.fecha,id);
169 - //YAHOO.log("Fim cria janela", "janela");  
170 return(new Array(YAHOO.janelaDoca.xp.panel,$i(id+"_cabecalho"),$i(id+"_corpo"))); 168 return(new Array(YAHOO.janelaDoca.xp.panel,$i(id+"_cabecalho"),$i(id+"_corpo")));
171 }, 169 },
172 /* 170 /*
classesjs/classe_tema.js
@@ -226,7 +226,7 @@ i3GEO.tema = { @@ -226,7 +226,7 @@ i3GEO.tema = {
226 idtema - id que identifica o tema conforme definido no map file 226 idtema - id que identifica o tema conforme definido no map file
227 */ 227 */
228 procuraratrib: function(idtema) 228 procuraratrib: function(idtema)
229 - {i3GEO.janela.cria("550px","340px",i3GEO.configura.locaplic+"/ferramentas/busca/index.htm?tema="+idtema,"","","Procurar");}, 229 + {i3GEO.janela.cria("280px","320px",i3GEO.configura.locaplic+"/ferramentas/busca/index.htm?tema="+idtema,"","","Procurar","janela_busca");},
230 /* 230 /*
231 Function: tabela 231 Function: tabela
232 232
ferramentas/busca/index.htm
1 <html> 1 <html>
2 <head> 2 <head>
3 <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=ISO-8859-1"> 3 <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=ISO-8859-1">
4 -<link rel="stylesheet" type="text/css" href="../../css/ferramentas.css"> 4 +<link rel="stylesheet" type="text/css" href="../../css/i3geo_ferramentas.css">
  5 +<style type="text/css">.yuibutton button{padding-left:2em;background:url(../../imagens/tic.png) 5% 50% no-repeat;}</style>
  6 +
5 <title></title> 7 <title></title>
6 </head> 8 </head>
7 <body> 9 <body>
8 <div style="top:5px;left:5px;width:300px"> 10 <div style="top:5px;left:5px;width:300px">
9 - <b>Procurar:</b>  
10 - <input style='cursor:text' class=digitar type=text size=30 id=palavra value=''/>  
11 - <img alt="tic.png" onclick="javascript:procurar()" style="cursor:pointer" src="../../imagens/tic.png" title='procurar' /> 11 + <input style='cursor:text' class=digitar type=text size=47 id=palavra value='digite aqui o texto...'/>
  12 + </div>
  13 + <div style=top:10px;left:3px;text-align:left; onclick="procurar()">
  14 + <input id=botao1 size=20 type=button value="Procurar" />
12 </div> 15 </div>
13 <div style="top:20px;left:5px;"> 16 <div style="top:20px;left:5px;">
14 <table summary="Lista de opcoes" class=lista3 width="250px"> 17 <table summary="Lista de opcoes" class=lista3 width="250px">
@@ -33,9 +36,7 @@ @@ -33,9 +36,7 @@
33 <div style="top:30px;left:5px;"> 36 <div style="top:30px;left:5px;">
34 <b>Buscar nos itens:</b> 37 <b>Buscar nos itens:</b>
35 </div> 38 </div>
36 - <div id=listai class=digitar style="text-align:left;top:30px;left:5px;width:250px;overflow:auto;height:160px">  
37 - </div>  
38 - <div id="resultado" style="position:absolute;top:5px;left:270px;width:230;overflow:auto;height:315px"> 39 + <div id=listai class=digitar style="text-align:left;top:30px;left:5px;width:250px;overflow:auto;height:120px">
39 </div> 40 </div>
40 <script src="../i3geo_tudo_compacto.js.php" type="text/javascript"></script> 41 <script src="../i3geo_tudo_compacto.js.php" type="text/javascript"></script>
41 <script language="JavaScript" type="text/javascript" src="index.js"></script> 42 <script language="JavaScript" type="text/javascript" src="index.js"></script>
ferramentas/busca/index.js
@@ -21,7 +21,7 @@ Free Software Foundation, Inc., no endereço @@ -21,7 +21,7 @@ Free Software Foundation, Inc., no endereço
21 */ 21 */
22 //inicializa 22 //inicializa
23 parametrosURL() 23 parametrosURL()
24 - 24 +contadorJanelas = 0
25 //monta a lista de itens 25 //monta a lista de itens
26 checkitensf( 26 checkitensf(
27 tema, 27 tema,
@@ -34,7 +34,14 @@ checkitensf( @@ -34,7 +34,14 @@ checkitensf(
34 } 34 }
35 ,"listai" 35 ,"listai"
36 ) 36 )
37 - 37 +YAHOO.example.init = function ()
  38 +{
  39 + function onPushButtonsMarkupReady()
  40 + {
  41 + new YAHOO.widget.Button("botao1");
  42 + }
  43 + YAHOO.util.Event.onContentReady("botao1", onPushButtonsMarkupReady);
  44 +}()
38 function procurar() 45 function procurar()
39 { 46 {
40 aguarde("block") 47 aguarde("block")
@@ -53,7 +60,6 @@ function procurar() @@ -53,7 +60,6 @@ function procurar()
53 {alert("digite uma palavra");aguarde("none")} 60 {alert("digite uma palavra");aguarde("none")}
54 else 61 else
55 { 62 {
56 - $i("resultado").innerHTML = "";  
57 var tipo = "exata"; 63 var tipo = "exata";
58 if ($i("qualquer").checked == true) 64 if ($i("qualquer").checked == true)
59 {tipo = "qualquer"} 65 {tipo = "qualquer"}
@@ -74,31 +80,40 @@ function procurar() @@ -74,31 +80,40 @@ function procurar()
74 //monta o resultado 80 //monta o resultado
75 function listaretornof(retorno) 81 function listaretornof(retorno)
76 { 82 {
  83 + var palavra = $i("palavra").value;
  84 + var idJanela = "janelaBusca"+contadorJanelas
  85 + contadorJanelas++
  86 + window.parent.i3GEO.janela.cria("200px","200px","","","",palavra,idJanela)
77 aguarde("none") 87 aguarde("none")
78 var naoEncontrado = "<p style=color:red >Nenhum registro encontrado<br>" 88 var naoEncontrado = "<p style=color:red >Nenhum registro encontrado<br>"
79 var ins = new Array() 89 var ins = new Array()
80 if (retorno.data != undefined) 90 if (retorno.data != undefined)
81 { 91 {
82 - var palavra = $i("palavra").value; 92 +
83 for (tema=0;tema<retorno.data.length; tema++) 93 for (tema=0;tema<retorno.data.length; tema++)
84 { 94 {
85 var linhas = retorno.data[tema].resultado 95 var linhas = retorno.data[tema].resultado
86 for (linha=0;linha<linhas.length; linha++) 96 for (linha=0;linha<linhas.length; linha++)
87 { 97 {
88 - ins.push("<table><tr><td onclick='zoomf(\""+linhas[linha].box+"\")'style='cursor:pointer;color:navy'>zoom</td><td onclick='pinf(\""+linhas[linha].box+"\")'style='color:navy;cursor:pointer;'>localiza</td></tr></table>") 98 + var valores = (linhas[linha].box).split(" ");
  99 + var x = (valores[0] * 1) + ((((valores[0] * -1) - (valores[2] * -1)) / 2) * 1);
  100 + var y = (valores[1] * 1) + ((((valores[1] * -1) - (valores[3] * -1)) / 2) * 1);
  101 +
  102 + 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;'>localiza</td></tr></table>")
89 for (i=0;i<linhas[linha].valores.length; i++) 103 for (i=0;i<linhas[linha].valores.length; i++)
90 { 104 {
91 var er = new RegExp(palavra, "gi"); 105 var er = new RegExp(palavra, "gi");
92 - var tr = (linhas[linha].valores[i].valor).replace(er,"<span style=color:red >"+palavra+"</span>")  
93 - ins.push("&nbsp;" + linhas[linha].valores[i].item + ": " + tr + "<br><br>") 106 + var tr = (linhas[linha].valores[i].valor).replace(er,"<span style=color:red;text-align:left >"+palavra+"</span>")
  107 + ins.push("<div style=width:170px;text-align:left;left:5px; >"+ linhas[linha].valores[i].item + ": " + tr + "</div><br>")
94 var naoEncontrado = "" 108 var naoEncontrado = ""
95 } 109 }
96 } 110 }
97 } 111 }
98 - $i("resultado").innerHTML=naoEncontrado+ins.join("")  
99 - $i("resultado").style.borderLeft = "1px solid rgb(235,235,235)"  
100 - $i("resultado").style.backgroundColor = "rgb(250,250,250)" 112 + //$i("resultado").innerHTML=naoEncontrado+ins.join("")
  113 + window.parent.document.getElementById(idJanela+"_corpo").innerHTML = "<div style='position:relative;top:0px;left:0px;width:190;overflow:auto;height:315px'>"+naoEncontrado+ins.join("")+"</div>"
  114 + //$i("resultado").style.borderLeft = "1px solid rgb(235,235,235)"
  115 + //$i("resultado").style.backgroundColor = "rgb(250,250,250)"
101 } 116 }
102 else 117 else
103 - {$i("resultado").innerHTML = "<p style=color:red >Ocorreu um erro<br>"} 118 + {window.parent.document.getElementById(idJanela+"_corpo").innerHTML = "<p style=color:red >Ocorreu um erro<br>"}
104 } 119 }
105 \ No newline at end of file 120 \ No newline at end of file