Commit 86fc805d71d6325b4218426bbdef2a5b4f870259

Authored by Edmar Moretti
1 parent 039ca6a8

--no commit message

Showing 1 changed file with 41 additions and 99 deletions   Show diff stats
js/barradebotoes.js
@@ -903,47 +903,39 @@ i3GEO.barraDeBotoes = @@ -903,47 +903,39 @@ i3GEO.barraDeBotoes =
903 * "olhodepeixe1" substitui a antiga "olhodepeixe" e nao precisa de ajustes de posicionamento 903 * "olhodepeixe1" substitui a antiga "olhodepeixe" e nao precisa de ajustes de posicionamento
904 * 904 *
905 */ 905 */
906 - inicializaBarraOP : function(onde) { 906 + inicializaBarraOP : function(onde,numBotoes) {
907 if (i3GEO.barraDeBotoes.ATIVA === false || !$i(i3GEO.Interface.IDCORPO)) { 907 if (i3GEO.barraDeBotoes.ATIVA === false || !$i(i3GEO.Interface.IDCORPO)) {
908 return; 908 return;
909 } 909 }
910 -  
911 var divBarra = document.createElement("div"), 910 var divBarra = document.createElement("div"),
912 chaves = i3GEO.util.listaChaves(i3GEO.barraDeBotoes.INCLUIBOTAO), 911 chaves = i3GEO.util.listaChaves(i3GEO.barraDeBotoes.INCLUIBOTAO),
913 icones = [], 912 icones = [],
914 - n = 7,  
915 - dica, i, botao, titulo, imagem, l;  
916 - 913 + imagens = [],
  914 + n = 7,
  915 + i, botao, titulo, imagem, l, topo;
  916 +
917 if (i3GEO.barraDeBotoes.MAXBOTOES > 0) { 917 if (i3GEO.barraDeBotoes.MAXBOTOES > 0) {
918 n = i3GEO.barraDeBotoes.MAXBOTOES; 918 n = i3GEO.barraDeBotoes.MAXBOTOES;
919 } 919 }
920 - 920 + if(numBotoes){
  921 + n = numBotoes;
  922 + }
  923 + topo = (i3GEO.util.pegaPosicaoObjeto($i(i3GEO.Interface.IDMAPA))[1] + i3GEO.barraDeBotoes.OFFSET) * -1;
921 divBarra.style.position = "relative"; 924 divBarra.style.position = "relative";
922 - divBarra.style.top = "-50px"; 925 + divBarra.style.top = topo - 10 + "px";
923 divBarra.style.margin = "auto"; 926 divBarra.style.margin = "auto";
924 - divBarra.style.textAlign = "center"; 927 + divBarra.style.textAlign = "center";
925 divBarra.style.width = i3GEO.parametros.w + "px"; 928 divBarra.style.width = i3GEO.parametros.w + "px";
926 //cria os icones 929 //cria os icones
927 - icones.push('<div style="z-index: 1; border: 0px solid black; top: 0px; position: relative; text-align: center; margin: auto;" id="euDock_0_bar" class="noprint">');  
928 - icones.push('<img onclick="javascript:i3GEO.util.animaClique(this);i3GEO.barraDeBotoes.ajudaEmLista()" id="euDock_euImage_2" class="noprint" style="position: relative; visibility: visible; left: 0px; top: 0px;" src="' + i3GEO.configura.locaplic + '/pacotes/eudock/barImages/dockBg-l.png">');  
929 - icones.push('<img id="euDock_euImage_3" width="' + 38*n + '" height="28" class="noprint" style="position: relative; visibility: visible; left: 0px; top: 0px;" src="' + i3GEO.configura.locaplic + '/pacotes/eudock/barImages/dockBg-c-o.png" >');  
930 - icones.push('<img id="euDock_euImage_4" class="noprint" style="position: relative; visibility: visible; left: 0px; top: 0px;" src="' + i3GEO.configura.locaplic + '/pacotes/eudock/barImages/dockBg-r.png" >');  
931 - icones.push('</div>');  
932 - icones.push('<div style="margin:auto; z-index: 1; position: relative; border: 0px solid black; cursor: pointer; top: -57px; width: 494px; height: 38px;" id="euDock_0" class="noprint">');  
933 - 930 + //l acumula a largura da barra de icones
934 l = 0; 931 l = 0;
935 for (i = 0; i < n; i += 1) { 932 for (i = 0; i < n; i += 1) {
936 - if (i3GEO.barraDeBotoes.INCLUIBOTAO[chaves[i]] && i3GEO.barraDeBotoes.INCLUIBOTAO[chaves[i]] === true) { 933 + if (chaves[i] && i3GEO.barraDeBotoes.INCLUIBOTAO[chaves[i]] && i3GEO.barraDeBotoes.INCLUIBOTAO[chaves[i]] === true) {
  934 +
937 botao = i3GEO.barraDeBotoes.defBotao(chaves[i]); 935 botao = i3GEO.barraDeBotoes.defBotao(chaves[i]);
938 if (botao === false || i3GEO.barraDeBotoes.AJUDA === false) { 936 if (botao === false || i3GEO.barraDeBotoes.AJUDA === false) {
939 - dica = "";  
940 titulo = ""; 937 titulo = "";
941 } else { 938 } else {
942 - if (botao.dica) {  
943 - dica = botao.dica;  
944 - } else {  
945 - dica = "";  
946 - }  
947 if (botao.titulo != undefined && i3GEO.barraDeBotoes.AJUDA === true) { 939 if (botao.titulo != undefined && i3GEO.barraDeBotoes.AJUDA === true) {
948 titulo = botao.titulo; 940 titulo = botao.titulo;
949 } else { 941 } else {
@@ -952,87 +944,42 @@ i3GEO.barraDeBotoes = @@ -952,87 +944,42 @@ i3GEO.barraDeBotoes =
952 } 944 }
953 imagem = i3GEO.configura.locaplic + i3GEO.barraDeBotoes.ICONEBOTAO[chaves[i]]; 945 imagem = i3GEO.configura.locaplic + i3GEO.barraDeBotoes.ICONEBOTAO[chaves[i]];
954 icones.push('<img name="' + chaves[i] + '" class="eudockImagemBottom" onclick="javascript:i3GEO.util.animaClique(this);i3GEO.barraDeBotoes.execBotao(this.name)" style="width: 38px; height: 38px; position: absolute; visibility: visible; left: ' + l + 'px; top: 0px;" src="' + imagem + '" title="' + titulo + '">'); 946 icones.push('<img name="' + chaves[i] + '" class="eudockImagemBottom" onclick="javascript:i3GEO.util.animaClique(this);i3GEO.barraDeBotoes.execBotao(this.name)" style="width: 38px; height: 38px; position: absolute; visibility: visible; left: ' + l + 'px; top: 0px;" src="' + imagem + '" title="' + titulo + '">');
  947 + l += 38;
955 } 948 }
956 - l += 38;  
957 } 949 }
958 - icones.push('</div>'); 950 + if (i3GEO.barraDeBotoes.POSICAO === "top") {}
  951 +
  952 + imagens.push('<div style="z-index: 1; border: 0px solid black; top: 0px; position: relative; text-align: center; margin: auto;" id="euDock_0_bar" class="noprint">');
  953 + imagens.push('<img onclick="javascript:i3GEO.util.animaClique(this);i3GEO.barraDeBotoes.ajudaEmLista()" id="euDock_euImage_2" class="noprint" style="position: relative; visibility: visible; left: 0px; top: 0px;" src="' + i3GEO.configura.locaplic + '/pacotes/eudock/barImages/dockBg-l.png">');
  954 + imagens.push('<img id="euDock_euImage_3" width="' + l + '" height="28" class="noprint" style="position: relative; visibility: visible; left: 0px; top: 0px;" src="' + i3GEO.configura.locaplic + '/pacotes/eudock/barImages/dockBg-c-o.png" >');
  955 + imagens.push('<img id="euDock_euImage_4" class="noprint" style="position: relative; visibility: visible; left: 0px; top: 0px;" src="' + i3GEO.configura.locaplic + '/pacotes/eudock/barImages/dockBg-r.png" >');
  956 + imagens.push('</div>');
  957 + imagens.push('<div style="margin:auto; z-index: 1; position: relative; border: 0px solid black; cursor: pointer; top: ' + (-10 + topo) + 'px; width: ' + l + 'px; height: 38px;" id="euDock_0" class="noprint">');
  958 + //inclui os icones
  959 + imagens.push(icones.join(""));
  960 + //
  961 + imagens.push('</div>');
  962 + divBarra.innerHTML = imagens.join("");
959 963
960 - divBarra.innerHTML = icones.join("");  
961 -  
962 //adiciona a barra ao mapa 964 //adiciona a barra ao mapa
963 if(!onde){ 965 if(!onde){
964 onde = document.body; 966 onde = document.body;
965 } 967 }
966 onde.appendChild(divBarra); 968 onde.appendChild(divBarra);
967 -  
968 - return;  
969 -  
970 - //  
971 - euEnv.imageBasePath = i3GEO.configura.locaplic + "/pacotes/eudock/";  
972 - var botao, dica, titulo, i, dock = new euDock(onde), temp = "dockBg-r.png", tempAjuda = "dockBg-l.png", chaves =  
973 - i3GEO.util.listaChaves(i3GEO.barraDeBotoes.INCLUIBOTAO), n = chaves.length, preload;  
974 - preload = new Image();  
975 - preload.src = i3GEO.configura.locaplic + "/imagens/gisicons/eudock/sobe1.png";  
976 - if (i3GEO.barraDeBotoes.POSICAO === "top") {  
977 - dock.setObjectAlign(i3GEO.Interface.IDCORPO, euUP, (i3GEO.parametros.h) * 1 + i3GEO.barraDeBotoes.OFFSET, euDOWN);  
978 - } else {  
979 - if (onde) {  
980 - dock.setObjectAlign(i3GEO.Interface.IDCORPO, euDOWN, i3GEO.barraDeBotoes.OFFSET, euUP);  
981 - } else {  
982 - dock.setObjectAlign(i3GEO.Interface.IDCORPO, euDOWN, (parseInt(document.body.style.height, 10)) * -1  
983 - + i3GEO.barraDeBotoes.OFFSET, euUP); 969 + //funcao de expancao da barra
  970 + $i("euDock_euImage_4").onclick = function(){
  971 + var nicones = icones.length;
  972 + if ($i("euDock_0_bar")) {
  973 + $i("euDock_0_bar").parentNode.parentNode.removeChild($i("euDock_0_bar").parentNode);
984 } 974 }
985 - }  
986 -  
987 -  
988 - $i(euEnv.euDockArray.euDock_0.bar.elementsArray.right.id).onclick =  
989 - function() {  
990 - var dica, titulo, chaves = i3GEO.util.listaChaves(i3GEO.barraDeBotoes.INCLUIBOTAO), n = chaves.length, nb =  
991 - euEnv.euDockArray.euDock_0.iconsArray.length, i;  
992 - // if ($i("i3geoMarcaIcone")) {  
993 - // $i("i3geoMarcaIcone").style.display = "none";  
994 - // }  
995 - // a barra j&aacute; foi expandida  
996 - if (nb !== i3GEO.barraDeBotoes.MAXBOTOES) {  
997 - i3GEO.barraDeBotoes.recria();  
998 - return;  
999 - }  
1000 - if (i3GEO.barraDeBotoes.MAXBOTOES > 0 && n > nb) {  
1001 - for (i = nb; i < n; i += 1) {  
1002 - if (i3GEO.barraDeBotoes.INCLUIBOTAO[chaves[i]] && i3GEO.barraDeBotoes.INCLUIBOTAO[chaves[i]] === true) {  
1003 - botao = i3GEO.barraDeBotoes.defBotao(chaves[i]);  
1004 - if (botao === false) {  
1005 - dica = "";  
1006 - titulo = "";  
1007 - } else {  
1008 - if (botao.dica) {  
1009 - dica = botao.dica;  
1010 - } else {  
1011 - dica = "";  
1012 - }  
1013 - if (botao.titulo != undefined) {  
1014 - titulo = botao.titulo;  
1015 - } else {  
1016 - titulo = "";  
1017 - }  
1018 - }  
1019 - dock.addIcon(new Array({  
1020 - euImage : {  
1021 - image : i3GEO.configura.locaplic + i3GEO.barraDeBotoes.ICONEBOTAO[chaves[i]],  
1022 - titulo : titulo  
1023 - }  
1024 - }), {  
1025 - mouseInsideClick : function(x, y, id, posX) {  
1026 - i3GEO.barraDeBotoes.execBotao(euEnv.euDockArray[id].idBotao, x, y, posX);  
1027 - },  
1028 - idBotao : chaves[i],  
1029 - dica : dica,  
1030 - titulo : titulo  
1031 - });  
1032 - }  
1033 - }  
1034 - }  
1035 - }; 975 + //30 e um valor qualquer
  976 + if(i3GEO.barraDeBotoes.MAXBOTOES === nicones){
  977 + i3GEO.barraDeBotoes.inicializaBarraOP(false,30);
  978 + }
  979 + else{
  980 + i3GEO.barraDeBotoes.inicializaBarraOP();
  981 + }
  982 + };
1036 }, 983 },
1037 /** 984 /**
1038 * Function: inicializaBarra 985 * Function: inicializaBarra
@@ -1501,15 +1448,10 @@ i3GEO.barraDeBotoes = @@ -1501,15 +1448,10 @@ i3GEO.barraDeBotoes =
1501 console.info("i3GEO.barraDeBotoes.recria()"); 1448 console.info("i3GEO.barraDeBotoes.recria()");
1502 1449
1503 if (i3GEO.barraDeBotoes.TIPO === "olhodepeixe" || i3GEO.barraDeBotoes.TIPO === "olhodepeixe1") { 1450 if (i3GEO.barraDeBotoes.TIPO === "olhodepeixe" || i3GEO.barraDeBotoes.TIPO === "olhodepeixe1") {
1504 - euEnv.euDockArray = [];  
1505 - euEnv.Kost.num = 0;  
1506 if ($i("euDock_0_bar")) { 1451 if ($i("euDock_0_bar")) {
1507 $i("euDock_0_bar").parentNode.parentNode.removeChild($i("euDock_0_bar").parentNode); 1452 $i("euDock_0_bar").parentNode.parentNode.removeChild($i("euDock_0_bar").parentNode);
1508 } 1453 }
1509 i3GEO.barraDeBotoes.inicializaBarra(); 1454 i3GEO.barraDeBotoes.inicializaBarra();
1510 - // if ($i("i3geoMarcaIcone")) {  
1511 - // $i("i3geoMarcaIcone").style.display = "none";  
1512 - // }  
1513 return; 1455 return;
1514 } 1456 }
1515 var i, n, temp, novoel, barraZoom, x, y, BARRAS = i3GEO.barraDeBotoes.BARRAS, iu = i3GEO.util; 1457 var i, n, temp, novoel, barraZoom, x, y, BARRAS = i3GEO.barraDeBotoes.BARRAS, iu = i3GEO.util;