Commit d8a7f959c5dab2bebb4c5f437481362a2055bba0

Authored by Edmar Moretti
1 parent 2778389a

Validacao com JSLint

classesjs/classe_ajuda.js
  1 +/*jslint white:false,undef: false, rhino: true, onevar: true, evil: false */
  2 +
1 /* 3 /*
2 Title: Ajuda 4 Title: Ajuda
3 5
classesjs/classe_analise.js
  1 +/*jslint white:false,undef: false, rhino: true, onevar: true, evil: false */
  2 +
1 /* 3 /*
2 Title: Análise geográfica 4 Title: Análise geográfica
3 5
classesjs/classe_arvoredecamadas.js
  1 +/*jslint white:false,undef: false, rhino: true, onevar: true, evil: false */
  2 +
1 /* 3 /*
2 Title: Árvore de camadas 4 Title: Árvore de camadas
3 5
classesjs/classe_arvoredetemas.js
  1 +/*jslint white:false,undef: false, rhino: true, onevar: true, evil: false */
  2 +
1 /* 3 /*
2 Title: Árvore de temas 4 Title: Árvore de temas
3 5
classesjs/classe_barradebotoes.js
  1 +/*jslint white:false,undef: false, rhino: true, onevar: true, evil: false */
  2 +
1 /* 3 /*
2 Title: Barra de botões 4 Title: Barra de botões
3 5
classesjs/classe_calculo.js
  1 +/*jslint white:false,undef: false, rhino: true, onevar: true, evil: false */
  2 +
1 /* 3 /*
2 Title: Cálculos 4 Title: Cálculos
3 5
classesjs/classe_configura.js
  1 +/*jslint plusplus:false,white:false,undef: false, rhino: true, onevar: true, evil: false */
  2 +
