From b28b4cda8811e4db5dcb7a0b14868d0c7d5f79b5 Mon Sep 17 00:00:00 2001 From: Edmar Moretti Date: Mon, 11 Jan 2010 23:25:51 +0000 Subject: [PATCH] --- ferramentas/opcoes_fundo/index.js.php | 119 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++----------------------------------------------------- 1 file changed, 66 insertions(+), 53 deletions(-) diff --git a/ferramentas/opcoes_fundo/index.js.php b/ferramentas/opcoes_fundo/index.js.php index 36a8b8d..4032aa4 100644 --- a/ferramentas/opcoes_fundo/index.js.php +++ b/ferramentas/opcoes_fundo/index.js.php @@ -26,11 +26,11 @@ if(typeof(i3GEOF) === 'undefined'){ i3GEOF = []; } /* -Class: i3GEOF.opcoesFundo +Class: i3GEOF.editorsql Altera as propriedades do fundo do mapa. */ -i3GEOF.opcoesFundo = { +i3GEOF.editorsql = { /* Variavel: aguarde @@ -48,21 +48,34 @@ i3GEOF.opcoesFundo = { */ inicia: function(iddiv){ try{ - i3GEOF.opcoesFundo.aguarde.visibility = "visible"; - $i(iddiv).innerHTML += i3GEOF.opcoesFundo.html(); + $i(iddiv).innerHTML = i3GEOF.editorsql.html(); new YAHOO.widget.Button( - "i3GEOopcoesFundobotao1", - {onclick:{fn: i3GEOF.opcoesFundo.executa}} + "i3GEOeditorsqlbotao1", + {onclick:{fn: i3GEOF.editorsql.altera}} ); - var p = i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?g_sid="+i3GEO.configura.sid+"&funcao=pegacorfundo", - cp = new cpaint(), - retorno = function(retorno){ - i3GEOF.opcoesFundo.aguarde.visibility = "hidden"; - if(retorno.data.erro){alert("Ocorreu um erro");return;} - $i("i3GEOopcoesFundocor").value = retorno.data; - }; - cp.set_response_type("JSON"); - cp.call(p,"corQM",retorno); + 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);} }, @@ -76,10 +89,12 @@ i3GEOF.opcoesFundo = { String com o código html */ html:function(){ - var ins = $inputText("","","i3GEOopcoesFundocor","",12,"") + - 'aquarela.gif ' + - '

'; + 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; }, /* @@ -88,57 +103,55 @@ i3GEOF.opcoesFundo = { Cria a janela flutuante para controle da ferramenta. */ criaJanelaFlutuante: function(){ - var janela,divid,temp,titulo,cabecalho,minimiza; - cabecalho = function(){}; - minimiza = function(){ - i3GEO.janela.minimiza("i3GEOF.opcoesFundo"); - }; + var janela,divid,temp,titulo; //cria a janela flutuante - titulo = "Cor do fundo    "; + titulo = "Altera SQL    "; janela = i3GEO.janela.cria( - "210px", - "80px", + "300px", + "260px", "", "", "", titulo, - "i3GEOF.opcoesFundo", - false, - "hd", - cabecalho, - minimiza + "i3GEOF.editorsql", + true, + "hd" ); divid = janela[2].id; - $i("i3GEOF.opcoesFundo_corpo").style.backgroundColor = "white"; - $i("i3GEOF.opcoesFundo_corpo").style.textAlign = "left"; - i3GEOF.opcoesFundo.aguarde = $i("i3GEOF.opcoesFundo_imagemCabecalho").style; - i3GEOF.opcoesFundo.inicia(divid); + $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: corj + Function: pega - Abre a janela para o usuário selecionar uma cor interativamente + Pega o SQL */ - corj: function(obj) - {i3GEO.util.abreCor("",obj);}, + 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: executa + Function: altera - Insere a grade no mapa + Altera o SQL */ - executa: function(){ - if(i3GEOF.opcoesFundo.aguarde.visibility === "visible") + altera: function(){ + if(i3GEOF.editorsql.aguarde.visibility === "visible") {return;} - i3GEOF.opcoesFundo.aguarde.visibility = "visible"; + i3GEOF.editorsql.aguarde.visibility = "visible"; var temp = function(){ - i3GEOF.opcoesFundo.aguarde.visibility = "hidden"; - i3GEO.atualiza(); - }, - cor = $i("i3GEOopcoesFundocor").value, - p = i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?g_sid="+i3GEO.configura.sid+"&funcao=corfundo&cor="+cor, - cp = new cpaint(); - cp.set_response_type("JSON"); - cp.call(p,"corQM",temp); + 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