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 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 907 if (i3GEO.barraDeBotoes.ATIVA === false || !$i(i3GEO.Interface.IDCORPO)) {
908 908 return;
909 909 }
910   -
911 910 var divBarra = document.createElement("div"),
912 911 chaves = i3GEO.util.listaChaves(i3GEO.barraDeBotoes.INCLUIBOTAO),
913 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 917 if (i3GEO.barraDeBotoes.MAXBOTOES > 0) {
918 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 924 divBarra.style.position = "relative";
922   - divBarra.style.top = "-50px";
  925 + divBarra.style.top = topo - 10 + "px";
923 926 divBarra.style.margin = "auto";
924   - divBarra.style.textAlign = "center";
  927 + divBarra.style.textAlign = "center";
925 928 divBarra.style.width = i3GEO.parametros.w + "px";
926 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 931 l = 0;
935 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 935 botao = i3GEO.barraDeBotoes.defBotao(chaves[i]);
938 936 if (botao === false || i3GEO.barraDeBotoes.AJUDA === false) {
939   - dica = "";
940 937 titulo = "";
941 938 } else {
942   - if (botao.dica) {
943   - dica = botao.dica;
944   - } else {
945   - dica = "";
946   - }
947 939 if (botao.titulo != undefined && i3GEO.barraDeBotoes.AJUDA === true) {
948 940 titulo = botao.titulo;
949 941 } else {
... ... @@ -952,87 +944,42 @@ i3GEO.barraDeBotoes =
952 944 }
953 945 imagem = i3GEO.configura.locaplic + i3GEO.barraDeBotoes.ICONEBOTAO[chaves[i]];
954 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 964 //adiciona a barra ao mapa
963 965 if(!onde){
964 966 onde = document.body;
965 967 }
966 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 985 * Function: inicializaBarra
... ... @@ -1501,15 +1448,10 @@ i3GEO.barraDeBotoes =
1501 1448 console.info("i3GEO.barraDeBotoes.recria()");
1502 1449  
1503 1450 if (i3GEO.barraDeBotoes.TIPO === "olhodepeixe" || i3GEO.barraDeBotoes.TIPO === "olhodepeixe1") {
1504   - euEnv.euDockArray = [];
1505   - euEnv.Kost.num = 0;
1506 1451 if ($i("euDock_0_bar")) {
1507 1452 $i("euDock_0_bar").parentNode.parentNode.removeChild($i("euDock_0_bar").parentNode);
1508 1453 }
1509 1454 i3GEO.barraDeBotoes.inicializaBarra();
1510   - // if ($i("i3geoMarcaIcone")) {
1511   - // $i("i3geoMarcaIcone").style.display = "none";
1512   - // }
1513 1455 return;
1514 1456 }
1515 1457 var i, n, temp, novoel, barraZoom, x, y, BARRAS = i3GEO.barraDeBotoes.BARRAS, iu = i3GEO.util;
... ...