From 35d4db39a6a7b20c497c85553a994eb010d0e0e7 Mon Sep 17 00:00:00 2001 From: Edmar Moretti Date: Thu, 30 Jul 2015 20:51:06 +0000 Subject: [PATCH] --- classesphp/classe_atributos.php | 13 +++++++------ ferramentas/identifica/index.js | 1524 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ 2 files changed, 577 insertions(+), 960 deletions(-) diff --git a/classesphp/classe_atributos.php b/classesphp/classe_atributos.php index 80fc8f7..670e242 100644 --- a/classesphp/classe_atributos.php +++ b/classesphp/classe_atributos.php @@ -2117,10 +2117,10 @@ class Atributos $res = str_replace("INFOFORMAT","INFO_FORMAT",$res); $res2 = $layer->getWMSFeatureInfoURL($ptimg->x, $ptimg->y, 1,"MIME"); $res2 = str_replace("INFOFORMAT","INFO_FORMAT",$res2); + //echo $res." ".$res2;exit; $resposta = file($res); //var_dump($resposta);exit; - $n = array(); if(strtoupper($formatoinfo) != "TEXT/HTML" && strtoupper($formatoinfo) != "MIME"){ foreach($resposta as $r){ @@ -2158,20 +2158,21 @@ class Atributos } } //var_dump($n);exit; - if(count($n) == 0){ + $id = nomeRandomico(); + if(count($n) == 0 && strtoupper($formatoinfo) != "TEXT/HTML"){ $formatoinfo = "MIME"; } if(strtoupper($formatoinfo) == "TEXT/HTML" && $res != ""){ - $n[] = array("alias"=>"","valor"=>"","link"=>"","img"=>""); + $n[] = array("alias"=>"","valor"=>"","link"=>"","img"=>""); } if(strtoupper($formatoinfo) == "MIME" && $res2 != ""){ - $n[] = array("alias"=>"","valor"=>"","link"=>"","img"=>""); + $n[] = array("alias"=>"","valor"=>"","link"=>"","img"=>""); } if($res != ""){ - $n[] = array("alias"=>"Link WMS","valor"=>"getfeatureinfo ".$formatoinfo,"link"=>$res,"img"=>""); + $n[] = array("alias"=>"Link WMS","valor"=>"getfeatureinfo ".$formatoinfo,"link"=>$res,"img"=>"","idIframe"=>$id); } if($res2 != ""){ - $n[] = array("alias"=>"Link WMS","valor"=>"getfeatureinfo padrão do serviço","link"=>$res2,"img"=>""); + $n[] = array("alias"=>"Link WMS","valor"=>"getfeatureinfo padrão do serviço","link"=>$res2,"img"=>"","idIframe"=>$id); } if($res == "" && $res2 == ""){ $n[] = array("alias"=>"Ocorreu um erro","valor"=>"","link"=>"","img"=>""); diff --git a/ferramentas/identifica/index.js b/ferramentas/identifica/index.js index b729e56..0caebd8 100644 --- a/ferramentas/identifica/index.js +++ b/ferramentas/identifica/index.js @@ -45,10 +45,11 @@ if (typeof (i3GEOF) === 'undefined') { } /* * Classe: i3GEOF.identifica - * + * */ -//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 +// 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 i3GEOF.identifica = { /** @@ -57,8 +58,7 @@ i3GEOF.identifica = janelas : [], propJanelas : {}, /** - * Template no formato mustache. E preenchido na carga do javascript com - * o programa dependencias.php + * Template no formato mustache. E preenchido na carga do javascript com o programa dependencias.php */ MUSTACHE : "", /** @@ -71,109 +71,92 @@ i3GEOF.identifica = }, /* * Propriedade: mostraLinkGeohack - * + * * Mostra ou não o link para abrir o site GeoHack. - * - * Este site permite o uso de vários buscadores - * disponíveis na internet. - * + * + * Este site permite o uso de vários buscadores disponíveis na internet. + * * Type: {boolean} */ mostraLinkGeohack : true, /* * Propriedade: mostraSistemasAdicionais - * - * Mostra ou não a lista de sistemas adicionais de busca de - * dados. - * + * + * Mostra ou não a lista de sistemas adicionais de busca de dados. + * * Type: {boolean} */ mostraSistemasAdicionais : true, /* * Variavel: tema - * + * * Código do tema que será pesquisado - * + * * Type: {String} */ tema : "", /* * Variavel: x - * + * * Coordenada x - * + * * Type: {Numeric} */ x : 0, /* * Variavel: y - * + * * Coordenada y - * + * * Type: {Numeric} */ y : 0, /* * Variavel: sistemasAdicionais - * - * Guarda a lista de sistemas adicionais que são incluídos - * na seleção de temas - * + * + * Guarda a lista de sistemas adicionais que são incluídos na seleção de temas + * * Type: {Array} */ sistemasAdicionais : [], /* * Variavel: dadosIdentifica - * - * Guarda os dados obtidos com a chamada em AJAX de - * identificação - * + * + * Guarda os dados obtidos com a chamada em AJAX de identificação + * * Type: {Array} */ dadosIdentifica : [], /* - * Para efeitos de compatibilidade antes da versão 4.7 que - * não tinha dicionário + * Para efeitos de compatibilidade antes da versão 4.7 que não tinha dicionário */ criaJanelaFlutuante : function(x, y) { - i3GEOF.identifica.iniciaDicionario( - x, - y); + i3GEOF.identifica.iniciaDicionario(x, y); }, /* * Function: iniciaDicionario - * - * Carrega o dicionário e chama a função que inicia - * a ferramenta - * - * O Javascript é carregado com o id - * i3GEOF.nomedaferramenta.dicionario_script + * + * Carrega o dicionário e chama a função que inicia a ferramenta + * + * O Javascript é carregado com o id i3GEOF.nomedaferramenta.dicionario_script */ iniciaDicionario : function(x, y, id) { if (typeof (i3GEOF.identifica.dicionario) === 'undefined') { if (x) { i3GEO.util.scriptTag( - i3GEO.configura.locaplic - + "/ferramentas/identifica/dicionario.js", - "i3GEOF.identifica.iniciaJanelaFlutuante(" - + x - + "," - + y - + ")", + i3GEO.configura.locaplic + "/ferramentas/identifica/dicionario.js", + "i3GEOF.identifica.iniciaJanelaFlutuante(" + x + "," + y + ")", "i3GEOF.identifica.dicionario_script"); } else { i3GEO.util.scriptTag( - i3GEO.configura.locaplic - + "/ferramentas/identifica/dicionario.js", + i3GEO.configura.locaplic + "/ferramentas/identifica/dicionario.js", "i3GEOF.identifica.iniciaJanelaFlutuante()", "i3GEOF.identifica.dicionario_script"); } } else { if (x) { - i3GEOF.identifica.iniciaJanelaFlutuante( - x, - y); + i3GEOF.identifica.iniciaJanelaFlutuante(x, y); } else { i3GEOF.identifica.iniciaJanelaFlutuante(); } @@ -181,29 +164,24 @@ i3GEOF.identifica = }, /* * Function: inicia - * + * * Inicia a janela de informações - * + * * Parameters: - * - * tema {String} - código do tema, existente no mapfile - * armazenado na seção, que será consultado + * + * tema {String} - código do tema, existente no mapfile armazenado na seção, que será consultado * já na inicialização - * - * x {Numeric} - coordenada x do ponto que será utilizado para - * busca dos atributos - * + * + * x {Numeric} - coordenada x do ponto que será utilizado para busca dos atributos + * * y {Numeric} - coordenada y do ponto - * - * iddiv {String} - id do elemento html onde o conteúdo da - * ferramenta será incluido - * - * mostraLinkGeohack {boolean} - mostra ou não o link para o site - * geohacks - * - * mostraSistemasAdicionais {boolean} - mostra ou não os sistemas - * adicionais de busca de dados - * + * + * iddiv {String} - id do elemento html onde o conteúdo da ferramenta será incluido + * + * mostraLinkGeohack {boolean} - mostra ou não o link para o site geohacks + * + * mostraSistemasAdicionais {boolean} - mostra ou não os sistemas adicionais de busca de dados + * * idjanela {string} */ inicia : function(tema, x, y, iddiv, mostraLinkGeohack, mostraSistemasAdicionais, idjanela) { @@ -221,140 +199,83 @@ i3GEOF.identifica = if (i3GEO.parametros.editor.toLowerCase() == "sim") { i3GEOF.identifica.mostraSistemasAdicionais == true; } - i3GEO.guias.mostraGuiaFerramenta( - idjanela - + "i3GEOidentificaguia1", - idjanela - + "i3GEOidentificaguia"); + i3GEO.guias.mostraGuiaFerramenta(idjanela + "i3GEOidentificaguia1", idjanela + "i3GEOidentificaguia"); // eventos das guias - $i(idjanela - + "i3GEOidentificaguia1").onclick = function() { - i3GEOF.identifica.listaTemas( - "ligados", - "", - "", - idjanela); - i3GEO.guias.mostraGuiaFerramenta( - idjanela - + "i3GEOidentificaguia1", - idjanela - + "i3GEOidentificaguia"); + $i(idjanela + "i3GEOidentificaguia1").onclick = function() { + i3GEOF.identifica.listaTemas("ligados", "", "", idjanela); + i3GEO.guias.mostraGuiaFerramenta(idjanela + "i3GEOidentificaguia1", idjanela + "i3GEOidentificaguia"); if (i3GEO.identifica.propJanelas[idjanela].temaAtivo === "") { - $i(idjanela - + "i3GEOidentificaocorrencia").innerHTML = $trad( - 'selecionaTema', - i3GEOF.identifica.dicionario); + $i(idjanela + "i3GEOidentificaocorrencia").innerHTML = $trad('selecionaTema', i3GEOF.identifica.dicionario); } }; - $i(idjanela - + "i3GEOidentificaguia2").onclick = function() { - i3GEOF.identifica.listaTemas( - "todos", - "", - "", - idjanela); - i3GEO.guias.mostraGuiaFerramenta( - idjanela - + "i3GEOidentificaguia1", - idjanela - + "i3GEOidentificaguia"); + $i(idjanela + "i3GEOidentificaguia2").onclick = function() { + i3GEOF.identifica.listaTemas("todos", "", "", idjanela); + i3GEO.guias.mostraGuiaFerramenta(idjanela + "i3GEOidentificaguia1", idjanela + "i3GEOidentificaguia"); }; - $i(idjanela - + "i3GEOidentificaguia3").onclick = function() { - i3GEO.guias.mostraGuiaFerramenta( - idjanela - + "i3GEOidentificaguia3", - idjanela - + "i3GEOidentificaguia"); + $i(idjanela + "i3GEOidentificaguia3").onclick = function() { + i3GEO.guias.mostraGuiaFerramenta(idjanela + "i3GEOidentificaguia3", idjanela + "i3GEOidentificaguia"); }; - $i(idjanela - + "i3GEOidentificaguia4").onclick = function() { - i3GEO.guias.mostraGuiaFerramenta( - idjanela - + "i3GEOidentificaguia4", - idjanela - + "i3GEOidentificaguia"); - var b = new YAHOO.widget.Button( - idjanela - + "i3GEOidentificabotao1", { - onclick : { - fn : function() { - if (i3GEOF.identifica.propJanelas[idjanela].temaAtivo - && i3GEOF.identifica.propJanelas[idjanela].temaAtivo !== "") { - var ltema = i3GEO.arvoreDeCamadas.pegaTema(i3GEOF.identifica.propJanelas[idjanela].temaAtivo); - if (ltema.identifica == "nao" - || ltema.identifica == "NAO") { - i3GEO.janela.tempoMsg($trad( - 'msgEtiquetas', - i3GEOF.identifica.dicionario)); - } else { - i3GEO.tema.dialogo.etiquetas(i3GEOF.identifica.propJanelas[idjanela].temaAtivo); + $i(idjanela + "i3GEOidentificaguia4").onclick = + function() { + i3GEO.guias.mostraGuiaFerramenta(idjanela + "i3GEOidentificaguia4", idjanela + "i3GEOidentificaguia"); + var b = + new YAHOO.widget.Button( + idjanela + "i3GEOidentificabotao1", + { + onclick : { + fn : function() { + if (i3GEOF.identifica.propJanelas[idjanela].temaAtivo && i3GEOF.identifica.propJanelas[idjanela].temaAtivo !== "") { + var ltema = + i3GEO.arvoreDeCamadas.pegaTema(i3GEOF.identifica.propJanelas[idjanela].temaAtivo); + if (ltema.identifica == "nao" || ltema.identifica == "NAO") { + i3GEO.janela.tempoMsg($trad('msgEtiquetas', i3GEOF.identifica.dicionario)); + } else { + i3GEO.tema.dialogo.etiquetas(i3GEOF.identifica.propJanelas[idjanela].temaAtivo); + } + $i(idjanela + "i3GEOidentificaocorrencia").innerHTML = ""; + } else { + $i(idjanela + "i3GEOidentificaocorrencia").innerHTML = + $trad('selecionaTema', i3GEOF.identifica.dicionario); + } } - $i(idjanela - + "i3GEOidentificaocorrencia").innerHTML = ""; - } else { - $i(idjanela - + "i3GEOidentificaocorrencia").innerHTML = $trad( - 'selecionaTema', - i3GEOF.identifica.dicionario); + } + }); + b.addClass("abrir"); + }; + $i(idjanela + "i3GEOidentificaguia5").onclick = + function() { + i3GEO.guias.mostraGuiaFerramenta(idjanela + "i3GEOidentificaguia5", idjanela + "i3GEOidentificaguia"); + var temp, b = + new YAHOO.widget.Button(idjanela + "i3GEOidentificabotao2", { + onclick : { + fn : function() { + var js = i3GEO.configura.locaplic + "/ferramentas/bufferpt/dependencias.php"; + i3GEO.util.scriptTag( + js, + "i3GEOF.bufferpt.iniciaJanelaFlutuante(" + i3GEOF.identifica.propJanelas[idjanela].x + + "," + + i3GEOF.identifica.propJanelas[idjanela].y + + ")", + "i3GEOF.bufferpt_script"); } } - } - }); - b.addClass("abrir"); - }; - $i(idjanela - + "i3GEOidentificaguia5").onclick = function() { - i3GEO.guias.mostraGuiaFerramenta( - idjanela - + "i3GEOidentificaguia5", - idjanela - + "i3GEOidentificaguia"); - var temp, b = new YAHOO.widget.Button( - idjanela - + "i3GEOidentificabotao2", { - onclick : { - fn : function() { - var js = i3GEO.configura.locaplic - + "/ferramentas/bufferpt/dependencias.php"; - i3GEO.util.scriptTag( - js, - "i3GEOF.bufferpt.iniciaJanelaFlutuante(" - + i3GEOF.identifica.propJanelas[idjanela].x - + "," - + i3GEOF.identifica.propJanelas[idjanela].y - + ")", - "i3GEOF.bufferpt_script"); - } - } - }); - b.addClass("rodar"); - temp = i3GEO.coordenadas.formato, - gh = i3GEO.coordenadas.geohash.encodeGeoHash( - i3GEOF.identifica.propJanelas[idjanela].y, - i3GEOF.identifica.propJanelas[idjanela].x); - i3GEO.coordenadas.formato = "lista"; - i3GEO.coordenadas.mostraCoordenadas( - false, - idjanela - + "i3GEOidentificacoordtexto", - i3GEOF.identifica.propJanelas[idjanela].x, - i3GEOF.identifica.propJanelas[idjanela].y); - i3GEO.coordenadas.MODOTEXTO += "Geohash: " - + gh - + ""; - $i(idjanela - + "i3GEOidentificacoordtexto").innerHTML = i3GEO.coordenadas.MODOTEXTO - + ""; - i3GEO.coordenadas.formato = temp; - }; - i3GEOF.identifica.listaTemas( - "ligados", - "", - "", - idjanela); + }); + b.addClass("rodar"); + temp = i3GEO.coordenadas.formato, gh = + i3GEO.coordenadas.geohash.encodeGeoHash( + i3GEOF.identifica.propJanelas[idjanela].y, + i3GEOF.identifica.propJanelas[idjanela].x); + i3GEO.coordenadas.formato = "lista"; + i3GEO.coordenadas.mostraCoordenadas( + false, + idjanela + "i3GEOidentificacoordtexto", + i3GEOF.identifica.propJanelas[idjanela].x, + i3GEOF.identifica.propJanelas[idjanela].y); + i3GEO.coordenadas.MODOTEXTO += "Geohash: " + gh + ""; + $i(idjanela + "i3GEOidentificacoordtexto").innerHTML = i3GEO.coordenadas.MODOTEXTO + ""; + i3GEO.coordenadas.formato = temp; + }; + i3GEOF.identifica.listaTemas("ligados", "", "", idjanela); // // verifica se existem sistemas para identificar // @@ -363,11 +284,7 @@ i3GEOF.identifica = // verifica se o tema ativo pode ser identificado var temp = i3GEO.arvoreDeCamadas.pegaTema(i3GEOF.identifica.propJanelas[idjanela].temaAtivo); if (temp.identifica.toLowerCase() !== "nao") { - i3GEOF.identifica.buscaDadosTema( - i3GEOF.identifica.propJanelas[idjanela].temaAtivo, - "", - "", - idjanela); + i3GEOF.identifica.buscaDadosTema(i3GEOF.identifica.propJanelas[idjanela].temaAtivo, "", "", idjanela); } } } catch (erro) { @@ -375,60 +292,32 @@ i3GEOF.identifica = // botao de redimensionar as partes da janela var Dom = YAHOO.util.Dom, col1 = null, col2 = null; - col1 = Dom.get(idjanela - + 'i3GEOidentificatemaativo'); - col2 = Dom.get(idjanela - + 'i3GEOidentificaocorrencia'); - var resize = new YAHOO.util.Resize( - idjanela - + 'i3GEOidentificatemaativo', { - handles : [ - 'r' - ], - maxWidth : 180 - }); - resize.on( - 'resize', - function(ev) { - // Dom.setStyle(col1, 'height', ''); - // 150 é o tamanho inicial da parte esquerda, - // corresponde a 40% - var w1 = parseInt(col1.style.width); - var dif = parseInt( - (w1 * 40) / 150, - 10); - Dom.setStyle( - col2, - 'width', - 40 - - dif - + 60 - + '%'); - Dom.setStyle( - col2, - 'left', - w1 - + 15 - + 'px'); - }); - resize.resize( - null, - null, - null, - 0, - 0, - true); + col1 = Dom.get(idjanela + 'i3GEOidentificatemaativo'); + col2 = Dom.get(idjanela + 'i3GEOidentificaocorrencia'); + var resize = new YAHOO.util.Resize(idjanela + 'i3GEOidentificatemaativo', { + handles : [ + 'r' + ], + maxWidth : 180 + }); + resize.on('resize', function(ev) { + // Dom.setStyle(col1, 'height', ''); + // 150 é o tamanho inicial da parte esquerda, + // corresponde a 40% + var w1 = parseInt(col1.style.width); + var dif = parseInt((w1 * 40) / 150, 10); + Dom.setStyle(col2, 'width', 40 - dif + 60 + '%'); + Dom.setStyle(col2, 'left', w1 + 15 + 'px'); + }); + resize.resize(null, null, null, 0, 0, true); }, atualizaSistemas : function() { if (i3GEOF.identifica.mostraSistemasAdicionais === true) { if (i3GEOF.identifica.sistemasAdicionais.length == 0) { - var p = i3GEO.configura.locaplic - + "/classesphp/mapa_controle.php?funcao=pegaSistemasIdentificacao&g_sid=" - + i3GEO.configura.sid; - cpJSON.call( - p, - "foo", - i3GEOF.identifica.montaListaSistemas); + var p = + i3GEO.configura.locaplic + "/classesphp/mapa_controle.php?funcao=pegaSistemasIdentificacao&g_sid=" + + i3GEO.configura.sid; + cpJSON.call(p, "foo", i3GEOF.identifica.montaListaSistemas); } else { i3GEOF.identifica.montaListaSistemas(""); } @@ -436,14 +325,11 @@ i3GEOF.identifica = }, /* * Function: iniciaJanelaFlutuante - * + * * Cria a janela flutuante para controle da ferramenta. */ iniciaJanelaFlutuante : function(x, y) { - var minimiza, cabecalho, duplica, janela, divid, temp, titulo, id = "ident" - + parseInt( - Math.random() * 1000000, - 10); + var minimiza, cabecalho, duplica, janela, divid, temp, titulo, id = "ident" + parseInt(Math.random() * 1000000, 10); i3GEOF.identifica.janelas.push(id); i3GEOF.identifica.propJanelas[id] = {}; if (x) { @@ -465,85 +351,77 @@ i3GEOF.identifica = i3GEO.janela.minimiza(id); }; duplica = function() { - i3GEOF.identifica.iniciaJanelaFlutuante( - i3GEOF.identifica.propJanelas[id].x, - i3GEOF.identifica.propJanelas[id].y); + i3GEOF.identifica.iniciaJanelaFlutuante(i3GEOF.identifica.propJanelas[id].x, i3GEOF.identifica.propJanelas[id].y); }; // cria a janela flutuante - titulo = "
" + $trad("d7t") - + "
"; - janela = i3GEO.janela.cria( - "450px", - "250px", - "", - "", - "", - titulo, - id, - false, - "hd", - cabecalho, - minimiza, - "", - true, - i3GEO.configura.locaplic - + "/imagens/oxygen/16x16/telepathy-kde.png", - duplica); + titulo = + "
" + $trad("d7t") + + "
"; + janela = + i3GEO.janela.cria( + "450px", + "250px", + "", + "", + "", + titulo, + id, + false, + "hd", + cabecalho, + minimiza, + "", + true, + i3GEO.configura.locaplic + "/imagens/oxygen/16x16/telepathy-kde.png", + duplica); divid = janela[2].id; if (i3GEOF.identifica.janelas.length > 1) { temp = janela[0].cfg.config; janela[0].moveTo( - temp.x.value - + (i3GEOF.identifica.janelas.length * 50), - temp.y.value - + (i3GEOF.identifica.janelas.length * 15)); + temp.x.value + (i3GEOF.identifica.janelas.length * 50), + temp.y.value + (i3GEOF.identifica.janelas.length * 15)); } - i3GEOF.identifica.inicia( - i3GEO.temaAtivo, - objposicaocursor.ddx, - objposicaocursor.ddy, - divid, - true, - true, - id); + i3GEOF.identifica.inicia(i3GEO.temaAtivo, objposicaocursor.ddx, objposicaocursor.ddy, divid, true, true, id); janela[2].style.backgroundColor = "white"; - i3GEOF.identifica.propJanelas[id].aguarde = $i(id - + "_imagemCabecalho").style; + i3GEOF.identifica.propJanelas[id].aguarde = $i(id + "_imagemCabecalho").style; i3GEOF.identifica.propJanelas[id].atualiza = true; - temp = 'i3GEOF.identifica.propJanelas["' - + id - + '"].atualiza = this.checked'; - janela[0].setFooter("
 " - + $trad( - 'atualizaJanela', - i3GEOF.identifica.dicionario) - + "