1 /* 3 /*
2 Title: Configurações gerais 4 Title: Configurações gerais
3 5
@@ -27,7 +29,7 @@ GNU junto com este programa; se não, escreva para a @@ -27,7 +29,7 @@ GNU junto com este programa; se não, escreva para a
27 Free Software Foundation, Inc., no endereço 29 Free Software Foundation, Inc., no endereço
28 59 Temple Street, Suite 330, Boston, MA 02111-1307 USA. 30 59 Temple Street, Suite 330, Boston, MA 02111-1307 USA.
29 */ 31 */
30 -if(typeof(i3GEO) == 'undefined'){ 32 +if(typeof(i3GEO) === 'undefined'){
31 i3GEO = []; 33 i3GEO = [];
32 } 34 }
33 /* 35 /*
@@ -538,7 +540,7 @@ i3GEO.configura = { @@ -538,7 +540,7 @@ i3GEO.configura = {
538 tipo:"", 540 tipo:"",
539 dica:$trad("d2"), 541 dica:$trad("d2"),
540 funcaoonclick:function(){ 542 funcaoonclick:function(){
541 - if(i3GEO.Interface.ATUAL == "openlayers"){ 543 + if(i3GEO.Interface.ATUAL === "openlayers"){
542 i3GEO.Interface.openlayers.zoom2ext(i3GEO.parametros.extentTotal); 544 i3GEO.Interface.openlayers.zoom2ext(i3GEO.parametros.extentTotal);
543 return; 545 return;
544 } 546 }
@@ -561,7 +563,7 @@ i3GEO.configura = { @@ -561,7 +563,7 @@ i3GEO.configura = {
561 g_tipoacao='zoomli'; 563 g_tipoacao='zoomli';
562 i3GEO.barraDeBotoes.ativaIcone("zoomli"); 564 i3GEO.barraDeBotoes.ativaIcone("zoomli");
563 marcadorZoom = ""; 565 marcadorZoom = "";
564 - if(i3GEO.Interface.ATUAL=="openlayers"){ 566 + if(i3GEO.Interface.ATUAL==="openlayers"){
565 OLpanel.activateControl(OLzoom); 567 OLpanel.activateControl(OLzoom);
566 return; 568 return;
567 } 569 }
@@ -593,19 +595,19 @@ i3GEO.configura = { @@ -593,19 +595,19 @@ i3GEO.configura = {
593 i3GEO.util.mudaCursor(i3GEO.configura.cursores,temp,i3GEO.Interface.IDMAPA,i3GEO.configura.locaplic); 595 i3GEO.util.mudaCursor(i3GEO.configura.cursores,temp,i3GEO.Interface.IDMAPA,i3GEO.configura.locaplic);
594 } 596 }
595 marcadorZoom = ""; 597 marcadorZoom = "";
596 - if(i3GEO.Interface.ATUAL=="openlayers"){ 598 + if(i3GEO.Interface.ATUAL==="openlayers"){
597 OLpanel.activateControl(OLpan); 599 OLpanel.activateControl(OLpan);
598 return; 600 return;
599 } 601 }
600 panMapaInicia = function(exy){ 602 panMapaInicia = function(exy){
601 var k; 603 var k;
602 - if ($i("img") && (g_tipoacao == "pan")){ 604 + if ($i("img") && (g_tipoacao === "pan")){
603 try{ 605 try{
604 if(navm) 606 if(navm)
605 {k = event.button;} 607 {k = event.button;}
606 else 608 else
607 {k = exy.button;} 609 {k = exy.button;}
608 - if(k == 2){return;} 610 + if(k === 2){return;}
609 } 611 }
610 catch(h){} 612 catch(h){}
611 g_panM = "sim"; 613 g_panM = "sim";
@@ -630,10 +632,10 @@ i3GEO.configura = { @@ -630,10 +632,10 @@ i3GEO.configura = {
630 }; 632 };
631 panMapaDesloca = function(){ 633 panMapaDesloca = function(){
632 var nx,ny,l,t; 634 var nx,ny,l,t;
633 - if ($i(i3GEO.Interface.IDMAPA) && (g_panM == "sim")){ 635 + if ($i(i3GEO.Interface.IDMAPA) && (g_panM === "sim")){
634 nx = objposicaocursor.telax - leftinicial - clicinicialx; 636 nx = objposicaocursor.telax - leftinicial - clicinicialx;
635 ny = objposicaocursor.telay - topinicial - clicinicialy; 637 ny = objposicaocursor.telay - topinicial - clicinicialy;
636 - if (i3GEO.configura.entorno == "nao"){ 638 + if (i3GEO.configura.entorno === "nao"){
637 l = 0; 639 l = 0;
638 if (parseInt($i("i3geo").style.left,10)) 640 if (parseInt($i("i3geo").style.left,10))
639 {l = parseInt($i("i3geo").style.left,10);} 641 {l = parseInt($i("i3geo").style.left,10);}
@@ -662,7 +664,7 @@ i3GEO.configura = { @@ -662,7 +664,7 @@ i3GEO.configura = {
662 } 664 }
663 }; 665 };
664 panMapaTermina = function(){ 666 panMapaTermina = function(){
665 - if (g_tipoacao == "pan"){ 667 + if (g_tipoacao === "pan"){
666 marcadorZoom = ""; 668 marcadorZoom = "";
667 g_panM = "nao"; 669 g_panM = "nao";
668 var f = "i3GEO.navega.timerNavega = null;if("+ 670 var f = "i3GEO.navega.timerNavega = null;if("+
@@ -712,7 +714,7 @@ i3GEO.configura = { @@ -712,7 +714,7 @@ i3GEO.configura = {
712 funcaoonclick:function() 714 funcaoonclick:function()
713 { 715 {
714 var temp; 716 var temp;
715 - if(i3GEO.Interface.ATUAL=="padrao"){ 717 + if(i3GEO.Interface.ATUAL==="padrao"){
716 $i("img").title = ""; 718 $i("img").title = "";
717 temp = "identifica"; 719 temp = "identifica";
718 if(i3GEO.Interface.ATIVAMENUCONTEXTO) 720 if(i3GEO.Interface.ATIVAMENUCONTEXTO)
@@ -724,15 +726,15 @@ i3GEO.configura = { @@ -724,15 +726,15 @@ i3GEO.configura = {
724 g_operacao='identifica'; 726 g_operacao='identifica';
725 i3GEO.barraDeBotoes.BOTAOPADRAO = "identifica"; 727 i3GEO.barraDeBotoes.BOTAOPADRAO = "identifica";
726 cliqueIdentifica = function(){ 728 cliqueIdentifica = function(){
727 - if (g_operacao == "identifica"){ 729 + if (g_operacao === "identifica"){
728 eval(i3GEO.configura.funcaoIdentifica); 730 eval(i3GEO.configura.funcaoIdentifica);
729 } 731 }
730 }; 732 };
731 verificaTip = function(){ 733 verificaTip = function(){
732 - if(g_operacao != "identifica" || i3GEOF.identifica){return;} 734 + if(g_operacao !== "identifica" || i3GEOF.identifica){return;}
733 if($i("marcaIdentifica")){return;} 735 if($i("marcaIdentifica")){return;}
734 //funcao default para pegar os dados 736 //funcao default para pegar os dados
735 - if (g_operacao == "identifica"){ 737 + if (g_operacao === "identifica"){
736 eval(i3GEO.configura.funcaoTip); 738 eval(i3GEO.configura.funcaoTip);
737 } 739 }
738 }; 740 };
@@ -776,7 +778,7 @@ i3GEO.configura = { @@ -776,7 +778,7 @@ i3GEO.configura = {
776 {$i("wdocai").src = i3GEO.configura.locaplic+"/ferramentas/wiki/index.htm";} 778 {$i("wdocai").src = i3GEO.configura.locaplic+"/ferramentas/wiki/index.htm";}
777 else{ 779 else{
778 wikiAtivo = false;i3GEO.eventos.NAVEGAMAPA.remove("atualizawiki()"); 780 wikiAtivo = false;i3GEO.eventos.NAVEGAMAPA.remove("atualizawiki()");
779 - if(i3GEO.Interface.ATUAL == "googlemaps"){ 781 + if(i3GEO.Interface.ATUAL === "googlemaps"){
780 GEvent.removeListener(wikiDragend); 782 GEvent.removeListener(wikiDragend);
781 GEvent.removeListener(wikiZoomend); 783 GEvent.removeListener(wikiZoomend);
782 } 784 }
@@ -784,11 +786,11 @@ i3GEO.configura = { @@ -784,11 +786,11 @@ i3GEO.configura = {
784 }; 786 };
785 if(i3GEO.eventos.NAVEGAMAPA.toString().search("atualizawiki()") < 0){ 787 if(i3GEO.eventos.NAVEGAMAPA.toString().search("atualizawiki()") < 0){
786 i3GEO.eventos.NAVEGAMAPA.push("atualizawiki()"); 788 i3GEO.eventos.NAVEGAMAPA.push("atualizawiki()");
787 - if(i3GEO.Interface.ATUAL == "googlemaps"){ 789 + if(i3GEO.Interface.ATUAL === "googlemaps"){
788 wikiDragend = GEvent.addListener(i3GeoMap, "dragend", function() {atualizawiki();}); 790 wikiDragend = GEvent.addListener(i3GeoMap, "dragend", function() {atualizawiki();});
789 wikiZoomend = GEvent.addListener(i3GeoMap, "zoomend", function() {atualizawiki();}); 791 wikiZoomend = GEvent.addListener(i3GeoMap, "zoomend", function() {atualizawiki();});
790 } 792 }
791 - if(i3GEO.Interface.ATUAL == "openlayers"){ 793 + if(i3GEO.Interface.ATUAL === "openlayers"){
792 i3geoOL.events.register("moveend",i3geoOL,function(e){atualizawiki();}); 794 i3geoOL.events.register("moveend",i3geoOL,function(e){atualizawiki();});
793 } 795 }
794 } 796 }
@@ -851,8 +853,8 @@ i3GEO.configura = { @@ -851,8 +853,8 @@ i3GEO.configura = {
851 if(document.frames("wdocai")) 853 if(document.frames("wdocai"))
852 {doc = document.frames("wdocai").document;} 854 {doc = document.frames("wdocai").document;}
853 } 855 }
854 - if(window.parent.frames["wdocai"].panTogoogle)  
855 - {window.parent.frames["wdocai"].panTogoogle();} 856 + if(window.parent.wdocai.panTogoogle)
  857 + {window.parent.wdocai.panTogoogle();}
856 else{ 858 else{
857 i3GEO.eventos.NAVEGAMAPA.remove("atualizagoogle()"); 859 i3GEO.eventos.NAVEGAMAPA.remove("atualizagoogle()");
858 } 860 }
@@ -864,9 +866,9 @@ i3GEO.configura = { @@ -864,9 +866,9 @@ i3GEO.configura = {
864 }; 866 };
865 if(i3GEO.eventos.NAVEGAMAPA.toString().search("atualizagoogle()") < 0) 867 if(i3GEO.eventos.NAVEGAMAPA.toString().search("atualizagoogle()") < 0)
866 {i3GEO.eventos.NAVEGAMAPA.push("atualizagoogle()");} 868 {i3GEO.eventos.NAVEGAMAPA.push("atualizagoogle()");}
867 - if(i3GEO.Interface.ATUAL == "openlayers"){ 869 + if(i3GEO.Interface.ATUAL === "openlayers"){
868 i3geoOL.events.register("moveend",i3geoOL,function(e){ 870 i3geoOL.events.register("moveend",i3geoOL,function(e){
869 - try{window.parent.frames["wdocai"].panTogoogle();}catch(x){} 871 + try{window.parent.wdocai.panTogoogle();}catch(x){}
870 }); 872 });
871 } 873 }
872 } 874 }
@@ -888,7 +890,7 @@ i3GEO.configura = { @@ -888,7 +890,7 @@ i3GEO.configura = {
888 {$i("wdocai").src = i3GEO.configura.locaplic+"/ferramentas/scielo/index.htm";} 890 {$i("wdocai").src = i3GEO.configura.locaplic+"/ferramentas/scielo/index.htm";}
889 else{ 891 else{
890 i3GEO.eventos.NAVEGAMAPA.remove("atualizascielo()"); 892 i3GEO.eventos.NAVEGAMAPA.remove("atualizascielo()");
891 - if(i3GEO.Interface.ATUAL == "googlemaps"){ 893 + if(i3GEO.Interface.ATUAL === "googlemaps"){
892 GEvent.removeListener(scieloDragend); 894 GEvent.removeListener(scieloDragend);
893 GEvent.removeListener(scieloZoomend); 895 GEvent.removeListener(scieloZoomend);
894 } 896 }
@@ -898,11 +900,11 @@ i3GEO.configura = { @@ -898,11 +900,11 @@ i3GEO.configura = {
898 }; 900 };
899 if(i3GEO.eventos.NAVEGAMAPA.toString().search("atualizascielo()") < 0){ 901 if(i3GEO.eventos.NAVEGAMAPA.toString().search("atualizascielo()") < 0){
900 i3GEO.eventos.NAVEGAMAPA.push("atualizascielo()"); 902 i3GEO.eventos.NAVEGAMAPA.push("atualizascielo()");
901 - if(i3GEO.Interface.ATUAL == "googlemaps"){ 903 + if(i3GEO.Interface.ATUAL === "googlemaps"){
902 scieloDragend = GEvent.addListener(i3GeoMap, "dragend", function() {atualizascielo();}); 904 scieloDragend = GEvent.addListener(i3GeoMap, "dragend", function() {atualizascielo();});
903 scieloZoomend = GEvent.addListener(i3GeoMap, "zoomend", function() {atualizascielo();}); 905 scieloZoomend = GEvent.addListener(i3GeoMap, "zoomend", function() {atualizascielo();});
904 } 906 }
905 - if(i3GEO.Interface.ATUAL == "openlayers"){ 907 + if(i3GEO.Interface.ATUAL === "openlayers"){
906 i3geoOL.events.register("moveend",i3geoOL,function(e){atualizascielo();}); 908 i3geoOL.events.register("moveend",i3geoOL,function(e){atualizascielo();});
907 } 909 }
908 } 910 }
@@ -925,7 +927,7 @@ i3GEO.configura = { @@ -925,7 +927,7 @@ i3GEO.configura = {
925 {$i("wdocai").src = i3GEO.configura.locaplic+"/ferramentas/confluence/index.htm";} 927 {$i("wdocai").src = i3GEO.configura.locaplic+"/ferramentas/confluence/index.htm";}
926 else{ 928 else{
927 i3GEO.eventos.NAVEGAMAPA.remove("atualizaconfluence()"); 929 i3GEO.eventos.NAVEGAMAPA.remove("atualizaconfluence()");
928 - if(i3GEO.Interface.ATUAL == "googlemaps"){ 930 + if(i3GEO.Interface.ATUAL === "googlemaps"){
929 GEvent.removeListener(confluenceDragend); 931 GEvent.removeListener(confluenceDragend);
930 GEvent.removeListener(confluenceZoomend); 932 GEvent.removeListener(confluenceZoomend);
931 } 933 }
@@ -933,11 +935,11 @@ i3GEO.configura = { @@ -933,11 +935,11 @@ i3GEO.configura = {
933 }; 935 };
934 if(i3GEO.eventos.NAVEGAMAPA.toString().search("atualizaconfluence()") < 0){ 936 if(i3GEO.eventos.NAVEGAMAPA.toString().search("atualizaconfluence()") < 0){
935 i3GEO.eventos.NAVEGAMAPA.push("atualizaconfluence()"); 937 i3GEO.eventos.NAVEGAMAPA.push("atualizaconfluence()");
936 - if(i3GEO.Interface.ATUAL == "googlemaps"){ 938 + if(i3GEO.Interface.ATUAL === "googlemaps"){
937 confluenceDragend = GEvent.addListener(i3GeoMap, "dragend", function() {atualizaconfluence();}); 939 confluenceDragend = GEvent.addListener(i3GeoMap, "dragend", function() {atualizaconfluence();});
938 confluenceZoomend = GEvent.addListener(i3GeoMap, "zoomend", function() {atualizaconfluence();}); 940 confluenceZoomend = GEvent.addListener(i3GeoMap, "zoomend", function() {atualizaconfluence();});
939 } 941 }
940 - if(i3GEO.Interface.ATUAL == "openlayers"){ 942 + if(i3GEO.Interface.ATUAL === "openlayers"){
941 i3geoOL.events.register("moveend",i3geoOL,function(e){atualizaconfluence();}); 943 i3geoOL.events.register("moveend",i3geoOL,function(e){atualizaconfluence();});
942 } 944 }
943 } 945 }
@@ -950,7 +952,7 @@ i3GEO.configura = { @@ -950,7 +952,7 @@ i3GEO.configura = {
950 dica:$trad("d18"), 952 dica:$trad("d18"),
951 funcaoonclick:function() 953 funcaoonclick:function()
952 { 954 {
953 - if (i3GEO.navega.lente.ESTAATIVA == "nao") 955 + if (i3GEO.navega.lente.ESTAATIVA === "nao")
954 {i3GEO.navega.lente.inicia();} 956 {i3GEO.navega.lente.inicia();}
955 else 957 else
956 {i3GEO.navega.lente.desativa();} 958 {i3GEO.navega.lente.desativa();}
@@ -1073,18 +1075,18 @@ i3GEO.configura = { @@ -1073,18 +1075,18 @@ i3GEO.configura = {
1073 tipo:"", 1075 tipo:"",
1074 dica:"Rota", 1076 dica:"Rota",
1075 funcaoonclick:function(){ 1077 funcaoonclick:function(){
1076 - if(i3GEO.Interface.ATUAL != "googlemaps") 1078 + if(i3GEO.Interface.ATUAL !== "googlemaps")
1077 {alert("Operacao disponivel apenas na interface Google Maps");return;} 1079 {alert("Operacao disponivel apenas na interface Google Maps");return;}
1078 counterClick = 1; 1080 counterClick = 1;
1079 var parametrosRota = function(overlay,latlng){ 1081 var parametrosRota = function(overlay,latlng){
1080 var temp,janela; 1082 var temp,janela;
1081 - if(counterClick == 1){ 1083 + if(counterClick === 1){
1082 counterClick++; 1084 counterClick++;
1083 alert("Clique o ponto de destino da rota"); 1085 alert("Clique o ponto de destino da rota");
1084 pontoRota1 = latlng; 1086 pontoRota1 = latlng;
1085 return; 1087 return;
1086 } 1088 }
1087 - if(counterClick == 2){ 1089 + if(counterClick === 2){
1088 pontoRota2 = latlng; 1090 pontoRota2 = latlng;
1089 counterClick = 0; 1091 counterClick = 0;
1090 GEvent.removeListener(rotaEvento); 1092 GEvent.removeListener(rotaEvento);
classesjs/classe_desenho.js
1 -/*jslint white:false,undef: false, rhino: true, onevar: true, evil: false */ 1 +/*jslint plusplus:false,white:false,undef: false, rhino: true, onevar: true, evil: false */
  2 +
