Commit 235892cc6af6039fb0c908073c3d4b3c125e34e8

Authored by Murilo Caixêta
1 parent 21fd2987

Implementação do Mustache

classesjs/classe_analise.js
@@ -73,10 +73,7 @@ i3GEO.analise = { @@ -73,10 +73,7 @@ i3GEO.analise = {
73 * Ferramenta mapa de calor 73 * Ferramenta mapa de calor
74 */ 74 */
75 heatmap : function() { 75 heatmap : function() {
76 - i3GEO.util.dialogoFerramenta(  
77 - "i3GEO.analise.dialogo.heatmap()",  
78 - "heatmap",  
79 - "heatmap"); 76 + i3GEO.util.dialogoFerramenta("i3GEO.analise.dialogo.heatmap()","heatmap","heatmap","dependencias.php","i3GEOF.heatmap.iniciaJanelaFlutuante()");
80 }, 77 },
81 /** 78 /**
82 * Function: saiku 79 * Function: saiku
ferramentas/heatmap/index.js
@@ -50,6 +50,18 @@ i3GEOF.heatmap = @@ -50,6 +50,18 @@ i3GEOF.heatmap =
50 i3GEOF.heatmap.iniciaDicionario(); 50 i3GEOF.heatmap.iniciaDicionario();
51 }, 51 },
52 /** 52 /**
  53 + * Template no formato mustache. E preenchido na carga do javascript com o programa dependencias.php
  54 + */
  55 + MUSTACHE : "",
  56 + /**
  57 + * Susbtitutos para o template
  58 + */
  59 + mustacheHash : function() {
  60 + var dicionario = i3GEO.idioma.objetoIdioma(i3GEOF.heatmap.dicionario);
  61 + dicionario["locaplic"] = i3GEO.configura.locaplic;
  62 + return dicionario;
  63 + },
  64 + /**
53 * Function: iniciaDicionario 65 * Function: iniciaDicionario
54 * 66 *
55 * Carrega o dicionário e chama a função que inicia a ferramenta 67 * Carrega o dicionário e chama a função que inicia a ferramenta
@@ -93,11 +105,7 @@ i3GEOF.heatmap = @@ -93,11 +105,7 @@ i3GEOF.heatmap =
93 * String com o código html 105 * String com o código html
94 */ 106 */
95 html : function() { 107 html : function() {
96 - var ins = '';  
97 - ins += '<div style="padding:5px;background-color:#F2F2F2;top:0px;left:0px;display:block;width:98%;" id="i3GEOheatmapresultado" >';  
98 - ins += '</div>';  
99 - ins += '<div style="top:10px;left:0px;display:block;width:98%;color:red" id="i3GEOheatmapfim" >';  
100 - ins += '</div>'; 108 + var ins = Mustache.render(i3GEOF.heatmap.MUSTACHE, i3GEOF.heatmap.mustacheHash());
101 return ins; 109 return ins;
102 }, 110 },
103 /** 111 /**
@@ -133,26 +141,20 @@ i3GEOF.heatmap = @@ -133,26 +141,20 @@ i3GEOF.heatmap =
133 } 141 }
134 }, 142 },
135 t0 : function() { 143 t0 : function() {
136 - var ins =  
137 - "<img class=i3GeoExemploImg src='" + i3GEO.configura.locaplic + "/ferramentas/heatmap/exemplo.png' />"  
138 - + "<p class='paragrafo' >" + $trad('ajuda', i3GEOF.heatmap.dicionario) + "<p class='paragrafo' >"  
139 - + $trad('ajuda2', i3GEOF.heatmap.dicionario);  
140 i3GEO.util.proximoAnterior( 144 i3GEO.util.proximoAnterior(
141 "", 145 "",
142 "i3GEOF.heatmap.t1()", 146 "i3GEOF.heatmap.t1()",
143 - ins, 147 + "",
144 "i3GEOFgradeDePontost0", 148 "i3GEOFgradeDePontost0",
145 "i3GEOheatmapresultado", 149 "i3GEOheatmapresultado",
146 true, 150 true,
147 "i3GEOF.heatmap_rodape"); 151 "i3GEOF.heatmap_rodape");
148 }, 152 },
149 t1 : function() { 153 t1 : function() {
150 - var ins = "<p class='paragrafo'>" + $trad('selecionaTema', i3GEOF.heatmap.dicionario) + ":</p>";  
151 - ins += "<div id='i3GEOheatmapSelTemas' class='styled-select'></div>";  
152 i3GEO.util.proximoAnterior( 154 i3GEO.util.proximoAnterior(
153 "i3GEOF.heatmap.t0()", 155 "i3GEOF.heatmap.t0()",
154 "i3GEOF.heatmap.t2()", 156 "i3GEOF.heatmap.t2()",
155 - ins, 157 + "",
156 "i3GEOF.heatmap.t1", 158 "i3GEOF.heatmap.t1",
157 "i3GEOheatmapresultado", 159 "i3GEOheatmapresultado",
158 true, 160 true,
@@ -160,15 +162,10 @@ i3GEOF.heatmap = @@ -160,15 +162,10 @@ i3GEOF.heatmap =
160 i3GEOF.heatmap.comboTemasSel(); 162 i3GEOF.heatmap.comboTemasSel();
161 }, 163 },
162 t2 : function() { 164 t2 : function() {
163 - var ins = "<p class='paragrafo'>" + $trad('valorPonto', i3GEOF.heatmap.dicionario) + "</p>"  
164 - + "<div class='i3geoForm i3geoFormIconeEdita'><input id='i3GEOheatmapd' type='text' value='1'/></div><br>"  
165 - + "<p class='paragrafo' >" + $trad('selecionaAtributo', i3GEOF.heatmap.dicionario) + "</p>"  
166 - + "<div class='styled-select' id='i3GEOheatmapondeItens' style='display:block' ></div> ";  
167 -  
168 i3GEO.util.proximoAnterior( 165 i3GEO.util.proximoAnterior(
169 "i3GEOF.heatmap.t1()", 166 "i3GEOF.heatmap.t1()",
170 "i3GEOF.heatmap.t3()", 167 "i3GEOF.heatmap.t3()",
171 - ins, 168 + "",
172 "i3GEOF.heatmap.t2", 169 "i3GEOF.heatmap.t2",
173 "i3GEOheatmapresultado", 170 "i3GEOheatmapresultado",
174 true, 171 true,
@@ -176,41 +173,25 @@ i3GEOF.heatmap = @@ -176,41 +173,25 @@ i3GEOF.heatmap =
176 i3GEOF.heatmap.comboItens(); 173 i3GEOF.heatmap.comboItens();
177 }, 174 },
178 t3 : function() { 175 t3 : function() {
179 - var ins = "<p class='paragrafo'>" + $trad('tituloNovaCamada', i3GEOF.heatmap.dicionario);  
180 - ins +=  
181 - "<br></p><div class='i3geoForm i3geoFormIconeEdita'><input id='i3GEOheatmapTitulo' type=text value='Mapa de calor'/></div>";  
182 -  
183 - ins += "<br><br><p class='paragrafo' >" + $trad('valorRaio', i3GEOF.heatmap.dicionario);  
184 - ins += "<br></p><div class='i3geoForm i3geoFormIconeEdita'><input id='i3GEOheatmapRaio' type=text size=10 value='15'/></div>";  
185 -  
186 - ins += "<br><br><p class='paragrafo' >" + $trad('opacidade', i3GEOF.heatmap.dicionario);  
187 - ins +=  
188 - "<br></p><div class='i3geoForm i3geoFormIconeEdita'><input id='i3GEOheatmapOpacidade' type=text size=10 value='50'/></div>";  
189 -  
190 - //ins += "<br><br><p class='paragrafo' >" + $trad('valorMaximoPonto', i3GEOF.heatmap.dicionario);  
191 - //ins += "<br></p><input class=digitar id='i3GEOheatmapMax' type=text size=10 value='10'/>";  
192 -  
193 i3GEO.util.proximoAnterior( 176 i3GEO.util.proximoAnterior(
194 "i3GEOF.heatmap.t2()", 177 "i3GEOF.heatmap.t2()",
195 "i3GEOF.heatmap.t4()", 178 "i3GEOF.heatmap.t4()",
196 - ins, 179 + "",
197 "i3GEOF.heatmap.t3", 180 "i3GEOF.heatmap.t3",
198 "i3GEOheatmapresultado", 181 "i3GEOheatmapresultado",
199 true, 182 true,
200 "i3GEOF.heatmap_rodape"); 183 "i3GEOF.heatmap_rodape");
201 }, 184 },
202 t4 : function() { 185 t4 : function() {
203 - var b,ins = "<p class='paragrafo'>" + $trad('adicionaTema', i3GEOF.heatmap.dicionario);  
204 - ins += "<br><br><input id=i3GEOheatmapbotao1 type='button' value='" + $trad('criaCamada', i3GEOF.heatmap.dicionario) + "' />";  
205 i3GEO.util.proximoAnterior( 186 i3GEO.util.proximoAnterior(
206 "i3GEOF.heatmap.t3()", 187 "i3GEOF.heatmap.t3()",
207 "", 188 "",
208 - ins, 189 + "",
209 "i3GEOF.heatmap.t4", 190 "i3GEOF.heatmap.t4",
210 "i3GEOheatmapresultado", 191 "i3GEOheatmapresultado",
211 true, 192 true,
212 "i3GEOF.heatmap_rodape"); 193 "i3GEOF.heatmap_rodape");
213 - b = new YAHOO.widget.Button("i3GEOheatmapbotao1", { 194 + var b = new YAHOO.widget.Button("i3GEOheatmapbotao1", {
214 onclick : { 195 onclick : {
215 fn : i3GEOF.heatmap.criaheatmap 196 fn : i3GEOF.heatmap.criaheatmap
216 } 197 }
ferramentas/heatmap/template_mst.html
1 -<div style='padding: 5px; background-color: #F2F2F2; top: 0px; left: 0px; display: block; width: 98%;' id='i3GEOheatmapresultado'></div> 1 +<div style='padding: 5px; background-color: #F2F2F2; top: 0px; left: 0px; display: block; width: 98%;' id='i3GEOheatmapresultado'>
  2 + <div id='i3GEOFgradeDePontost0'>
  3 + <img class='i3GeoExemploImg'
  4 + src='{{{locaplic}}}/ferramentas/heatmap/exemplo.png' />
  5 + <p class='paragrafo'>{{{ajuda}}}
  6 + <p class='paragrafo'>{{{ajuda2}}}
  7 + </div>
  8 + <div id='i3GEOF.heatmap.t1'>
  9 + <p class='paragrafo'>{{{selecionaTema}}}:</p>
  10 + <div id='i3GEOheatmapSelTemas' class='styled-select'></div>
  11 + </div>
  12 + <div id='i3GEOF.heatmap.t2'>
  13 + <p class='paragrafo'>{{{valorPonto}}}</p>
  14 + <div class='i3geoForm i3geoFormIconeEdita'>
  15 + <input id='i3GEOheatmapd' type='text' value='1' />
  16 + </div>
  17 + <br>
  18 + <p class='paragrafo'>{{{selecionaAtributo}}}</p>
  19 + <div class='styled-select' id='i3GEOheatmapondeItens' style='display: block'></div>
  20 + </div>
  21 + <div id='i3GEOF.heatmap.t3'>
  22 + <p class='paragrafo'>
  23 + {{{tituloNovaCamada}}}<br>
  24 + </p>
  25 + <div class='i3geoForm i3geoFormIconeEdita'>
  26 + <input id='i3GEOheatmapTitulo' type='text' value='Mapa de calor' />
  27 + </div>
  28 + <br>
  29 + <br>
  30 + <p class='paragrafo'>
  31 + {{{valorRaio}}}<br>
  32 + </p>
  33 + <div class='i3geoForm i3geoFormIconeEdita'>
  34 + <input id='i3GEOheatmapRaio' type='text' size='10' value='15' />
  35 + </div>
  36 + <br>
  37 + <br>
  38 + <p class='paragrafo'>
  39 + {{{opacidade}}}<br>
  40 + </p>
  41 + <div class='i3geoForm i3geoFormIconeEdita'>
  42 + <input id='i3GEOheatmapOpacidade' type='text' size='10' value='50' />
  43 + </div>
  44 + </div>
  45 + <div id='i3GEOF.heatmap.t4'>
  46 + <p class='paragrafo'>
  47 + {{{adicionaTema}}}<br>
  48 + <br>
  49 + <input id='i3GEOheatmapbotao1' type='button' value='{{{criaCamada}}}' />
  50 + </div>
  51 +</div>
2 <div style='top: 10px; left: 0px; display: block; width: 98%; color: red' id='i3GEOheatmapfim'></div> 52 <div style='top: 10px; left: 0px; display: block; width: 98%; color: red' id='i3GEOheatmapfim'></div>
3 \ No newline at end of file 53 \ No newline at end of file