From bdcc7584da947f0eae9436a2e7c2f9300347089b Mon Sep 17 00:00:00 2001 From: Edmar Moretti Date: Tue, 12 Jan 2010 14:56:38 +0000 Subject: [PATCH] --- ferramentas/editorsql/exemplo.htm | 13 +++++++++++++ ferramentas/editorsql/index.js.php | 157 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 170 insertions(+), 0 deletions(-) create mode 100644 ferramentas/editorsql/exemplo.htm create mode 100644 ferramentas/editorsql/index.js.php diff --git a/ferramentas/editorsql/exemplo.htm b/ferramentas/editorsql/exemplo.htm new file mode 100644 index 0000000..3332ddf --- /dev/null +++ b/ferramentas/editorsql/exemplo.htm @@ -0,0 +1,13 @@ + + + + + + + + + \ No newline at end of file diff --git a/ferramentas/editorsql/index.js.php b/ferramentas/editorsql/index.js.php new file mode 100644 index 0000000..4032aa4 --- /dev/null +++ b/ferramentas/editorsql/index.js.php @@ -0,0 +1,157 @@ + +/*jslint plusplus:false,white:false,undef: false, rhino: true, onevar: true, evil: true */ + +/* +About: Licença + +I3Geo Interface Integrada de Ferramentas de Geoprocessamento para Internet + +Direitos Autorais Reservados (c) 2006 Ministério do Meio Ambiente Brasil +Desenvolvedor: Edmar Moretti edmar.moretti@mma.gov.br + +Este programa é software livre; você pode redistribuí-lo +e/ou modificá-lo sob os termos da Licença Pública Geral +GNU conforme publicada pela Free Software Foundation; +tanto a versão 2 da Licença. +Este programa é distribuído na expectativa de que seja útil, +porém, SEM NENHUMA GARANTIA; nem mesmo a garantia implícita +de COMERCIABILIDADE OU ADEQUAÇÃO A UMA FINALIDADE ESPECÍFICA. +Consulte a Licença Pública Geral do GNU para mais detalhes. +Você deve ter recebido uma cópia da Licença Pública Geral do +GNU junto com este programa; se não, escreva para a +Free Software Foundation, Inc., no endereço +59 Temple Street, Suite 330, Boston, MA 02111-1307 USA. +*/ +if(typeof(i3GEOF) === 'undefined'){ + i3GEOF = []; +} +/* +Class: i3GEOF.editorsql + +Altera as propriedades do fundo do mapa. +*/ +i3GEOF.editorsql = { + /* + Variavel: aguarde + + Estilo do objeto DOM com a imagem de aguarde existente no cabeçalho da janela. + */ + aguarde: "", + /* + Function: inicia + + Inicia a ferramenta. É chamado por criaJanelaFlutuante + + Parametro: + + iddiv {String} - id do div que receberá o conteudo HTML da ferramenta + */ + inicia: function(iddiv){ + try{ + $i(iddiv).innerHTML = i3GEOF.editorsql.html(); + new YAHOO.widget.Button( + "i3GEOeditorsqlbotao1", + {onclick:{fn: i3GEOF.editorsql.altera}} + ); + i3GEOF.editorsql.pega(); + + i3GEO.util.comboItens( + "i3GEOeditorsqlItem", + i3GEO.temaAtivo, + function(retorno){ + $i("i3GEOeditorsqlDivItem").innerHTML = retorno.dados; + $i("i3GEOeditorsqlItem").onchange = function(){ + i3GEO.util.comboValoresItem( + "i3GEOeditorsqlitens", + i3GEO.temaAtivo, + $i("i3GEOeditorsqlItem").value, + function(retorno){ + $i("i3GEOeditorsqlvalores").innerHTML = "

Valores encontrados:

"+retorno.dados+"

"; + }, + "i3GEOeditorsqlvalores" + ); + + }; + }, + "i3GEOeditorsqlDivItem" + ); + + } + catch(erro){alert(erro);} + }, + /* + Function: html + + Gera o código html para apresentação das opções da ferramenta + + Retorno: + + String com o código html + */ + html:function(){ + var ins = "" + + '

' + + '

Veja aqui o manual de funções SQL do Postgis' + + '

Lista de itens existentes na tabela de atributos do tema (escolha um para ver os valores):

' + + '
' + + '
'; + return ins; + }, + /* + Function: criaJanelaFlutuante + + Cria a janela flutuante para controle da ferramenta. + */ + criaJanelaFlutuante: function(){ + var janela,divid,temp,titulo; + //cria a janela flutuante + titulo = "Altera SQL    "; + janela = i3GEO.janela.cria( + "300px", + "260px", + "", + "", + "", + titulo, + "i3GEOF.editorsql", + true, + "hd" + ); + divid = janela[2].id; + $i("i3GEOF.editorsql_corpo").style.backgroundColor = "white"; + $i("i3GEOF.editorsql_corpo").style.textAlign = "left"; + i3GEOF.editorsql.aguarde = $i("i3GEOF.editorsql_imagemCabecalho").style; + i3GEOF.editorsql.inicia(divid); + }, + /* + Function: pega + + Pega o SQL + */ + pega: function(){ + if(i3GEOF.editorsql.aguarde.visibility === "visible") + {return;} + i3GEOF.editorsql.aguarde.visibility = "visible"; + var temp = function(retorno){ + i3GEOF.editorsql.aguarde.visibility = "hidden"; + $i("i3GEOeditorsqlSQL").innerHTML = retorno.data; + }; + i3GEO.php.pegaData(temp,i3GEO.temaAtivo); + }, + /* + Function: altera + + Altera o SQL + */ + altera: function(){ + if(i3GEOF.editorsql.aguarde.visibility === "visible") + {return;} + i3GEOF.editorsql.aguarde.visibility = "visible"; + var temp = function(){ + i3GEOF.editorsql.aguarde.visibility = "hidden"; + i3GEO.atualiza(); + }; + i3GEO.php.alteraData(temp,i3GEO.temaAtivo,$i("i3GEOeditorsqlSQL").value); + } +}; + \ No newline at end of file -- libgit2 0.21.2