Commit aa07727e0c015a91f2d36a15bf5214371bf53fc4
1 parent
af685e98
Exists in
master
and in
7 other branches
Inclusão de um novo icone na arvore de camadas que abre as ferramentas referentes ao mapa
Showing
5 changed files
with
116 additions
and
0 deletions
Show diff stats
... | ... | @@ -0,0 +1,30 @@ |
1 | +<?php | |
2 | +/** | |
3 | + * Carrega os programas javascript necessarios para a ferramenta | |
4 | + * Esse programa e usado na tag <script> ou com a funcao scripttag do i3Geo | |
5 | + * Alem de carregar os scripts, carrega tambem o template no formato MUSTACHE, definindo a variavel | |
6 | + * javascript i3GEOF.atalhosmapa.MUSTACHE | |
7 | + * O template e substituido pelos valores definidos em index.js no momento da inicializacao da ferramenta | |
8 | + */ | |
9 | +if(extension_loaded('zlib')){ | |
10 | + ob_start('ob_gzhandler'); | |
11 | +} | |
12 | +header("Content-type: text/javascript"); | |
13 | +include("index.js"); | |
14 | +include("dicionario.js"); | |
15 | +echo "\n"; | |
16 | +/** | |
17 | + * Inclui o template mustache do HTML usado para criar o conteudo da janela | |
18 | + */ | |
19 | +echo 'i3GEOF.atalhosmapa.MUSTACHE = "'; | |
20 | +$texto = file_get_contents("template_mst.html"); | |
21 | +$texto = str_replace("\n", "", $texto); | |
22 | +$texto = str_replace("\r", "", $texto); | |
23 | +$texto = str_replace("\t", "", $texto); | |
24 | +$texto = str_replace('"', "'", $texto); | |
25 | +echo $texto; | |
26 | +echo '";'; | |
27 | +if(extension_loaded('zlib')){ | |
28 | + ob_end_flush(); | |
29 | +} | |
30 | +?> | ... | ... |
... | ... | @@ -0,0 +1 @@ |
1 | + | ... | ... |
... | ... | @@ -0,0 +1,81 @@ |
1 | +if (typeof (i3GEOF) === 'undefined') { | |
2 | + var i3GEOF = {}; | |
3 | +} | |
4 | +/* | |
5 | + * Classe: i3GEOF.atalhosmapa | |
6 | + */ | |
7 | +i3GEOF.atalhosmapa = | |
8 | +{ | |
9 | + /* | |
10 | + * Function: inicia | |
11 | + * | |
12 | + * Inicia a ferramenta. É chamado por criaJanelaFlutuante | |
13 | + * | |
14 | + * Parametro: | |
15 | + * | |
16 | + * iddiv {String} - id do div que receberá o conteudo HTML da ferramenta | |
17 | + */ | |
18 | + inicia : function(iddiv) { | |
19 | + //pega os itens do menu suspenso e que contem a lista de aplicativos | |
20 | + var s, b, m, n, i, t, ins = "<div style='margin-left: 5px'>"; | |
21 | + m = i3GEO.configura.oMenuData.submenus.ferramentas; | |
22 | + n = m.length; | |
23 | + for(i=0;i<n;i++){ | |
24 | + if(m[i].submenu.id === "mapa"){ | |
25 | + t = m[i].submenu.itemdata[0]; | |
26 | + } | |
27 | + } | |
28 | + n = t.length; | |
29 | + for(i=0;i<n;i++){ | |
30 | + ins += "<p class='paragrafo'><input id='atalhosmapa" + i + "' type='button' value='" + t[i].text.split("</span>")[1] + "' /></p>"; | |
31 | + } | |
32 | + $i(iddiv).innerHTML = ins + "</div>"; | |
33 | + for(i=0;i<n;i++){ | |
34 | + eval("s = "+t[i].url.split("javascript:")[1].replace("()","") + ";"); | |
35 | + b = new YAHOO.widget.Button("atalhosmapa" + i, { | |
36 | + onclick : { | |
37 | + fn : s | |
38 | + } | |
39 | + }); | |
40 | + b.addClass("abrir"); | |
41 | + } | |
42 | + | |
43 | + }, | |
44 | + /* | |
45 | + * Function: criaJanelaFlutuante | |
46 | + * | |
47 | + * Cria a janela flutuante para controle da ferramenta. | |
48 | + */ | |
49 | + iniciaJanelaFlutuante : function() { | |
50 | + var temp, minimiza, cabecalho, janela, divid, temp, titulo, ltema; | |
51 | + | |
52 | + cabecalho = function() { | |
53 | + }; | |
54 | + minimiza = function() { | |
55 | + i3GEO.janela.minimiza(id); | |
56 | + }; | |
57 | + // cria a janela flutuante | |
58 | + titulo = " "; | |
59 | + janela = | |
60 | + i3GEO.janela.cria( | |
61 | + "280px", | |
62 | + "300px", | |
63 | + "", | |
64 | + "", | |
65 | + "", | |
66 | + titulo, | |
67 | + "i3GEOF.atalhosmapa", | |
68 | + false, | |
69 | + "hd", | |
70 | + cabecalho, | |
71 | + minimiza, | |
72 | + "", | |
73 | + true, | |
74 | + i3GEO.configura.locaplic + "/imagens/oxygen/16x16/games-config-custom.png" | |
75 | + ); | |
76 | + divid = janela[2].id; | |
77 | + janela[2].style.backgroundColor = "white"; | |
78 | + janela[0].bringToTop(); | |
79 | + i3GEOF.atalhosmapa.inicia(divid); | |
80 | + } | |
81 | +}; | |
0 | 82 | \ No newline at end of file | ... | ... |