From bf6d2c92a2475ff9e2a5912ff7d79f33beaebba7 Mon Sep 17 00:00:00 2001 From: edmarmoretti Date: Tue, 14 Jun 2016 00:40:01 -0300 Subject: [PATCH] Menu de contexto na arvore de camadas --- admin/admin.db | Bin 335872 -> 0 bytes css/black.css | 16 ++++++++++++++++ js/arvoredecamadas.js | 85 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-------------- js/compactados/arvoredecamadas_compacto.js | 2 +- js/compactados/interface_compacto.js | 2 +- js/i3geo_tudo_compacto7.js | 4 ++-- js/i3geo_tudo_compacto7.js.php | 4 ++-- js/interface.js | 10 +++++++--- 8 files changed, 100 insertions(+), 23 deletions(-) diff --git a/admin/admin.db b/admin/admin.db index 6ea9a2d..d6dcd17 100755 Binary files a/admin/admin.db and b/admin/admin.db differ diff --git a/css/black.css b/css/black.css index 80c6103..b6db8e9 100755 --- a/css/black.css +++ b/css/black.css @@ -1,4 +1,15 @@ /* +menu de contexto da arvore de camadas +*/ +#i3GEOmenuContextoTema a { + color: gray; +} + +#i3GEOmenuContextoTema .yuimenuitemlabel-selected { + color: white; +} + +/* Botao de ligar desligar do tipo chave */ .i3GEOarvCam .temaSwitch { @@ -383,6 +394,11 @@ Menu superior de opcoes border-radius : 0px; } +.i3GEOarvCam a { + font-size: 1em; + text-decoration: solid; +} + .i3GEOarvCam .ygtvcell .ygtvlp, .i3GEOarvCam .ygtvlp { background: url("../css/treeview-sprite.gif") no-repeat scroll 0 -8897px transparent; } diff --git a/js/arvoredecamadas.js b/js/arvoredecamadas.js index 86bf228..8801b3f 100755 --- a/js/arvoredecamadas.js +++ b/js/arvoredecamadas.js @@ -399,9 +399,23 @@ i3GEO.arvoreDeCamadas = * * Default: * + * false + */ + OPCOESICONES : false, + /** + * Propriedade: MENUCOTEXTOTEMA + * + * Inclui o menu de contexto no clique sobre o nome do tema + * + * Tipo: + * + * {boolean} + * + * Default: + * * true */ - OPCOESICONES : true, + MENUCOTEXTOTEMA : true, /** * depreciado em 6.0 */ @@ -1011,9 +1025,11 @@ i3GEO.arvoreDeCamadas = temp.html = textoTema; temp.idlegenda = ltema.name; temp.tipo = "tema"; + temp.enableHighlight = false; temaNode = new YAHOO.widget.HTMLNode( temp, tempNode); + if (i3GEO.arvoreDeCamadas.OPCOESICONES === true) { - textoTema = i3GEO.arvoreDeCamadas.montaIconesTema(ltema); + textoTema = i3GEO.arvoreDeCamadas.montaIconesTema(ltema)[0]; //console.warn(tema.plugini3geo) temp = i3GEO.arvoreDeCamadas.NOTEMAICONES; temp.id = ltema.name; @@ -1075,17 +1091,17 @@ i3GEO.arvoreDeCamadas = textoTema = i3GEO.arvoreDeCamadas.montaTextoTema(ltema); if (textoTema !== "") { d = { - expanded : true, + expanded : false, hasIcon : false, html : textoTema, idlegenda : ltema.name, tipo : "tema", - enableHighlight : false + enableHighlight : true }; temaNode = new YAHOO.widget.HTMLNode(d, grupoNode); // if (i3GEO.arvoreDeCamadas.OPCOESICONES === true) { - textoTema = i3GEO.arvoreDeCamadas.montaIconesTema(ltema); + textoTema = i3GEO.arvoreDeCamadas.montaIconesTema(ltema)[0]; temaNodeFilho = new YAHOO.widget.HTMLNode({ id : ltema.name, expanded : false, @@ -1138,7 +1154,7 @@ i3GEO.arvoreDeCamadas = }; temaNode = new YAHOO.widget.HTMLNode(d, grupoNode); // if (i3GEO.arvoreDeCamadas.OPCOESICONES === true) { - textoTema = i3GEO.arvoreDeCamadas.montaIconesTema(ltema); + textoTema = i3GEO.arvoreDeCamadas.montaIconesTema(ltema)[0]; temaNodeFilho = new YAHOO.widget.HTMLNode({ id : ltema.name, expanded : false, @@ -1197,6 +1213,14 @@ i3GEO.arvoreDeCamadas = temaNode = new YAHOO.widget.HTMLNode( { + html : "", + isLeaf : false, + hasIcon : false + }, root + ); + + temaNode = new YAHOO.widget.HTMLNode( + { html : $trad("p16"), isLeaf : false, hasIcon : true @@ -1770,7 +1794,12 @@ i3GEO.arvoreDeCamadas = html += "
"; html += " "; - html += tema.tema + ""; + if(i3GEO.arvoreDeCamadas.MENUCOTEXTOTEMA === true){ + html += "" + tema.tema + ""; + } + else{ + html += tema.tema + ""; + } // adiciona o temporizador // que redesenha o tema de tempos em tempos if (i3GEO.tema.TEMPORIZADORESID[tema.name] == undefined && tema.temporizador != "") { @@ -1778,14 +1807,23 @@ i3GEO.arvoreDeCamadas = } return (html); }, + menuContextoTema : function(obj,tema){ + if(typeof i3GEO.arvoreDeCamadas.oMenuContextoTema != "undefined"){ + i3GEO.arvoreDeCamadas.oMenuContextoTema.destroy(); + } + i3GEO.arvoreDeCamadas.oMenuContextoTema = new YAHOO.widget.Menu("i3GEOmenuContextoTema", { + fixedcenter: false, + xy: YAHOO.util.Dom.getXY(obj), + position: "dynamic", + zIndex: 50000 + }); + i3GEO.arvoreDeCamadas.oMenuContextoTema.addItems(i3GEO.arvoreDeCamadas.montaIconesTema(i3GEO.arvoreDeCamadas.pegaTema(tema))[1]); + i3GEO.arvoreDeCamadas.oMenuContextoTema.render(document.body); + i3GEO.arvoreDeCamadas.oMenuContextoTema.show(); + }, montaIconesTema : function(tema) { - var fer = "", fers, iconePlugin, n, i = null, c, html, estilo, farol, mfarol, imb = i3GEO.configura.locaplic + "/imagens/branco.gif"; - + var hash = [], fer = "", fers, iconePlugin, n, i = null, c, html, estilo, farol, mfarol, imb = i3GEO.configura.locaplic + "/imagens/branco.gif"; estilo = "i3GEOarvCamTemaIco"; - // verifica se a versao do IE e menor que 9 - if (navm && parseInt(YAHOO.env.ua.ie, 10) < 9) { - estilo = "i3GEOarvCamTemaIcoIE"; - } // inicia o div html = "
"; // @@ -1816,7 +1854,13 @@ i3GEO.arvoreDeCamadas = html += " "; + + hash.push({ + text: ""; + + hash.push({ + text: c.title, + url: "javascript:" + c.funcao + "('" + tema.name + "',true,'" + tema.link_tema + "')" + }); } } + /* + hash.push({ + text: temp, + value: c.funcao, + onclick: {fn: funcao} + }); + */ + //inclui o icone especifico quando o tema e baseado em algum plugin if (tema.plugini3geo){ iconePlugin = i3GEO.pluginI3geo.iconeArvoreDeCamadas(tema); @@ -1886,7 +1943,7 @@ i3GEO.arvoreDeCamadas = } } html += "
"; - return (html); + return ([html,hash]); }, /** * Atualiza o farol de cada tema. diff --git a/js/compactados/arvoredecamadas_compacto.js b/js/compactados/arvoredecamadas_compacto.js index 4c526f0..eeacfed 100755 --- a/js/compactados/arvoredecamadas_compacto.js +++ b/js/compactados/arvoredecamadas_compacto.js @@ -1 +1 @@ -if(typeof(i3GEO)==='undefined'){var i3GEO={}}i3GEO.arvoreDeCamadas={ARVORE:null,IDHTML:"listaTemas",CAMADASINICIAIS:"",CAMADAS:"",FINALIZA:"",finaliza:"",NOTEMA:{expanded:true,hasIcon:false,enableHighlight:false},NOTEMAICONES:{expanded:false,hasIcon:true,enableHighlight:false},INCLUILFUNDO:true,ATIVATEMA:"",TEMPLATELEGENDA:"legenda5.htm",BARRAPROGRESSO:true,MOSTRALISTAKML:false,FILTRO:"",VERIFICAABRANGENCIATEMAS:false,EXPANDESOLEGENDA:false,PERMITEEXPANDIRTEMAS:true,ARRASTARORDEM:true,REFRESH:true,ARRASTARLIXEIRA:true,ALTERAOPACIDADE:false,FERRAMENTAS:true,IMPRIMIR:false,ANIMAMAPA:false,LIGARDESLIGARTODOS:true,FILTRAR:true,ABRELEGENDA:true,EXPANDIDA:false,LEGENDAEXPANDIDA:false,MOSTRATITULO:false,OPCOESICONES:true,OPCOESTEMAS:true,OPCOESLEGENDA:true,OPCOESARVORE:true,AGUARDALEGENDA:false,ICONETEMA:true,FUNCOES:{farolescala:true,excluir:true,sobe:true,desce:true,fonte:true,zoomtema:true,compartilhar:true,opacidade:true,mudanome:true,procurar:true,toponimia:true,etiquetas:true,filtrar:true,tabela:true,grafico:true,editorlegenda:true,destacar:true,cortina:true,sql:true,comentar:true,temporizador:true,wms:true,tme:true,copia:true,storymap:true,animagif:true},SID:null,LOCAPLIC:null,CONFIGICONES:{"refresh":{tipo:"arvore",icone:"",classe:"i3geo_refresh2",funcao:"i3GEO.arvoreDeCamadas.atualiza(i3GEO.arvoreDeCamadas.CAMADAS,true)",title:"Refresh",dica:$trad("refresh"),curto:"Refresh",id:"i3geo_refresh",status:true},"lixeira":{tipo:"arvore",icone:"",classe:"i3geo_lixeira",funcao:"i3GEO.arvoreDeCamadas.dialogo.excluir()",title:$trad("t2"),dica:$trad("lixeira"),curto:$trad("t12"),id:"i3geo_lixeira",status:true},"filtro":{tipo:"arvore",icone:"",classe:"i3geo_filtro",funcao:"i3GEO.arvoreDeCamadas.dialogo.filtro()",title:$trad("t2a"),dica:$trad("filtraCam"),id:"i3geo_filtro",status:true},"legenda":{tipo:"arvore",icone:"",classe:"soltaleg2",funcao:"i3GEO.mapa.legendaHTML.libera()",title:$trad("t2b"),dica:$trad("legenda"),id:"soltaleg2",status:false},"opacidade":{tipo:"arvore",icone:"",classe:"opacidadeMapa",funcao:"i3GEO.mapa.dialogo.opacidade()",title:$trad("t20"),dica:"",id:"opacidadeMapa",status:false},"animacao":{tipo:"arvore",icone:"",classe:"animaMapa",funcao:"i3GEO.mapa.dialogo.animacao()",title:$trad("p21"),dica:"",id:"animaMapa",status:false},"imprimir":{tipo:"arvore",icone:"",classe:"imprimirMapa",funcao:"i3GEO.mapa.dialogo.imprimir()",title:$trad("d12"),dica:"",id:"imprimirMapa",status:false},"ferramentas":{tipo:"arvore",icone:"",classe:"ferramentasMapa",funcao:"i3GEO.mapa.dialogo.ferramentas()",title:$trad("u15a"),dica:$trad("ferramMapa"),id:"ferramentasMapa",status:true},"ajuda":{tipo:"arvore",icone:"",classe:"ajudaMapa",funcao:"i3GEO.arvoreDeCamadas.ajudaEmLista()",title:$trad("s1"),dica:"",id:"ajudaMapa",status:true},"olhoaberto":{tipo:"arvore",icone:"",classe:"olhoAberto",funcao:"i3GEO.arvoreDeCamadas.aplicaTemas(\"ligartodos\")",title:$trad("t3a"),dica:$trad("t3a"),id:"olhoAberto",status:true},"olhofechado":{tipo:"arvore",icone:"",classe:"olhoFechado",funcao:"i3GEO.arvoreDeCamadas.aplicaTemas(\"desligartodos\")",title:$trad("t3b"),dica:$trad("t3b"),id:"olhoFechado",status:true},"ferramentasTema":{tipo:"tema",icone:"imagens/oxygen/16x16/configure-shortcuts.png",classe:"arvCamFerramentas",funcao:"i3GEO.tema.dialogo.atalhoscamada",title:$trad("u15a"),dica:$trad("ferramCamadas"),id:"",status:true,flag:true},"removerTema":{tipo:"tema",icone:"imagens/oxygen/16x16/draw-x.png",classe:"arvCamRemoveLayer",funcao:"i3GEO.tema.exclui",title:$trad("t12"),dica:$trad("t12a"),id:"",status:true,flag:true},"zoomtema":{tipo:"tema",icone:"imagens/gisicons/zoom-layer.png",classe:"arvCamZoomLayer",funcao:"i3GEO.tema.zoom",title:$trad("t17"),dica:$trad("t18"),id:"",status:true,flag:true},"sobe":{tipo:"tema",icone:"imagens/oxygen/16x16/draw-triangle3.png",classe:"arvCamSobeLayer",funcao:"i3GEO.tema.sobe",title:$trad("t13"),dica:$trad("t14"),id:"",status:true,flag:true},"desce":{tipo:"tema",icone:"imagens/oxygen/16x16/draw-triangle4.png",classe:"arvCamDesceLayer",funcao:"i3GEO.tema.desce",title:$trad("t15"),dica:$trad("t16"),id:"",status:true,flag:true},"contextoescala":{tipo:"tema",icone:"imagens/oxygen/16x16/task-attempt.png",classe:"arvCamDependeEscala",funcao:"",title:$trad("t36"),dica:$trad("t36"),id:"",status:true,flag:true},"selecionado":{tipo:"tema",icone:"imagens/gisicons/select-cancel.png",classe:"arvCamSelecionado",funcao:"i3GEO.tema.limpasel",title:$trad("t4"),dica:$trad("t5"),id:"",status:true,flag:true},"zoomsel":{tipo:"tema",icone:"imagens/gisicons/zoom-selection.png",classe:"arvCamZoomSelecionado",funcao:"i3GEO.tema.zoomsel",title:$trad("t4a"),dica:$trad("t5"),id:"",status:true,flag:true},"link":{tipo:"tema",icone:"imagens/oxygen/16x16/help-about.png",classe:"arvCamFonte",funcao:"i3GEO.tema.fonte",title:$trad("a9"),dica:$trad("a9"),id:"",status:true,flag:true},"download":{tipo:"tema",icone:"imagens/oxygen/16x16/download.png",classe:"arvCamDownload",funcao:"i3GEO.tema.dialogo.download",title:"Download",dica:$trad("t6"),id:"",status:true,flag:true},"ogc":{tipo:"tema",icone:"imagens/oxygen/16x16/application-x-smb-workgroup.png",classe:"arvCamOgc",funcao:"i3GEO.tema.dialogo.ogcwindow",title:"OGC",dica:"OGC",id:"",status:true,flag:true}},cria:function(onde,temas,g_sid,g_locaplic,funcaoTema){if(!YAHOO.lang.isUndefined(funcaoTema)){i3GEO.arvoreDeCamadas.ATIVATEMA=funcaoTema}var novoel,temp;if(i3GEO.arvoreDeCamadas.BARRAPROGRESSO===true&&i3GEO.Interface.ATUAL==="openlayers"){if(!$i("i3GEOprogressoDiv")){novoel=document.createElement("div");novoel.id="i3GEOprogressoDiv";novoel.style.position="absolute";novoel.style.top="0px";novoel.style.zIndex="50000";novoel.style.left=((i3GEO.parametros.w/2)-75)+"px";novoel.style.display="none";$i(i3GEO.Interface.IDMAPA).appendChild(novoel);i3GEO.arvoreDeCamadas.progressBar=new YAHOO.widget.ProgressBar({height:5,width:150,minValue:1,maxValue:0,value:0}).render("i3GEOprogressoDiv")}}i3GEO.arvoreDeCamadas.SID=typeof(g_sid)!=='undefined'?g_sid:i3GEO.configura.sid;i3GEO.arvoreDeCamadas.LOCAPLIC=typeof(g_locaplic)!=='undefined'?g_locaplic:i3GEO.configura.locaplic;if(onde!==""){i3GEO.arvoreDeCamadas.IDHTML=onde}if(i3GEO.arvoreDeCamadas.IDHTML===""){return}temp=$i(i3GEO.arvoreDeCamadas.IDHTML);if(!temp){return}if(temp.className===""){temp.className="i3GEOarvCam"}if(YAHOO.lang.isUndefined(temas)||temas===""){temas=i3GEO.arvoreDeCamadas.CAMADAS}i3GEO.arvoreDeCamadas.atualiza(temas);if(i3GEO.arvoreDeCamadas.finaliza!==""){alert("i3GEO.arvoreDeCamadas.finaliza depreciado. Utilize i3GEO.arvoreDeCamadas.FINALIZA");i3GEO.arvoreDeCamadas.FINALIZA=i3GEO.arvoreDeCamadas.finaliza;eval(i3GEO.arvoreDeCamadas.finaliza)}if(i3GEO.arvoreDeCamadas.FINALIZA!==""){if(YAHOO.lang.isFunction(i3GEO.arvoreDeCamadas.FINALIZA)){i3GEO.arvoreDeCamadas.FINALIZA.call()}else{if(i3GEO.arvoreDeCamadas.FINALIZA!=""){eval(i3GEO.arvoreDeCamadas.FINALIZA)}}}},inicia:function(id){i3GEO.arvoreDeCamadas.cria(id);i3GEO.arvoreDeCamadas.atualiza();if(i3GEO.arvoreDeCamadas.FINALIZA!==""){if(YAHOO.lang.isFunction(i3GEO.arvoreDeCamadas.FINALIZA)){i3GEO.arvoreDeCamadas.FINALIZA.call()}else{if(i3GEO.arvoreDeCamadas.FINALIZA!=""){eval(i3GEO.arvoreDeCamadas.FINALIZA)}}}},atualiza:function(temas,forca){if(arguments.length===0){temas=i3GEO.arvoreDeCamadas.CAMADAS;i3GEO.arvoreDeCamadas.CAMADAS="";forca=false}var temp,newVal,root,tempNode,titulo="",d,c,ltema,temaNode,temaNodeFilho="",i,j,n,nk,k,noGrupo,incluidos=[],grupoNode="",grupoLayers=i3GEO.configura.grupoLayers,textoTema="";temp=$i(i3GEO.arvoreDeCamadas.IDHTML);if(temp){if(forca===true){temp.innerHTML=""}if(temp.innerHTML!==""){if(i3GEO.arvoreDeCamadas.comparaTemas(temas,i3GEO.arvoreDeCamadas.CAMADAS)){i3GEO.arvoreDeCamadas.CAMADAS=temas;return}}}else{return}i3GEO.util.defineValor(i3GEO.arvoreDeCamadas.IDHTML,"innerHTML","");i3GEO.arvoreDeCamadas.CAMADAS=temas;if(i3GEO.arvoreDeCamadas.CAMADASINICIAIS===""){i3GEO.arvoreDeCamadas.CAMADASINICIAIS=temas}(function(){function changeIconMode(){var currentIconMode="";newVal=parseInt(this.value,10);if(newVal!==currentIconMode){currentIconMode=newVal}buildTree()}function buildTree(){i3GEO.arvoreDeCamadas.ARVORE=new YAHOO.widget.TreeView(i3GEO.arvoreDeCamadas.IDHTML)}buildTree()})();root=i3GEO.arvoreDeCamadas.ARVORE.getRoot();if(i3GEO.arvoreDeCamadas.MOSTRATITULO===true){titulo=$trad("t1")}tempNode=new YAHOO.widget.HTMLNode({expanded:true,html:titulo,hasIcon:i3GEO.arvoreDeCamadas.MOSTRATITULO,enableHighlight:true},root);if(i3GEO.arvoreDeCamadas.OPCOESARVORE===true){if($i("arvoreCamOpcoes")){var onMenuItemClick=function(p_sType,p_aArgs,p_oItem){eval(p_oItem.value)};new YAHOO.widget.Button({type:"menu",label:$trad("opcoes"),name:"arvoreCamOpcoes",menu:i3GEO.arvoreDeCamadas.montaOpcoesArvore("hash",onMenuItemClick),container:"arvoreCamOpcoes"});i3GEO.arvoreDeCamadas.OPCOESARVORE=false}else{new YAHOO.widget.HTMLNode({expanded:false,html:i3GEO.arvoreDeCamadas.montaOpcoesArvore("html"),hasIcon:false,enableHighlight:false},tempNode)}}if(grupoLayers===""){c=temas.length;for(i=0,j=c;i"+grupoLayers[i].nome+"";d=i3GEO.arvoreDeCamadas.EXPANDIDA;if(grupoLayers[i].expandido&&grupoLayers[i].expandido===true){d=true}n=grupoLayers[i].layers.length;for(j=0;j"+$trad("u27")+""},tempNode);c=incluidos.length;for(k=0;k