"); + temp = 'i3GEOF.identifica.propJanelas["' + id + '"].atualiza = this.checked'; + janela[0] + .setFooter("
 " + + $trad('atualizaJanela', i3GEOF.identifica.dicionario) + + "
"); if (i3GEO.Interface.ATUAL !== "googleearth") { temp = function() { i3GEOF.identifica.limpaMarca(id); i3GEOF.identifica.janelas.remove(id); i3GEOF.identifica.propJanelas[id] = null; if (i3GEOF.identifica.janelas.length === 0) { - i3GEO.eventos.removeEventos("MOUSECLIQUE",[i3GEO.configura.funcaoIdentifica]); + i3GEO.eventos.removeEventos("MOUSECLIQUE", [ + i3GEO.configura.funcaoIdentifica + ]); i3GEO.barraDeBotoes.ativaIcone(i3GEO.barraDeBotoes.BOTAOPADRAO); - i3GEO.eventos.removeEventos("ATUALIZAARVORECAMADAS",["i3GEOF.identifica.listaTemas()"]); - i3GEO.eventos.removeEventos("MOUSECLIQUEPERM",[i3GEO.configura.funcaoIdentifica]); - i3GEO.eventos.adicionaEventos("MOUSECLIQUEPERM",[i3GEO.configura.funcaoTip]); + i3GEO.eventos.removeEventos("ATUALIZAARVORECAMADAS", [ + "i3GEOF.identifica.listaTemas()" + ]); + i3GEO.eventos.removeEventos("MOUSECLIQUEPERM", [ + i3GEO.configura.funcaoIdentifica + ]); + i3GEO.eventos.adicionaEventos("MOUSECLIQUEPERM", [ + i3GEO.configura.funcaoTip + ]); // reativa o evento default i3GEO.eventos.cliquePerm.ativa(); } }; - YAHOO.util.Event.addListener( - janela[0].close, - "click", - temp); + YAHOO.util.Event.addListener(janela[0].close, "click", temp); } - i3GEO.eventos.adicionaEventos("ATUALIZAARVORECAMADAS",["i3GEOF.identifica.listaTemas()"]); + i3GEO.eventos.adicionaEventos("ATUALIZAARVORECAMADAS", [ + "i3GEOF.identifica.listaTemas()" + ]); }, limpaMarca : function(id) { i3GEO.desenho.removePins(id); @@ -551,59 +429,43 @@ i3GEOF.identifica = }, /* * Function: ativaFoco - * - * Refaz a interface da ferramenta quando a janela flutuante tem seu - * foco ativado + * + * Refaz a interface da ferramenta quando a janela flutuante tem seu foco ativado */ ativaFoco : function(id) { i3GEOF.identifica.listaTemas("ligados"); - i3GEO.util.mudaCursor( - i3GEO.configura.cursores, - temp, - i3GEO.Interface.IDMAPA, - i3GEO.configura.locaplic); - //i3GEOF.identifica.mostraImagemPonto(id); + i3GEO.util.mudaCursor(i3GEO.configura.cursores, temp, i3GEO.Interface.IDMAPA, i3GEO.configura.locaplic); + // i3GEOF.identifica.mostraImagemPonto(id); }, mostraImagemPonto : function(id) { - if(i3GEO.Interface.ATUAL === "googleearth") - {return;} - if(i3GEOF.identifica.propJanelas[id].marca === false){ - i3GEOF.identifica.propJanelas[id].marca = i3GEO.desenho.addPin( - i3GEOF.identifica.propJanelas[id].x, - i3GEOF.identifica.propJanelas[id].y, - "", - "", - "", - id - ); + if (i3GEO.Interface.ATUAL === "googleearth") { + return; } - else{ + if (i3GEOF.identifica.propJanelas[id].marca === false) { + i3GEOF.identifica.propJanelas[id].marca = + i3GEO.desenho.addPin(i3GEOF.identifica.propJanelas[id].x, i3GEOF.identifica.propJanelas[id].y, "", "", "", id); + } else { i3GEO.desenho.movePin( i3GEOF.identifica.propJanelas[id].marca, i3GEOF.identifica.propJanelas[id].x, - i3GEOF.identifica.propJanelas[id].y - ); + i3GEOF.identifica.propJanelas[id].y); } }, /* * Function: html - * - * Gera o código html para apresentação das - * opções da ferramenta - * + * + * Gera o código html para apresentação das opções da ferramenta + * * Retorno: - * + * * String com o código html */ html : function(idjanela) { - var ins = Mustache.render( - i3GEOF.identifica.MUSTACHE, - i3GEOF.identifica.mustacheHash(idjanela)); + var ins = Mustache.render(i3GEOF.identifica.MUSTACHE, i3GEOF.identifica.mustacheHash(idjanela)); return ins; }, /* - * Abre a janela flutuante para controlar o processo de reposicionar um - * ponto. Ativada apenas quando o usuario puder editar um tema + * Abre a janela flutuante para controlar o processo de reposicionar um ponto. Ativada apenas quando o usuario puder editar um tema */ janelaMoverPonto : function(tema, idreg) { if ($i("i3GEOF.movePonto_corpo")) { @@ -611,82 +473,51 @@ i3GEOF.identifica = } var temp, titulo; // cria a janela flutuante - titulo = "
" + $trad( - 'move', - i3GEOF.identifica.dicionario) + "
"; - i3GEO.janela.cria( - "250px", - "100px", - "", - "", - "", - titulo, - "i3GEOF.movePonto", - false, - "hd", - "", - ""); + titulo = "
" + $trad('move', i3GEOF.identifica.dicionario) + "
"; + i3GEO.janela.cria("250px", "100px", "", "", "", titulo, "i3GEOF.movePonto", false, "hd", "", ""); $i("i3GEOF.movePonto_corpo").style.backgroundColor = "white"; - i3GEO.eventos.removeEventos("MOUSECLIQUEPERM",[i3GEO.configura.funcaoIdentifica]); - i3GEO.eventos.adicionaEventos("MOUSECLIQUE",["i3GEOF.identifica.atualizaJanelaMoverPonto()"]); + i3GEO.eventos.removeEventos("MOUSECLIQUEPERM", [ + i3GEO.configura.funcaoIdentifica + ]); + i3GEO.eventos.adicionaEventos("MOUSECLIQUE", [ + "i3GEOF.identifica.atualizaJanelaMoverPonto()" + ]); temp = function() { - i3GEO.eventos.adicionaEventos("MOUSECLIQUE",[i3GEO.configura.funcaoIdentifica]); + i3GEO.eventos.adicionaEventos("MOUSECLIQUE", [ + i3GEO.configura.funcaoIdentifica + ]); }; - YAHOO.util.Event.addListener( - janela[0].close, - "click", - temp); - $i("i3GEOF.movePonto_corpo").innerHTML = "" - + $trad( - 'cliqueNovaPosicao', - i3GEOF.identifica.dicionario) - + "

