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 73 * Ferramenta mapa de calor
74 74 */
75 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 79 * Function: saiku
... ...
ferramentas/heatmap/index.js
... ... @@ -50,6 +50,18 @@ i3GEOF.heatmap =
50 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 65 * Function: iniciaDicionario
54 66 *
55 67 * Carrega o dicionário e chama a função que inicia a ferramenta
... ... @@ -93,11 +105,7 @@ i3GEOF.heatmap =
93 105 * String com o código html
94 106 */
95 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 109 return ins;
102 110 },
103 111 /**
... ... @@ -133,26 +141,20 @@ i3GEOF.heatmap =
133 141 }
134 142 },
135 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 144 i3GEO.util.proximoAnterior(
141 145 "",
142 146 "i3GEOF.heatmap.t1()",
143   - ins,
  147 + "",
144 148 "i3GEOFgradeDePontost0",
145 149 "i3GEOheatmapresultado",
146 150 true,
147 151 "i3GEOF.heatmap_rodape");
148 152 },
149 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 154 i3GEO.util.proximoAnterior(
153 155 "i3GEOF.heatmap.t0()",
154 156 "i3GEOF.heatmap.t2()",
155   - ins,
  157 + "",
156 158 "i3GEOF.heatmap.t1",
157 159 "i3GEOheatmapresultado",
158 160 true,
... ... @@ -160,15 +162,10 @@ i3GEOF.heatmap =
160 162 i3GEOF.heatmap.comboTemasSel();
161 163 },
162 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 165 i3GEO.util.proximoAnterior(
169 166 "i3GEOF.heatmap.t1()",
170 167 "i3GEOF.heatmap.t3()",
171   - ins,
  168 + "",
172 169 "i3GEOF.heatmap.t2",
173 170 "i3GEOheatmapresultado",
174 171 true,
... ... @@ -176,41 +173,25 @@ i3GEOF.heatmap =
176 173 i3GEOF.heatmap.comboItens();
177 174 },
178 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 176 i3GEO.util.proximoAnterior(
194 177 "i3GEOF.heatmap.t2()",
195 178 "i3GEOF.heatmap.t4()",
196   - ins,
  179 + "",
197 180 "i3GEOF.heatmap.t3",
198 181 "i3GEOheatmapresultado",
199 182 true,
200 183 "i3GEOF.heatmap_rodape");
201 184 },
202 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 186 i3GEO.util.proximoAnterior(
206 187 "i3GEOF.heatmap.t3()",
207 188 "",
208   - ins,
  189 + "",
209 190 "i3GEOF.heatmap.t4",
210 191 "i3GEOheatmapresultado",
211 192 true,
212 193 "i3GEOF.heatmap_rodape");
213   - b = new YAHOO.widget.Button("i3GEOheatmapbotao1", {
  194 + var b = new YAHOO.widget.Button("i3GEOheatmapbotao1", {
214 195 onclick : {
215 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 52 <div style='top: 10px; left: 0px; display: block; width: 98%; color: red' id='i3GEOheatmapfim'></div>
3 53 \ No newline at end of file
... ...