From 6603b277606d4286dbe24392ee08d69c7e6cde0b Mon Sep 17 00:00:00 2001 From: Edmar Moretti Date: Mon, 18 Jul 2011 02:42:46 +0000 Subject: [PATCH] --- classesjs/classe_util.js | 14 +++++++++----- ferramentas/legenda/index.js.php | 33 +++++++++++++++++++++++++++++++-- imagens/alerta.gif | Bin 0 -> 656 bytes interface/openlayers.htm | 2 +- 4 files changed, 41 insertions(+), 8 deletions(-) create mode 100644 imagens/alerta.gif diff --git a/classesjs/classe_util.js b/classesjs/classe_util.js index c1666ef..6743c30 100644 --- a/classesjs/classe_util.js +++ b/classesjs/classe_util.js @@ -733,9 +733,11 @@ i3GEO.util = { valor {String} - valor do input - nome {String - name do input + nome {String} - name do input + + onch {String} - (opcional) string que será inserida no evento "onchange" */ - $inputText: function(idPai,larguraIdPai,idInput,titulo,digitos,valor,nome) { + $inputText: function(idPai,larguraIdPai,idInput,titulo,digitos,valor,nome,onch) { if(arguments.length === 6) {nome = "";} if(idPai !== ""){ @@ -748,7 +750,9 @@ i3GEO.util = { $i(idPai).onmouseout = function() {this.className = "";}; } - return ""; + if(!onch) + {onch = "";} + return ""; }, $inputTextMudaCor: function(obj){ var n = obj.value.split(" "); @@ -2553,10 +2557,10 @@ catch(e){} $im = function(g){ return i3GEO.util.$im(g); }; -$inputText = function(idPai,larguraIdPai,idInput,titulo,digitos,valor,nome){ +$inputText = function(idPai,larguraIdPai,idInput,titulo,digitos,valor,nome,onch){ if(arguments.length === 6) {nome = "";} - return i3GEO.util.$inputText(idPai,larguraIdPai,idInput,titulo,digitos,valor,nome); + return i3GEO.util.$inputText(idPai,larguraIdPai,idInput,titulo,digitos,valor,nome,onch); }; $top = function(id,valor){ i3GEO.util.$top(id,valor); diff --git a/ferramentas/legenda/index.js.php b/ferramentas/legenda/index.js.php index 116fe58..0a6dcaf 100644 --- a/ferramentas/legenda/index.js.php +++ b/ferramentas/legenda/index.js.php @@ -45,6 +45,15 @@ Classe: i3GEOF.legenda */ i3GEOF.legenda = { /* + Variavel: aviso + + Indica que uma alteração ainda não foi salva + + Type: + {boolean} + */ + aviso: false, + /* Variavel: tema Tema que será utilizado @@ -385,6 +394,7 @@ i3GEOF.legenda = { retorno - objeto contendo os dados para formatação da legenda */ montaLegenda: function(retorno){ + i3GEOF.legenda.aviso = false; try{ if (retorno.data != undefined){ var ins = [], @@ -402,9 +412,9 @@ i3GEOF.legenda = { ins.push(""); ins.push(""); ins.push(""); - ins.push($inputText("","","i3GEOlegendaid_"+id,"digite o novo nome",30,retorno.data[i].nomeclasse,"nome")); + ins.push($inputText("","","i3GEOlegendaid_"+id,"digite o novo nome",30,retorno.data[i].nomeclasse,"nome","javascript:i3GEOF.legenda.aviso()")); ins.push(""); - ins.push($inputText("","","i3GEOlegendaid_"+id,"digite a nova expressão",30,exp,"expressao")); + ins.push($inputText("","","i3GEOlegendaid_"+id,"digite a nova expressão",30,exp,"expressao",,"javascript:i3GEOF.legenda.aviso()")); ins.push(""); } ins.push("
"); @@ -449,6 +459,24 @@ i3GEOF.legenda = { } catch(e){alert("Não é possível editar a legenda desse tema");i3GEOF.legenda.aguarde.visibility = "hidden";} }, + /* + Function: aviso + + Mostra um alerta ao usuário quando um campo da tabela que contém os dados da legenda é alterado + + O aviso é mostrado apenas uma vez + */ + aviso: function(){ + if(i3GEOF.legenda.aviso == true){ + alert("Clique em 'Aplicar' para que as alteraçõpes sejam salvas"); + i3GEOF.legenda.aviso == false; + } + }, + /* + Function: aplicaColourRamp + + Aplica às classes da legenda as cores escolhidas no seletor de cores + */ aplicaColourRamp: function(){ if($i("listaColourRamp").value != ""){ if(i3GEOF.legenda.aguarde.visibility === "visible") @@ -520,6 +548,7 @@ i3GEOF.legenda = { */ mudaLegenda: function(){ + i3GEOF.legenda.aviso = false; if(i3GEOF.legenda.aguarde.visibility === "visible") {return;} i3GEOF.legenda.aguarde.visibility = "visible"; diff --git a/imagens/alerta.gif b/imagens/alerta.gif new file mode 100644 index 0000000..e1a30c6 Binary files /dev/null and b/imagens/alerta.gif differ diff --git a/interface/openlayers.htm b/interface/openlayers.htm index 055562f..4055d92 100644 --- a/interface/openlayers.htm +++ b/interface/openlayers.htm @@ -147,7 +147,7 @@ - +