X:

" - + "
" - + "

Y:

" - + "
" - + "" - + ""; + YAHOO.util.Event.addListener(janela[0].close, "click", temp); + $i("i3GEOF.movePonto_corpo").innerHTML = + "" + $trad('cliqueNovaPosicao', i3GEOF.identifica.dicionario) + + "

X:

" + + "
" + + "

Y:

" + + "
" + + "" + + ""; new YAHOO.widget.Button( - "i3GEOF.moveAplica", { + "i3GEOF.moveAplica", + { onclick : { fn : function() { - var x = $i("i3GEOF.movePontoX").value, y = $i("i3GEOF.movePontoY").value, tema = $i("i3GEOF.moveAplicaTema").value, p = i3GEO.configura.locaplic - + "/ferramentas/editortema/exec.php?funcao=atualizageometria&g_sid=" - + i3GEO.configura.sid, temp = function(retorno) { + var x = $i("i3GEOF.movePontoX").value, y = $i("i3GEOF.movePontoY").value, tema = + $i("i3GEOF.moveAplicaTema").value, p = + i3GEO.configura.locaplic + "/ferramentas/editortema/exec.php?funcao=atualizageometria&g_sid=" + + i3GEO.configura.sid, temp = function(retorno) { i3GEO.janela.fechaAguarde("aguardeSalvaPonto"); - i3GEO.Interface.atualizaTema( - "", - tema); - i3GEOF.identifica.buscaDadosTema( - tema, - x, - y); + i3GEO.Interface.atualizaTema("", tema); + i3GEOF.identifica.buscaDadosTema(tema, x, y); }; i3GEO.janela.AGUARDEMODAL = true; - i3GEO.janela.abreAguarde( - "aguardeSalvaPonto", - "Adicionando..."); + i3GEO.janela.abreAguarde("aguardeSalvaPonto", "Adicionando..."); i3GEO.janela.AGUARDEMODAL = false; - cpJSON.call( - p, - "foo", - temp, - "&idunico=" - + idreg - + "&tema=" - + tema - + "&wkt=POINT(" - + x - + " " - + y - + ")"); + cpJSON.call(p, "foo", temp, "&idunico=" + idreg + "&tema=" + tema + "&wkt=POINT(" + x + " " + y + ")"); } } }); @@ -696,65 +527,49 @@ i3GEOF.identifica = $i("i3GEOF.movePontoX").value = objposicaocursor.ddx; $i("i3GEOF.movePontoY").value = objposicaocursor.ddy; } else { - i3GEO.eventos.removeEventos("MOUSECLIQUE",["i3GEOF.identifica.atualizaJanelaMoverPonto()"]); + i3GEO.eventos.removeEventos("MOUSECLIQUE", [ + "i3GEOF.identifica.atualizaJanelaMoverPonto()" + ]); } }, /* * Function: listaTemas - * + * * Incluí a lista de temas para o usuário escolher - * + * * Veja: - * + * * - * + * * Parametros: - * - * tipo {String} - ligados|todos lista apenas os temas que estão - * visíveis no mapa ou todos os temas - * + * + * tipo {String} - ligados|todos lista apenas os temas que estão visíveis no mapa ou todos os temas + * * id {string} id da janela em foco */ listaTemas : function(tipo) { if (i3GEO.arvoreDeCamadas.CAMADAS !== "") { var lista = i3GEO.arvoreDeCamadas.CAMADAS; if (tipo === "ligados") { - lista = i3GEO.arvoreDeCamadas.filtraCamadas( - "status", - 2, - "igual", - lista); + lista = i3GEO.arvoreDeCamadas.filtraCamadas("status", 2, "igual", lista); } - lista = i3GEO.arvoreDeCamadas.filtraCamadas( - "identifica", - "NAO", - "diferente", - lista); - lista = i3GEO.arvoreDeCamadas.filtraCamadas( - "identifica", - "nao", - "diferente", - lista); + lista = i3GEO.arvoreDeCamadas.filtraCamadas("identifica", "NAO", "diferente", lista); + lista = i3GEO.arvoreDeCamadas.filtraCamadas("identifica", "nao", "diferente", lista); i3GEOF.identifica.montaListaTemas(lista); } else { - i3GEO.php.listaTemas( - i3GEOF.identifica.montaListaTemas, - tipo, - i3GEO.configura.locaplic, - i3GEO.configura.sid); + i3GEO.php.listaTemas(i3GEOF.identifica.montaListaTemas, tipo, i3GEO.configura.locaplic, i3GEO.configura.sid); } }, /* * Function: montaListaTemas - * + * * Monta a lista de temas na forma de botões 'radio' - * + * * O resultado é inserido no div com id "listaTemas" - * + * * Parametros: - * - * retorno {JSON} - objeto retornado por i3GEO.php.listaTemas ou por - * i3GEO.arvoreDeCamadas.filtraCamadas + * + * retorno {JSON} - objeto retornado por i3GEO.php.listaTemas ou por i3GEO.arvoreDeCamadas.filtraCamadas */ montaListaTemas : function(retorno) { var lista, linhas, linhas1, l, nome, tema, divResultado, marcado = "", n = i3GEOF.identifica.janelas.length, id = "", i; @@ -776,11 +591,7 @@ i3GEOF.identifica = // // monta a lista de temas // - linhas += "" - + $trad( - 'verDados', - i3GEOF.identifica.dicionario) - + ""; + linhas += "" + $trad('verDados', i3GEOF.identifica.dicionario) + ""; linhas1 = ""; for (l = 0; l < lista.length; l++) { marcado = ""; @@ -795,30 +606,29 @@ i3GEOF.identifica = marcado = "CHECKED"; } if (lista[l].identifica !== "nao") { - linhas1 += "" - + nome - + ""; + linhas1 += + "" + + nome + + ""; } } - divResultado = $i(id - + "i3GEOidentificalistaTemas"); + divResultado = $i(id + "i3GEOidentificalistaTemas"); if (divResultado) { - divResultado.innerHTML = linhas - + "" - + linhas1 - + "
Todos
"; + divResultado.innerHTML = + linhas + "" + + linhas1 + + "
Todos
"; if (i3GEOF.identifica.propJanelas[id].temaAtivo != "") { i3GEOF.identifica.buscaDadosTema( i3GEOF.identifica.propJanelas[id].temaAtivo, @@ -831,11 +641,11 @@ i3GEOF.identifica = }, /* * Function: montaLinkGeohack - * + * * Monta o link para o site geohack - * + * * Return: - * + * * {String} */ montaLinkGeohack : function() { @@ -843,9 +653,7 @@ i3GEOF.identifica = }, abreLinkGeohack : function() { var b, x, y, w, s, param; - b = i3GEO.calculo.dd2dms( - i3GEOF.identifica.x, - i3GEOF.identifica.y); + b = i3GEO.calculo.dd2dms(i3GEOF.identifica.x, i3GEOF.identifica.y); x = b[0].split(" "); y = b[1].split(" "); w = "W"; @@ -857,41 +665,23 @@ i3GEOF.identifica = s = "N"; } if (x[0] * 1 < 0) { - x[0] = x[0] - * -1; + x[0] = x[0] * -1; } if (y[0] * 1 < 0) { - y[0] = y[0] - * -1; + y[0] = y[0] * -1; } - param = y[0] - + "_" - + y[1] - + "_" - + y[2] - + "_" - + s - + "_" - + x[0] - + "_" - + x[1] - + "_" - + x[2] - + "_" - + w; - window.open("http://tools.wikimedia.de/~magnus/geo/geohack.php?params=" - + param); + param = y[0] + "_" + y[1] + "_" + y[2] + "_" + s + "_" + x[0] + "_" + x[1] + "_" + x[2] + "_" + w; + window.open("http://tools.wikimedia.de/~magnus/geo/geohack.php?params=" + param); }, /* * Function: montaListaSistemas - * + * * Obtém a lista de sistemas especiais de consulta. - * + * * O resultado é inserido no div com id "listaSistemas". - * - * Cada sistema consiste em uma URL para a qual serão passados os - * parametros x e y. - * + * + * Cada sistema consiste em uma URL para a qual serão passados os parametros x e y. + * */ montaListaSistemas : function(retorno) { var l, divins, ig, sistema, pub, exec, temp, t, linhas, ltema, i, idjanela, n = i3GEOF.identifica.janelas.length; @@ -903,20 +693,15 @@ i3GEOF.identifica = if (sis[ig].PUBLICADO) { if (sis[ig].PUBLICADO) { pub = sis[ig].PUBLICADO; - if (pub === "NAO" - || pub === "nao") { - sistema = "" - + sistema - + ""; + if (pub === "NAO" || pub === "nao") { + sistema = "" + sistema + ""; } } } exec = sis[ig].ABRIR; temp = exec.split('"'); if (temp.length === 1) { - exec = '"' - + exec - + '"'; + exec = '"' + exec + '"'; } temp = exec.split("?"); if (temp.length !== 2) { @@ -926,47 +711,38 @@ i3GEOF.identifica = if (sis[ig].TARGET) { t = sis[ig].TARGET; } - i3GEOF.identifica.sistemasAdicionais.push(sistema - + "," - + exec - + "," - + t); + i3GEOF.identifica.sistemasAdicionais.push(sistema + "," + exec + "," + t); } } if (i3GEOF.identifica.sistemasAdicionais.length > 0) { for (i = 0; i < n; i++) { idjanela = i3GEOF.identifica.janelas[i]; - divins = $i(idjanela - + "i3GEOidentificalistaSistemas"); + divins = $i(idjanela + "i3GEOidentificalistaSistemas"); linhas = ""; for (l = 0; l < i3GEOF.identifica.sistemasAdicionais.length; l++) { ltema = i3GEOF.identifica.sistemasAdicionais[l].split(","); if (ltema.length > 1) { - linhas += "" - + ltema[0] - + ""; + linhas += + "" + + ltema[0] + + ""; } } if (divins) { if (i3GEO.parametros.editor.toLowerCase() == "sim") { temp = - "

