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 103  
104 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 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 109 id do iframe interno é sempre igual ao id + a letra i. Por default, será "wdocai".
108 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 116 {Array} Array contendo: objeto YAHOO.panel criado,elemento HTML com o cabecalho, elemento HTML com o corpo
115 117 */
116 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 119 if(i3GEO.janela.ANTESCRIA){
120 120 for(i=0;i<i3GEO.janela.ANTESCRIA.length;i++)
121 121 {eval(i3GEO.janela.ANTESCRIA[i]);}
... ... @@ -152,7 +152,6 @@ i3GEO.janela = {
152 152 with (wdocaiframe.style){width = "100%";height=waltura;};
153 153 wdocaiframe.style.display = "block";
154 154 wdocaiframe.src = wsrc;
155   - //i3GEO.janela.ANTESFECHA.push("$i('"+id+"i').src = ''");
156 155 }
157 156 var fix = false;
158 157 if(nx == "" || nx == "center"){var fix = true;}
... ... @@ -166,7 +165,6 @@ i3GEO.janela = {
166 165 }
167 166 YAHOO.janelaDoca.xp.panel.render();
168 167 YAHOO.util.Event.addListener(YAHOO.janelaDoca.xp.panel.close, "click", i3GEO.janela.fecha,id);
169   - //YAHOO.log("Fim cria janela", "janela");
170 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 226 idtema - id que identifica o tema conforme definido no map file
227 227 */
228 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 231 Function: tabela
232 232  
... ...
ferramentas/busca/index.htm
1 1 <html>
2 2 <head>
3 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 7 <title></title>
6 8 </head>
7 9 <body>
8 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 15 </div>
13 16 <div style="top:20px;left:5px;">
14 17 <table summary="Lista de opcoes" class=lista3 width="250px">
... ... @@ -33,9 +36,7 @@
33 36 <div style="top:30px;left:5px;">
34 37 <b>Buscar nos itens:</b>
35 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 40 </div>
40 41 <script src="../i3geo_tudo_compacto.js.php" type="text/javascript"></script>
41 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 21 */
22 22 //inicializa
23 23 parametrosURL()
24   -
  24 +contadorJanelas = 0
25 25 //monta a lista de itens
26 26 checkitensf(
27 27 tema,
... ... @@ -34,7 +34,14 @@ checkitensf(
34 34 }
35 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 45 function procurar()
39 46 {
40 47 aguarde("block")
... ... @@ -53,7 +60,6 @@ function procurar()
53 60 {alert("digite uma palavra");aguarde("none")}
54 61 else
55 62 {
56   - $i("resultado").innerHTML = "";
57 63 var tipo = "exata";
58 64 if ($i("qualquer").checked == true)
59 65 {tipo = "qualquer"}
... ... @@ -74,31 +80,40 @@ function procurar()
74 80 //monta o resultado
75 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 87 aguarde("none")
78 88 var naoEncontrado = "<p style=color:red >Nenhum registro encontrado<br>"
79 89 var ins = new Array()
80 90 if (retorno.data != undefined)
81 91 {
82   - var palavra = $i("palavra").value;
  92 +
83 93 for (tema=0;tema<retorno.data.length; tema++)
84 94 {
85 95 var linhas = retorno.data[tema].resultado
86 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 103 for (i=0;i<linhas[linha].valores.length; i++)
90 104 {
91 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 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 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 120 \ No newline at end of file
... ...