Commit 9344b06ea685fb3ccf330b9f51f2df3a83d0bfc4
1 parent
235892cc
Exists in
master
and in
7 other branches
Implementação do Mustache
Showing
3 changed files
with
44 additions
and
60 deletions
Show diff stats
classesjs/classe_analise.js
@@ -62,10 +62,7 @@ i3GEO.analise = { | @@ -62,10 +62,7 @@ i3GEO.analise = { | ||
62 | * Ferramenta mapa agrupamento de pontos | 62 | * Ferramenta mapa agrupamento de pontos |
63 | */ | 63 | */ |
64 | markercluster : function() { | 64 | markercluster : function() { |
65 | - i3GEO.util.dialogoFerramenta( | ||
66 | - "i3GEO.analise.dialogo.markercluster()", | ||
67 | - "markercluster", | ||
68 | - "markercluster"); | 65 | + i3GEO.util.dialogoFerramenta("i3GEO.analise.dialogo.markercluster()","markercluster","markercluster","dependencias.php","i3GEOF.markercluster.iniciaJanelaFlutuante()"); |
69 | }, | 66 | }, |
70 | /** | 67 | /** |
71 | * Function: heatmap | 68 | * Function: heatmap |
ferramentas/markercluster/index.js
@@ -57,6 +57,18 @@ i3GEOF.markercluster = { | @@ -57,6 +57,18 @@ i3GEOF.markercluster = { | ||
57 | i3GEOF.markercluster.iniciaDicionario(); | 57 | i3GEOF.markercluster.iniciaDicionario(); |
58 | }, | 58 | }, |
59 | /** | 59 | /** |
60 | + * Template no formato mustache. E preenchido na carga do javascript com o programa dependencias.php | ||
61 | + */ | ||
62 | + MUSTACHE : "", | ||
63 | + /** | ||
64 | + * Susbtitutos para o template | ||
65 | + */ | ||
66 | + mustacheHash : function() { | ||
67 | + var dicionario = i3GEO.idioma.objetoIdioma(i3GEOF.markercluster.dicionario); | ||
68 | + dicionario["locaplic"] = i3GEO.configura.locaplic; | ||
69 | + return dicionario; | ||
70 | + }, | ||
71 | + /** | ||
60 | * Function: iniciaDicionario | 72 | * Function: iniciaDicionario |
61 | * | 73 | * |
62 | * Carrega o dicionário e chama a função que inicia a | 74 | * Carrega o dicionário e chama a função que inicia a |
@@ -105,11 +117,7 @@ i3GEOF.markercluster = { | @@ -105,11 +117,7 @@ i3GEOF.markercluster = { | ||
105 | * String com o código html | 117 | * String com o código html |
106 | */ | 118 | */ |
107 | html : function() { | 119 | html : function() { |
108 | - var ins = ''; | ||
109 | - ins += '<div style="padding:5px;background-color:#F2F2F2;top:0px;left:0px;display:block;width:98%;" id="i3GEOmarkerclusterresultado" >'; | ||
110 | - ins += '</div>'; | ||
111 | - ins += '<div style="top:10px;left:0px;display:block;width:98%;color:red" id="i3GEOmarkerclusterfim" >'; | ||
112 | - ins += '</div>'; | 120 | + var ins = Mustache.render(i3GEOF.markercluster.MUSTACHE, i3GEOF.markercluster.mustacheHash()); |
113 | return ins; | 121 | return ins; |
114 | }, | 122 | }, |
115 | /** | 123 | /** |
@@ -123,7 +131,7 @@ i3GEOF.markercluster = { | @@ -123,7 +131,7 @@ i3GEOF.markercluster = { | ||
123 | titulo = $trad("x104") | 131 | titulo = $trad("x104") |
124 | + " <a class=ajuda_usuario target=_blank href='" | 132 | + " <a class=ajuda_usuario target=_blank href='" |
125 | + i3GEO.configura.locaplic | 133 | + i3GEO.configura.locaplic |
126 | - + "/ajuda_usuario.php?idcategoria=3&idajuda=123' > </a>"; | 134 | + + "/ajuda_usuario.php?idcategoria=3&idajuda=122' > </a>"; |
127 | cabecalho = function() { | 135 | cabecalho = function() { |
128 | }; | 136 | }; |
129 | janela = i3GEO.janela.cria( | 137 | janela = i3GEO.janela.cria( |
@@ -166,37 +174,20 @@ i3GEOF.markercluster = { | @@ -166,37 +174,20 @@ i3GEOF.markercluster = { | ||
166 | } | 174 | } |
167 | }, | 175 | }, |
168 | t0 : function() { | 176 | t0 : function() { |
169 | - var ins = "<img class=i3GeoExemploImg src='" | ||
170 | - + i3GEO.configura.locaplic | ||
171 | - + "/ferramentas/markercluster/exemplo.png' />" | ||
172 | - + "<p class='paragrafo' >" | ||
173 | - + $trad( | ||
174 | - 'ajuda', | ||
175 | - i3GEOF.markercluster.dicionario) | ||
176 | - + "<p class='paragrafo' >" | ||
177 | - + $trad( | ||
178 | - 'ajuda2', | ||
179 | - i3GEOF.markercluster.dicionario); | ||
180 | i3GEO.util.proximoAnterior( | 177 | i3GEO.util.proximoAnterior( |
181 | "", | 178 | "", |
182 | "i3GEOF.markercluster.t1()", | 179 | "i3GEOF.markercluster.t1()", |
183 | - ins, | 180 | + "", |
184 | "i3GEOFgradeDePontost0", | 181 | "i3GEOFgradeDePontost0", |
185 | "i3GEOmarkerclusterresultado", | 182 | "i3GEOmarkerclusterresultado", |
186 | true, | 183 | true, |
187 | "i3GEOF.markercluster_rodape"); | 184 | "i3GEOF.markercluster_rodape"); |
188 | }, | 185 | }, |
189 | t1 : function() { | 186 | t1 : function() { |
190 | - var ins = "<p class='paragrafo'>" | ||
191 | - + $trad( | ||
192 | - 'selecionaTema', | ||
193 | - i3GEOF.markercluster.dicionario) | ||
194 | - + ":"; | ||
195 | - ins += "<div class=styled-select id='i3GEOmarkerclusterSelTemas' ></div>"; | ||
196 | i3GEO.util.proximoAnterior( | 187 | i3GEO.util.proximoAnterior( |
197 | "i3GEOF.markercluster.t0()", | 188 | "i3GEOF.markercluster.t0()", |
198 | "i3GEOF.markercluster.t2()", | 189 | "i3GEOF.markercluster.t2()", |
199 | - ins, | 190 | + "", |
200 | "i3GEOF.markercluster.t1", | 191 | "i3GEOF.markercluster.t1", |
201 | "i3GEOmarkerclusterresultado", | 192 | "i3GEOmarkerclusterresultado", |
202 | true, | 193 | true, |
@@ -204,28 +195,10 @@ i3GEOF.markercluster = { | @@ -204,28 +195,10 @@ i3GEOF.markercluster = { | ||
204 | i3GEOF.markercluster.comboTemasSel(); | 195 | i3GEOF.markercluster.comboTemasSel(); |
205 | }, | 196 | }, |
206 | t2 : function() { | 197 | t2 : function() { |
207 | - var ins = "<p class='paragrafo'>" | ||
208 | - + $trad( | ||
209 | - 'tituloNovaCamada', | ||
210 | - i3GEOF.markercluster.dicionario); | ||
211 | - ins += "<br></p><div class='i3geoForm i3geoFormIconeEdita' ><input id='i3GEOmarkerclusterTitulo' type=text value='Mapa de agrupamento'/></div>"; | ||
212 | - | ||
213 | - ins += "<br><p class='paragrafo' >" | ||
214 | - + $trad( | ||
215 | - 'raio', | ||
216 | - i3GEOF.markercluster.dicionario); | ||
217 | - ins += "</p><div class='i3geoForm i3geoFormIconeEdita' ><input id='i3GEOmarkerclusterRaio' type=text value='50'/></div>"; | ||
218 | - | ||
219 | - ins += "<br><p class='paragrafo' >" | ||
220 | - + $trad( | ||
221 | - 'opacidade', | ||
222 | - i3GEOF.markercluster.dicionario); | ||
223 | - ins += "</p><div class='i3geoForm i3geoFormIconeEdita' ><input id='i3GEOmarkerclusterOpacidade' type=text value='50'/></div>"; | ||
224 | - | ||
225 | i3GEO.util.proximoAnterior( | 198 | i3GEO.util.proximoAnterior( |
226 | "i3GEOF.markercluster.t1()", | 199 | "i3GEOF.markercluster.t1()", |
227 | "i3GEOF.markercluster.t3()", | 200 | "i3GEOF.markercluster.t3()", |
228 | - ins, | 201 | + "", |
229 | "i3GEOF.markercluster.t2", | 202 | "i3GEOF.markercluster.t2", |
230 | "i3GEOmarkerclusterresultado", | 203 | "i3GEOmarkerclusterresultado", |
231 | true, | 204 | true, |
@@ -233,24 +206,15 @@ i3GEOF.markercluster = { | @@ -233,24 +206,15 @@ i3GEOF.markercluster = { | ||
233 | i3GEOF.markercluster.comboItens(); | 206 | i3GEOF.markercluster.comboItens(); |
234 | }, | 207 | }, |
235 | t3 : function() { | 208 | t3 : function() { |
236 | - var b,ins = "<p class='paragrafo'>" | ||
237 | - + $trad( | ||
238 | - 'adicionaTema', | ||
239 | - i3GEOF.markercluster.dicionario); | ||
240 | - ins += "<br><br><input id=i3GEOmarkerclusterbotao1 type='button' value='" | ||
241 | - + $trad( | ||
242 | - 'criaCamada', | ||
243 | - i3GEOF.markercluster.dicionario) | ||
244 | - + "' />"; | ||
245 | i3GEO.util.proximoAnterior( | 209 | i3GEO.util.proximoAnterior( |
246 | "i3GEOF.markercluster.t2()", | 210 | "i3GEOF.markercluster.t2()", |
247 | "", | 211 | "", |
248 | - ins, | 212 | + "", |
249 | "i3GEOF.markercluster.t3", | 213 | "i3GEOF.markercluster.t3", |
250 | "i3GEOmarkerclusterresultado", | 214 | "i3GEOmarkerclusterresultado", |
251 | true, | 215 | true, |
252 | "i3GEOF.markercluster_rodape"); | 216 | "i3GEOF.markercluster_rodape"); |
253 | - b = new YAHOO.widget.Button("i3GEOmarkerclusterbotao1", { | 217 | + var b = new YAHOO.widget.Button("i3GEOmarkerclusterbotao1", { |
254 | onclick : { | 218 | onclick : { |
255 | fn : i3GEOF.markercluster.criamarkercluster | 219 | fn : i3GEOF.markercluster.criamarkercluster |
256 | } | 220 | } |
ferramentas/markercluster/template_mst.html
1 | -<div style='padding: 5px; background-color: #F2F2F2; top: 0px; left: 0px; display: block; width: 98%;' id='i3GEOmarkerclusterresultado'></div> | 1 | +<div style='padding: 5px; background-color: #F2F2F2; top: 0px; left: 0px; display: block; width: 98%;' id='i3GEOmarkerclusterresultado'> |
2 | + <div id='i3GEOFgradeDePontost0'> | ||
3 | + <img class='i3GeoExemploImg' src='{{{locaplic}}}/ferramentas/markercluster/exemplo.png' /> | ||
4 | + <p class='paragrafo'>{{{ajuda}}} | ||
5 | + <p class='paragrafo'>{{{ajuda2}}} | ||
6 | + </div> | ||
7 | + <div id='i3GEOF.markercluster.t1'> | ||
8 | + <p class='paragrafo'>{{{selecionaTema}}}: | ||
9 | + <div class='styled-select' id='i3GEOmarkerclusterSelTemas'></div> | ||
10 | + </div> | ||
11 | + <div id='i3GEOF.markercluster.t2'> | ||
12 | + <p class='paragrafo'>{{{tituloNovaCamada}}}<br></p> | ||
13 | + <div class='i3geoForm i3geoFormIconeEdita'><input id='i3GEOmarkerclusterTitulo' type='text' value='Mapa de agrupamento' /></div> | ||
14 | + <br> | ||
15 | + <p class='paragrafo'>{{{raio}}}</p> | ||
16 | + <div class='i3geoForm i3geoFormIconeEdita'><input id='i3GEOmarkerclusterRaio' type='text' value='50' /></div> | ||
17 | + <br> | ||
18 | + <p class='paragrafo'>{{{opacidade}}}</p> | ||
19 | + <div class='i3geoForm i3geoFormIconeEdita'><input id='i3GEOmarkerclusterOpacidade' type='text' value='50' /></div> | ||
20 | + </div> | ||
21 | + <div id='i3GEOF.markercluster.t3'> | ||
22 | + <p class='paragrafo'>{{{adicionaTema}}}<br><br><input id='i3GEOmarkerclusterbotao1' type='button' value='{{{criaCamada}}}' /> | ||
23 | + </div> | ||
24 | +</div> | ||
2 | <div style='top: 10px; left: 0px; display: block; width: 98%; color: red' id='i3GEOmarkerclusterfim'></div> | 25 | <div style='top: 10px; left: 0px; display: block; width: 98%; color: red' id='i3GEOmarkerclusterfim'></div> |
3 | \ No newline at end of file | 26 | \ No newline at end of file |