Editar a lista de sistemas adicionais

"; } else { temp = ""; } - divins.innerHTML = temp - + "" - + linhas - + "
"; + divins.innerHTML = temp + "" + linhas + "
"; } } } @@ -975,18 +751,16 @@ i3GEOF.identifica = }, /* * Function: buscaDadosTema - * - * Obtém os dados de um tema para o ponto de coordenadas clicado - * no mapa - * + * + * Obtém os dados de um tema para o ponto de coordenadas clicado no mapa + * * Veja: - * + * * */ buscaDadosTema : function(tema, x, y, idjanela) { var res, opcao, resolucao, janelas, n, i, id; - if (tema != "" - && i3GEO.temaAtivo === "") { + if (tema != "" && i3GEO.temaAtivo === "") { i3GEO.temaAtivo = tema; } if (idjanela) { @@ -997,20 +771,14 @@ i3GEOF.identifica = janelas = i3GEOF.identifica.janelas; } // guarda o valor de x y nas variaveis de uso global da ferramenta - if (x - && x != "") { + if (x && x != "") { i3GEOF.identifica.x = x; i3GEOF.identifica.y = y; } n = janelas.length; - if (n == 0 - || (idjanela && !$i(idjanela - + "i3GEOidentificaocorrencia"))) { - if (x - && x != "") { - i3GEOF.identifica.criaJanelaFlutuante( - x, - y); + if (n == 0 || (idjanela && !$i(idjanela + "i3GEOidentificaocorrencia"))) { + if (x && x != "") { + i3GEOF.identifica.criaJanelaFlutuante(x, y); } else { i3GEOF.identifica.criaJanelaFlutuante(); } @@ -1025,34 +793,24 @@ i3GEOF.identifica = } for (i = 0; i < n; i++) { id = janelas[i]; - if (i3GEOF.identifica.propJanelas[id].atualiza == undefined - || i3GEOF.identifica.propJanelas[id].atualiza === true) { - if (x - && x != "") { + if (i3GEOF.identifica.propJanelas[id].atualiza == undefined || i3GEOF.identifica.propJanelas[id].atualiza === true) { + if (x && x != "") { i3GEOF.identifica.propJanelas[id].x = x; i3GEOF.identifica.propJanelas[id].y = y; } - if (tema != "" - && idjanela) { + if (tema != "" && idjanela) { i3GEOF.identifica.propJanelas[id].temaAtivo = tema; } - if ($i(id - + "i3GEOidentificaocorrencia")) { - $i(id - + "i3GEOidentificaocorrencia").innerHTML = ""; - res = $i(id - + "i3GEOidentificaresolucao"); + if ($i(id + "i3GEOidentificaocorrencia")) { + $i(id + "i3GEOidentificaocorrencia").innerHTML = + ""; + res = $i(id + "i3GEOidentificaresolucao"); if (res) { resolucao = res.value; } else { resolucao = 5; } - i3GEOF.identifica.buscaDadosTemaJanela( - id, - resolucao, - opcao); + i3GEOF.identifica.buscaDadosTemaJanela(id, resolucao, opcao); } } } @@ -1060,7 +818,7 @@ i3GEOF.identifica = if (!x) { i3GEOF.identifica.criaJanelaFlutuante(); } else { - i3GEOF.identifica.criaJanelaFlutuante(x,y); + i3GEOF.identifica.criaJanelaFlutuante(x, y); } } }, @@ -1069,13 +827,9 @@ i3GEOF.identifica = var temp = function(retorno) { // i3GEOF.identifica.dadosIdentifica = retorno.data; if (retorno !== undefined) { - i3GEOF.identifica.mostraDadosTema( - retorno.data, - idjanela); + i3GEOF.identifica.mostraDadosTema(retorno.data, idjanela); } else { - i3GEOF.identifica.mostraDadosTema( - undefined, - idjanela); + i3GEOF.identifica.mostraDadosTema(undefined, idjanela); } }; // importante: os temas editaveis nao utilizam alias em seus nomes @@ -1094,31 +848,23 @@ i3GEOF.identifica = }, /* * Function: mostraDadosSistema - * - * Obtém os dados de um sistema para o ponto de coordenadas - * clicado no mapa - * + * + * Obtém os dados de um sistema para o ponto de coordenadas clicado no mapa + * * Parametros: - * + * * exec {String} - url que será aberta - * - * target {String} (depreciado) - _self|self| onde a url será - * aberta. Se for "self", será aberta na mesma janela, caso + * + * target {String} (depreciado) - _self|self| onde a url será aberta. Se for "self", será aberta na mesma janela, caso * contrário, em uma nova página do navegador */ mostraDadosSistema : function(exec, target, idjanela) { i3GEOF.identifica.mostraImagemPonto(idjanela); - exec += "&x=" - + i3GEOF.identifica.propJanelas[idjanela].x - + "&y=" - + i3GEOF.identifica.propJanelas[idjanela].y; + exec += "&x=" + i3GEOF.identifica.propJanelas[idjanela].x + "&y=" + i3GEOF.identifica.propJanelas[idjanela].y; if (target === "target") { window.open(exec); } else { - i3GEOF.identifica.abrejanelaIframe( - "500", - "500", - exec); + i3GEOF.identifica.abrejanelaIframe("500", "500", exec); } var i = $i("i3GEOmarcaIdentifica"); if (i) { @@ -1127,43 +873,27 @@ i3GEOF.identifica = }, /* * Function abrejanelaIframe - * + * * Abre uma janela flutuante contendo um iframe - * + * * Parametros: - * + * * w {string} - largura - * + * * h {string} - altura - * + * * s {string} - src do iframe */ abrejanelaIframe : function(w, h, s) { - var janelaeditor = i3GEO.janela.cria( - w, - h, - s, - parseInt( - Math.random() * 100, - 10), - 10, - "", - "janela" - + i3GEO.util.randomRGB(), - false); + var janelaeditor = + i3GEO.janela.cria(w, h, s, parseInt(Math.random() * 100, 10), 10, "", "janela" + i3GEO.util.randomRGB(), false); var temp = function() { i3GEOF.identifica.sistemasAdicionais = []; i3GEOF.identifica.atualizaSistemas(); }; - YAHOO.util.Event.addListener( - janelaeditor[0].close, - "click", - temp, - janelaeditor[0].panel, - { - id : janelaeditor[0].id - }, - true); + YAHOO.util.Event.addListener(janelaeditor[0].close, "click", temp, janelaeditor[0].panel, { + id : janelaeditor[0].id + }, true); }, /** * Aplica um estilo a um elemento de todas as janelas @@ -1173,8 +903,7 @@ i3GEOF.identifica = for (i = 0; i < n; i++) { temp = $i(i3GEOF.identifica.janelas[i]); if (temp) { - temp = $i(i3GEOF.identifica.janelas[i] - + posFixo); + temp = $i(i3GEOF.identifica.janelas[i] + posFixo); if (temp) { temp.style[estilo] = valor; } @@ -1183,35 +912,26 @@ i3GEOF.identifica = }, /* * Function: mostraDadosTema - * + * * Mostra os dados obtidos de um ou mais temas. - * - * Recebe o resultado em JSON da operação de consulta - * realizada pelo servidor e formata os dados para + * + * Recebe o resultado em JSON da operação de consulta realizada pelo servidor e formata os dados para * apresentação na tela. - * + * * Parametros: - * + * * retorno {JSON} - objeto JSON com os dados */ mostraDadosTema : function(retorno, idjanela) { - var filtro, camada, idreg, idsalva, paramsalva, i, res = "", ntemas, resultados, nres, cor, j, nitens, k, atualN = "todas", inicio = 0, numResultados = 0, tip, link, textovalor; + var alvo, filtro, camada, idreg, idsalva, paramsalva, i, res = "", ntemas, resultados, nres, cor, j, nitens, k, atualN = "todas", inicio = + 0, numResultados = 0, tip, link, textovalor; - if ($i(idjanela - + "i3GEOFidentificaNocorrencias")) { - atualN = $i(idjanela - + "i3GEOFidentificaNocorrencias").value; + if ($i(idjanela + "i3GEOFidentificaNocorrencias")) { + atualN = $i(idjanela + "i3GEOFidentificaNocorrencias").value; } - i3GEOF.identifica.aplicaEstilo( - "_corpo", - "scrollTop", - 0); - if (retorno == undefined - || retorno == "") { - $i(idjanela - + "i3GEOidentificaocorrencia").innerHTML = $trad( - 'msgNadaEncontrado', - i3GEOF.identifica.dicionario); + i3GEOF.identifica.aplicaEstilo("_corpo", "scrollTop", 0); + if (retorno == undefined || retorno == "") { + $i(idjanela + "i3GEOidentificaocorrencia").innerHTML = $trad('msgNadaEncontrado', i3GEOF.identifica.dicionario); return; } i = $i("i3GEOmarcaIdentifica"); @@ -1219,33 +939,32 @@ i3GEOF.identifica = i.style.display = "block"; } if (retorno !== undefined) { - $i(idjanela - + "i3GEOidentificaocorrencia").innerHTML = ""; + $i(idjanela + "i3GEOidentificaocorrencia").innerHTML = ""; ntemas = retorno.length; for (i = 0; i < ntemas; i++) { resultados = retorno[i].resultado; - //nome do tema e icone de remover filtro - res += "
" - + retorno[i].nome - + "" - + ""; - //icone que mostra as medidas das variaveis vinculadas a uma regiao, se for o caso - if(retorno[i].codigo_tipo_regiao && retorno[i].codigo_tipo_regiao != ""){ - res += ""; + // nome do tema e icone de remover filtro + res += + "
" + retorno[i].nome + + "" + + ""; + // icone que mostra as medidas das variaveis vinculadas a uma regiao, se for o caso + if (retorno[i].codigo_tipo_regiao && retorno[i].codigo_tipo_regiao != "") { + res += + ""; } res += "
"; @@ -1269,26 +988,21 @@ i3GEOF.identifica = } } // opcao para apagar e mover o registro - if (idreg != "" - && retorno[i].editavel == "todos") { - res += "" - + $trad( - 'apagaRegistro', - i3GEOF.identifica.dicionario) - + "" - + " " - + $trad( - 'move', - i3GEOF.identifica.dicionario) - + "
"; + if (idreg != "" && retorno[i].editavel == "todos") { + res += + "" + + $trad('apagaRegistro', i3GEOF.identifica.dicionario) + + "" + + " " + + $trad('move', i3GEOF.identifica.dicionario) + + "
"; } for (k = 0; k < nitens; k++) { tip = "  "; @@ -1296,123 +1010,123 @@ i3GEOF.identifica = // insere o input para edicao // se for uma regiao cadastrada, todos os campos // sao editaveis - if (idreg != "" - && (resultados[j][k].item === retorno[i].editavel || retorno[i].editavel == "todos")) { + if (idreg != "" && (resultados[j][k].item === retorno[i].editavel || retorno[i].editavel == "todos")) { if (retorno[i].tiposalva == "regiao") { retorno[i].id_medida_variavel = 0; } - idsalva = "idsalva" - + retorno[i].tema - + "_" - + idreg - + "_" - + resultados[j][k].item - + "_" - + retorno[i].tiposalva; - paramsalva = "\"" - + retorno[i].tema - + "\"," - + idreg - + ",\"" - + resultados[j][k].item - + "\",\"" - + retorno[i].tiposalva - + "\""; - textovalor = "
" - + "" - + ""; + idsalva = + "idsalva" + retorno[i].tema + + "_" + + idreg + + "_" + + resultados[j][k].item + + "_" + + retorno[i].tiposalva; + paramsalva = + "\"" + retorno[i].tema + + "\"," + + idreg + + ",\"" + + resultados[j][k].item + + "\",\"" + + retorno[i].tiposalva + + "\""; + textovalor = + "
" + + "" + + ""; } - if (resultados[j][k].tip - && resultados[j][k].tip.toLowerCase() == "sim") { - tip = ""; + if (resultados[j][k].tip && resultados[j][k].tip.toLowerCase() == "sim") { + tip = + ""; } else { - tip = ""; + tip = + ""; } - filtro = "onclick=\"i3GEO.util.animaClique(this);i3GEOF.identifica.filtrar('" - + retorno[i].tema - + "','" - + resultados[j][k].item - + "','" - + resultados[j][k].valor - + "','" - + idjanela - + "')\""; - filtro = ""; + filtro = + "onclick=\"i3GEO.util.animaClique(this);i3GEOF.identifica.filtrar('" + retorno[i].tema + + "','" + + resultados[j][k].item + + "','" + + resultados[j][k].valor + + "','" + + idjanela + + "')\""; + filtro = + ""; // verifica se o texto possui tags de abertura e // fechamento html try { - if (textovalor - && (textovalor.search(">") >= 0 || textovalor.search("<") >= 0)) { + if (textovalor && (textovalor.search(">") >= 0 || textovalor.search("<") >= 0)) { filtro = ""; } // o mesmo problema pode ocorrer em raster, // que possuem o nome da classe como valor - if (resultados[j][k].alias.search(">") >= 0 - || resultados[j][k].alias.search("<") >= 0) { + if (resultados[j][k].alias.search(">") >= 0 || resultados[j][k].alias.search("<") >= 0) { filtro = ""; } } catch (e) { } if (resultados[j][k].link === "") { - res += "
" - + tip - + filtro - + resultados[j][k].alias - + ": " - + textovalor - + "
"; + res += + "
" + + tip + + filtro + + resultados[j][k].alias + + ": " + + textovalor + + "
"; } else { try { link = eval(resultados[j][k].link); } catch (e) { link = resultados[j][k].link; } - res += "
" - + tip - + resultados[j][k].alias - + ": " - + textovalor - + "
"; + if(resultados[j][k].idIframe){ + alvo = resultados[j][k].idIframe; + } + else{ + alvo = "_blank"; + } + res += + "
" + + tip + + resultados[j][k].alias + + ": " + + textovalor + + "
"; } if (resultados[j][k].img !== "") { - res += "
" - + resultados[j][k].img - + "
"; + res += + "
" + + resultados[j][k].img + + "
"; } if (cor === "RGB(250,250,250)") { cor = "beige"; @@ -1424,40 +1138,24 @@ i3GEOF.identifica = } } else { // verifica o tipo de tema - camada = i3GEO.arvoreDeCamadas.pegaTema( - i3GEO.temaAtivo, - "", - "name"); - if (retorno[i].tiposalva == "regiao" - && parseInt( - camada.type, - 10) == 0) { + camada = i3GEO.arvoreDeCamadas.pegaTema(i3GEO.temaAtivo, "", "name"); + if (retorno[i].tiposalva == "regiao" && parseInt(camada.type, 10) == 0) { // opcao para adicionar um ponto - res += $trad( - 'msgNadaEncontrado2', - i3GEOF.identifica.dicionario) - + "
" - + $trad( - 'adicionaPonto', - i3GEOF.identifica.dicionario) - + ""; + res += + $trad('msgNadaEncontrado2', i3GEOF.identifica.dicionario) + "
" + + $trad('adicionaPonto', i3GEOF.identifica.dicionario) + + ""; } else { - res += $trad( - 'msgNadaEncontrado2', - i3GEOF.identifica.dicionario); + res += $trad('msgNadaEncontrado2', i3GEOF.identifica.dicionario); } } } if (ntemas == 1) { - res = i3GEOF.identifica.montaOpcoesIdentificaOcorrencia( - atualN, - numResultados) - + res; + res = i3GEOF.identifica.montaOpcoesIdentificaOcorrencia(atualN, numResultados) + res; } - $i(idjanela - + "i3GEOidentificaocorrencia").innerHTML = res; + $i(idjanela + "i3GEOidentificaocorrencia").innerHTML = res; } }, filtrar : function(tema, item, valor, idjanela) { @@ -1465,29 +1163,15 @@ i3GEOF.identifica = return; } i3GEOF.identifica.propJanelas[idjanela].aguarde.visibility = "visible"; - var filtro = "(|[" - + item - + "]| = |" - + valor - + "|)", temp = function(retorno) { + var filtro = "(|[" + item + "]| = |" + valor + "|)", temp = function(retorno) { i3GEOF.identifica.propJanelas[idjanela].aguarde.visibility = "hidden"; - i3GEO.Interface.atualizaTema( - retorno, - tema); - }, p = i3GEO.configura.locaplic - + "/ferramentas/filtro/exec.php?base64=sim&g_sid=" - + i3GEO.configura.sid - + "&funcao=inserefiltro", cp = new cpaint(); + i3GEO.Interface.atualizaTema(retorno, tema); + }, p = + i3GEO.configura.locaplic + "/ferramentas/filtro/exec.php?base64=sim&g_sid=" + i3GEO.configura.sid + "&funcao=inserefiltro", cp = + new cpaint(); cp.set_response_type("JSON"); cp.set_transfer_mode('POST'); - cp.call( - p, - "insereFiltro", - temp, - "tema=" - + tema, - "filtro=" - + i3GEO.util.base64encode(filtro)); + cp.call(p, "insereFiltro", temp, "tema=" + tema, "filtro=" + i3GEO.util.base64encode(filtro)); }, removeFiltro : function(tema, idjanela) { if (i3GEOF.identifica.propJanelas[idjanela].visibility === "visible") { @@ -1496,123 +1180,65 @@ i3GEOF.identifica = i3GEOF.identifica.propJanelas[idjanela].aguarde.visibility = "visible"; var temp = function(retorno) { i3GEOF.identifica.propJanelas[idjanela].aguarde.visibility = "hidden"; - i3GEO.Interface.atualizaTema( - retorno, - tema); - }, p = i3GEO.configura.locaplic - + "/ferramentas/filtro/exec.php?base64=nao&g_sid=" - + i3GEO.configura.sid - + "&funcao=inserefiltro", cp = new cpaint(); + i3GEO.Interface.atualizaTema(retorno, tema); + }, p = + i3GEO.configura.locaplic + "/ferramentas/filtro/exec.php?base64=nao&g_sid=" + i3GEO.configura.sid + "&funcao=inserefiltro", cp = + new cpaint(); cp.set_response_type("JSON"); cp.set_transfer_mode('POST'); - cp.call( - p, - "insereFiltro", - temp, - "tema=" - + tema, - "filtro="); + cp.call(p, "insereFiltro", temp, "tema=" + tema, "filtro="); }, adicionaPontoRegiao : function(idjanela) { - var p = i3GEO.configura.locaplic - + "/ferramentas/editortema/exec.php?funcao=adicionaGeometria&g_sid=" - + i3GEO.configura.sid, tema = i3GEOF.identifica.propJanelas[idjanela].temaAtivo, temp = function(retorno) { + var p = i3GEO.configura.locaplic + "/ferramentas/editortema/exec.php?funcao=adicionaGeometria&g_sid=" + i3GEO.configura.sid, tema = + i3GEOF.identifica.propJanelas[idjanela].temaAtivo, temp = function(retorno) { i3GEO.janela.fechaAguarde("aguardeSalvaPonto"); - i3GEO.Interface.atualizaTema( - "", - tema); + i3GEO.Interface.atualizaTema("", tema); i3GEOF.identifica.buscaDadosTema(tema); }; i3GEO.janela.AGUARDEMODAL = true; - i3GEO.janela.abreAguarde( - "aguardeSalvaPonto", - "Adicionando..."); + i3GEO.janela.abreAguarde("aguardeSalvaPonto", "Adicionando..."); i3GEO.janela.AGUARDEMODAL = false; - cpJSON.call( - p, - "foo", - temp, - "&tema=" - + tema - + "&wkt=POINT(" - + i3GEOF.identifica.propJanelas[idjanela].x - + " " - + i3GEOF.identifica.propJanelas[idjanela].y - + ")"); + cpJSON.call(p, "foo", temp, "&tema=" + tema + + "&wkt=POINT(" + + i3GEOF.identifica.propJanelas[idjanela].x + + " " + + i3GEOF.identifica.propJanelas[idjanela].y + + ")"); }, apagaRegiao : function(tema, idreg) { - var excluir = function() { - var p = i3GEO.configura.locaplic - + "/ferramentas/editortema/exec.php?funcao=excluiRegistro&g_sid=" - + i3GEO.configura.sid, temp = function() { - i3GEO.janela.fechaAguarde("aguardeRemovendo"); - i3GEO.Interface.atualizaTema( - "", - tema); - i3GEOF.identifica.buscaDadosTema(tema); + var excluir = + function() { + var p = + i3GEO.configura.locaplic + "/ferramentas/editortema/exec.php?funcao=excluiRegistro&g_sid=" + i3GEO.configura.sid, temp = + function() { + i3GEO.janela.fechaAguarde("aguardeRemovendo"); + i3GEO.Interface.atualizaTema("", tema); + i3GEOF.identifica.buscaDadosTema(tema); + }; + i3GEO.janela.AGUARDEMODAL = true; + i3GEO.janela.abreAguarde("aguardeRemovendo", "Excluindo..."); + i3GEO.janela.AGUARDEMODAL = false; + cpJSON.call(p, "foo", temp, "&tema=" + tema + "&identificador=" + idreg); }; - i3GEO.janela.AGUARDEMODAL = true; - i3GEO.janela.abreAguarde( - "aguardeRemovendo", - "Excluindo..."); - i3GEO.janela.AGUARDEMODAL = false; - cpJSON.call( - p, - "foo", - temp, - "&tema=" - + tema - + "&identificador=" - + idreg); - }; i3GEO.janela.confirma( - $trad( - 'removeRegistroBD', - i3GEOF.identifica.dicionario), + $trad('removeRegistroBD', i3GEOF.identifica.dicionario), "", - $trad( - 'sim', - i3GEOF.identifica.dicionario), - $trad( - 'cancela', - i3GEOF.identifica.dicionario), + $trad('sim', i3GEOF.identifica.dicionario), + $trad('cancela', i3GEOF.identifica.dicionario), excluir); }, salvaDados : function(tema, idreg, coluna, tiposalva) { - var p = i3GEO.configura.locaplic - + "/ferramentas/editortema/exec.php?funcao=salvaRegistro&g_sid=" - + i3GEO.configura.sid, idvalor = $i("idsalva" - + tema - + "_" - + idreg - + "_" - + coluna - + "_" - + tiposalva), temp = function(retorno) { + var p = i3GEO.configura.locaplic + "/ferramentas/editortema/exec.php?funcao=salvaRegistro&g_sid=" + i3GEO.configura.sid, idvalor = + $i("idsalva" + tema + "_" + idreg + "_" + coluna + "_" + tiposalva), temp = function(retorno) { i3GEO.janela.fechaAguarde("aguardeSalvaAtributos"); - i3GEO.Interface.atualizaTema( - "", - i3GEOF.identifica.tema); + i3GEO.Interface.atualizaTema("", i3GEOF.identifica.tema); }; if (idvalor) { i3GEO.janela.AGUARDEMODAL = true; - i3GEO.janela.abreAguarde( - "aguardeSalvaAtributos", - "Salvando..."); + i3GEO.janela.abreAguarde("aguardeSalvaAtributos", "Salvando..."); i3GEO.janela.AGUARDEMODAL = false; - cpJSON.call( - p, - "foo", - temp, - "&tema=" - + tema - + "&coluna=" - + coluna - + "&valor=" - + idvalor.value - + "&identificador=" - + idreg); + cpJSON.call(p, "foo", temp, "&tema=" + tema + "&coluna=" + coluna + "&valor=" + idvalor.value + "&identificador=" + idreg); } else { alert("ocorreu um erro"); } @@ -1623,75 +1249,58 @@ i3GEOF.identifica = atual = "todas"; } sel = ""; - select = ""; if (atual == "todas") { sel = "SELECTED"; } - select += ""; + select += ""; nocor = nres + 1; for (i = 1; i < nocor; i++) { sel = ""; if (atual == i) { sel = "SELECTED"; } - select += ""; + select += ""; } select += ""; ins = ""; - ins += ""; - ins += ""; + ins += ""; + ins += ""; ins += "
" - + $trad( - 'mostraOcorrencia', - i3GEOF.identifica.dicionario) - + ": " - + select - + "" + $trad('mostraOcorrencia', i3GEOF.identifica.dicionario) + ": " + select + "
"; if (nres == 1) { ins = ""; } return ins; }, - listaVariaveis : function(codigo_tipo_regiao,idjanela){ + listaVariaveis : function(codigo_tipo_regiao, idjanela) { var p, temp; - temp = function (retorno){ + temp = function(retorno) { var ins = "", n, i, m, j, d, dd, nc, ic, ndd, idd; n = retorno.length; - if(n > 0){ - //cada variavel - for(i=0; i 0) { + // cada variavel + for (i = 0; i < n; i++) { d = retorno[i]; ins += "" + d.variavel + ""; m = d.dados.length; - //cada medida - for(j = 0; j"; } ins += ""; ndd = dd.dados.dados.length; - //cada valor - for(idd=0; idd"; } ins += ""; @@ -1700,9 +1309,16 @@ i3GEOF.identifica = } } } - i3GEO.janela.mensagemSimples("
"+ins+"
", ""); + i3GEO.janela.mensagemSimples("
" + ins + "
", ""); }; - p = i3GEO.configura.locaplic+"/admin/php/metaestat.php?funcao=LISTATODOSATRIBUTOSMEDIDAVARIAVELXY", - cpJSON.call(p,"foo",temp,"&codigo_tipo_regiao="+codigo_tipo_regiao+"&x="+i3GEOF.identifica.propJanelas[idjanela].x+"&y="+i3GEOF.identifica.propJanelas[idjanela].y); + p = i3GEO.configura.locaplic + "/admin/php/metaestat.php?funcao=LISTATODOSATRIBUTOSMEDIDAVARIAVELXY", cpJSON.call( + p, + "foo", + temp, + "&codigo_tipo_regiao=" + codigo_tipo_regiao + + "&x=" + + i3GEOF.identifica.propJanelas[idjanela].x + + "&y=" + + i3GEOF.identifica.propJanelas[idjanela].y); } }; -- libgit2 0.21.2