Commit d453929225ba3dfe11026aae5b70985cbe913b7d
1 parent
c0514e32
Exists in
master
and in
7 other branches
Adaptação da ferramenta de excluir camadas em lote para Bootstrap. Reativação do…
… evento atualizaarvoredecamadas
Showing
6 changed files
with
167 additions
and
155 deletions
Show diff stats
admin/admin.db
No preview for this file type
ferramentas/colourramp/index.php
... | ... | @@ -126,15 +126,11 @@ Clique para escolher o modelo de cores |
126 | 126 | <p style="text-align:center;width:250px"><span id="demo_range" >0-255</span></p> |
127 | 127 | <div id=cores ></div> |
128 | 128 | <p style="position:relative;left:6px;top:5px;text-align:left;" > |
129 | -<input id=voltar size="22" type="button" value="Aplicar cores"> | |
129 | +<input id=voltar size="22" type="button" onclick="aplicarCores()" value="Aplicar cores"> | |
130 | 130 | </p> |
131 | -<b>Para atualizar a lista de cores geradas, clique novamente sobre a barra de cor.</b> Você pode também definir os limites inicial e final (use a barra deslizante) e alterar os valores obtidos editando diretamente o RGB | |
131 | +<br> | |
132 | +<p>Para atualizar a lista de cores geradas, clique novamente sobre a barra de cor. Você pode também definir os limites inicial e final (use a barra deslizante) e alterar os valores obtidos editando diretamente o RGB</p> | |
132 | 133 | <script> |
133 | -new YAHOO.widget.Button( | |
134 | - "voltar", | |
135 | - {onclick:{fn: function(){aplicarCores();}}} | |
136 | -); | |
137 | -$i("voltar-button").style.width = "250px" | |
138 | 134 | var lista = "<?php echo $lista;?>"; |
139 | 135 | lista = lista.split(","); |
140 | 136 | var n = lista.length; | ... | ... |
... | ... | @@ -0,0 +1,24 @@ |
1 | +<?php | |
2 | +include(dirname(__FILE__)."/../blacklist.php"); | |
3 | +verificaBlFerramentas(basename(dirname(__FILE__))); | |
4 | + | |
5 | + | |
6 | +/** | |
7 | + * Carrega os programas javascript necessarios para a ferramenta | |
8 | + * Esse programa e usado na tag <script> ou com a funcao scripttag do i3Geo | |
9 | + * Alem de carregar os scripts, carrega tambem o template no formato MUSTACHE, definindo a variavel | |
10 | + * javascript i3GEOF.etiqueta.MUSTACHE | |
11 | + * O template e substituido pelos valores definidos em index.js no momento da inicializacao da ferramenta | |
12 | + */ | |
13 | +if(extension_loaded('zlib')){ | |
14 | + ob_start('ob_gzhandler'); | |
15 | +} | |
16 | +header("Content-type: text/javascript"); | |
17 | +include("index.js"); | |
18 | +include("dicionario.js"); | |
19 | +echo "\n"; | |
20 | + | |
21 | +if(extension_loaded('zlib')){ | |
22 | + ob_end_flush(); | |
23 | +} | |
24 | +?> | |
0 | 25 | \ No newline at end of file | ... | ... |
ferramentas/excluirarvore/index.js
... | ... | @@ -30,53 +30,34 @@ Voc&ecirc; deve ter recebido uma c&oacute;pia da Licen&ccedil;a P&uacute;blica G |
30 | 30 | GNU junto com este programa; se não, escreva para a |
31 | 31 | Free Software Foundation, Inc., no endereço |
32 | 32 | 59 Temple Street, Suite 330, Boston, MA 02111-1307 USA. |
33 | -*/ | |
33 | + */ | |
34 | 34 | if(typeof(i3GEOF) === 'undefined'){ |
35 | 35 | var i3GEOF = {}; |
36 | 36 | } |
37 | 37 | /* |
38 | 38 | Classe: i3GEOF.excluirarvore |
39 | 39 | |
40 | -*/ | |
40 | + */ | |
41 | 41 | i3GEOF.excluirarvore = { |
42 | - /* | |
42 | + /* | |
43 | 43 | Variavel: aguarde |
44 | 44 | |
45 | 45 | Estilo do objeto DOM com a imagem de aguarde existente no cabeçalho da janela. |
46 | - */ | |
47 | - aguarde: "", | |
48 | - /* | |
46 | + */ | |
47 | + aguarde: "", | |
48 | + MUSTACHE : "", | |
49 | + /* | |
49 | 50 | Variavel: iddiv |
50 | 51 | |
51 | 52 | Guarda o id do div definido na função "inicia". |
52 | - */ | |
53 | - iddiv: "", | |
54 | - /* | |
55 | - Para efeitos de compatibilidade antes da versão 4.7 que não tinha dicionário | |
56 | - */ | |
57 | - criaJanelaFlutuante: function(){ | |
58 | - i3GEOF.excluirarvore.iniciaDicionario(); | |
59 | - }, | |
60 | - /* | |
61 | - Function: iniciaDicionario | |
62 | - | |
63 | - Carrega o dicionário e chama a função que inicia a ferramenta | |
64 | - | |
65 | - O Javascript é carregado com o id i3GEOF.nomedaferramenta.dicionario_script | |
66 | - */ | |
67 | - iniciaDicionario: function(){ | |
68 | - if(typeof(i3GEOF.excluirarvore.dicionario) === 'undefined'){ | |
69 | - i3GEO.util.scriptTag( | |
70 | - i3GEO.configura.locaplic+"/ferramentas/excluirarvore/dicionario.js", | |
71 | - "i3GEOF.excluirarvore.iniciaJanelaFlutuante()", | |
72 | - "i3GEOF.excluirarvore.dicionario_script" | |
73 | - ); | |
74 | - } | |
75 | - else{ | |
76 | - i3GEOF.excluirarvore.iniciaJanelaFlutuante(); | |
77 | - } | |
78 | - }, | |
79 | - /* | |
53 | + */ | |
54 | + iddiv: "", | |
55 | + mustacheHash : function() { | |
56 | + var dicionario = i3GEO.idioma.objetoIdioma(i3GEOF.excluirarvore.dicionario); | |
57 | + return dicionario; | |
58 | + }, | |
59 | + | |
60 | + /* | |
80 | 61 | Function: inicia |
81 | 62 | |
82 | 63 | Inicia a ferramenta. É chamado por criaJanelaFlutuante |
... | ... | @@ -84,30 +65,38 @@ i3GEOF.excluirarvore = { |
84 | 65 | Parametro: |
85 | 66 | |
86 | 67 | iddiv {String} - id do div que receberá o conteudo HTML da ferramenta |
87 | - */ | |
88 | - inicia: function(iddiv){ | |
89 | - var camadas = i3GEO.arvoreDeCamadas.CAMADAS, | |
90 | - n = camadas.length, | |
91 | - temp; | |
92 | - i3GEOF.excluirarvore.iddiv = iddiv; | |
93 | - try{ | |
68 | + */ | |
69 | + inicia: function(iddiv){ | |
70 | + if(i3GEOF.excluirarvore.MUSTACHE == ""){ | |
71 | + $.get(i3GEO.configura.locaplic + "/ferramentas/excluirarvore/template_mst.html", function(template) { | |
72 | + i3GEOF.excluirarvore.MUSTACHE = template; | |
73 | + i3GEOF.excluirarvore.inicia(iddiv); | |
74 | + }); | |
75 | + return; | |
76 | + } | |
77 | + | |
78 | + i3GEOF.excluirarvore.iddiv = iddiv; | |
79 | + | |
94 | 80 | $i(iddiv).innerHTML = i3GEOF.excluirarvore.html(); |
95 | - new YAHOO.widget.Button( | |
96 | - "i3GEOexcluirbotao1", | |
97 | - {onclick:{fn: i3GEOF.excluirarvore.lote}} | |
98 | - ); | |
99 | - } | |
100 | - catch(erro){ | |
101 | - i3GEO.eventos.removeEventos("ATUALIZAARVORECAMADAS",["i3GEOF.excluirarvore.inicia(i3GEOF.excluirarvore.iddiv)"]); | |
102 | - } | |
103 | - while(n > 0){ | |
104 | - n -= 1; | |
105 | - temp = $i("excluirC_"+camadas[n].name); | |
106 | - if(temp) | |
107 | - {temp.checked = false;} | |
108 | - } | |
109 | - }, | |
110 | - /* | |
81 | + | |
82 | + i3GEOF.excluirarvore.lista(); | |
83 | + }, | |
84 | + lista: function(){ | |
85 | + var camadas = i3GEO.arvoreDeCamadas.CAMADAS, | |
86 | + n = camadas.length, ins = ""; | |
87 | + while(n > 0){ | |
88 | + n -= 1; | |
89 | + if(camadas[n].tema !== ""){ | |
90 | + ins += '<div class="checkbox text-left"><label>' | |
91 | + + '<input name="' + camadas[n].name + '" type="checkbox">' | |
92 | + + '<span class="checkbox-material noprint"><span class="check"></span></span> ' | |
93 | + + camadas[n].tema | |
94 | + + '</label></div>'; | |
95 | + } | |
96 | + } | |
97 | + $i("i3GEOFexcluirarvoreLista").innerHTML = ins; | |
98 | + }, | |
99 | + /* | |
111 | 100 | Function: html |
112 | 101 | |
113 | 102 | Gera o código html para apresentação das opções da ferramenta |
... | ... | @@ -115,99 +104,90 @@ i3GEOF.excluirarvore = { |
115 | 104 | Retorno: |
116 | 105 | |
117 | 106 | String com o código html |
118 | - */ | |
119 | - html:function(){ | |
120 | - var camadas = i3GEO.arvoreDeCamadas.CAMADAS, | |
121 | - n = camadas.length, | |
122 | - ins = ""; | |
123 | - | |
124 | - ins = "<p class=paragrafo ><input id=i3GEOexcluirbotao1 type='buttom' value='"+$trad('removeMapa',i3GEOF.excluirarvore.dicionario)+"' /></p>" + | |
125 | - "<table id='i3GEOFexcluirarvoreLista' style='width:95%' class='lista8'>"; | |
126 | - while(n > 0){ | |
127 | - n -= 1; | |
128 | - if(camadas[n].tema !== "") | |
129 | - {ins += "<tr><td><input id='excluirC_"+camadas[n].name+"' CHECKED class=inputsb style='cursor:pointer' type=checkbox value='"+camadas[n].name+"' /></td><td><span id='i3GEOanima"+camadas[n].name+"'>"+camadas[n].tema+"</span></td></tr>";} | |
130 | - } | |
131 | - ins += "</table><br>"; | |
132 | - return ins; | |
133 | - }, | |
134 | - /* | |
107 | + */ | |
108 | + html:function(){ | |
109 | + var ins = Mustache.render(i3GEOF.excluirarvore.MUSTACHE, i3GEOF.excluirarvore.mustacheHash()); | |
110 | + return ins; | |
111 | + }, | |
112 | + /* | |
135 | 113 | Function: iniciaJanelaFlutuante |
136 | 114 | |
137 | 115 | Cria a janela flutuante para controle da ferramenta. |
138 | - */ | |
139 | - iniciaJanelaFlutuante: function(){ | |
140 | - var janela,divid,temp,titulo,cabecalho,minimiza; | |
141 | - if($i("i3GEOF.excluirarvore")){ | |
142 | - return; | |
143 | - } | |
144 | - cabecalho = function(){}; | |
145 | - minimiza = function(){ | |
146 | - i3GEO.janela.minimiza("i3GEOF.excluirarvore",200); | |
147 | - }; | |
148 | - //cria a janela flutuante | |
149 | - titulo = "<span class='i3GeoTituloJanelaBsNolink' >" + $trad("t12") + "</span></div>"; | |
150 | - janela = i3GEO.janela.cria( | |
151 | - "300px", | |
152 | - "350px", | |
153 | - "", | |
154 | - "", | |
155 | - "", | |
156 | - titulo, | |
157 | - "i3GEOF.excluirarvore", | |
158 | - false, | |
159 | - "hd", | |
160 | - cabecalho, | |
161 | - minimiza, | |
162 | - "", | |
163 | - true, | |
164 | - "", | |
165 | - "", | |
166 | - "", | |
167 | - "", | |
168 | - "110" | |
169 | - ); | |
170 | - i3GEOF.excluirarvore.aguarde = $i("i3GEOF.excluirarvore_imagemCabecalho").style; | |
171 | - divid = janela[2].id; | |
172 | - $i("i3GEOF.excluirarvore_corpo").style.backgroundColor = "white"; | |
173 | - $i("i3GEOF.excluirarvore_corpo").style.textAlign = "left"; | |
174 | - temp = function(){ | |
175 | - if(i3GEO.eventos.ATUALIZAARVORECAMADAS.toString().search("i3GEOF.excluirarvore.inicia(i3GEOF.excluirarvore.iddiv)") > 0) | |
176 | - {i3GEO.eventos.ATUALIZAARVORECAMADAS.remove("i3GEOF.excluirarvore.inicia(i3GEOF.excluirarvore.iddiv)");} | |
177 | - }; | |
178 | - YAHOO.util.Event.addListener(janela[0].close, "click", temp); | |
179 | - i3GEO.eventos.adicionaEventos("ATUALIZAARVORECAMADAS",["i3GEOF.excluirarvore.inicia(i3GEOF.excluirarvore.iddiv)"]); | |
180 | - i3GEOF.excluirarvore.inicia(divid); | |
181 | - }, | |
182 | - /* | |
116 | + */ | |
117 | + iniciaJanelaFlutuante: function(){ | |
118 | + var janela,divid,temp,titulo,cabecalho,minimiza; | |
119 | + if($i("i3GEOF.excluirarvore")){ | |
120 | + return; | |
121 | + } | |
122 | + cabecalho = function(){}; | |
123 | + minimiza = function(){ | |
124 | + i3GEO.janela.minimiza("i3GEOF.excluirarvore",200); | |
125 | + }; | |
126 | + //cria a janela flutuante | |
127 | + titulo = "<span class='i3GeoTituloJanelaBsNolink' >" + $trad("t12") + "</span></div>"; | |
128 | + janela = i3GEO.janela.cria( | |
129 | + "300px", | |
130 | + "350px", | |
131 | + "", | |
132 | + "", | |
133 | + "", | |
134 | + titulo, | |
135 | + "i3GEOF.excluirarvore", | |
136 | + false, | |
137 | + "hd", | |
138 | + cabecalho, | |
139 | + minimiza, | |
140 | + "", | |
141 | + true, | |
142 | + "", | |
143 | + "", | |
144 | + "", | |
145 | + "", | |
146 | + "110" | |
147 | + ); | |
148 | + i3GEOF.excluirarvore.aguarde = $i("i3GEOF.excluirarvore_imagemCabecalho").style; | |
149 | + divid = janela[2].id; | |
150 | + temp = function(){ | |
151 | + if(i3GEO.eventos.ATUALIZAARVORECAMADAS.toString().search("i3GEOF.excluirarvore.lista()") >= 0){ | |
152 | + i3GEO.eventos.ATUALIZAARVORECAMADAS.remove("i3GEOF.excluirarvore.lista()"); | |
153 | + } | |
154 | + }; | |
155 | + YAHOO.util.Event.addListener(janela[0].close, "click", temp); | |
156 | + i3GEO.eventos.adicionaEventos("ATUALIZAARVORECAMADAS",["i3GEOF.excluirarvore.lista()"]); | |
157 | + i3GEOF.excluirarvore.inicia(divid); | |
158 | + }, | |
159 | + /* | |
183 | 160 | Function: lote |
184 | 161 | |
185 | 162 | Executa uma operação em lote sobre as camadas mostradas no mapa |
186 | 163 | |
187 | - */ | |
188 | - lote: function(objeto){ | |
189 | - var lista = [], | |
164 | + */ | |
165 | + lote: function(objeto){ | |
166 | + var lista = [], | |
190 | 167 | temp, |
191 | - camadas = i3GEO.arvoreDeCamadas.CAMADAS, | |
168 | + camadas = $i("i3GEOFexcluirarvoreLista").getElementsByTagName("input"), | |
192 | 169 | n = camadas.length; |
193 | - if(i3GEOF.excluirarvore.aguarde.visibility === "visible") | |
194 | - {return;} | |
195 | - i3GEOF.excluirarvore.aguarde.visibility = "visible"; | |
196 | - while(n > 0){ | |
197 | - n -= 1; | |
198 | - temp = $i("excluirC_"+camadas[n].name); | |
199 | - if(temp && temp.checked === true) | |
200 | - {lista.push(temp.value);} | |
201 | - } | |
202 | - temp = function(){ | |
203 | - i3GEOF.excluirarvore.aguarde.visibility = "hidden"; | |
204 | - i3GEO.atualiza(); | |
205 | - }; | |
206 | - if(lista.length > 0) | |
207 | - {i3GEO.php.excluitema(temp,lista);} | |
208 | - else{ | |
209 | - i3GEO.janela.tempoMsg($trad('selecionaCamada',i3GEOF.excluirarvore.dicionario)); | |
210 | - i3GEOF.excluirarvore.aguarde.visibility = "hidden"; | |
170 | + if(i3GEOF.excluirarvore.aguarde.visibility === "visible"){ | |
171 | + return; | |
172 | + } | |
173 | + i3GEOF.excluirarvore.aguarde.visibility = "visible"; | |
174 | + while(n > 0){ | |
175 | + n -= 1; | |
176 | + if(camadas[n].checked === true){ | |
177 | + lista.push(camadas[n].name); | |
178 | + } | |
179 | + } | |
180 | + temp = function(){ | |
181 | + i3GEOF.excluirarvore.aguarde.visibility = "hidden"; | |
182 | + i3GEO.atualiza(); | |
183 | + | |
184 | + }; | |
185 | + if(lista.length > 0){ | |
186 | + i3GEO.php.excluitema(temp,lista); | |
187 | + } | |
188 | + else{ | |
189 | + i3GEO.janela.tempoMsg($trad('selecionaCamada',i3GEOF.excluirarvore.dicionario)); | |
190 | + i3GEOF.excluirarvore.aguarde.visibility = "hidden"; | |
191 | + } | |
211 | 192 | } |
212 | - } | |
213 | 193 | }; | ... | ... |
js/arvoredecamadas.js
... | ... | @@ -320,6 +320,7 @@ i3GEO.arvoreDeCamadas = |
320 | 320 | $("#" + config.idListaFundo).html(t); |
321 | 321 | } |
322 | 322 | } |
323 | + i3GEO.eventos.executaEventos(i3GEO.eventos.ATUALIZAARVORECAMADAS); | |
323 | 324 | /* |
324 | 325 | |
325 | 326 | // |
... | ... | @@ -993,11 +994,12 @@ i3GEO.arvoreDeCamadas = |
993 | 994 | */ |
994 | 995 | filtro : function() { |
995 | 996 | i3GEO.util.dialogoFerramenta( |
996 | - "i3GEO.arvoreDeCamadas.dialogo.filtro()", | |
997 | - "filtroarvore", | |
998 | - "filtroarvore", | |
999 | - "dependencias.php", | |
1000 | - "i3GEOF.filtroarvore.iniciaJanelaFlutuante()"); | |
997 | + "i3GEO.arvoreDeCamadas.dialogo.filtro()", | |
998 | + "filtroarvore", | |
999 | + "filtroarvore", | |
1000 | + "dependencias.php", | |
1001 | + "i3GEOF.filtroarvore.iniciaJanelaFlutuante()" | |
1002 | + ); | |
1001 | 1003 | }, |
1002 | 1004 | /** |
1003 | 1005 | * Function: excluir |
... | ... | @@ -1005,7 +1007,13 @@ i3GEO.arvoreDeCamadas = |
1005 | 1007 | * Abre a janela de diálogo para o usuário escolher os temas que serão excluídos da árvore |
1006 | 1008 | */ |
1007 | 1009 | excluir : function() { |
1008 | - i3GEO.util.dialogoFerramenta("i3GEO.arvoreDeCamadas.dialogo.excluir()", "excluirarvore", "excluirarvore"); | |
1010 | + i3GEO.util.dialogoFerramenta( | |
1011 | + "i3GEO.arvoreDeCamadas.dialogo.excluir()", | |
1012 | + "excluirarvore", | |
1013 | + "excluirarvore", | |
1014 | + "dependencias.php", | |
1015 | + "i3GEOF.excluirarvore.iniciaJanelaFlutuante()" | |
1016 | + ); | |
1009 | 1017 | } |
1010 | 1018 | } |
1011 | 1019 | }; | ... | ... |