Commit 35d4db39a6a7b20c497c85553a994eb010d0e0e7
1 parent
74944053
Exists in
master
and in
7 other branches
--no commit message
Showing
2 changed files
with
577 additions
and
960 deletions
Show diff stats
classesphp/classe_atributos.php
... | ... | @@ -2117,10 +2117,10 @@ class Atributos |
2117 | 2117 | $res = str_replace("INFOFORMAT","INFO_FORMAT",$res); |
2118 | 2118 | $res2 = $layer->getWMSFeatureInfoURL($ptimg->x, $ptimg->y, 1,"MIME"); |
2119 | 2119 | $res2 = str_replace("INFOFORMAT","INFO_FORMAT",$res2); |
2120 | + //echo $res." ".$res2;exit; | |
2120 | 2121 | |
2121 | 2122 | $resposta = file($res); |
2122 | 2123 | //var_dump($resposta);exit; |
2123 | - | |
2124 | 2124 | $n = array(); |
2125 | 2125 | if(strtoupper($formatoinfo) != "TEXT/HTML" && strtoupper($formatoinfo) != "MIME"){ |
2126 | 2126 | foreach($resposta as $r){ |
... | ... | @@ -2158,20 +2158,21 @@ class Atributos |
2158 | 2158 | } |
2159 | 2159 | } |
2160 | 2160 | //var_dump($n);exit; |
2161 | - if(count($n) == 0){ | |
2161 | + $id = nomeRandomico(); | |
2162 | + if(count($n) == 0 && strtoupper($formatoinfo) != "TEXT/HTML"){ | |
2162 | 2163 | $formatoinfo = "MIME"; |
2163 | 2164 | } |
2164 | 2165 | if(strtoupper($formatoinfo) == "TEXT/HTML" && $res != ""){ |
2165 | - $n[] = array("alias"=>"","valor"=>"<iframe width=250px src='".$res."'></iframe>","link"=>"","img"=>""); | |
2166 | + $n[] = array("alias"=>"","valor"=>"<iframe width=250px id='".$id."' name='".$id."' src='".$res."'></iframe>","link"=>"","img"=>""); | |
2166 | 2167 | } |
2167 | 2168 | if(strtoupper($formatoinfo) == "MIME" && $res2 != ""){ |
2168 | - $n[] = array("alias"=>"","valor"=>"<iframe width=250px src='".$res2."'></iframe>","link"=>"","img"=>""); | |
2169 | + $n[] = array("alias"=>"","valor"=>"<iframe width=250px id='".$id."' name='".$id."' src='".$res2."'></iframe>","link"=>"","img"=>""); | |
2169 | 2170 | } |
2170 | 2171 | if($res != ""){ |
2171 | - $n[] = array("alias"=>"Link WMS","valor"=>"getfeatureinfo ".$formatoinfo,"link"=>$res,"img"=>""); | |
2172 | + $n[] = array("alias"=>"Link WMS","valor"=>"getfeatureinfo ".$formatoinfo,"link"=>$res,"img"=>"","idIframe"=>$id); | |
2172 | 2173 | } |
2173 | 2174 | if($res2 != ""){ |
2174 | - $n[] = array("alias"=>"Link WMS","valor"=>"getfeatureinfo padrão do serviço","link"=>$res2,"img"=>""); | |
2175 | + $n[] = array("alias"=>"Link WMS","valor"=>"getfeatureinfo padrão do serviço","link"=>$res2,"img"=>"","idIframe"=>$id); | |
2175 | 2176 | } |
2176 | 2177 | if($res == "" && $res2 == ""){ |
2177 | 2178 | $n[] = array("alias"=>"Ocorreu um erro","valor"=>"","link"=>"","img"=>""); | ... | ... |
ferramentas/identifica/index.js
... | ... | @@ -45,10 +45,11 @@ if (typeof (i3GEOF) === 'undefined') { |
45 | 45 | } |
46 | 46 | /* |
47 | 47 | * Classe: i3GEOF.identifica |
48 | - * | |
48 | + * | |
49 | 49 | */ |
50 | 50 | |
51 | -//TODO na listagem de atributos, incluir opcao para abrir os valores das variaveis associadas a uma regiao, quando codigo_tipo_regiao for diferente de null | |
51 | +// TODO na listagem de atributos, incluir opcao para abrir os valores das variaveis associadas a uma regiao, quando codigo_tipo_regiao for | |
52 | +// diferente de null | |
52 | 53 | i3GEOF.identifica = |
53 | 54 | { |
54 | 55 | /** |
... | ... | @@ -57,8 +58,7 @@ i3GEOF.identifica = |
57 | 58 | janelas : [], |
58 | 59 | propJanelas : {}, |
59 | 60 | /** |
60 | - * Template no formato mustache. E preenchido na carga do javascript com | |
61 | - * o programa dependencias.php | |
61 | + * Template no formato mustache. E preenchido na carga do javascript com o programa dependencias.php | |
62 | 62 | */ |
63 | 63 | MUSTACHE : "", |
64 | 64 | /** |
... | ... | @@ -71,109 +71,92 @@ i3GEOF.identifica = |
71 | 71 | }, |
72 | 72 | /* |
73 | 73 | * Propriedade: mostraLinkGeohack |
74 | - * | |
74 | + * | |
75 | 75 | * Mostra ou não o link para abrir o site GeoHack. |
76 | - * | |
77 | - * Este site permite o uso de vários buscadores | |
78 | - * disponíveis na internet. | |
79 | - * | |
76 | + * | |
77 | + * Este site permite o uso de vários buscadores disponíveis na internet. | |
78 | + * | |
80 | 79 | * Type: {boolean} |
81 | 80 | */ |
82 | 81 | mostraLinkGeohack : true, |
83 | 82 | /* |
84 | 83 | * Propriedade: mostraSistemasAdicionais |
85 | - * | |
86 | - * Mostra ou não a lista de sistemas adicionais de busca de | |
87 | - * dados. | |
88 | - * | |
84 | + * | |
85 | + * Mostra ou não a lista de sistemas adicionais de busca de dados. | |
86 | + * | |
89 | 87 | * Type: {boolean} |
90 | 88 | */ |
91 | 89 | mostraSistemasAdicionais : true, |
92 | 90 | /* |
93 | 91 | * Variavel: tema |
94 | - * | |
92 | + * | |
95 | 93 | * Código do tema que será pesquisado |
96 | - * | |
94 | + * | |
97 | 95 | * Type: {String} |
98 | 96 | */ |
99 | 97 | tema : "", |
100 | 98 | /* |
101 | 99 | * Variavel: x |
102 | - * | |
100 | + * | |
103 | 101 | * Coordenada x |
104 | - * | |
102 | + * | |
105 | 103 | * Type: {Numeric} |
106 | 104 | */ |
107 | 105 | x : 0, |
108 | 106 | /* |
109 | 107 | * Variavel: y |
110 | - * | |
108 | + * | |
111 | 109 | * Coordenada y |
112 | - * | |
110 | + * | |
113 | 111 | * Type: {Numeric} |
114 | 112 | */ |
115 | 113 | y : 0, |
116 | 114 | /* |
117 | 115 | * Variavel: sistemasAdicionais |
118 | - * | |
119 | - * Guarda a lista de sistemas adicionais que são incluídos | |
120 | - * na seleção de temas | |
121 | - * | |
116 | + * | |
117 | + * Guarda a lista de sistemas adicionais que são incluídos na seleção de temas | |
118 | + * | |
122 | 119 | * Type: {Array} |
123 | 120 | */ |
124 | 121 | sistemasAdicionais : [], |
125 | 122 | /* |
126 | 123 | * Variavel: dadosIdentifica |
127 | - * | |
128 | - * Guarda os dados obtidos com a chamada em AJAX de | |
129 | - * identificação | |
130 | - * | |
124 | + * | |
125 | + * Guarda os dados obtidos com a chamada em AJAX de identificação | |
126 | + * | |
131 | 127 | * Type: {Array} |
132 | 128 | */ |
133 | 129 | dadosIdentifica : [], |
134 | 130 | |
135 | 131 | /* |
136 | - * Para efeitos de compatibilidade antes da versão 4.7 que | |
137 | - * não tinha dicionário | |
132 | + * Para efeitos de compatibilidade antes da versão 4.7 que não tinha dicionário | |
138 | 133 | */ |
139 | 134 | criaJanelaFlutuante : function(x, y) { |
140 | - i3GEOF.identifica.iniciaDicionario( | |
141 | - x, | |
142 | - y); | |
135 | + i3GEOF.identifica.iniciaDicionario(x, y); | |
143 | 136 | }, |
144 | 137 | /* |
145 | 138 | * Function: iniciaDicionario |
146 | - * | |
147 | - * Carrega o dicionário e chama a função que inicia | |
148 | - * a ferramenta | |
149 | - * | |
150 | - * O Javascript é carregado com o id | |
151 | - * i3GEOF.nomedaferramenta.dicionario_script | |
139 | + * | |
140 | + * Carrega o dicionário e chama a função que inicia a ferramenta | |
141 | + * | |
142 | + * O Javascript é carregado com o id i3GEOF.nomedaferramenta.dicionario_script | |
152 | 143 | */ |
153 | 144 | iniciaDicionario : function(x, y, id) { |
154 | 145 | if (typeof (i3GEOF.identifica.dicionario) === 'undefined') { |
155 | 146 | if (x) { |
156 | 147 | i3GEO.util.scriptTag( |
157 | - i3GEO.configura.locaplic | |
158 | - + "/ferramentas/identifica/dicionario.js", | |
159 | - "i3GEOF.identifica.iniciaJanelaFlutuante(" | |
160 | - + x | |
161 | - + "," | |
162 | - + y | |
163 | - + ")", | |
148 | + i3GEO.configura.locaplic + "/ferramentas/identifica/dicionario.js", | |
149 | + "i3GEOF.identifica.iniciaJanelaFlutuante(" + x + "," + y + ")", | |
164 | 150 | "i3GEOF.identifica.dicionario_script"); |
165 | 151 | } else { |
166 | 152 | i3GEO.util.scriptTag( |
167 | - i3GEO.configura.locaplic | |
168 | - + "/ferramentas/identifica/dicionario.js", | |
153 | + i3GEO.configura.locaplic + "/ferramentas/identifica/dicionario.js", | |
169 | 154 | "i3GEOF.identifica.iniciaJanelaFlutuante()", |
170 | 155 | "i3GEOF.identifica.dicionario_script"); |
171 | 156 | } |
172 | 157 | } else { |
173 | 158 | if (x) { |
174 | - i3GEOF.identifica.iniciaJanelaFlutuante( | |
175 | - x, | |
176 | - y); | |
159 | + i3GEOF.identifica.iniciaJanelaFlutuante(x, y); | |
177 | 160 | } else { |
178 | 161 | i3GEOF.identifica.iniciaJanelaFlutuante(); |
179 | 162 | } |
... | ... | @@ -181,29 +164,24 @@ i3GEOF.identifica = |
181 | 164 | }, |
182 | 165 | /* |
183 | 166 | * Function: inicia |
184 | - * | |
167 | + * | |
185 | 168 | * Inicia a janela de informações |
186 | - * | |
169 | + * | |
187 | 170 | * Parameters: |
188 | - * | |
189 | - * tema {String} - código do tema, existente no mapfile | |
190 | - * armazenado na seção, que será consultado | |
171 | + * | |
172 | + * tema {String} - código do tema, existente no mapfile armazenado na seção, que será consultado | |
191 | 173 | * já na inicialização |
192 | - * | |
193 | - * x {Numeric} - coordenada x do ponto que será utilizado para | |
194 | - * busca dos atributos | |
195 | - * | |
174 | + * | |
175 | + * x {Numeric} - coordenada x do ponto que será utilizado para busca dos atributos | |
176 | + * | |
196 | 177 | * y {Numeric} - coordenada y do ponto |
197 | - * | |
198 | - * iddiv {String} - id do elemento html onde o conteúdo da | |
199 | - * ferramenta será incluido | |
200 | - * | |
201 | - * mostraLinkGeohack {boolean} - mostra ou não o link para o site | |
202 | - * geohacks | |
203 | - * | |
204 | - * mostraSistemasAdicionais {boolean} - mostra ou não os sistemas | |
205 | - * adicionais de busca de dados | |
206 | - * | |
178 | + * | |
179 | + * iddiv {String} - id do elemento html onde o conteúdo da ferramenta será incluido | |
180 | + * | |
181 | + * mostraLinkGeohack {boolean} - mostra ou não o link para o site geohacks | |
182 | + * | |
183 | + * mostraSistemasAdicionais {boolean} - mostra ou não os sistemas adicionais de busca de dados | |
184 | + * | |
207 | 185 | * idjanela {string} |
208 | 186 | */ |
209 | 187 | inicia : function(tema, x, y, iddiv, mostraLinkGeohack, mostraSistemasAdicionais, idjanela) { |
... | ... | @@ -221,140 +199,83 @@ i3GEOF.identifica = |
221 | 199 | if (i3GEO.parametros.editor.toLowerCase() == "sim") { |
222 | 200 | i3GEOF.identifica.mostraSistemasAdicionais == true; |
223 | 201 | } |
224 | - i3GEO.guias.mostraGuiaFerramenta( | |
225 | - idjanela | |
226 | - + "i3GEOidentificaguia1", | |
227 | - idjanela | |
228 | - + "i3GEOidentificaguia"); | |
202 | + i3GEO.guias.mostraGuiaFerramenta(idjanela + "i3GEOidentificaguia1", idjanela + "i3GEOidentificaguia"); | |
229 | 203 | // eventos das guias |
230 | - $i(idjanela | |
231 | - + "i3GEOidentificaguia1").onclick = function() { | |
232 | - i3GEOF.identifica.listaTemas( | |
233 | - "ligados", | |
234 | - "", | |
235 | - "", | |
236 | - idjanela); | |
237 | - i3GEO.guias.mostraGuiaFerramenta( | |
238 | - idjanela | |
239 | - + "i3GEOidentificaguia1", | |
240 | - idjanela | |
241 | - + "i3GEOidentificaguia"); | |
204 | + $i(idjanela + "i3GEOidentificaguia1").onclick = function() { | |
205 | + i3GEOF.identifica.listaTemas("ligados", "", "", idjanela); | |
206 | + i3GEO.guias.mostraGuiaFerramenta(idjanela + "i3GEOidentificaguia1", idjanela + "i3GEOidentificaguia"); | |
242 | 207 | if (i3GEO.identifica.propJanelas[idjanela].temaAtivo === "") { |
243 | - $i(idjanela | |
244 | - + "i3GEOidentificaocorrencia").innerHTML = $trad( | |
245 | - 'selecionaTema', | |
246 | - i3GEOF.identifica.dicionario); | |
208 | + $i(idjanela + "i3GEOidentificaocorrencia").innerHTML = $trad('selecionaTema', i3GEOF.identifica.dicionario); | |
247 | 209 | } |
248 | 210 | }; |
249 | - $i(idjanela | |
250 | - + "i3GEOidentificaguia2").onclick = function() { | |
251 | - i3GEOF.identifica.listaTemas( | |
252 | - "todos", | |
253 | - "", | |
254 | - "", | |
255 | - idjanela); | |
256 | - i3GEO.guias.mostraGuiaFerramenta( | |
257 | - idjanela | |
258 | - + "i3GEOidentificaguia1", | |
259 | - idjanela | |
260 | - + "i3GEOidentificaguia"); | |
211 | + $i(idjanela + "i3GEOidentificaguia2").onclick = function() { | |
212 | + i3GEOF.identifica.listaTemas("todos", "", "", idjanela); | |
213 | + i3GEO.guias.mostraGuiaFerramenta(idjanela + "i3GEOidentificaguia1", idjanela + "i3GEOidentificaguia"); | |
261 | 214 | }; |
262 | - $i(idjanela | |
263 | - + "i3GEOidentificaguia3").onclick = function() { | |
264 | - i3GEO.guias.mostraGuiaFerramenta( | |
265 | - idjanela | |
266 | - + "i3GEOidentificaguia3", | |
267 | - idjanela | |
268 | - + "i3GEOidentificaguia"); | |
215 | + $i(idjanela + "i3GEOidentificaguia3").onclick = function() { | |
216 | + i3GEO.guias.mostraGuiaFerramenta(idjanela + "i3GEOidentificaguia3", idjanela + "i3GEOidentificaguia"); | |
269 | 217 | }; |
270 | - $i(idjanela | |
271 | - + "i3GEOidentificaguia4").onclick = function() { | |
272 | - i3GEO.guias.mostraGuiaFerramenta( | |
273 | - idjanela | |
274 | - + "i3GEOidentificaguia4", | |
275 | - idjanela | |
276 | - + "i3GEOidentificaguia"); | |
277 | - var b = new YAHOO.widget.Button( | |
278 | - idjanela | |
279 | - + "i3GEOidentificabotao1", { | |
280 | - onclick : { | |
281 | - fn : function() { | |
282 | - if (i3GEOF.identifica.propJanelas[idjanela].temaAtivo | |
283 | - && i3GEOF.identifica.propJanelas[idjanela].temaAtivo !== "") { | |
284 | - var ltema = i3GEO.arvoreDeCamadas.pegaTema(i3GEOF.identifica.propJanelas[idjanela].temaAtivo); | |
285 | - if (ltema.identifica == "nao" | |
286 | - || ltema.identifica == "NAO") { | |
287 | - i3GEO.janela.tempoMsg($trad( | |
288 | - 'msgEtiquetas', | |
289 | - i3GEOF.identifica.dicionario)); | |
290 | - } else { | |
291 | - i3GEO.tema.dialogo.etiquetas(i3GEOF.identifica.propJanelas[idjanela].temaAtivo); | |
218 | + $i(idjanela + "i3GEOidentificaguia4").onclick = | |
219 | + function() { | |
220 | + i3GEO.guias.mostraGuiaFerramenta(idjanela + "i3GEOidentificaguia4", idjanela + "i3GEOidentificaguia"); | |
221 | + var b = | |
222 | + new YAHOO.widget.Button( | |
223 | + idjanela + "i3GEOidentificabotao1", | |
224 | + { | |
225 | + onclick : { | |
226 | + fn : function() { | |
227 | + if (i3GEOF.identifica.propJanelas[idjanela].temaAtivo && i3GEOF.identifica.propJanelas[idjanela].temaAtivo !== "") { | |
228 | + var ltema = | |
229 | + i3GEO.arvoreDeCamadas.pegaTema(i3GEOF.identifica.propJanelas[idjanela].temaAtivo); | |
230 | + if (ltema.identifica == "nao" || ltema.identifica == "NAO") { | |
231 | + i3GEO.janela.tempoMsg($trad('msgEtiquetas', i3GEOF.identifica.dicionario)); | |
232 | + } else { | |
233 | + i3GEO.tema.dialogo.etiquetas(i3GEOF.identifica.propJanelas[idjanela].temaAtivo); | |
234 | + } | |
235 | + $i(idjanela + "i3GEOidentificaocorrencia").innerHTML = ""; | |
236 | + } else { | |
237 | + $i(idjanela + "i3GEOidentificaocorrencia").innerHTML = | |
238 | + $trad('selecionaTema', i3GEOF.identifica.dicionario); | |
239 | + } | |
292 | 240 | } |
293 | - $i(idjanela | |
294 | - + "i3GEOidentificaocorrencia").innerHTML = ""; | |
295 | - } else { | |
296 | - $i(idjanela | |
297 | - + "i3GEOidentificaocorrencia").innerHTML = $trad( | |
298 | - 'selecionaTema', | |
299 | - i3GEOF.identifica.dicionario); | |
241 | + } | |
242 | + }); | |
243 | + b.addClass("abrir"); | |
244 | + }; | |
245 | + $i(idjanela + "i3GEOidentificaguia5").onclick = | |
246 | + function() { | |
247 | + i3GEO.guias.mostraGuiaFerramenta(idjanela + "i3GEOidentificaguia5", idjanela + "i3GEOidentificaguia"); | |
248 | + var temp, b = | |
249 | + new YAHOO.widget.Button(idjanela + "i3GEOidentificabotao2", { | |
250 | + onclick : { | |
251 | + fn : function() { | |
252 | + var js = i3GEO.configura.locaplic + "/ferramentas/bufferpt/dependencias.php"; | |
253 | + i3GEO.util.scriptTag( | |
254 | + js, | |
255 | + "i3GEOF.bufferpt.iniciaJanelaFlutuante(" + i3GEOF.identifica.propJanelas[idjanela].x | |
256 | + + "," | |
257 | + + i3GEOF.identifica.propJanelas[idjanela].y | |
258 | + + ")", | |
259 | + "i3GEOF.bufferpt_script"); | |
300 | 260 | } |
301 | 261 | } |
302 | - } | |
303 | - }); | |
304 | - b.addClass("abrir"); | |
305 | - }; | |
306 | - $i(idjanela | |
307 | - + "i3GEOidentificaguia5").onclick = function() { | |
308 | - i3GEO.guias.mostraGuiaFerramenta( | |
309 | - idjanela | |
310 | - + "i3GEOidentificaguia5", | |
311 | - idjanela | |
312 | - + "i3GEOidentificaguia"); | |
313 | - var temp, b = new YAHOO.widget.Button( | |
314 | - idjanela | |
315 | - + "i3GEOidentificabotao2", { | |
316 | - onclick : { | |
317 | - fn : function() { | |
318 | - var js = i3GEO.configura.locaplic | |
319 | - + "/ferramentas/bufferpt/dependencias.php"; | |
320 | - i3GEO.util.scriptTag( | |
321 | - js, | |
322 | - "i3GEOF.bufferpt.iniciaJanelaFlutuante(" | |
323 | - + i3GEOF.identifica.propJanelas[idjanela].x | |
324 | - + "," | |
325 | - + i3GEOF.identifica.propJanelas[idjanela].y | |
326 | - + ")", | |
327 | - "i3GEOF.bufferpt_script"); | |
328 | - } | |
329 | - } | |
330 | - }); | |
331 | - b.addClass("rodar"); | |
332 | - temp = i3GEO.coordenadas.formato, | |
333 | - gh = i3GEO.coordenadas.geohash.encodeGeoHash( | |
334 | - i3GEOF.identifica.propJanelas[idjanela].y, | |
335 | - i3GEOF.identifica.propJanelas[idjanela].x); | |
336 | - i3GEO.coordenadas.formato = "lista"; | |
337 | - i3GEO.coordenadas.mostraCoordenadas( | |
338 | - false, | |
339 | - idjanela | |
340 | - + "i3GEOidentificacoordtexto", | |
341 | - i3GEOF.identifica.propJanelas[idjanela].x, | |
342 | - i3GEOF.identifica.propJanelas[idjanela].y); | |
343 | - i3GEO.coordenadas.MODOTEXTO += "Geohash: <a href='http://geohash.org/" | |
344 | - + gh | |
345 | - + "' target=_blank >" | |
346 | - + gh | |
347 | - + "</a>"; | |
348 | - $i(idjanela | |
349 | - + "i3GEOidentificacoordtexto").innerHTML = i3GEO.coordenadas.MODOTEXTO | |
350 | - + "</span>"; | |
351 | - i3GEO.coordenadas.formato = temp; | |
352 | - }; | |
353 | - i3GEOF.identifica.listaTemas( | |
354 | - "ligados", | |
355 | - "", | |
356 | - "", | |
357 | - idjanela); | |
262 | + }); | |
263 | + b.addClass("rodar"); | |
264 | + temp = i3GEO.coordenadas.formato, gh = | |
265 | + i3GEO.coordenadas.geohash.encodeGeoHash( | |
266 | + i3GEOF.identifica.propJanelas[idjanela].y, | |
267 | + i3GEOF.identifica.propJanelas[idjanela].x); | |
268 | + i3GEO.coordenadas.formato = "lista"; | |
269 | + i3GEO.coordenadas.mostraCoordenadas( | |
270 | + false, | |
271 | + idjanela + "i3GEOidentificacoordtexto", | |
272 | + i3GEOF.identifica.propJanelas[idjanela].x, | |
273 | + i3GEOF.identifica.propJanelas[idjanela].y); | |
274 | + i3GEO.coordenadas.MODOTEXTO += "Geohash: <a href='http://geohash.org/" + gh + "' target=_blank >" + gh + "</a>"; | |
275 | + $i(idjanela + "i3GEOidentificacoordtexto").innerHTML = i3GEO.coordenadas.MODOTEXTO + "</span>"; | |
276 | + i3GEO.coordenadas.formato = temp; | |
277 | + }; | |
278 | + i3GEOF.identifica.listaTemas("ligados", "", "", idjanela); | |
358 | 279 | // |
359 | 280 | // verifica se existem sistemas para identificar |
360 | 281 | // |
... | ... | @@ -363,11 +284,7 @@ i3GEOF.identifica = |
363 | 284 | // verifica se o tema ativo pode ser identificado |
364 | 285 | var temp = i3GEO.arvoreDeCamadas.pegaTema(i3GEOF.identifica.propJanelas[idjanela].temaAtivo); |
365 | 286 | if (temp.identifica.toLowerCase() !== "nao") { |
366 | - i3GEOF.identifica.buscaDadosTema( | |
367 | - i3GEOF.identifica.propJanelas[idjanela].temaAtivo, | |
368 | - "", | |
369 | - "", | |
370 | - idjanela); | |
287 | + i3GEOF.identifica.buscaDadosTema(i3GEOF.identifica.propJanelas[idjanela].temaAtivo, "", "", idjanela); | |
371 | 288 | } |
372 | 289 | } |
373 | 290 | } catch (erro) { |
... | ... | @@ -375,60 +292,32 @@ i3GEOF.identifica = |
375 | 292 | // botao de redimensionar as partes da janela |
376 | 293 | var Dom = YAHOO.util.Dom, col1 = null, col2 = null; |
377 | 294 | |
378 | - col1 = Dom.get(idjanela | |
379 | - + 'i3GEOidentificatemaativo'); | |
380 | - col2 = Dom.get(idjanela | |
381 | - + 'i3GEOidentificaocorrencia'); | |
382 | - var resize = new YAHOO.util.Resize( | |
383 | - idjanela | |
384 | - + 'i3GEOidentificatemaativo', { | |
385 | - handles : [ | |
386 | - 'r' | |
387 | - ], | |
388 | - maxWidth : 180 | |
389 | - }); | |
390 | - resize.on( | |
391 | - 'resize', | |
392 | - function(ev) { | |
393 | - // Dom.setStyle(col1, 'height', ''); | |
394 | - // 150 é o tamanho inicial da parte esquerda, | |
395 | - // corresponde a 40% | |
396 | - var w1 = parseInt(col1.style.width); | |
397 | - var dif = parseInt( | |
398 | - (w1 * 40) / 150, | |
399 | - 10); | |
400 | - Dom.setStyle( | |
401 | - col2, | |
402 | - 'width', | |
403 | - 40 | |
404 | - - dif | |
405 | - + 60 | |
406 | - + '%'); | |
407 | - Dom.setStyle( | |
408 | - col2, | |
409 | - 'left', | |
410 | - w1 | |
411 | - + 15 | |
412 | - + 'px'); | |
413 | - }); | |
414 | - resize.resize( | |
415 | - null, | |
416 | - null, | |
417 | - null, | |
418 | - 0, | |
419 | - 0, | |
420 | - true); | |
295 | + col1 = Dom.get(idjanela + 'i3GEOidentificatemaativo'); | |
296 | + col2 = Dom.get(idjanela + 'i3GEOidentificaocorrencia'); | |
297 | + var resize = new YAHOO.util.Resize(idjanela + 'i3GEOidentificatemaativo', { | |
298 | + handles : [ | |
299 | + 'r' | |
300 | + ], | |
301 | + maxWidth : 180 | |
302 | + }); | |
303 | + resize.on('resize', function(ev) { | |
304 | + // Dom.setStyle(col1, 'height', ''); | |
305 | + // 150 é o tamanho inicial da parte esquerda, | |
306 | + // corresponde a 40% | |
307 | + var w1 = parseInt(col1.style.width); | |
308 | + var dif = parseInt((w1 * 40) / 150, 10); | |
309 | + Dom.setStyle(col2, 'width', 40 - dif + 60 + '%'); | |
310 | + Dom.setStyle(col2, 'left', w1 + 15 + 'px'); | |
311 | + }); | |
312 | + resize.resize(null, null, null, 0, 0, true); | |
421 | 313 | }, |
422 | 314 | atualizaSistemas : function() { |
423 | 315 | if (i3GEOF.identifica.mostraSistemasAdicionais === true) { |
424 | 316 | if (i3GEOF.identifica.sistemasAdicionais.length == 0) { |
425 | - var p = i3GEO.configura.locaplic | |
426 | - + "/classesphp/mapa_controle.php?funcao=pegaSistemasIdentificacao&g_sid=" | |
427 | - + i3GEO.configura.sid; | |
428 | - cpJSON.call( | |
429 | - p, | |
430 | - "foo", | |
431 | - i3GEOF.identifica.montaListaSistemas); | |
317 | + var p = | |
318 | + i3GEO.configura.locaplic + "/classesphp/mapa_controle.php?funcao=pegaSistemasIdentificacao&g_sid=" | |
319 | + + i3GEO.configura.sid; | |
320 | + cpJSON.call(p, "foo", i3GEOF.identifica.montaListaSistemas); | |
432 | 321 | } else { |
433 | 322 | i3GEOF.identifica.montaListaSistemas(""); |
434 | 323 | } |
... | ... | @@ -436,14 +325,11 @@ i3GEOF.identifica = |
436 | 325 | }, |
437 | 326 | /* |
438 | 327 | * Function: iniciaJanelaFlutuante |
439 | - * | |
328 | + * | |
440 | 329 | * Cria a janela flutuante para controle da ferramenta. |
441 | 330 | */ |
442 | 331 | iniciaJanelaFlutuante : function(x, y) { |
443 | - var minimiza, cabecalho, duplica, janela, divid, temp, titulo, id = "ident" | |
444 | - + parseInt( | |
445 | - Math.random() * 1000000, | |
446 | - 10); | |
332 | + var minimiza, cabecalho, duplica, janela, divid, temp, titulo, id = "ident" + parseInt(Math.random() * 1000000, 10); | |
447 | 333 | i3GEOF.identifica.janelas.push(id); |
448 | 334 | i3GEOF.identifica.propJanelas[id] = {}; |
449 | 335 | if (x) { |
... | ... | @@ -465,85 +351,77 @@ i3GEOF.identifica = |
465 | 351 | i3GEO.janela.minimiza(id); |
466 | 352 | }; |
467 | 353 | duplica = function() { |
468 | - i3GEOF.identifica.iniciaJanelaFlutuante( | |
469 | - i3GEOF.identifica.propJanelas[id].x, | |
470 | - i3GEOF.identifica.propJanelas[id].y); | |
354 | + i3GEOF.identifica.iniciaJanelaFlutuante(i3GEOF.identifica.propJanelas[id].x, i3GEOF.identifica.propJanelas[id].y); | |
471 | 355 | }; |
472 | 356 | // cria a janela flutuante |
473 | - titulo = "<div class='i3GeoTituloJanela'>" + $trad("d7t") | |
474 | - + "<a class=ajuda_usuario target=_blank href='" | |
475 | - + i3GEO.configura.locaplic | |
476 | - + "/ajuda_usuario.php?idcategoria=8&idajuda=70' ><b> </b></a></div>"; | |
477 | - janela = i3GEO.janela.cria( | |
478 | - "450px", | |
479 | - "250px", | |
480 | - "", | |
481 | - "", | |
482 | - "", | |
483 | - titulo, | |
484 | - id, | |
485 | - false, | |
486 | - "hd", | |
487 | - cabecalho, | |
488 | - minimiza, | |
489 | - "", | |
490 | - true, | |
491 | - i3GEO.configura.locaplic | |
492 | - + "/imagens/oxygen/16x16/telepathy-kde.png", | |
493 | - duplica); | |
357 | + titulo = | |
358 | + "<div class='i3GeoTituloJanela'>" + $trad("d7t") | |
359 | + + "<a class=ajuda_usuario target=_blank href='" | |
360 | + + i3GEO.configura.locaplic | |
361 | + + "/ajuda_usuario.php?idcategoria=8&idajuda=70' ><b> </b></a></div>"; | |
362 | + janela = | |
363 | + i3GEO.janela.cria( | |
364 | + "450px", | |
365 | + "250px", | |
366 | + "", | |
367 | + "", | |
368 | + "", | |
369 | + titulo, | |
370 | + id, | |
371 | + false, | |
372 | + "hd", | |
373 | + cabecalho, | |
374 | + minimiza, | |
375 | + "", | |
376 | + true, | |
377 | + i3GEO.configura.locaplic + "/imagens/oxygen/16x16/telepathy-kde.png", | |
378 | + duplica); | |
494 | 379 | divid = janela[2].id; |
495 | 380 | if (i3GEOF.identifica.janelas.length > 1) { |
496 | 381 | temp = janela[0].cfg.config; |
497 | 382 | janela[0].moveTo( |
498 | - temp.x.value | |
499 | - + (i3GEOF.identifica.janelas.length * 50), | |
500 | - temp.y.value | |
501 | - + (i3GEOF.identifica.janelas.length * 15)); | |
383 | + temp.x.value + (i3GEOF.identifica.janelas.length * 50), | |
384 | + temp.y.value + (i3GEOF.identifica.janelas.length * 15)); | |
502 | 385 | } |
503 | - i3GEOF.identifica.inicia( | |
504 | - i3GEO.temaAtivo, | |
505 | - objposicaocursor.ddx, | |
506 | - objposicaocursor.ddy, | |
507 | - divid, | |
508 | - true, | |
509 | - true, | |
510 | - id); | |
386 | + i3GEOF.identifica.inicia(i3GEO.temaAtivo, objposicaocursor.ddx, objposicaocursor.ddy, divid, true, true, id); | |
511 | 387 | janela[2].style.backgroundColor = "white"; |
512 | 388 | |
513 | - i3GEOF.identifica.propJanelas[id].aguarde = $i(id | |
514 | - + "_imagemCabecalho").style; | |
389 | + i3GEOF.identifica.propJanelas[id].aguarde = $i(id + "_imagemCabecalho").style; | |
515 | 390 | i3GEOF.identifica.propJanelas[id].atualiza = true; |
516 | - temp = 'i3GEOF.identifica.propJanelas["' | |
517 | - + id | |
518 | - + '"].atualiza = this.checked'; | |
519 | - janela[0].setFooter("<div class='i3GeoRodapeJanela' ><input class='inputsb' style='cursor:pointer;position:relative;top:2px;' checked onclick='" | |
520 | - + temp | |
521 | - + "' type=checkbox /> " | |
522 | - + $trad( | |
523 | - 'atualizaJanela', | |
524 | - i3GEOF.identifica.dicionario) | |
525 | - + "</div>"); | |
391 | + temp = 'i3GEOF.identifica.propJanelas["' + id + '"].atualiza = this.checked'; | |
392 | + janela[0] | |
393 | + .setFooter("<div class='i3GeoRodapeJanela' ><input class='inputsb' style='cursor:pointer;position:relative;top:2px;' checked onclick='" + temp | |
394 | + + "' type=checkbox /> " | |
395 | + + $trad('atualizaJanela', i3GEOF.identifica.dicionario) | |
396 | + + "</div>"); | |
526 | 397 | if (i3GEO.Interface.ATUAL !== "googleearth") { |
527 | 398 | temp = function() { |
528 | 399 | i3GEOF.identifica.limpaMarca(id); |
529 | 400 | i3GEOF.identifica.janelas.remove(id); |
530 | 401 | i3GEOF.identifica.propJanelas[id] = null; |
531 | 402 | if (i3GEOF.identifica.janelas.length === 0) { |
532 | - i3GEO.eventos.removeEventos("MOUSECLIQUE",[i3GEO.configura.funcaoIdentifica]); | |
403 | + i3GEO.eventos.removeEventos("MOUSECLIQUE", [ | |
404 | + i3GEO.configura.funcaoIdentifica | |
405 | + ]); | |
533 | 406 | i3GEO.barraDeBotoes.ativaIcone(i3GEO.barraDeBotoes.BOTAOPADRAO); |
534 | - i3GEO.eventos.removeEventos("ATUALIZAARVORECAMADAS",["i3GEOF.identifica.listaTemas()"]); | |
535 | - i3GEO.eventos.removeEventos("MOUSECLIQUEPERM",[i3GEO.configura.funcaoIdentifica]); | |
536 | - i3GEO.eventos.adicionaEventos("MOUSECLIQUEPERM",[i3GEO.configura.funcaoTip]); | |
407 | + i3GEO.eventos.removeEventos("ATUALIZAARVORECAMADAS", [ | |
408 | + "i3GEOF.identifica.listaTemas()" | |
409 | + ]); | |
410 | + i3GEO.eventos.removeEventos("MOUSECLIQUEPERM", [ | |
411 | + i3GEO.configura.funcaoIdentifica | |
412 | + ]); | |
413 | + i3GEO.eventos.adicionaEventos("MOUSECLIQUEPERM", [ | |
414 | + i3GEO.configura.funcaoTip | |
415 | + ]); | |
537 | 416 | // reativa o evento default |
538 | 417 | i3GEO.eventos.cliquePerm.ativa(); |
539 | 418 | } |
540 | 419 | }; |
541 | - YAHOO.util.Event.addListener( | |
542 | - janela[0].close, | |
543 | - "click", | |
544 | - temp); | |
420 | + YAHOO.util.Event.addListener(janela[0].close, "click", temp); | |
545 | 421 | } |
546 | - i3GEO.eventos.adicionaEventos("ATUALIZAARVORECAMADAS",["i3GEOF.identifica.listaTemas()"]); | |
422 | + i3GEO.eventos.adicionaEventos("ATUALIZAARVORECAMADAS", [ | |
423 | + "i3GEOF.identifica.listaTemas()" | |
424 | + ]); | |
547 | 425 | }, |
548 | 426 | limpaMarca : function(id) { |
549 | 427 | i3GEO.desenho.removePins(id); |
... | ... | @@ -551,59 +429,43 @@ i3GEOF.identifica = |
551 | 429 | }, |
552 | 430 | /* |
553 | 431 | * Function: ativaFoco |
554 | - * | |
555 | - * Refaz a interface da ferramenta quando a janela flutuante tem seu | |
556 | - * foco ativado | |
432 | + * | |
433 | + * Refaz a interface da ferramenta quando a janela flutuante tem seu foco ativado | |
557 | 434 | */ |
558 | 435 | ativaFoco : function(id) { |
559 | 436 | i3GEOF.identifica.listaTemas("ligados"); |
560 | - i3GEO.util.mudaCursor( | |
561 | - i3GEO.configura.cursores, | |
562 | - temp, | |
563 | - i3GEO.Interface.IDMAPA, | |
564 | - i3GEO.configura.locaplic); | |
565 | - //i3GEOF.identifica.mostraImagemPonto(id); | |
437 | + i3GEO.util.mudaCursor(i3GEO.configura.cursores, temp, i3GEO.Interface.IDMAPA, i3GEO.configura.locaplic); | |
438 | + // i3GEOF.identifica.mostraImagemPonto(id); | |
566 | 439 | }, |
567 | 440 | mostraImagemPonto : function(id) { |
568 | - if(i3GEO.Interface.ATUAL === "googleearth") | |
569 | - {return;} | |
570 | - if(i3GEOF.identifica.propJanelas[id].marca === false){ | |
571 | - i3GEOF.identifica.propJanelas[id].marca = i3GEO.desenho.addPin( | |
572 | - i3GEOF.identifica.propJanelas[id].x, | |
573 | - i3GEOF.identifica.propJanelas[id].y, | |
574 | - "", | |
575 | - "", | |
576 | - "", | |
577 | - id | |
578 | - ); | |
441 | + if (i3GEO.Interface.ATUAL === "googleearth") { | |
442 | + return; | |
579 | 443 | } |
580 | - else{ | |
444 | + if (i3GEOF.identifica.propJanelas[id].marca === false) { | |
445 | + i3GEOF.identifica.propJanelas[id].marca = | |
446 | + i3GEO.desenho.addPin(i3GEOF.identifica.propJanelas[id].x, i3GEOF.identifica.propJanelas[id].y, "", "", "", id); | |
447 | + } else { | |
581 | 448 | i3GEO.desenho.movePin( |
582 | 449 | i3GEOF.identifica.propJanelas[id].marca, |
583 | 450 | i3GEOF.identifica.propJanelas[id].x, |
584 | - i3GEOF.identifica.propJanelas[id].y | |
585 | - ); | |
451 | + i3GEOF.identifica.propJanelas[id].y); | |
586 | 452 | } |
587 | 453 | }, |
588 | 454 | /* |
589 | 455 | * Function: html |
590 | - * | |
591 | - * Gera o código html para apresentação das | |
592 | - * opções da ferramenta | |
593 | - * | |
456 | + * | |
457 | + * Gera o código html para apresentação das opções da ferramenta | |
458 | + * | |
594 | 459 | * Retorno: |
595 | - * | |
460 | + * | |
596 | 461 | * String com o código html |
597 | 462 | */ |
598 | 463 | html : function(idjanela) { |
599 | - var ins = Mustache.render( | |
600 | - i3GEOF.identifica.MUSTACHE, | |
601 | - i3GEOF.identifica.mustacheHash(idjanela)); | |
464 | + var ins = Mustache.render(i3GEOF.identifica.MUSTACHE, i3GEOF.identifica.mustacheHash(idjanela)); | |
602 | 465 | return ins; |
603 | 466 | }, |
604 | 467 | /* |
605 | - * Abre a janela flutuante para controlar o processo de reposicionar um | |
606 | - * ponto. Ativada apenas quando o usuario puder editar um tema | |
468 | + * Abre a janela flutuante para controlar o processo de reposicionar um ponto. Ativada apenas quando o usuario puder editar um tema | |
607 | 469 | */ |
608 | 470 | janelaMoverPonto : function(tema, idreg) { |
609 | 471 | if ($i("i3GEOF.movePonto_corpo")) { |
... | ... | @@ -611,82 +473,51 @@ i3GEOF.identifica = |
611 | 473 | } |
612 | 474 | var temp, titulo; |
613 | 475 | // cria a janela flutuante |
614 | - titulo = "<div class='i3GeoTituloJanela'>" + $trad( | |
615 | - 'move', | |
616 | - i3GEOF.identifica.dicionario) + "</div>"; | |
617 | - i3GEO.janela.cria( | |
618 | - "250px", | |
619 | - "100px", | |
620 | - "", | |
621 | - "", | |
622 | - "", | |
623 | - titulo, | |
624 | - "i3GEOF.movePonto", | |
625 | - false, | |
626 | - "hd", | |
627 | - "", | |
628 | - ""); | |
476 | + titulo = "<div class='i3GeoTituloJanela'>" + $trad('move', i3GEOF.identifica.dicionario) + "</div>"; | |
477 | + i3GEO.janela.cria("250px", "100px", "", "", "", titulo, "i3GEOF.movePonto", false, "hd", "", ""); | |
629 | 478 | $i("i3GEOF.movePonto_corpo").style.backgroundColor = "white"; |
630 | - i3GEO.eventos.removeEventos("MOUSECLIQUEPERM",[i3GEO.configura.funcaoIdentifica]); | |
631 | - i3GEO.eventos.adicionaEventos("MOUSECLIQUE",["i3GEOF.identifica.atualizaJanelaMoverPonto()"]); | |
479 | + i3GEO.eventos.removeEventos("MOUSECLIQUEPERM", [ | |
480 | + i3GEO.configura.funcaoIdentifica | |
481 | + ]); | |
482 | + i3GEO.eventos.adicionaEventos("MOUSECLIQUE", [ | |
483 | + "i3GEOF.identifica.atualizaJanelaMoverPonto()" | |
484 | + ]); | |
632 | 485 | temp = function() { |
633 | - i3GEO.eventos.adicionaEventos("MOUSECLIQUE",[i3GEO.configura.funcaoIdentifica]); | |
486 | + i3GEO.eventos.adicionaEventos("MOUSECLIQUE", [ | |
487 | + i3GEO.configura.funcaoIdentifica | |
488 | + ]); | |
634 | 489 | }; |
635 | - YAHOO.util.Event.addListener( | |
636 | - janela[0].close, | |
637 | - "click", | |
638 | - temp); | |
639 | - $i("i3GEOF.movePonto_corpo").innerHTML = "" | |
640 | - + $trad( | |
641 | - 'cliqueNovaPosicao', | |
642 | - i3GEOF.identifica.dicionario) | |
643 | - + "<br><br><p class=paragrafo >X: </p>" | |
644 | - + "<div class='i3geoForm100 i3geoFormIconeEdita' ><input type=text id=i3GEOF.movePontoX /></div>" | |
645 | - + "<br><p class=paragrafo >Y: </p>" | |
646 | - + "<div class='i3geoForm100 i3geoFormIconeEdita' ><input type=text id=i3GEOF.movePontoY /></div>" | |
647 | - + "<input type=buttom value='" | |
648 | - + $trad( | |
649 | - 'move', | |
650 | - i3GEOF.identifica.dicionario) | |
651 | - + "' id=i3GEOF.moveAplica />" | |
652 | - + "<input type=hidden value='" | |
653 | - + tema | |
654 | - + "' id=i3GEOF.moveAplicaTema />"; | |
490 | + YAHOO.util.Event.addListener(janela[0].close, "click", temp); | |
491 | + $i("i3GEOF.movePonto_corpo").innerHTML = | |
492 | + "" + $trad('cliqueNovaPosicao', i3GEOF.identifica.dicionario) | |
493 | + + "<br><br><p class=paragrafo >X: </p>" | |
494 | + + "<div class='i3geoForm100 i3geoFormIconeEdita' ><input type=text id=i3GEOF.movePontoX /></div>" | |
495 | + + "<br><p class=paragrafo >Y: </p>" | |
496 | + + "<div class='i3geoForm100 i3geoFormIconeEdita' ><input type=text id=i3GEOF.movePontoY /></div>" | |
497 | + + "<input type=buttom value='" | |
498 | + + $trad('move', i3GEOF.identifica.dicionario) | |
499 | + + "' id=i3GEOF.moveAplica />" | |
500 | + + "<input type=hidden value='" | |
501 | + + tema | |
502 | + + "' id=i3GEOF.moveAplicaTema />"; | |
655 | 503 | |
656 | 504 | new YAHOO.widget.Button( |
657 | - "i3GEOF.moveAplica", { | |
505 | + "i3GEOF.moveAplica", | |
506 | + { | |
658 | 507 | onclick : { |
659 | 508 | fn : function() { |
660 | - var x = $i("i3GEOF.movePontoX").value, y = $i("i3GEOF.movePontoY").value, tema = $i("i3GEOF.moveAplicaTema").value, p = i3GEO.configura.locaplic | |
661 | - + "/ferramentas/editortema/exec.php?funcao=atualizageometria&g_sid=" | |
662 | - + i3GEO.configura.sid, temp = function(retorno) { | |
509 | + var x = $i("i3GEOF.movePontoX").value, y = $i("i3GEOF.movePontoY").value, tema = | |
510 | + $i("i3GEOF.moveAplicaTema").value, p = | |
511 | + i3GEO.configura.locaplic + "/ferramentas/editortema/exec.php?funcao=atualizageometria&g_sid=" | |
512 | + + i3GEO.configura.sid, temp = function(retorno) { | |
663 | 513 | i3GEO.janela.fechaAguarde("aguardeSalvaPonto"); |
664 | - i3GEO.Interface.atualizaTema( | |
665 | - "", | |
666 | - tema); | |
667 | - i3GEOF.identifica.buscaDadosTema( | |
668 | - tema, | |
669 | - x, | |
670 | - y); | |
514 | + i3GEO.Interface.atualizaTema("", tema); | |
515 | + i3GEOF.identifica.buscaDadosTema(tema, x, y); | |
671 | 516 | }; |
672 | 517 | i3GEO.janela.AGUARDEMODAL = true; |
673 | - i3GEO.janela.abreAguarde( | |
674 | - "aguardeSalvaPonto", | |
675 | - "Adicionando..."); | |
518 | + i3GEO.janela.abreAguarde("aguardeSalvaPonto", "Adicionando..."); | |
676 | 519 | i3GEO.janela.AGUARDEMODAL = false; |
677 | - cpJSON.call( | |
678 | - p, | |
679 | - "foo", | |
680 | - temp, | |
681 | - "&idunico=" | |
682 | - + idreg | |
683 | - + "&tema=" | |
684 | - + tema | |
685 | - + "&wkt=POINT(" | |
686 | - + x | |
687 | - + " " | |
688 | - + y | |
689 | - + ")"); | |
520 | + cpJSON.call(p, "foo", temp, "&idunico=" + idreg + "&tema=" + tema + "&wkt=POINT(" + x + " " + y + ")"); | |
690 | 521 | } |
691 | 522 | } |
692 | 523 | }); |
... | ... | @@ -696,65 +527,49 @@ i3GEOF.identifica = |
696 | 527 | $i("i3GEOF.movePontoX").value = objposicaocursor.ddx; |
697 | 528 | $i("i3GEOF.movePontoY").value = objposicaocursor.ddy; |
698 | 529 | } else { |
699 | - i3GEO.eventos.removeEventos("MOUSECLIQUE",["i3GEOF.identifica.atualizaJanelaMoverPonto()"]); | |
530 | + i3GEO.eventos.removeEventos("MOUSECLIQUE", [ | |
531 | + "i3GEOF.identifica.atualizaJanelaMoverPonto()" | |
532 | + ]); | |
700 | 533 | } |
701 | 534 | }, |
702 | 535 | /* |
703 | 536 | * Function: listaTemas |
704 | - * | |
537 | + * | |
705 | 538 | * Incluí a lista de temas para o usuário escolher |
706 | - * | |
539 | + * | |
707 | 540 | * Veja: |
708 | - * | |
541 | + * | |
709 | 542 | * <i3GEO.php.listaTemas> |
710 | - * | |
543 | + * | |
711 | 544 | * Parametros: |
712 | - * | |
713 | - * tipo {String} - ligados|todos lista apenas os temas que estão | |
714 | - * visíveis no mapa ou todos os temas | |
715 | - * | |
545 | + * | |
546 | + * tipo {String} - ligados|todos lista apenas os temas que estão visíveis no mapa ou todos os temas | |
547 | + * | |
716 | 548 | * id {string} id da janela em foco |
717 | 549 | */ |
718 | 550 | listaTemas : function(tipo) { |
719 | 551 | if (i3GEO.arvoreDeCamadas.CAMADAS !== "") { |
720 | 552 | var lista = i3GEO.arvoreDeCamadas.CAMADAS; |
721 | 553 | if (tipo === "ligados") { |
722 | - lista = i3GEO.arvoreDeCamadas.filtraCamadas( | |
723 | - "status", | |
724 | - 2, | |
725 | - "igual", | |
726 | - lista); | |
554 | + lista = i3GEO.arvoreDeCamadas.filtraCamadas("status", 2, "igual", lista); | |
727 | 555 | } |
728 | - lista = i3GEO.arvoreDeCamadas.filtraCamadas( | |
729 | - "identifica", | |
730 | - "NAO", | |
731 | - "diferente", | |
732 | - lista); | |
733 | - lista = i3GEO.arvoreDeCamadas.filtraCamadas( | |
734 | - "identifica", | |
735 | - "nao", | |
736 | - "diferente", | |
737 | - lista); | |
556 | + lista = i3GEO.arvoreDeCamadas.filtraCamadas("identifica", "NAO", "diferente", lista); | |
557 | + lista = i3GEO.arvoreDeCamadas.filtraCamadas("identifica", "nao", "diferente", lista); | |
738 | 558 | i3GEOF.identifica.montaListaTemas(lista); |
739 | 559 | } else { |
740 | - i3GEO.php.listaTemas( | |
741 | - i3GEOF.identifica.montaListaTemas, | |
742 | - tipo, | |
743 | - i3GEO.configura.locaplic, | |
744 | - i3GEO.configura.sid); | |
560 | + i3GEO.php.listaTemas(i3GEOF.identifica.montaListaTemas, tipo, i3GEO.configura.locaplic, i3GEO.configura.sid); | |
745 | 561 | } |
746 | 562 | }, |
747 | 563 | /* |
748 | 564 | * Function: montaListaTemas |
749 | - * | |
565 | + * | |
750 | 566 | * Monta a lista de temas na forma de botões 'radio' |
751 | - * | |
567 | + * | |
752 | 568 | * O resultado é inserido no div com id "listaTemas" |
753 | - * | |
569 | + * | |
754 | 570 | * Parametros: |
755 | - * | |
756 | - * retorno {JSON} - objeto retornado por i3GEO.php.listaTemas ou por | |
757 | - * i3GEO.arvoreDeCamadas.filtraCamadas | |
571 | + * | |
572 | + * retorno {JSON} - objeto retornado por i3GEO.php.listaTemas ou por i3GEO.arvoreDeCamadas.filtraCamadas | |
758 | 573 | */ |
759 | 574 | montaListaTemas : function(retorno) { |
760 | 575 | var lista, linhas, linhas1, l, nome, tema, divResultado, marcado = "", n = i3GEOF.identifica.janelas.length, id = "", i; |
... | ... | @@ -776,11 +591,7 @@ i3GEOF.identifica = |
776 | 591 | // |
777 | 592 | // monta a lista de temas |
778 | 593 | // |
779 | - linhas += "<span style=color:gray; >" | |
780 | - + $trad( | |
781 | - 'verDados', | |
782 | - i3GEOF.identifica.dicionario) | |
783 | - + "</span>"; | |
594 | + linhas += "<span style=color:gray; >" + $trad('verDados', i3GEOF.identifica.dicionario) + "</span>"; | |
784 | 595 | linhas1 = ""; |
785 | 596 | for (l = 0; l < lista.length; l++) { |
786 | 597 | marcado = ""; |
... | ... | @@ -795,30 +606,29 @@ i3GEOF.identifica = |
795 | 606 | marcado = "CHECKED"; |
796 | 607 | } |
797 | 608 | if (lista[l].identifica !== "nao") { |
798 | - linhas1 += "<tr><td style='border-top:1px solid beige;'><input name='buscaDadosTema" | |
799 | - + id | |
800 | - + "' onclick='i3GEOF.identifica.buscaDadosTema(\"" | |
801 | - + tema | |
802 | - + "\",\"\",\"\",\"" | |
803 | - + id | |
804 | - + "\")' style='border:0px solid white;cursor:pointer;' type=radio " | |
805 | - + marcado | |
806 | - + " /></td><td style='border-top:1px solid beige;' >" | |
807 | - + nome | |
808 | - + "</td></tr>"; | |
609 | + linhas1 += | |
610 | + "<tr><td style='border-top:1px solid beige;'><input name='buscaDadosTema" + id | |
611 | + + "' onclick='i3GEOF.identifica.buscaDadosTema(\"" | |
612 | + + tema | |
613 | + + "\",\"\",\"\",\"" | |
614 | + + id | |
615 | + + "\")' style='border:0px solid white;cursor:pointer;' type=radio " | |
616 | + + marcado | |
617 | + + " /></td><td style='border-top:1px solid beige;' >" | |
618 | + + nome | |
619 | + + "</td></tr>"; | |
809 | 620 | } |
810 | 621 | } |
811 | - divResultado = $i(id | |
812 | - + "i3GEOidentificalistaTemas"); | |
622 | + divResultado = $i(id + "i3GEOidentificalistaTemas"); | |
813 | 623 | if (divResultado) { |
814 | - divResultado.innerHTML = linhas | |
815 | - + "<table class=lista2 ><tr><td style=text-align:left ><input name='buscaDadosTema" | |
816 | - + id | |
817 | - + "' onclick='i3GEOF.identifica.buscaDadosTema(\"ligados\",\"\",\"\",\"" | |
818 | - + id | |
819 | - + "\")' style='border:0px solid white;;cursor:pointer' type=radio /></td><td>Todos</td></tr>" | |
820 | - + linhas1 | |
821 | - + "</table>"; | |
624 | + divResultado.innerHTML = | |
625 | + linhas + "<table class=lista2 ><tr><td style=text-align:left ><input name='buscaDadosTema" | |
626 | + + id | |
627 | + + "' onclick='i3GEOF.identifica.buscaDadosTema(\"ligados\",\"\",\"\",\"" | |
628 | + + id | |
629 | + + "\")' style='border:0px solid white;;cursor:pointer' type=radio /></td><td>Todos</td></tr>" | |
630 | + + linhas1 | |
631 | + + "</table>"; | |
822 | 632 | if (i3GEOF.identifica.propJanelas[id].temaAtivo != "") { |
823 | 633 | i3GEOF.identifica.buscaDadosTema( |
824 | 634 | i3GEOF.identifica.propJanelas[id].temaAtivo, |
... | ... | @@ -831,11 +641,11 @@ i3GEOF.identifica = |
831 | 641 | }, |
832 | 642 | /* |
833 | 643 | * Function: montaLinkGeohack |
834 | - * | |
644 | + * | |
835 | 645 | * Monta o link para o site geohack |
836 | - * | |
646 | + * | |
837 | 647 | * Return: |
838 | - * | |
648 | + * | |
839 | 649 | * {String} |
840 | 650 | */ |
841 | 651 | montaLinkGeohack : function() { |
... | ... | @@ -843,9 +653,7 @@ i3GEOF.identifica = |
843 | 653 | }, |
844 | 654 | abreLinkGeohack : function() { |
845 | 655 | var b, x, y, w, s, param; |
846 | - b = i3GEO.calculo.dd2dms( | |
847 | - i3GEOF.identifica.x, | |
848 | - i3GEOF.identifica.y); | |
656 | + b = i3GEO.calculo.dd2dms(i3GEOF.identifica.x, i3GEOF.identifica.y); | |
849 | 657 | x = b[0].split(" "); |
850 | 658 | y = b[1].split(" "); |
851 | 659 | w = "W"; |
... | ... | @@ -857,41 +665,23 @@ i3GEOF.identifica = |
857 | 665 | s = "N"; |
858 | 666 | } |
859 | 667 | if (x[0] * 1 < 0) { |
860 | - x[0] = x[0] | |
861 | - * -1; | |
668 | + x[0] = x[0] * -1; | |
862 | 669 | } |
863 | 670 | if (y[0] * 1 < 0) { |
864 | - y[0] = y[0] | |
865 | - * -1; | |
671 | + y[0] = y[0] * -1; | |
866 | 672 | } |
867 | - param = y[0] | |
868 | - + "_" | |
869 | - + y[1] | |
870 | - + "_" | |
871 | - + y[2] | |
872 | - + "_" | |
873 | - + s | |
874 | - + "_" | |
875 | - + x[0] | |
876 | - + "_" | |
877 | - + x[1] | |
878 | - + "_" | |
879 | - + x[2] | |
880 | - + "_" | |
881 | - + w; | |
882 | - window.open("http://tools.wikimedia.de/~magnus/geo/geohack.php?params=" | |
883 | - + param); | |
673 | + param = y[0] + "_" + y[1] + "_" + y[2] + "_" + s + "_" + x[0] + "_" + x[1] + "_" + x[2] + "_" + w; | |
674 | + window.open("http://tools.wikimedia.de/~magnus/geo/geohack.php?params=" + param); | |
884 | 675 | }, |
885 | 676 | /* |
886 | 677 | * Function: montaListaSistemas |
887 | - * | |
678 | + * | |
888 | 679 | * Obtém a lista de sistemas especiais de consulta. |
889 | - * | |
680 | + * | |
890 | 681 | * O resultado é inserido no div com id "listaSistemas". |
891 | - * | |
892 | - * Cada sistema consiste em uma URL para a qual serão passados os | |
893 | - * parametros x e y. | |
894 | - * | |
682 | + * | |
683 | + * Cada sistema consiste em uma URL para a qual serão passados os parametros x e y. | |
684 | + * | |
895 | 685 | */ |
896 | 686 | montaListaSistemas : function(retorno) { |
897 | 687 | var l, divins, ig, sistema, pub, exec, temp, t, linhas, ltema, i, idjanela, n = i3GEOF.identifica.janelas.length; |
... | ... | @@ -903,20 +693,15 @@ i3GEOF.identifica = |
903 | 693 | if (sis[ig].PUBLICADO) { |
904 | 694 | if (sis[ig].PUBLICADO) { |
905 | 695 | pub = sis[ig].PUBLICADO; |
906 | - if (pub === "NAO" | |
907 | - || pub === "nao") { | |
908 | - sistema = "<s>" | |
909 | - + sistema | |
910 | - + "</s>"; | |
696 | + if (pub === "NAO" || pub === "nao") { | |
697 | + sistema = "<s>" + sistema + "</s>"; | |
911 | 698 | } |
912 | 699 | } |
913 | 700 | } |
914 | 701 | exec = sis[ig].ABRIR; |
915 | 702 | temp = exec.split('"'); |
916 | 703 | if (temp.length === 1) { |
917 | - exec = '"' | |
918 | - + exec | |
919 | - + '"'; | |
704 | + exec = '"' + exec + '"'; | |
920 | 705 | } |
921 | 706 | temp = exec.split("?"); |
922 | 707 | if (temp.length !== 2) { |
... | ... | @@ -926,47 +711,38 @@ i3GEOF.identifica = |
926 | 711 | if (sis[ig].TARGET) { |
927 | 712 | t = sis[ig].TARGET; |
928 | 713 | } |
929 | - i3GEOF.identifica.sistemasAdicionais.push(sistema | |
930 | - + "," | |
931 | - + exec | |
932 | - + "," | |
933 | - + t); | |
714 | + i3GEOF.identifica.sistemasAdicionais.push(sistema + "," + exec + "," + t); | |
934 | 715 | } |
935 | 716 | } |
936 | 717 | if (i3GEOF.identifica.sistemasAdicionais.length > 0) { |
937 | 718 | for (i = 0; i < n; i++) { |
938 | 719 | idjanela = i3GEOF.identifica.janelas[i]; |
939 | - divins = $i(idjanela | |
940 | - + "i3GEOidentificalistaSistemas"); | |
720 | + divins = $i(idjanela + "i3GEOidentificalistaSistemas"); | |
941 | 721 | linhas = ""; |
942 | 722 | for (l = 0; l < i3GEOF.identifica.sistemasAdicionais.length; l++) { |
943 | 723 | ltema = i3GEOF.identifica.sistemasAdicionais[l].split(","); |
944 | 724 | if (ltema.length > 1) { |
945 | - linhas += "<tr><td style='border-top:1px solid beige;'><input onclick='i3GEOF.identifica.mostraDadosSistema(" | |
946 | - + ltema[1] | |
947 | - + ",\"" | |
948 | - + ltema[2] | |
949 | - + "\",\"" | |
950 | - + idjanela | |
951 | - + "\")' style='border:0px solid white;cursor:pointer' type=radio /></td><td style='border-top:1px solid beige;' >" | |
952 | - + ltema[0] | |
953 | - + "</td></tr>"; | |
725 | + linhas += | |
726 | + "<tr><td style='border-top:1px solid beige;'><input onclick='i3GEOF.identifica.mostraDadosSistema(" + ltema[1] | |
727 | + + ",\"" | |
728 | + + ltema[2] | |
729 | + + "\",\"" | |
730 | + + idjanela | |
731 | + + "\")' style='border:0px solid white;cursor:pointer' type=radio /></td><td style='border-top:1px solid beige;' >" | |
732 | + + ltema[0] | |
733 | + + "</td></tr>"; | |
954 | 734 | } |
955 | 735 | |
956 | 736 | } |
957 | 737 | if (divins) { |
958 | 738 | if (i3GEO.parametros.editor.toLowerCase() == "sim") { |
959 | 739 | temp = |
960 | - "<p class=paragrafo ><a href='#' title='Opção visível apenas para quem é editor' style=color:red onclick=\"i3GEOF.identifica.abrejanelaIframe('1050','500','" | |
961 | - + i3GEO.configura.locaplic | |
740 | + "<p class=paragrafo ><a href='#' title='Opção visível apenas para quem é editor' style=color:red onclick=\"i3GEOF.identifica.abrejanelaIframe('1050','500','" + i3GEO.configura.locaplic | |
962 | 741 | + "/admin/html/webservices.html');\" >Editar a lista de sistemas adicionais</a></p>"; |
963 | 742 | } else { |
964 | 743 | temp = ""; |
965 | 744 | } |
966 | - divins.innerHTML = temp | |
967 | - + "<table class='lista2' >" | |
968 | - + linhas | |
969 | - + "</table>"; | |
745 | + divins.innerHTML = temp + "<table class='lista2' >" + linhas + "</table>"; | |
970 | 746 | } |
971 | 747 | } |
972 | 748 | } |
... | ... | @@ -975,18 +751,16 @@ i3GEOF.identifica = |
975 | 751 | }, |
976 | 752 | /* |
977 | 753 | * Function: buscaDadosTema |
978 | - * | |
979 | - * Obtém os dados de um tema para o ponto de coordenadas clicado | |
980 | - * no mapa | |
981 | - * | |
754 | + * | |
755 | + * Obtém os dados de um tema para o ponto de coordenadas clicado no mapa | |
756 | + * | |
982 | 757 | * Veja: |
983 | - * | |
758 | + * | |
984 | 759 | * <i3GEO.php.identifica3> |
985 | 760 | */ |
986 | 761 | buscaDadosTema : function(tema, x, y, idjanela) { |
987 | 762 | var res, opcao, resolucao, janelas, n, i, id; |
988 | - if (tema != "" | |
989 | - && i3GEO.temaAtivo === "") { | |
763 | + if (tema != "" && i3GEO.temaAtivo === "") { | |
990 | 764 | i3GEO.temaAtivo = tema; |
991 | 765 | } |
992 | 766 | if (idjanela) { |
... | ... | @@ -997,20 +771,14 @@ i3GEOF.identifica = |
997 | 771 | janelas = i3GEOF.identifica.janelas; |
998 | 772 | } |
999 | 773 | // guarda o valor de x y nas variaveis de uso global da ferramenta |
1000 | - if (x | |
1001 | - && x != "") { | |
774 | + if (x && x != "") { | |
1002 | 775 | i3GEOF.identifica.x = x; |
1003 | 776 | i3GEOF.identifica.y = y; |
1004 | 777 | } |
1005 | 778 | n = janelas.length; |
1006 | - if (n == 0 | |
1007 | - || (idjanela && !$i(idjanela | |
1008 | - + "i3GEOidentificaocorrencia"))) { | |
1009 | - if (x | |
1010 | - && x != "") { | |
1011 | - i3GEOF.identifica.criaJanelaFlutuante( | |
1012 | - x, | |
1013 | - y); | |
779 | + if (n == 0 || (idjanela && !$i(idjanela + "i3GEOidentificaocorrencia"))) { | |
780 | + if (x && x != "") { | |
781 | + i3GEOF.identifica.criaJanelaFlutuante(x, y); | |
1014 | 782 | } else { |
1015 | 783 | i3GEOF.identifica.criaJanelaFlutuante(); |
1016 | 784 | } |
... | ... | @@ -1025,34 +793,24 @@ i3GEOF.identifica = |
1025 | 793 | } |
1026 | 794 | for (i = 0; i < n; i++) { |
1027 | 795 | id = janelas[i]; |
1028 | - if (i3GEOF.identifica.propJanelas[id].atualiza == undefined | |
1029 | - || i3GEOF.identifica.propJanelas[id].atualiza === true) { | |
1030 | - if (x | |
1031 | - && x != "") { | |
796 | + if (i3GEOF.identifica.propJanelas[id].atualiza == undefined || i3GEOF.identifica.propJanelas[id].atualiza === true) { | |
797 | + if (x && x != "") { | |
1032 | 798 | i3GEOF.identifica.propJanelas[id].x = x; |
1033 | 799 | i3GEOF.identifica.propJanelas[id].y = y; |
1034 | 800 | } |
1035 | - if (tema != "" | |
1036 | - && idjanela) { | |
801 | + if (tema != "" && idjanela) { | |
1037 | 802 | i3GEOF.identifica.propJanelas[id].temaAtivo = tema; |
1038 | 803 | } |
1039 | - if ($i(id | |
1040 | - + "i3GEOidentificaocorrencia")) { | |
1041 | - $i(id | |
1042 | - + "i3GEOidentificaocorrencia").innerHTML = "<img src='" | |
1043 | - + i3GEO.configura.locaplic | |
1044 | - + "/imagens/aguarde.gif' />"; | |
1045 | - res = $i(id | |
1046 | - + "i3GEOidentificaresolucao"); | |
804 | + if ($i(id + "i3GEOidentificaocorrencia")) { | |
805 | + $i(id + "i3GEOidentificaocorrencia").innerHTML = | |
806 | + "<img src='" + i3GEO.configura.locaplic + "/imagens/aguarde.gif' />"; | |
807 | + res = $i(id + "i3GEOidentificaresolucao"); | |
1047 | 808 | if (res) { |
1048 | 809 | resolucao = res.value; |
1049 | 810 | } else { |
1050 | 811 | resolucao = 5; |
1051 | 812 | } |
1052 | - i3GEOF.identifica.buscaDadosTemaJanela( | |
1053 | - id, | |
1054 | - resolucao, | |
1055 | - opcao); | |
813 | + i3GEOF.identifica.buscaDadosTemaJanela(id, resolucao, opcao); | |
1056 | 814 | } |
1057 | 815 | } |
1058 | 816 | } |
... | ... | @@ -1060,7 +818,7 @@ i3GEOF.identifica = |
1060 | 818 | if (!x) { |
1061 | 819 | i3GEOF.identifica.criaJanelaFlutuante(); |
1062 | 820 | } else { |
1063 | - i3GEOF.identifica.criaJanelaFlutuante(x,y); | |
821 | + i3GEOF.identifica.criaJanelaFlutuante(x, y); | |
1064 | 822 | } |
1065 | 823 | } |
1066 | 824 | }, |
... | ... | @@ -1069,13 +827,9 @@ i3GEOF.identifica = |
1069 | 827 | var temp = function(retorno) { |
1070 | 828 | // i3GEOF.identifica.dadosIdentifica = retorno.data; |
1071 | 829 | if (retorno !== undefined) { |
1072 | - i3GEOF.identifica.mostraDadosTema( | |
1073 | - retorno.data, | |
1074 | - idjanela); | |
830 | + i3GEOF.identifica.mostraDadosTema(retorno.data, idjanela); | |
1075 | 831 | } else { |
1076 | - i3GEOF.identifica.mostraDadosTema( | |
1077 | - undefined, | |
1078 | - idjanela); | |
832 | + i3GEOF.identifica.mostraDadosTema(undefined, idjanela); | |
1079 | 833 | } |
1080 | 834 | }; |
1081 | 835 | // importante: os temas editaveis nao utilizam alias em seus nomes |
... | ... | @@ -1094,31 +848,23 @@ i3GEOF.identifica = |
1094 | 848 | }, |
1095 | 849 | /* |
1096 | 850 | * Function: mostraDadosSistema |
1097 | - * | |
1098 | - * Obtém os dados de um sistema para o ponto de coordenadas | |
1099 | - * clicado no mapa | |
1100 | - * | |
851 | + * | |
852 | + * Obtém os dados de um sistema para o ponto de coordenadas clicado no mapa | |
853 | + * | |
1101 | 854 | * Parametros: |
1102 | - * | |
855 | + * | |
1103 | 856 | * exec {String} - url que será aberta |
1104 | - * | |
1105 | - * target {String} (depreciado) - _self|self| onde a url será | |
1106 | - * aberta. Se for "self", será aberta na mesma janela, caso | |
857 | + * | |
858 | + * target {String} (depreciado) - _self|self| onde a url será aberta. Se for "self", será aberta na mesma janela, caso | |
1107 | 859 | * contrário, em uma nova página do navegador |
1108 | 860 | */ |
1109 | 861 | mostraDadosSistema : function(exec, target, idjanela) { |
1110 | 862 | i3GEOF.identifica.mostraImagemPonto(idjanela); |
1111 | - exec += "&x=" | |
1112 | - + i3GEOF.identifica.propJanelas[idjanela].x | |
1113 | - + "&y=" | |
1114 | - + i3GEOF.identifica.propJanelas[idjanela].y; | |
863 | + exec += "&x=" + i3GEOF.identifica.propJanelas[idjanela].x + "&y=" + i3GEOF.identifica.propJanelas[idjanela].y; | |
1115 | 864 | if (target === "target") { |
1116 | 865 | window.open(exec); |
1117 | 866 | } else { |
1118 | - i3GEOF.identifica.abrejanelaIframe( | |
1119 | - "500", | |
1120 | - "500", | |
1121 | - exec); | |
867 | + i3GEOF.identifica.abrejanelaIframe("500", "500", exec); | |
1122 | 868 | } |
1123 | 869 | var i = $i("i3GEOmarcaIdentifica"); |
1124 | 870 | if (i) { |
... | ... | @@ -1127,43 +873,27 @@ i3GEOF.identifica = |
1127 | 873 | }, |
1128 | 874 | /* |
1129 | 875 | * Function abrejanelaIframe |
1130 | - * | |
876 | + * | |
1131 | 877 | * Abre uma janela flutuante contendo um iframe |
1132 | - * | |
878 | + * | |
1133 | 879 | * Parametros: |
1134 | - * | |
880 | + * | |
1135 | 881 | * w {string} - largura |
1136 | - * | |
882 | + * | |
1137 | 883 | * h {string} - altura |
1138 | - * | |
884 | + * | |
1139 | 885 | * s {string} - src do iframe |
1140 | 886 | */ |
1141 | 887 | abrejanelaIframe : function(w, h, s) { |
1142 | - var janelaeditor = i3GEO.janela.cria( | |
1143 | - w, | |
1144 | - h, | |
1145 | - s, | |
1146 | - parseInt( | |
1147 | - Math.random() * 100, | |
1148 | - 10), | |
1149 | - 10, | |
1150 | - "", | |
1151 | - "janela" | |
1152 | - + i3GEO.util.randomRGB(), | |
1153 | - false); | |
888 | + var janelaeditor = | |
889 | + i3GEO.janela.cria(w, h, s, parseInt(Math.random() * 100, 10), 10, "", "janela" + i3GEO.util.randomRGB(), false); | |
1154 | 890 | var temp = function() { |
1155 | 891 | i3GEOF.identifica.sistemasAdicionais = []; |
1156 | 892 | i3GEOF.identifica.atualizaSistemas(); |
1157 | 893 | }; |
1158 | - YAHOO.util.Event.addListener( | |
1159 | - janelaeditor[0].close, | |
1160 | - "click", | |
1161 | - temp, | |
1162 | - janelaeditor[0].panel, | |
1163 | - { | |
1164 | - id : janelaeditor[0].id | |
1165 | - }, | |
1166 | - true); | |
894 | + YAHOO.util.Event.addListener(janelaeditor[0].close, "click", temp, janelaeditor[0].panel, { | |
895 | + id : janelaeditor[0].id | |
896 | + }, true); | |
1167 | 897 | }, |
1168 | 898 | /** |
1169 | 899 | * Aplica um estilo a um elemento de todas as janelas |
... | ... | @@ -1173,8 +903,7 @@ i3GEOF.identifica = |
1173 | 903 | for (i = 0; i < n; i++) { |
1174 | 904 | temp = $i(i3GEOF.identifica.janelas[i]); |
1175 | 905 | if (temp) { |
1176 | - temp = $i(i3GEOF.identifica.janelas[i] | |
1177 | - + posFixo); | |
906 | + temp = $i(i3GEOF.identifica.janelas[i] + posFixo); | |
1178 | 907 | if (temp) { |
1179 | 908 | temp.style[estilo] = valor; |
1180 | 909 | } |
... | ... | @@ -1183,35 +912,26 @@ i3GEOF.identifica = |
1183 | 912 | }, |
1184 | 913 | /* |
1185 | 914 | * Function: mostraDadosTema |
1186 | - * | |
915 | + * | |
1187 | 916 | * Mostra os dados obtidos de um ou mais temas. |
1188 | - * | |
1189 | - * Recebe o resultado em JSON da operação de consulta | |
1190 | - * realizada pelo servidor e formata os dados para | |
917 | + * | |
918 | + * Recebe o resultado em JSON da operação de consulta realizada pelo servidor e formata os dados para | |
1191 | 919 | * apresentação na tela. |
1192 | - * | |
920 | + * | |
1193 | 921 | * Parametros: |
1194 | - * | |
922 | + * | |
1195 | 923 | * retorno {JSON} - objeto JSON com os dados <i3GEO.php.identifica3> |
1196 | 924 | */ |
1197 | 925 | mostraDadosTema : function(retorno, idjanela) { |
1198 | - var filtro, camada, idreg, idsalva, paramsalva, i, res = "", ntemas, resultados, nres, cor, j, nitens, k, atualN = "todas", inicio = 0, numResultados = 0, tip, link, textovalor; | |
926 | + var alvo, filtro, camada, idreg, idsalva, paramsalva, i, res = "", ntemas, resultados, nres, cor, j, nitens, k, atualN = "todas", inicio = | |
927 | + 0, numResultados = 0, tip, link, textovalor; | |
1199 | 928 | |
1200 | - if ($i(idjanela | |
1201 | - + "i3GEOFidentificaNocorrencias")) { | |
1202 | - atualN = $i(idjanela | |
1203 | - + "i3GEOFidentificaNocorrencias").value; | |
929 | + if ($i(idjanela + "i3GEOFidentificaNocorrencias")) { | |
930 | + atualN = $i(idjanela + "i3GEOFidentificaNocorrencias").value; | |
1204 | 931 | } |
1205 | - i3GEOF.identifica.aplicaEstilo( | |
1206 | - "_corpo", | |
1207 | - "scrollTop", | |
1208 | - 0); | |
1209 | - if (retorno == undefined | |
1210 | - || retorno == "") { | |
1211 | - $i(idjanela | |
1212 | - + "i3GEOidentificaocorrencia").innerHTML = $trad( | |
1213 | - 'msgNadaEncontrado', | |
1214 | - i3GEOF.identifica.dicionario); | |
932 | + i3GEOF.identifica.aplicaEstilo("_corpo", "scrollTop", 0); | |
933 | + if (retorno == undefined || retorno == "") { | |
934 | + $i(idjanela + "i3GEOidentificaocorrencia").innerHTML = $trad('msgNadaEncontrado', i3GEOF.identifica.dicionario); | |
1215 | 935 | return; |
1216 | 936 | } |
1217 | 937 | i = $i("i3GEOmarcaIdentifica"); |
... | ... | @@ -1219,33 +939,32 @@ i3GEOF.identifica = |
1219 | 939 | i.style.display = "block"; |
1220 | 940 | } |
1221 | 941 | if (retorno !== undefined) { |
1222 | - $i(idjanela | |
1223 | - + "i3GEOidentificaocorrencia").innerHTML = ""; | |
942 | + $i(idjanela + "i3GEOidentificaocorrencia").innerHTML = ""; | |
1224 | 943 | ntemas = retorno.length; |
1225 | 944 | for (i = 0; i < ntemas; i++) { |
1226 | 945 | resultados = retorno[i].resultado; |
1227 | - //nome do tema e icone de remover filtro | |
1228 | - res += "<div style='padding-top:6px;left:2px;text-align:left;width:100%;' ><b>" | |
1229 | - + retorno[i].nome | |
1230 | - + "<img onclick='i3GEO.util.animaClique(this);i3GEOF.identifica.removeFiltro(\"" | |
1231 | - + retorno[i].tema | |
1232 | - + "\",\"" | |
1233 | - + idjanela | |
1234 | - + "\")' style='margin-left:3px;position:relative;top:3px;width:12px;' src='" | |
1235 | - + i3GEO.configura.locaplic | |
1236 | - + "/imagens/oxygen/16x16/remove-filter.png' title='" | |
1237 | - + $trad( | |
1238 | - 'removeFiltro', | |
1239 | - i3GEOF.identifica.dicionario) | |
1240 | - + "' />" | |
1241 | - + "</b>"; | |
1242 | - //icone que mostra as medidas das variaveis vinculadas a uma regiao, se for o caso | |
1243 | - if(retorno[i].codigo_tipo_regiao && retorno[i].codigo_tipo_regiao != ""){ | |
1244 | - res += "<img onclick='i3GEO.util.animaClique(this);i3GEOF.identifica.listaVariaveis(\"" | |
1245 | - + retorno[i].codigo_tipo_regiao | |
1246 | - + "\",\""+ idjanela +"\")' style='margin-left:3px;position:relative;top:3px;width:12px;' src='" | |
1247 | - + i3GEO.configura.locaplic | |
1248 | - + "/imagens/oxygen/16x16/list-add.png' />"; | |
946 | + // nome do tema e icone de remover filtro | |
947 | + res += | |
948 | + "<div style='padding-top:6px;left:2px;text-align:left;width:100%;' ><b>" + retorno[i].nome | |
949 | + + "<img onclick='i3GEO.util.animaClique(this);i3GEOF.identifica.removeFiltro(\"" | |
950 | + + retorno[i].tema | |
951 | + + "\",\"" | |
952 | + + idjanela | |
953 | + + "\")' style='margin-left:3px;position:relative;top:3px;width:12px;' src='" | |
954 | + + i3GEO.configura.locaplic | |
955 | + + "/imagens/oxygen/16x16/remove-filter.png' title='" | |
956 | + + $trad('removeFiltro', i3GEOF.identifica.dicionario) | |
957 | + + "' />" | |
958 | + + "</b>"; | |
959 | + // icone que mostra as medidas das variaveis vinculadas a uma regiao, se for o caso | |
960 | + if (retorno[i].codigo_tipo_regiao && retorno[i].codigo_tipo_regiao != "") { | |
961 | + res += | |
962 | + "<img onclick='i3GEO.util.animaClique(this);i3GEOF.identifica.listaVariaveis(\"" + retorno[i].codigo_tipo_regiao | |
963 | + + "\",\"" | |
964 | + + idjanela | |
965 | + + "\")' style='margin-left:3px;position:relative;top:3px;width:12px;' src='" | |
966 | + + i3GEO.configura.locaplic | |
967 | + + "/imagens/oxygen/16x16/list-add.png' />"; | |
1249 | 968 | |
1250 | 969 | } |
1251 | 970 | res += "</div>"; |
... | ... | @@ -1269,26 +988,21 @@ i3GEOF.identifica = |
1269 | 988 | } |
1270 | 989 | } |
1271 | 990 | // opcao para apagar e mover o registro |
1272 | - if (idreg != "" | |
1273 | - && retorno[i].editavel == "todos") { | |
1274 | - res += "<a href='#' onclick='i3GEO.util.animaClique(this);i3GEOF.identifica.apagaRegiao(\"" | |
1275 | - + retorno[i].tema | |
1276 | - + "\",\"" | |
1277 | - + idreg | |
1278 | - + "\")' >" | |
1279 | - + $trad( | |
1280 | - 'apagaRegistro', | |
1281 | - i3GEOF.identifica.dicionario) | |
1282 | - + "</a>" | |
1283 | - + " <a href='#' onclick='i3GEO.util.animaClique(this);i3GEOF.identifica.janelaMoverPonto(\"" | |
1284 | - + retorno[i].tema | |
1285 | - + "\",\"" | |
1286 | - + idreg | |
1287 | - + "\")' >" | |
1288 | - + $trad( | |
1289 | - 'move', | |
1290 | - i3GEOF.identifica.dicionario) | |
1291 | - + "</a><br>"; | |
991 | + if (idreg != "" && retorno[i].editavel == "todos") { | |
992 | + res += | |
993 | + "<a href='#' onclick='i3GEO.util.animaClique(this);i3GEOF.identifica.apagaRegiao(\"" + retorno[i].tema | |
994 | + + "\",\"" | |
995 | + + idreg | |
996 | + + "\")' >" | |
997 | + + $trad('apagaRegistro', i3GEOF.identifica.dicionario) | |
998 | + + "</a>" | |
999 | + + " <a href='#' onclick='i3GEO.util.animaClique(this);i3GEOF.identifica.janelaMoverPonto(\"" | |
1000 | + + retorno[i].tema | |
1001 | + + "\",\"" | |
1002 | + + idreg | |
1003 | + + "\")' >" | |
1004 | + + $trad('move', i3GEOF.identifica.dicionario) | |
1005 | + + "</a><br>"; | |
1292 | 1006 | } |
1293 | 1007 | for (k = 0; k < nitens; k++) { |
1294 | 1008 | tip = " "; |
... | ... | @@ -1296,123 +1010,123 @@ i3GEOF.identifica = |
1296 | 1010 | // insere o input para edicao |
1297 | 1011 | // se for uma regiao cadastrada, todos os campos |
1298 | 1012 | // sao editaveis |
1299 | - if (idreg != "" | |
1300 | - && (resultados[j][k].item === retorno[i].editavel || retorno[i].editavel == "todos")) { | |
1013 | + if (idreg != "" && (resultados[j][k].item === retorno[i].editavel || retorno[i].editavel == "todos")) { | |
1301 | 1014 | if (retorno[i].tiposalva == "regiao") { |
1302 | 1015 | retorno[i].id_medida_variavel = 0; |
1303 | 1016 | } |
1304 | - idsalva = "idsalva" | |
1305 | - + retorno[i].tema | |
1306 | - + "_" | |
1307 | - + idreg | |
1308 | - + "_" | |
1309 | - + resultados[j][k].item | |
1310 | - + "_" | |
1311 | - + retorno[i].tiposalva; | |
1312 | - paramsalva = "\"" | |
1313 | - + retorno[i].tema | |
1314 | - + "\"," | |
1315 | - + idreg | |
1316 | - + ",\"" | |
1317 | - + resultados[j][k].item | |
1318 | - + "\",\"" | |
1319 | - + retorno[i].tiposalva | |
1320 | - + "\""; | |
1321 | - textovalor = "<br><img title='' src='" | |
1322 | - + i3GEO.configura.locaplic | |
1323 | - + "/imagens/branco.gif' style='margin-right:2px;position:relative;top:3px;width:12px;'>" | |
1324 | - + "<img onclick='i3GEO.util.animaClique(this);i3GEOF.identifica.salvaDados(" | |
1325 | - + paramsalva | |
1326 | - + ")' title='Salvar' src='" | |
1327 | - + i3GEO.configura.locaplic | |
1328 | - + "/imagens/oxygen/16x16/media-floppy.png' style='cursor:pointer;margin-right:2px;position:relative;top:3px;width:12px;'>" | |
1329 | - + "<input id='" | |
1330 | - + idsalva | |
1331 | - + "' type=text value='" | |
1332 | - + textovalor | |
1333 | - + "' class=digitar style='widh:210px' />"; | |
1017 | + idsalva = | |
1018 | + "idsalva" + retorno[i].tema | |
1019 | + + "_" | |
1020 | + + idreg | |
1021 | + + "_" | |
1022 | + + resultados[j][k].item | |
1023 | + + "_" | |
1024 | + + retorno[i].tiposalva; | |
1025 | + paramsalva = | |
1026 | + "\"" + retorno[i].tema | |
1027 | + + "\"," | |
1028 | + + idreg | |
1029 | + + ",\"" | |
1030 | + + resultados[j][k].item | |
1031 | + + "\",\"" | |
1032 | + + retorno[i].tiposalva | |
1033 | + + "\""; | |
1034 | + textovalor = | |
1035 | + "<br><img title='' src='" + i3GEO.configura.locaplic | |
1036 | + + "/imagens/branco.gif' style='margin-right:2px;position:relative;top:3px;width:12px;'>" | |
1037 | + + "<img onclick='i3GEO.util.animaClique(this);i3GEOF.identifica.salvaDados(" | |
1038 | + + paramsalva | |
1039 | + + ")' title='Salvar' src='" | |
1040 | + + i3GEO.configura.locaplic | |
1041 | + + "/imagens/oxygen/16x16/media-floppy.png' style='cursor:pointer;margin-right:2px;position:relative;top:3px;width:12px;'>" | |
1042 | + + "<input id='" | |
1043 | + + idsalva | |
1044 | + + "' type=text value='" | |
1045 | + + textovalor | |
1046 | + + "' class=digitar style='widh:210px' />"; | |
1334 | 1047 | } |
1335 | - if (resultados[j][k].tip | |
1336 | - && resultados[j][k].tip.toLowerCase() == "sim") { | |
1337 | - tip = "<img style='margin-right:2px;position:relative;top:3px;width:12px;' src='" | |
1338 | - + i3GEO.configura.locaplic | |
1339 | - + "/imagens/tips.png' title='" | |
1340 | - + $trad( | |
1341 | - 'etiquetaAtiva', | |
1342 | - i3GEOF.identifica.dicionario) | |
1343 | - + "' />"; | |
1048 | + if (resultados[j][k].tip && resultados[j][k].tip.toLowerCase() == "sim") { | |
1049 | + tip = | |
1050 | + "<img style='margin-right:2px;position:relative;top:3px;width:12px;' src='" + i3GEO.configura.locaplic | |
1051 | + + "/imagens/tips.png' title='" | |
1052 | + + $trad('etiquetaAtiva', i3GEOF.identifica.dicionario) | |
1053 | + + "' />"; | |
1344 | 1054 | } else { |
1345 | - tip = "<img style='margin-right:4px;position:relative;top:3px;width:12px;' src='" | |
1346 | - + i3GEO.configura.locaplic | |
1347 | - + "/imagens/branco.gif' title='' />"; | |
1055 | + tip = | |
1056 | + "<img style='margin-right:4px;position:relative;top:3px;width:12px;' src='" + i3GEO.configura.locaplic | |
1057 | + + "/imagens/branco.gif' title='' />"; | |
1348 | 1058 | } |
1349 | - filtro = "onclick=\"i3GEO.util.animaClique(this);i3GEOF.identifica.filtrar('" | |
1350 | - + retorno[i].tema | |
1351 | - + "','" | |
1352 | - + resultados[j][k].item | |
1353 | - + "','" | |
1354 | - + resultados[j][k].valor | |
1355 | - + "','" | |
1356 | - + idjanela | |
1357 | - + "')\""; | |
1358 | - filtro = "<img " | |
1359 | - + filtro | |
1360 | - + " style='margin-right:2px;position:relative;top:3px;width:12px;' src='" | |
1361 | - + i3GEO.configura.locaplic | |
1362 | - + "/imagens/oxygen/16x16/view-filter.png' title='" | |
1363 | - + $trad( | |
1364 | - 'filtraValor', | |
1365 | - i3GEOF.identifica.dicionario) | |
1366 | - + "' />"; | |
1059 | + filtro = | |
1060 | + "onclick=\"i3GEO.util.animaClique(this);i3GEOF.identifica.filtrar('" + retorno[i].tema | |
1061 | + + "','" | |
1062 | + + resultados[j][k].item | |
1063 | + + "','" | |
1064 | + + resultados[j][k].valor | |
1065 | + + "','" | |
1066 | + + idjanela | |
1067 | + + "')\""; | |
1068 | + filtro = | |
1069 | + "<img " + filtro | |
1070 | + + " style='margin-right:2px;position:relative;top:3px;width:12px;' src='" | |
1071 | + + i3GEO.configura.locaplic | |
1072 | + + "/imagens/oxygen/16x16/view-filter.png' title='" | |
1073 | + + $trad('filtraValor', i3GEOF.identifica.dicionario) | |
1074 | + + "' />"; | |
1367 | 1075 | // verifica se o texto possui tags de abertura e |
1368 | 1076 | // fechamento html |
1369 | 1077 | try { |
1370 | - if (textovalor | |
1371 | - && (textovalor.search(">") >= 0 || textovalor.search("<") >= 0)) { | |
1078 | + if (textovalor && (textovalor.search(">") >= 0 || textovalor.search("<") >= 0)) { | |
1372 | 1079 | filtro = ""; |
1373 | 1080 | } |
1374 | 1081 | // o mesmo problema pode ocorrer em raster, |
1375 | 1082 | // que possuem o nome da classe como valor |
1376 | - if (resultados[j][k].alias.search(">") >= 0 | |
1377 | - || resultados[j][k].alias.search("<") >= 0) { | |
1083 | + if (resultados[j][k].alias.search(">") >= 0 || resultados[j][k].alias.search("<") >= 0) { | |
1378 | 1084 | filtro = ""; |
1379 | 1085 | } |
1380 | 1086 | } catch (e) { |
1381 | 1087 | } |
1382 | 1088 | |
1383 | 1089 | if (resultados[j][k].link === "") { |
1384 | - res += "<div style='width:100%;text-align:left;background-color:" | |
1385 | - + cor | |
1386 | - + "' >" | |
1387 | - + tip | |
1388 | - + filtro | |
1389 | - + resultados[j][k].alias | |
1390 | - + ": " | |
1391 | - + textovalor | |
1392 | - + "</div>"; | |
1090 | + res += | |
1091 | + "<div style='width:100%;text-align:left;background-color:" + cor | |
1092 | + + "' >" | |
1093 | + + tip | |
1094 | + + filtro | |
1095 | + + resultados[j][k].alias | |
1096 | + + ": " | |
1097 | + + textovalor | |
1098 | + + "</div>"; | |
1393 | 1099 | } else { |
1394 | 1100 | try { |
1395 | 1101 | link = eval(resultados[j][k].link); |
1396 | 1102 | } catch (e) { |
1397 | 1103 | link = resultados[j][k].link; |
1398 | 1104 | } |
1399 | - res += "<div style='width:100%;text-align:left;background-color:" | |
1400 | - + cor | |
1401 | - + "' >" | |
1402 | - + tip | |
1403 | - + resultados[j][k].alias | |
1404 | - + ": <a href='" | |
1405 | - + link | |
1406 | - + "' target=_blank >" | |
1407 | - + textovalor | |
1408 | - + "</a></div>"; | |
1105 | + if(resultados[j][k].idIframe){ | |
1106 | + alvo = resultados[j][k].idIframe; | |
1107 | + } | |
1108 | + else{ | |
1109 | + alvo = "_blank"; | |
1110 | + } | |
1111 | + res += | |
1112 | + "<div style='width:100%;text-align:left;background-color:" + cor | |
1113 | + + "' >" | |
1114 | + + tip | |
1115 | + + resultados[j][k].alias | |
1116 | + + ": <a href='" | |
1117 | + + link | |
1118 | + + "' target='" | |
1119 | + + alvo | |
1120 | + + "'>" | |
1121 | + + textovalor | |
1122 | + + "</a></div>"; | |
1409 | 1123 | } |
1410 | 1124 | if (resultados[j][k].img !== "") { |
1411 | - res += "<div style='width:100%;text-align:left;background-color:" | |
1412 | - + cor | |
1413 | - + "' >" | |
1414 | - + resultados[j][k].img | |
1415 | - + "</div>"; | |
1125 | + res += | |
1126 | + "<div style='width:100%;text-align:left;background-color:" + cor | |
1127 | + + "' >" | |
1128 | + + resultados[j][k].img | |
1129 | + + "</div>"; | |
1416 | 1130 | } |
1417 | 1131 | if (cor === "RGB(250,250,250)") { |
1418 | 1132 | cor = "beige"; |
... | ... | @@ -1424,40 +1138,24 @@ i3GEOF.identifica = |
1424 | 1138 | } |
1425 | 1139 | } else { |
1426 | 1140 | // verifica o tipo de tema |
1427 | - camada = i3GEO.arvoreDeCamadas.pegaTema( | |
1428 | - i3GEO.temaAtivo, | |
1429 | - "", | |
1430 | - "name"); | |
1431 | - if (retorno[i].tiposalva == "regiao" | |
1432 | - && parseInt( | |
1433 | - camada.type, | |
1434 | - 10) == 0) { | |
1141 | + camada = i3GEO.arvoreDeCamadas.pegaTema(i3GEO.temaAtivo, "", "name"); | |
1142 | + if (retorno[i].tiposalva == "regiao" && parseInt(camada.type, 10) == 0) { | |
1435 | 1143 | // opcao para adicionar um ponto |
1436 | - res += $trad( | |
1437 | - 'msgNadaEncontrado2', | |
1438 | - i3GEOF.identifica.dicionario) | |
1439 | - + "<br><a href='#' onclick='i3GEOF.identifica.adicionaPontoRegiao(\"" | |
1440 | - + idjanela | |
1441 | - + "\")' >" | |
1442 | - + $trad( | |
1443 | - 'adicionaPonto', | |
1444 | - i3GEOF.identifica.dicionario) | |
1445 | - + "</a>"; | |
1144 | + res += | |
1145 | + $trad('msgNadaEncontrado2', i3GEOF.identifica.dicionario) + "<br><a href='#' onclick='i3GEOF.identifica.adicionaPontoRegiao(\"" | |
1146 | + + idjanela | |
1147 | + + "\")' >" | |
1148 | + + $trad('adicionaPonto', i3GEOF.identifica.dicionario) | |
1149 | + + "</a>"; | |
1446 | 1150 | } else { |
1447 | - res += $trad( | |
1448 | - 'msgNadaEncontrado2', | |
1449 | - i3GEOF.identifica.dicionario); | |
1151 | + res += $trad('msgNadaEncontrado2', i3GEOF.identifica.dicionario); | |
1450 | 1152 | } |
1451 | 1153 | } |
1452 | 1154 | } |
1453 | 1155 | if (ntemas == 1) { |
1454 | - res = i3GEOF.identifica.montaOpcoesIdentificaOcorrencia( | |
1455 | - atualN, | |
1456 | - numResultados) | |
1457 | - + res; | |
1156 | + res = i3GEOF.identifica.montaOpcoesIdentificaOcorrencia(atualN, numResultados) + res; | |
1458 | 1157 | } |
1459 | - $i(idjanela | |
1460 | - + "i3GEOidentificaocorrencia").innerHTML = res; | |
1158 | + $i(idjanela + "i3GEOidentificaocorrencia").innerHTML = res; | |
1461 | 1159 | } |
1462 | 1160 | }, |
1463 | 1161 | filtrar : function(tema, item, valor, idjanela) { |
... | ... | @@ -1465,29 +1163,15 @@ i3GEOF.identifica = |
1465 | 1163 | return; |
1466 | 1164 | } |
1467 | 1165 | i3GEOF.identifica.propJanelas[idjanela].aguarde.visibility = "visible"; |
1468 | - var filtro = "(|[" | |
1469 | - + item | |
1470 | - + "]| = |" | |
1471 | - + valor | |
1472 | - + "|)", temp = function(retorno) { | |
1166 | + var filtro = "(|[" + item + "]| = |" + valor + "|)", temp = function(retorno) { | |
1473 | 1167 | i3GEOF.identifica.propJanelas[idjanela].aguarde.visibility = "hidden"; |
1474 | - i3GEO.Interface.atualizaTema( | |
1475 | - retorno, | |
1476 | - tema); | |
1477 | - }, p = i3GEO.configura.locaplic | |
1478 | - + "/ferramentas/filtro/exec.php?base64=sim&g_sid=" | |
1479 | - + i3GEO.configura.sid | |
1480 | - + "&funcao=inserefiltro", cp = new cpaint(); | |
1168 | + i3GEO.Interface.atualizaTema(retorno, tema); | |
1169 | + }, p = | |
1170 | + i3GEO.configura.locaplic + "/ferramentas/filtro/exec.php?base64=sim&g_sid=" + i3GEO.configura.sid + "&funcao=inserefiltro", cp = | |
1171 | + new cpaint(); | |
1481 | 1172 | cp.set_response_type("JSON"); |
1482 | 1173 | cp.set_transfer_mode('POST'); |
1483 | - cp.call( | |
1484 | - p, | |
1485 | - "insereFiltro", | |
1486 | - temp, | |
1487 | - "tema=" | |
1488 | - + tema, | |
1489 | - "filtro=" | |
1490 | - + i3GEO.util.base64encode(filtro)); | |
1174 | + cp.call(p, "insereFiltro", temp, "tema=" + tema, "filtro=" + i3GEO.util.base64encode(filtro)); | |
1491 | 1175 | }, |
1492 | 1176 | removeFiltro : function(tema, idjanela) { |
1493 | 1177 | if (i3GEOF.identifica.propJanelas[idjanela].visibility === "visible") { |
... | ... | @@ -1496,123 +1180,65 @@ i3GEOF.identifica = |
1496 | 1180 | i3GEOF.identifica.propJanelas[idjanela].aguarde.visibility = "visible"; |
1497 | 1181 | var temp = function(retorno) { |
1498 | 1182 | i3GEOF.identifica.propJanelas[idjanela].aguarde.visibility = "hidden"; |
1499 | - i3GEO.Interface.atualizaTema( | |
1500 | - retorno, | |
1501 | - tema); | |
1502 | - }, p = i3GEO.configura.locaplic | |
1503 | - + "/ferramentas/filtro/exec.php?base64=nao&g_sid=" | |
1504 | - + i3GEO.configura.sid | |
1505 | - + "&funcao=inserefiltro", cp = new cpaint(); | |
1183 | + i3GEO.Interface.atualizaTema(retorno, tema); | |
1184 | + }, p = | |
1185 | + i3GEO.configura.locaplic + "/ferramentas/filtro/exec.php?base64=nao&g_sid=" + i3GEO.configura.sid + "&funcao=inserefiltro", cp = | |
1186 | + new cpaint(); | |
1506 | 1187 | cp.set_response_type("JSON"); |
1507 | 1188 | cp.set_transfer_mode('POST'); |
1508 | - cp.call( | |
1509 | - p, | |
1510 | - "insereFiltro", | |
1511 | - temp, | |
1512 | - "tema=" | |
1513 | - + tema, | |
1514 | - "filtro="); | |
1189 | + cp.call(p, "insereFiltro", temp, "tema=" + tema, "filtro="); | |
1515 | 1190 | }, |
1516 | 1191 | adicionaPontoRegiao : function(idjanela) { |
1517 | - var p = i3GEO.configura.locaplic | |
1518 | - + "/ferramentas/editortema/exec.php?funcao=adicionaGeometria&g_sid=" | |
1519 | - + i3GEO.configura.sid, tema = i3GEOF.identifica.propJanelas[idjanela].temaAtivo, temp = function(retorno) { | |
1192 | + var p = i3GEO.configura.locaplic + "/ferramentas/editortema/exec.php?funcao=adicionaGeometria&g_sid=" + i3GEO.configura.sid, tema = | |
1193 | + i3GEOF.identifica.propJanelas[idjanela].temaAtivo, temp = function(retorno) { | |
1520 | 1194 | i3GEO.janela.fechaAguarde("aguardeSalvaPonto"); |
1521 | - i3GEO.Interface.atualizaTema( | |
1522 | - "", | |
1523 | - tema); | |
1195 | + i3GEO.Interface.atualizaTema("", tema); | |
1524 | 1196 | i3GEOF.identifica.buscaDadosTema(tema); |
1525 | 1197 | }; |
1526 | 1198 | i3GEO.janela.AGUARDEMODAL = true; |
1527 | - i3GEO.janela.abreAguarde( | |
1528 | - "aguardeSalvaPonto", | |
1529 | - "Adicionando..."); | |
1199 | + i3GEO.janela.abreAguarde("aguardeSalvaPonto", "Adicionando..."); | |
1530 | 1200 | i3GEO.janela.AGUARDEMODAL = false; |
1531 | - cpJSON.call( | |
1532 | - p, | |
1533 | - "foo", | |
1534 | - temp, | |
1535 | - "&tema=" | |
1536 | - + tema | |
1537 | - + "&wkt=POINT(" | |
1538 | - + i3GEOF.identifica.propJanelas[idjanela].x | |
1539 | - + " " | |
1540 | - + i3GEOF.identifica.propJanelas[idjanela].y | |
1541 | - + ")"); | |
1201 | + cpJSON.call(p, "foo", temp, "&tema=" + tema | |
1202 | + + "&wkt=POINT(" | |
1203 | + + i3GEOF.identifica.propJanelas[idjanela].x | |
1204 | + + " " | |
1205 | + + i3GEOF.identifica.propJanelas[idjanela].y | |
1206 | + + ")"); | |
1542 | 1207 | }, |
1543 | 1208 | apagaRegiao : function(tema, idreg) { |
1544 | - var excluir = function() { | |
1545 | - var p = i3GEO.configura.locaplic | |
1546 | - + "/ferramentas/editortema/exec.php?funcao=excluiRegistro&g_sid=" | |
1547 | - + i3GEO.configura.sid, temp = function() { | |
1548 | - i3GEO.janela.fechaAguarde("aguardeRemovendo"); | |
1549 | - i3GEO.Interface.atualizaTema( | |
1550 | - "", | |
1551 | - tema); | |
1552 | - i3GEOF.identifica.buscaDadosTema(tema); | |
1209 | + var excluir = | |
1210 | + function() { | |
1211 | + var p = | |
1212 | + i3GEO.configura.locaplic + "/ferramentas/editortema/exec.php?funcao=excluiRegistro&g_sid=" + i3GEO.configura.sid, temp = | |
1213 | + function() { | |
1214 | + i3GEO.janela.fechaAguarde("aguardeRemovendo"); | |
1215 | + i3GEO.Interface.atualizaTema("", tema); | |
1216 | + i3GEOF.identifica.buscaDadosTema(tema); | |
1217 | + }; | |
1218 | + i3GEO.janela.AGUARDEMODAL = true; | |
1219 | + i3GEO.janela.abreAguarde("aguardeRemovendo", "Excluindo..."); | |
1220 | + i3GEO.janela.AGUARDEMODAL = false; | |
1221 | + cpJSON.call(p, "foo", temp, "&tema=" + tema + "&identificador=" + idreg); | |
1553 | 1222 | }; |
1554 | - i3GEO.janela.AGUARDEMODAL = true; | |
1555 | - i3GEO.janela.abreAguarde( | |
1556 | - "aguardeRemovendo", | |
1557 | - "Excluindo..."); | |
1558 | - i3GEO.janela.AGUARDEMODAL = false; | |
1559 | - cpJSON.call( | |
1560 | - p, | |
1561 | - "foo", | |
1562 | - temp, | |
1563 | - "&tema=" | |
1564 | - + tema | |
1565 | - + "&identificador=" | |
1566 | - + idreg); | |
1567 | - }; | |
1568 | 1223 | i3GEO.janela.confirma( |
1569 | - $trad( | |
1570 | - 'removeRegistroBD', | |
1571 | - i3GEOF.identifica.dicionario), | |
1224 | + $trad('removeRegistroBD', i3GEOF.identifica.dicionario), | |
1572 | 1225 | "", |
1573 | - $trad( | |
1574 | - 'sim', | |
1575 | - i3GEOF.identifica.dicionario), | |
1576 | - $trad( | |
1577 | - 'cancela', | |
1578 | - i3GEOF.identifica.dicionario), | |
1226 | + $trad('sim', i3GEOF.identifica.dicionario), | |
1227 | + $trad('cancela', i3GEOF.identifica.dicionario), | |
1579 | 1228 | excluir); |
1580 | 1229 | }, |
1581 | 1230 | salvaDados : function(tema, idreg, coluna, tiposalva) { |
1582 | - var p = i3GEO.configura.locaplic | |
1583 | - + "/ferramentas/editortema/exec.php?funcao=salvaRegistro&g_sid=" | |
1584 | - + i3GEO.configura.sid, idvalor = $i("idsalva" | |
1585 | - + tema | |
1586 | - + "_" | |
1587 | - + idreg | |
1588 | - + "_" | |
1589 | - + coluna | |
1590 | - + "_" | |
1591 | - + tiposalva), temp = function(retorno) { | |
1231 | + var p = i3GEO.configura.locaplic + "/ferramentas/editortema/exec.php?funcao=salvaRegistro&g_sid=" + i3GEO.configura.sid, idvalor = | |
1232 | + $i("idsalva" + tema + "_" + idreg + "_" + coluna + "_" + tiposalva), temp = function(retorno) { | |
1592 | 1233 | i3GEO.janela.fechaAguarde("aguardeSalvaAtributos"); |
1593 | - i3GEO.Interface.atualizaTema( | |
1594 | - "", | |
1595 | - i3GEOF.identifica.tema); | |
1234 | + i3GEO.Interface.atualizaTema("", i3GEOF.identifica.tema); | |
1596 | 1235 | }; |
1597 | 1236 | |
1598 | 1237 | if (idvalor) { |
1599 | 1238 | i3GEO.janela.AGUARDEMODAL = true; |
1600 | - i3GEO.janela.abreAguarde( | |
1601 | - "aguardeSalvaAtributos", | |
1602 | - "Salvando..."); | |
1239 | + i3GEO.janela.abreAguarde("aguardeSalvaAtributos", "Salvando..."); | |
1603 | 1240 | i3GEO.janela.AGUARDEMODAL = false; |
1604 | - cpJSON.call( | |
1605 | - p, | |
1606 | - "foo", | |
1607 | - temp, | |
1608 | - "&tema=" | |
1609 | - + tema | |
1610 | - + "&coluna=" | |
1611 | - + coluna | |
1612 | - + "&valor=" | |
1613 | - + idvalor.value | |
1614 | - + "&identificador=" | |
1615 | - + idreg); | |
1241 | + cpJSON.call(p, "foo", temp, "&tema=" + tema + "&coluna=" + coluna + "&valor=" + idvalor.value + "&identificador=" + idreg); | |
1616 | 1242 | } else { |
1617 | 1243 | alert("ocorreu um erro"); |
1618 | 1244 | } |
... | ... | @@ -1623,75 +1249,58 @@ i3GEOF.identifica = |
1623 | 1249 | atual = "todas"; |
1624 | 1250 | } |
1625 | 1251 | sel = ""; |
1626 | - select = "<select id=i3GEOFidentificaNocorrencias onchange='i3GEOF.identifica.mostraDadosTema(i3GEOF.identifica.dadosIdentifica)'>"; | |
1252 | + select = | |
1253 | + "<select id=i3GEOFidentificaNocorrencias onchange='i3GEOF.identifica.mostraDadosTema(i3GEOF.identifica.dadosIdentifica)'>"; | |
1627 | 1254 | if (atual == "todas") { |
1628 | 1255 | sel = "SELECTED"; |
1629 | 1256 | } |
1630 | - select += "<option value='todas' " | |
1631 | - + sel | |
1632 | - + " >" | |
1633 | - + $trad( | |
1634 | - 'todas', | |
1635 | - i3GEOF.identifica.dicionario) | |
1636 | - + "</option>"; | |
1257 | + select += "<option value='todas' " + sel + " >" + $trad('todas', i3GEOF.identifica.dicionario) + "</option>"; | |
1637 | 1258 | nocor = nres + 1; |
1638 | 1259 | for (i = 1; i < nocor; i++) { |
1639 | 1260 | sel = ""; |
1640 | 1261 | if (atual == i) { |
1641 | 1262 | sel = "SELECTED"; |
1642 | 1263 | } |
1643 | - select += "<option value=" | |
1644 | - + i | |
1645 | - + " " | |
1646 | - + sel | |
1647 | - + " >" | |
1648 | - + i | |
1649 | - + "</option>"; | |
1264 | + select += "<option value=" + i + " " + sel + " >" + i + "</option>"; | |
1650 | 1265 | } |
1651 | 1266 | select += "</select>"; |
1652 | 1267 | ins = "<table><tr>"; |
1653 | - ins += "<td>" | |
1654 | - + $trad( | |
1655 | - 'mostraOcorrencia', | |
1656 | - i3GEOF.identifica.dicionario) | |
1657 | - + ": </td>"; | |
1658 | - ins += "<td> " | |
1659 | - + select | |
1660 | - + "</td>"; | |
1268 | + ins += "<td>" + $trad('mostraOcorrencia', i3GEOF.identifica.dicionario) + ": </td>"; | |
1269 | + ins += "<td> " + select + "</td>"; | |
1661 | 1270 | ins += "</tr></table>"; |
1662 | 1271 | if (nres == 1) { |
1663 | 1272 | ins = ""; |
1664 | 1273 | } |
1665 | 1274 | return ins; |
1666 | 1275 | }, |
1667 | - listaVariaveis : function(codigo_tipo_regiao,idjanela){ | |
1276 | + listaVariaveis : function(codigo_tipo_regiao, idjanela) { | |
1668 | 1277 | var p, temp; |
1669 | - temp = function (retorno){ | |
1278 | + temp = function(retorno) { | |
1670 | 1279 | var ins = "", n, i, m, j, d, dd, nc, ic, ndd, idd; |
1671 | 1280 | n = retorno.length; |
1672 | 1281 | |
1673 | - if(n > 0){ | |
1674 | - //cada variavel | |
1675 | - for(i=0; i<n; i++){ | |
1282 | + if (n > 0) { | |
1283 | + // cada variavel | |
1284 | + for (i = 0; i < n; i++) { | |
1676 | 1285 | d = retorno[i]; |
1677 | 1286 | ins += "<b>" + d.variavel + "</b>"; |
1678 | 1287 | m = d.dados.length; |
1679 | - //cada medida | |
1680 | - for(j = 0; j<m; j++){ | |
1288 | + // cada medida | |
1289 | + for (j = 0; j < m; j++) { | |
1681 | 1290 | dd = d.dados[j]; |
1682 | - //ins += " -> " + dd.medida; | |
1291 | + // ins += " -> " + dd.medida; | |
1683 | 1292 | nc = dd.dados.colunas.length; |
1684 | 1293 | ins += "<table class='lista4' ><tr>"; |
1685 | - //cabecalho | |
1686 | - for(ic=0; ic<nc; ic++){ | |
1294 | + // cabecalho | |
1295 | + for (ic = 0; ic < nc; ic++) { | |
1687 | 1296 | ins += "<td>" + dd.dados.aliascolunas[ic] + "</td>"; |
1688 | 1297 | } |
1689 | 1298 | ins += "</tr>"; |
1690 | 1299 | ndd = dd.dados.dados.length; |
1691 | - //cada valor | |
1692 | - for(idd=0; idd<ndd;idd++){ | |
1300 | + // cada valor | |
1301 | + for (idd = 0; idd < ndd; idd++) { | |
1693 | 1302 | ins += "<tr>"; |
1694 | - for(ic=0; ic<nc; ic++){ | |
1303 | + for (ic = 0; ic < nc; ic++) { | |
1695 | 1304 | ins += "<td>" + dd.dados.dados[idd][dd.dados.colunas[ic]] + "</td>"; |
1696 | 1305 | } |
1697 | 1306 | ins += "</tr>"; |
... | ... | @@ -1700,9 +1309,16 @@ i3GEOF.identifica = |
1700 | 1309 | } |
1701 | 1310 | } |
1702 | 1311 | } |
1703 | - i3GEO.janela.mensagemSimples("<div style='overflow:auto;height:100%'>"+ins+"</div>", ""); | |
1312 | + i3GEO.janela.mensagemSimples("<div style='overflow:auto;height:100%'>" + ins + "</div>", ""); | |
1704 | 1313 | }; |
1705 | - p = i3GEO.configura.locaplic+"/admin/php/metaestat.php?funcao=LISTATODOSATRIBUTOSMEDIDAVARIAVELXY", | |
1706 | - cpJSON.call(p,"foo",temp,"&codigo_tipo_regiao="+codigo_tipo_regiao+"&x="+i3GEOF.identifica.propJanelas[idjanela].x+"&y="+i3GEOF.identifica.propJanelas[idjanela].y); | |
1314 | + p = i3GEO.configura.locaplic + "/admin/php/metaestat.php?funcao=LISTATODOSATRIBUTOSMEDIDAVARIAVELXY", cpJSON.call( | |
1315 | + p, | |
1316 | + "foo", | |
1317 | + temp, | |
1318 | + "&codigo_tipo_regiao=" + codigo_tipo_regiao | |
1319 | + + "&x=" | |
1320 | + + i3GEOF.identifica.propJanelas[idjanela].x | |
1321 | + + "&y=" | |
1322 | + + i3GEOF.identifica.propJanelas[idjanela].y); | |
1707 | 1323 | } |
1708 | 1324 | }; | ... | ... |