2 /* 3 /*
3 Title: Desenho de elementos gráficos 4 Title: Desenho de elementos gráficos
4 5
classesjs/classe_eventos.js
  1 +/*jslint plusplus:false,white:false,undef: false, rhino: true, onevar: true, evil: false */
1 /* 2 /*
2 Title: Eventos 3 Title: Eventos
3 4
@@ -27,7 +28,7 @@ GNU junto com este programa; se não, escreva para a @@ -27,7 +28,7 @@ GNU junto com este programa; se não, escreva para a
27 Free Software Foundation, Inc., no endereço 28 Free Software Foundation, Inc., no endereço
28 59 Temple Street, Suite 330, Boston, MA 02111-1307 USA. 29 59 Temple Street, Suite 330, Boston, MA 02111-1307 USA.
29 */ 30 */
30 -if(typeof(i3GEO) == 'undefined'){ 31 +if(typeof(i3GEO) === 'undefined'){
31 i3GEO = []; 32 i3GEO = [];
32 } 33 }
33 objposicaocursor = { 34 objposicaocursor = {
@@ -76,9 +77,7 @@ i3GEO.eventos = { @@ -76,9 +77,7 @@ i3GEO.eventos = {
76 Default: 77 Default:
77 {["atualizaEscalaNumerica()"]} 78 {["atualizaEscalaNumerica()"]}
78 */ 79 */
79 - NAVEGAMAPA: new Array(  
80 - "atualizaEscalaNumerica()"  
81 - ), 80 + NAVEGAMAPA: ["atualizaEscalaNumerica()"],
82 /* 81 /*
83 Propriedade: MOUSEPARADO 82 Propriedade: MOUSEPARADO
84 83
@@ -91,9 +90,7 @@ i3GEO.eventos = { @@ -91,9 +90,7 @@ i3GEO.eventos = {
91 Default: 90 Default:
92 {["i3GEO.navega.mostraRosaDosVentos()"]} 91 {["i3GEO.navega.mostraRosaDosVentos()"]}
93 */ 92 */
94 - MOUSEPARADO: new Array(  
95 - "i3GEO.navega.mostraRosaDosVentos()"  
96 - ), 93 + MOUSEPARADO: ["i3GEO.navega.mostraRosaDosVentos()"],
97 /* 94 /*
98 Propriedade: MOUSEMOVE 95 Propriedade: MOUSEMOVE
99 96
@@ -141,9 +138,7 @@ i3GEO.eventos = { @@ -141,9 +138,7 @@ i3GEO.eventos = {
141 Default: 138 Default:
142 {["i3GEO.eventos.cliqueCapturaPt()"]} 139 {["i3GEO.eventos.cliqueCapturaPt()"]}
143 */ 140 */
144 - MOUSECLIQUE: new Array(  
145 - "i3GEO.eventos.cliqueCapturaPt()"  
146 - ), 141 + MOUSECLIQUE: ["i3GEO.eventos.cliqueCapturaPt()"],
147 /* 142 /*
148 Variavel: TIMERPARADO 143 Variavel: TIMERPARADO
149 144
@@ -165,20 +160,15 @@ i3GEO.eventos = { @@ -165,20 +160,15 @@ i3GEO.eventos = {
165 try 160 try
166 {clearTimeout(i3GEO.eventos.TIMERPARADO);} 161 {clearTimeout(i3GEO.eventos.TIMERPARADO);}
167 catch(e){i3GEO.eventos.TIMERPARADO = "";} 162 catch(e){i3GEO.eventos.TIMERPARADO = "";}
168 - if(objposicaocursor.dentroDomapa == false){return;} 163 + if(objposicaocursor.dentroDomapa === false){return;}
169 try{ 164 try{
170 - if(objposicaocursor.imgy == ""){ 165 + if(objposicaocursor.imgy === ""){
171 objposicaocursor.imgy = 1; 166 objposicaocursor.imgy = 1;
172 objposicaocursor.imgx = 1; 167 objposicaocursor.imgx = 1;
173 } 168 }
174 if (i3GEO.eventos.MOUSEPARADO.length > 0 && objposicaocursor.imgy > 0 && objposicaocursor.imgx > 0){ 169 if (i3GEO.eventos.MOUSEPARADO.length > 0 && objposicaocursor.imgy > 0 && objposicaocursor.imgx > 0){
175 - var f = i3GEO.eventos.MOUSEPARADO.length-1;  
176 - if (f >= 0){  
177 - do{  
178 - if(objposicaocursor.imgx > 0)  
179 - {eval(i3GEO.eventos.MOUSEPARADO[f]);}  
180 - }  
181 - while(f--) 170 + if(objposicaocursor.imgx > 0){
  171 + i3GEO.eventos.executaEventos(i3GEO.eventos.MOUSEPARADO);
182 } 172 }
183 } 173 }
184 }catch(e){} 174 }catch(e){}
@@ -189,19 +179,7 @@ i3GEO.eventos = { @@ -189,19 +179,7 @@ i3GEO.eventos = {
189 Executa as funções armazenadas em NAVEGAMAPA, ou seja, operações executadas quando o mapa tem sua extensão geográfica alterada. 179 Executa as funções armazenadas em NAVEGAMAPA, ou seja, operações executadas quando o mapa tem sua extensão geográfica alterada.
190 */ 180 */
191 navegaMapa: function(){ 181 navegaMapa: function(){
192 - if (i3GEO.eventos.NAVEGAMAPA.length > 0){  
193 - var f = i3GEO.eventos.NAVEGAMAPA.length-1;  
194 - if (f >= 0){  
195 - do{  
196 - var temp = i3GEO.eventos.NAVEGAMAPA[f].replace("()", "");  
197 - if(eval('typeof ' + temp) == 'function'){  
198 - eval(i3GEO.eventos.NAVEGAMAPA[f]);  
199 - //YAHOO.log("navegaMapa", "i3geo");  
200 - }  
201 - }  
202 - while(f--)  
203 - }  
204 - } 182 + i3GEO.eventos.executaEventos(i3GEO.eventos.NAVEGAMAPA);
205 }, 183 },
206 /* 184 /*
207 Function: mousemoveMapa 185 Function: mousemoveMapa
@@ -209,19 +187,7 @@ i3GEO.eventos = { @@ -209,19 +187,7 @@ i3GEO.eventos = {
209 Executa as funções armazenadas em MOUSEMOVE. 187 Executa as funções armazenadas em MOUSEMOVE.
210 */ 188 */
211 mousemoveMapa: function(){ 189 mousemoveMapa: function(){
212 - if (i3GEO.eventos.MOUSEMOVE.length > 0){  
213 - var f = i3GEO.eventos.MOUSEMOVE.length-1;  
214 - if (f >= 0){  
215 - do{  
216 - var temp = i3GEO.eventos.MOUSEMOVE[f].replace("()", "");  
217 - if(eval('typeof ' + temp) == 'function'){  
218 - eval(i3GEO.eventos.MOUSEMOVE[f]);  
219 - //YAHOO.log("mousemoveMapa", "i3geo");  
220 - }  
221 - }  
222 - while(f--)  
223 - }  
224 - } 190 + i3GEO.eventos.executaEventos(i3GEO.eventos.MOUSEMOVE);
225 }, 191 },
226 /* 192 /*
227 Function: mousedownMapa 193 Function: mousedownMapa
@@ -229,19 +195,7 @@ i3GEO.eventos = { @@ -229,19 +195,7 @@ i3GEO.eventos = {
229 Executa as funções armazenadas em MOUSEDOWN. 195 Executa as funções armazenadas em MOUSEDOWN.
230 */ 196 */
231 mousedownMapa: function(){ 197 mousedownMapa: function(){
232 - if (i3GEO.eventos.MOUSEDOWN.length > 0){  
233 - var f = i3GEO.eventos.MOUSEDOWN.length-1;  
234 - if (f >= 0){  
235 - do{  
236 - var temp = i3GEO.eventos.MOUSEDOWN[f].replace("()", "");  
237 - if(eval('typeof ' + temp) == 'function'){  
238 - eval(i3GEO.eventos.MOUSEDOWN[f]);  
239 - //YAHOO.log("mousedownMapa", "i3geo");  
240 - }  
241 - }  
242 - while(f--)  
243 - }  
244 - } 198 + i3GEO.eventos.executaEventos(i3GEO.eventos.MOUSEDOWN);
245 }, 199 },
246 /* 200 /*
247 Function: mouseupMapa 201 Function: mouseupMapa
@@ -249,36 +203,53 @@ i3GEO.eventos = { @@ -249,36 +203,53 @@ i3GEO.eventos = {
249 Executa as funções armazenadas em MOUSEUP. 203 Executa as funções armazenadas em MOUSEUP.
250 */ 204 */
251 mouseupMapa: function(){ 205 mouseupMapa: function(){
  206 + i3GEO.eventos.executaEventos(i3GEO.eventos.MOUSEUP);
  207 + /*
252 if (i3GEO.eventos.MOUSEUP.length > 0){ 208 if (i3GEO.eventos.MOUSEUP.length > 0){
253 - var f = i3GEO.eventos.MOUSEUP.length-1; 209 + var f,temp;
  210 + f = i3GEO.eventos.MOUSEUP.length-1;
254 if (f >= 0){ 211 if (f >= 0){
255 do{ 212 do{
256 - var temp = i3GEO.eventos.MOUSEUP[f].replace("()", ""); 213 + temp = i3GEO.eventos.MOUSEUP[f].replace("()", "");
257 if(eval('typeof ' + temp) == 'function'){ 214 if(eval('typeof ' + temp) == 'function'){
258 eval(i3GEO.eventos.MOUSEUP[f]); 215 eval(i3GEO.eventos.MOUSEUP[f]);
259 //YAHOO.log("mouseupMapa", "i3geo"); 216 //YAHOO.log("mouseupMapa", "i3geo");
260 } 217 }
261 } 218 }
262 - while(f--) 219 + while(f--);
263 } 220 }
264 - } 221 + }
  222 + */
265 }, 223 },
266 /* 224 /*
267 Function: mousecliqueMapa 225 Function: mousecliqueMapa
268 226
269 Executa as funções armazenadas em MOUSECLIQUE. 227 Executa as funções armazenadas em MOUSECLIQUE.
270 */ 228 */
271 - mousecliqueMapa: function(exy){  
272 - if (i3GEO.eventos.MOUSECLIQUE.length > 0){  
273 - var f = i3GEO.eventos.MOUSECLIQUE.length-1;  
274 - if (f >= 0){  
275 - do{  
276 - eval(i3GEO.eventos.MOUSECLIQUE[f]);  
277 - //YAHOO.log("mousecliqueMapa", "i3geo"); 229 + mousecliqueMapa: function(){
  230 + i3GEO.eventos.executaEventos(i3GEO.eventos.MOUSECLIQUE);
  231 + },
  232 + /*
  233 + Function: executaEventos
  234 +
  235 + Executa a pilha de nomes de funções armazenados em um array
  236 +
  237 + Parameter:
  238 +
  239 + eventos {array} - array com os nomes das funções
  240 + */
  241 + executaEventos: function(eventos){
  242 + try{
  243 + var f,temp;
  244 + if (eventos.length > 0){
  245 + f = eventos.length-1;
  246 + if (f >= 0){
  247 + do{eval(eventos[f]);}
  248 + while(f--);
278 } 249 }
279 - while(f--)  
280 } 250 }
281 } 251 }
  252 + catch(e){}
282 }, 253 },
283 /* 254 /*
284 Function posicaoMouseMapa 255 Function posicaoMouseMapa
@@ -321,85 +292,83 @@ i3GEO.eventos = { @@ -321,85 +292,83 @@ i3GEO.eventos = {
321 //Entretanto, nas ferramentas que usam o richdraw (distância e área) o posicionamento 292 //Entretanto, nas ferramentas que usam o richdraw (distância e área) o posicionamento
322 //deve ser controlado pelo i3geo 293 //deve ser controlado pelo i3geo
323 // 294 //
324 - var container = ""; 295 + var teladd,teladms,container,targ,pos,mousex,mousey,xfig,yfig,xreffig,yreffig,xtela,ytela,c,ex,r;
325 try{ 296 try{
326 //verifica se o richdraw está sendo usaado 297 //verifica se o richdraw está sendo usaado
327 - var container = e.target.parentNode.id; 298 + container = e.target.parentNode.id;
328 } 299 }
329 catch(erro){} 300 catch(erro){}
330 - if (container != "divGeometriasTemp"){  
331 - if((i3GEO.Interface.ATUAL == "googlemaps") || (i3GEO.Interface.ATUAL == "openlayers")) 301 + if (container !== "divGeometriasTemp"){
  302 + if((i3GEO.Interface.ATUAL === "googlemaps") || (i3GEO.Interface.ATUAL === "openlayers"))
332 {return;} 303 {return;}
333 } 304 }
334 - if (!e) var e = window.event; 305 + if (!e){e = window.event;}
335 // 306 //
336 //verifica sob qual objeto o mouse está se movendo 307 //verifica sob qual objeto o mouse está se movendo
337 // 308 //
338 if (e.target) 309 if (e.target)
339 - {var targ = e.target;}  
340 - else if (e.srcElement) var targ = e.srcElement;  
341 - if(targ.id == "" && $i(i3GEO.Interface.IDMAPA))  
342 - {var targ = $i(i3GEO.Interface.IDMAPA);} 310 + {targ = e.target;}
  311 + else if (e.srcElement) {targ = e.srcElement;}
  312 + if(targ.id === "" && $i(i3GEO.Interface.IDMAPA))
  313 + {targ = $i(i3GEO.Interface.IDMAPA);}
343 // 314 //
344 //se estiver no modo pan, o movimento deve ser obtido do elemento 315 //se estiver no modo pan, o movimento deve ser obtido do elemento
345 //onde está a imagem do mapa e não diretamente sobre o elemento 'img' 316 //onde está a imagem do mapa e não diretamente sobre o elemento 'img'
346 //se não for feito assim, o deslocamento do mapa não é capturado 317 //se não for feito assim, o deslocamento do mapa não é capturado
347 // 318 //
348 try{ 319 try{
349 - if(g_panM != 'undefined' && g_panM == "sim")  
350 - {var pos = i3GEO.util.pegaPosicaoObjeto(targ.parentNode);} 320 + if(g_panM !== 'undefined' && g_panM === "sim")
  321 + {pos = i3GEO.util.pegaPosicaoObjeto(targ.parentNode);}
351 else 322 else
352 - {var pos = i3GEO.util.pegaPosicaoObjeto(targ);}  
353 - if((i3GEO.configura.entorno == "sim") && (g_panM == "sim")){ 323 + {pos = i3GEO.util.pegaPosicaoObjeto(targ);}
  324 + if((i3GEO.configura.entorno === "sim") && (g_panM === "sim")){
354 pos[0] = pos[0] - i3GEO.parametros.w; 325 pos[0] = pos[0] - i3GEO.parametros.w;
355 pos[1] = pos[1] - i3GEO.parametros.h; 326 pos[1] = pos[1] - i3GEO.parametros.h;
356 } 327 }
357 } 328 }
358 - catch(m){var pos = i3GEO.util.pegaPosicaoObjeto(targ);} 329 + catch(m){pos = i3GEO.util.pegaPosicaoObjeto(targ);}
359 // 330 //
360 //pega a posicao correta do mouse 331 //pega a posicao correta do mouse
361 // 332 //
362 - var mousex = 0;  
363 - var mousey = 0; 333 + mousex = 0;
  334 + mousey = 0;
364 if (e.pageX || e.pageY){ 335 if (e.pageX || e.pageY){
365 - var mousex = e.pageX;  
366 - var mousey = e.pageY; 336 + mousex = e.pageX;
  337 + mousey = e.pageY;
367 } 338 }
368 else if (e.clientX || e.clientY){ 339 else if (e.clientX || e.clientY){
369 - var mousex = e.clientX + document.body.scrollLeft  
370 - + document.documentElement.scrollLeft;  
371 - var mousey = e.clientY + document.body.scrollTop  
372 - + document.documentElement.scrollTop; 340 + mousex = e.clientX + document.body.scrollLeft + document.documentElement.scrollLeft;
  341 + mousey = e.clientY + document.body.scrollTop + document.documentElement.scrollTop;
373 } 342 }
374 // 343 //
375 //faz os cálculos de posicionamento 344 //faz os cálculos de posicionamento
376 //fig e reffig são a mesma coisa por enquanto 345 //fig e reffig são a mesma coisa por enquanto
377 // 346 //
378 - var xfig = mousex - pos[0];  
379 - var yfig = mousey - pos[1];  
380 - var xreffig = xfig;  
381 - var yreffig = yfig;  
382 - var xtela = mousex;  
383 - var ytela = mousey; 347 + xfig = mousex - pos[0];
  348 + yfig = mousey - pos[1];
  349 + xreffig = xfig;
  350 + yreffig = yfig;
  351 + xtela = mousex;
  352 + ytela = mousey;
384 // 353 //
385 //celula e extent são necessários para se fazer a 354 //celula e extent são necessários para se fazer a
386 //conversão de coordenadas de tela para coordenadas geográficas 355 //conversão de coordenadas de tela para coordenadas geográficas
387 //esses valores são obtidos das funções ajax que redesenham ou inicializam o mapa 356 //esses valores são obtidos das funções ajax que redesenham ou inicializam o mapa
388 // 357 //
389 - var c = i3GEO.parametros.pixelsize;  
390 - var ex = i3GEO.parametros.mapexten; 358 + c = i3GEO.parametros.pixelsize;
  359 + ex = i3GEO.parametros.mapexten;
391 try{ 360 try{
392 - if(targ.id == "imagemReferencia"){  
393 - var c = i3GEO.parametros.celularef;  
394 - var ex = i3GEO.parametros.extentref;  
395 - var r = $i("i3geo_rosa"); 361 + if(targ.id === "imagemReferencia"){
  362 + c = i3GEO.parametros.celularef;
  363 + ex = i3GEO.parametros.extentref;
  364 + r = $i("i3geo_rosa");
396 if(r) 365 if(r)
397 - r.style.display = "none" 366 + {r.style.display = "none";}
398 } 367 }
399 } 368 }
400 catch(e){i3GEO.parametros.celularef = 0;} 369 catch(e){i3GEO.parametros.celularef = 0;}
401 - var teladd = i3GEO.calculo.tela2dd(xfig,yfig,c,ex);  
402 - var teladms = i3GEO.calculo.dd2dms(teladd[0],teladd[1]); 370 + teladd = i3GEO.calculo.tela2dd(xfig,yfig,c,ex);
  371 + teladms = i3GEO.calculo.dd2dms(teladd[0],teladd[1]);
403 objposicaocursor = { 372 objposicaocursor = {
404 ddx: teladd[0], 373 ddx: teladd[0],
405 ddy: teladd[1], 374 ddy: teladd[1],
@@ -435,57 +404,61 @@ i3GEO.eventos = { @@ -435,57 +404,61 @@ i3GEO.eventos = {
435 try{ 404 try{
436 try 405 try
437 {clearTimeout(i3GEO.eventos.TIMERPARADO);} 406 {clearTimeout(i3GEO.eventos.TIMERPARADO);}
438 - catch(e){var a = e;} 407 + catch(e){}
439 i3GEO.eventos.TIMERPARADO = setTimeout('i3GEO.eventos.mouseParado()',i3GEO.configura.tempoMouseParado); 408 i3GEO.eventos.TIMERPARADO = setTimeout('i3GEO.eventos.mouseParado()',i3GEO.configura.tempoMouseParado);
440 } 409 }
441 - catch(e){var e = "";} 410 + catch(e){}
442 try 411 try
443 {i3GEO.eventos.mousemoveMapa();} 412 {i3GEO.eventos.mousemoveMapa();}
444 - catch(e){var e = "";} 413 + catch(e){}
445 }; 414 };
446 }; 415 };
447 docMapa.onmouseout = function(){ 416 docMapa.onmouseout = function(){
448 objposicaocursor.dentroDomapa = true; 417 objposicaocursor.dentroDomapa = true;
449 try 418 try
450 {objmapaparado="parar";} 419 {objmapaparado="parar";}
451 - catch(e){var e = "";} 420 + catch(e){}
452 }; 421 };
453 docMapa.onmousedown = function(exy){ 422 docMapa.onmousedown = function(exy){
454 - try{  
455 - i3GEO.eventos.posicaoMouseMapa(exy);  
456 - if(navm)  
457 - {var k = event.button;}  
458 - else  
459 - {var k = exy.button;}  
460 - if(k != 2)  
461 - i3GEO.eventos.mousedownMapa();  
462 - }  
463 - catch(e){var e = "";} 423 + if(!i3GEO.eventos.botaoDireita(exy))
  424 + {i3GEO.eventos.mousedownMapa();}
464 }; 425 };
465 docMapa.onclick = function(exy){ 426 docMapa.onclick = function(exy){
466 - try{  
467 - if(navm)  
468 - {var k = event.button;}  
469 - else  
470 - {var k = exy.button;}  
471 - if(k != 2)  
472 - i3GEO.eventos.mousecliqueMapa();  
473 - }  
474 - catch(e){var e = "";} 427 + if(!i3GEO.eventos.botaoDireita(exy))
  428 + {i3GEO.eventos.mousecliqueMapa();}
475 }; 429 };
476 docMapa.onmouseup = function(exy){ 430 docMapa.onmouseup = function(exy){
477 - try{  
478 - if(navm)  
479 - {var k = event.button;}  
480 - else  
481 - {var k = exy.button;}  
482 - if(k != 2)  
483 - i3GEO.eventos.mouseupMapa();  
484 - }  
485 - catch(e){var e = "";} 431 + if(!i3GEO.eventos.botaoDireita(exy))
  432 + {i3GEO.eventos.mouseupMapa();}
486 }; 433 };
487 }, 434 },
488 /* 435 /*
  436 + Function: botaoDireita
  437 +
  438 + Retorna true se o botão da direita foi utilizado no evento do mouse
  439 +
  440 + Parametro:
  441 +
  442 + exy - evento
  443 +
  444 + Return:
  445 + {boolean}
  446 + */
  447 + botaoDireita: function(exy){
  448 + try{
  449 + var k;
  450 + if(navm)
  451 + {k = event.button;}
  452 + else
  453 + {k = exy.button;}
  454 + if(k !== 2)
  455 + {return false;}
  456 + else
  457 + {return true;}
  458 + }
  459 + catch(e){return false;}
  460 + },
  461 + /*
489 Function: cliqueCapturaPt 462 Function: cliqueCapturaPt
490 463
491 Captura um ponto na tela e retorna o resultado para a janela interna que estiver aberta. 464 Captura um ponto na tela e retorna o resultado para a janela interna que estiver aberta.
@@ -495,13 +468,14 @@ i3GEO.eventos = { @@ -495,13 +468,14 @@ i3GEO.eventos = {
495 ixg,ixm,ixs,iyg,iym,iys 468 ixg,ixm,ixs,iyg,iym,iys
496 */ 469 */
497 cliqueCapturaPt: function(){ 470 cliqueCapturaPt: function(){
498 - if (g_tipoacao != "capturaponto"){return;} 471 + var x,y,doc;
  472 + if (g_tipoacao !== "capturaponto"){return;}
499 else{ 473 else{
500 if($i("wdocai")) 474 if($i("wdocai"))
501 - {var doc = (navm) ? document.frames("wdocai").document : $i("wdocai").contentDocument;} 475 + {doc = (navm) ? document.frames("wdocai").document : $i("wdocai").contentDocument;}
502 try{ 476 try{
503 - var x = objposicaocursor.dmsx.split(" ");  
504 - var y = objposicaocursor.dmsy.split(" "); 477 + x = objposicaocursor.dmsx.split(" ");
  478 + y = objposicaocursor.dmsy.split(" ");
505 if (doc.getElementById("ixg")) 479 if (doc.getElementById("ixg"))
506 {doc.getElementById("ixg").value = x[0];} 480 {doc.getElementById("ixg").value = x[0];}
507 if (doc.getElementById("ixm")) 481 if (doc.getElementById("ixm"))
classesjs/classe_janela.js
@@ -314,11 +314,14 @@ i3GEO.janela = { @@ -314,11 +314,14 @@ i3GEO.janela = {
314 else if ($i("contemImg")) 314 else if ($i("contemImg"))
315 {var pos = YAHOO.util.Dom.getXY($i("contemImg"));} 315 {var pos = YAHOO.util.Dom.getXY($i("contemImg"));}
316 texto += "<br><span style='color:navy;cursor:pointer;font-size:9px;' onclick='javascript:if(i3GEO.janela.AGUARDEMODAL == true){i3GEO.janela.AGUARDEMODAL = false;}else{i3GEO.janela.AGUARDEMODAL = true;}'>bloquear/desbloquear</span>"; 316 texto += "<br><span style='color:navy;cursor:pointer;font-size:9px;' onclick='javascript:if(i3GEO.janela.AGUARDEMODAL == true){i3GEO.janela.AGUARDEMODAL = false;}else{i3GEO.janela.AGUARDEMODAL = true;}'>bloquear/desbloquear</span>";
317 - //texto += i3GEO.contadorAtualiza; 317 + var contador = "";
  318 + for(var index=0; index<i3GEO.contadorAtualiza; index++) {
  319 + contador = contador + ".";
  320 + }
318 eval ('YAHOO.aguarde.'+id+' = new YAHOO.widget.Panel("'+id+'",{width:"240px",fixedcenter:false,underlay:"none",close:true,draggable:false,modal:'+i3GEO.janela.AGUARDEMODAL.toString()+',monitorresize:false})'); 321 eval ('YAHOO.aguarde.'+id+' = new YAHOO.widget.Panel("'+id+'",{width:"240px",fixedcenter:false,underlay:"none",close:true,draggable:false,modal:'+i3GEO.janela.AGUARDEMODAL.toString()+',monitorresize:false})');
319 eval ('YAHOO.aguarde.'+id+'.setBody(texto)'); 322 eval ('YAHOO.aguarde.'+id+'.setBody(texto)');
320 eval ('YAHOO.aguarde.'+id+'.body.style.padding="5px"'); 323 eval ('YAHOO.aguarde.'+id+'.body.style.padding="5px"');
321 - eval ('YAHOO.aguarde.'+id+'.setHeader("<span><img id=aguardeGifAberto src=\'"+i3GEO.configura.locaplic+"/imagens/aguarde.gif\' /></span>&nbsp;<span style=font-size:8px >'+i3GEO.contadorAtualiza+'</span>")'); 324 + eval ('YAHOO.aguarde.'+id+'.setHeader("<span><img id=aguardeGifAberto src=\'"+i3GEO.configura.locaplic+"/imagens/aguarde.gif\' /></span>&nbsp;<span style=font-size:8px >'+contador+'</span>")');
322 eval ('YAHOO.aguarde.'+id+'.render(document.body)'); 325 eval ('YAHOO.aguarde.'+id+'.render(document.body)');
323 if($i("flamingo")) 326 if($i("flamingo"))
324 {eval ('YAHOO.aguarde.'+id+'.moveTo(0,0)');} 327 {eval ('YAHOO.aguarde.'+id+'.moveTo(0,0)');}