Commit d8a7f959c5dab2bebb4c5f437481362a2055bba0
1 parent
2778389a
Exists in
master
and in
7 other branches
Validacao com JSLint
Showing
10 changed files
with
168 additions
and
176 deletions
Show diff stats
classesjs/classe_ajuda.js
classesjs/classe_analise.js
classesjs/classe_arvoredecamadas.js
classesjs/classe_arvoredetemas.js
classesjs/classe_barradebotoes.js
classesjs/classe_calculo.js
classesjs/classe_configura.js
| 1 | +/*jslint plusplus:false,white:false,undef: false, rhino: true, onevar: true, evil: false */ | |
| 2 | + | |
| 1 | 3 | /* |
| 2 | 4 | Title: Configurações gerais |
| 3 | 5 | |
| ... | ... | @@ -27,7 +29,7 @@ GNU junto com este programa; se não, escreva para a |
| 27 | 29 | Free Software Foundation, Inc., no endereço |
| 28 | 30 | 59 Temple Street, Suite 330, Boston, MA 02111-1307 USA. |
| 29 | 31 | */ |
| 30 | -if(typeof(i3GEO) == 'undefined'){ | |
| 32 | +if(typeof(i3GEO) === 'undefined'){ | |
| 31 | 33 | i3GEO = []; |
| 32 | 34 | } |
| 33 | 35 | /* |
| ... | ... | @@ -538,7 +540,7 @@ i3GEO.configura = { |
| 538 | 540 | tipo:"", |
| 539 | 541 | dica:$trad("d2"), |
| 540 | 542 | funcaoonclick:function(){ |
| 541 | - if(i3GEO.Interface.ATUAL == "openlayers"){ | |
| 543 | + if(i3GEO.Interface.ATUAL === "openlayers"){ | |
| 542 | 544 | i3GEO.Interface.openlayers.zoom2ext(i3GEO.parametros.extentTotal); |
| 543 | 545 | return; |
| 544 | 546 | } |
| ... | ... | @@ -561,7 +563,7 @@ i3GEO.configura = { |
| 561 | 563 | g_tipoacao='zoomli'; |
| 562 | 564 | i3GEO.barraDeBotoes.ativaIcone("zoomli"); |
| 563 | 565 | marcadorZoom = ""; |
| 564 | - if(i3GEO.Interface.ATUAL=="openlayers"){ | |
| 566 | + if(i3GEO.Interface.ATUAL==="openlayers"){ | |
| 565 | 567 | OLpanel.activateControl(OLzoom); |
| 566 | 568 | return; |
| 567 | 569 | } |
| ... | ... | @@ -593,19 +595,19 @@ i3GEO.configura = { |
| 593 | 595 | i3GEO.util.mudaCursor(i3GEO.configura.cursores,temp,i3GEO.Interface.IDMAPA,i3GEO.configura.locaplic); |
| 594 | 596 | } |
| 595 | 597 | marcadorZoom = ""; |
| 596 | - if(i3GEO.Interface.ATUAL=="openlayers"){ | |
| 598 | + if(i3GEO.Interface.ATUAL==="openlayers"){ | |
| 597 | 599 | OLpanel.activateControl(OLpan); |
| 598 | 600 | return; |
| 599 | 601 | } |
| 600 | 602 | panMapaInicia = function(exy){ |
| 601 | 603 | var k; |
| 602 | - if ($i("img") && (g_tipoacao == "pan")){ | |
| 604 | + if ($i("img") && (g_tipoacao === "pan")){ | |
| 603 | 605 | try{ |
| 604 | 606 | if(navm) |
| 605 | 607 | {k = event.button;} |
| 606 | 608 | else |
| 607 | 609 | {k = exy.button;} |
| 608 | - if(k == 2){return;} | |
| 610 | + if(k === 2){return;} | |
| 609 | 611 | } |
| 610 | 612 | catch(h){} |
| 611 | 613 | g_panM = "sim"; |
| ... | ... | @@ -630,10 +632,10 @@ i3GEO.configura = { |
| 630 | 632 | }; |
| 631 | 633 | panMapaDesloca = function(){ |
| 632 | 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 | 636 | nx = objposicaocursor.telax - leftinicial - clicinicialx; |
| 635 | 637 | ny = objposicaocursor.telay - topinicial - clicinicialy; |
| 636 | - if (i3GEO.configura.entorno == "nao"){ | |
| 638 | + if (i3GEO.configura.entorno === "nao"){ | |
| 637 | 639 | l = 0; |
| 638 | 640 | if (parseInt($i("i3geo").style.left,10)) |
| 639 | 641 | {l = parseInt($i("i3geo").style.left,10);} |
| ... | ... | @@ -662,7 +664,7 @@ i3GEO.configura = { |
| 662 | 664 | } |
| 663 | 665 | }; |
| 664 | 666 | panMapaTermina = function(){ |
| 665 | - if (g_tipoacao == "pan"){ | |
| 667 | + if (g_tipoacao === "pan"){ | |
| 666 | 668 | marcadorZoom = ""; |
| 667 | 669 | g_panM = "nao"; |
| 668 | 670 | var f = "i3GEO.navega.timerNavega = null;if("+ |
| ... | ... | @@ -712,7 +714,7 @@ i3GEO.configura = { |
| 712 | 714 | funcaoonclick:function() |
| 713 | 715 | { |
| 714 | 716 | var temp; |
| 715 | - if(i3GEO.Interface.ATUAL=="padrao"){ | |
| 717 | + if(i3GEO.Interface.ATUAL==="padrao"){ | |
| 716 | 718 | $i("img").title = ""; |
| 717 | 719 | temp = "identifica"; |
| 718 | 720 | if(i3GEO.Interface.ATIVAMENUCONTEXTO) |
| ... | ... | @@ -724,15 +726,15 @@ i3GEO.configura = { |
| 724 | 726 | g_operacao='identifica'; |
| 725 | 727 | i3GEO.barraDeBotoes.BOTAOPADRAO = "identifica"; |
| 726 | 728 | cliqueIdentifica = function(){ |
| 727 | - if (g_operacao == "identifica"){ | |
| 729 | + if (g_operacao === "identifica"){ | |
| 728 | 730 | eval(i3GEO.configura.funcaoIdentifica); |
| 729 | 731 | } |
| 730 | 732 | }; |
| 731 | 733 | verificaTip = function(){ |
| 732 | - if(g_operacao != "identifica" || i3GEOF.identifica){return;} | |
| 734 | + if(g_operacao !== "identifica" || i3GEOF.identifica){return;} | |
| 733 | 735 | if($i("marcaIdentifica")){return;} |
| 734 | 736 | //funcao default para pegar os dados |
| 735 | - if (g_operacao == "identifica"){ | |
| 737 | + if (g_operacao === "identifica"){ | |
| 736 | 738 | eval(i3GEO.configura.funcaoTip); |
| 737 | 739 | } |
| 738 | 740 | }; |
| ... | ... | @@ -776,7 +778,7 @@ i3GEO.configura = { |
| 776 | 778 | {$i("wdocai").src = i3GEO.configura.locaplic+"/ferramentas/wiki/index.htm";} |
| 777 | 779 | else{ |
| 778 | 780 | wikiAtivo = false;i3GEO.eventos.NAVEGAMAPA.remove("atualizawiki()"); |
| 779 | - if(i3GEO.Interface.ATUAL == "googlemaps"){ | |
| 781 | + if(i3GEO.Interface.ATUAL === "googlemaps"){ | |
| 780 | 782 | GEvent.removeListener(wikiDragend); |
| 781 | 783 | GEvent.removeListener(wikiZoomend); |
| 782 | 784 | } |
| ... | ... | @@ -784,11 +786,11 @@ i3GEO.configura = { |
| 784 | 786 | }; |
| 785 | 787 | if(i3GEO.eventos.NAVEGAMAPA.toString().search("atualizawiki()") < 0){ |
| 786 | 788 | i3GEO.eventos.NAVEGAMAPA.push("atualizawiki()"); |
| 787 | - if(i3GEO.Interface.ATUAL == "googlemaps"){ | |
| 789 | + if(i3GEO.Interface.ATUAL === "googlemaps"){ | |
| 788 | 790 | wikiDragend = GEvent.addListener(i3GeoMap, "dragend", function() {atualizawiki();}); |
| 789 | 791 | wikiZoomend = GEvent.addListener(i3GeoMap, "zoomend", function() {atualizawiki();}); |
| 790 | 792 | } |
| 791 | - if(i3GEO.Interface.ATUAL == "openlayers"){ | |
| 793 | + if(i3GEO.Interface.ATUAL === "openlayers"){ | |
| 792 | 794 | i3geoOL.events.register("moveend",i3geoOL,function(e){atualizawiki();}); |
| 793 | 795 | } |
| 794 | 796 | } |
| ... | ... | @@ -851,8 +853,8 @@ i3GEO.configura = { |
| 851 | 853 | if(document.frames("wdocai")) |
| 852 | 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 | 858 | else{ |
| 857 | 859 | i3GEO.eventos.NAVEGAMAPA.remove("atualizagoogle()"); |
| 858 | 860 | } |
| ... | ... | @@ -864,9 +866,9 @@ i3GEO.configura = { |
| 864 | 866 | }; |
| 865 | 867 | if(i3GEO.eventos.NAVEGAMAPA.toString().search("atualizagoogle()") < 0) |
| 866 | 868 | {i3GEO.eventos.NAVEGAMAPA.push("atualizagoogle()");} |
| 867 | - if(i3GEO.Interface.ATUAL == "openlayers"){ | |
| 869 | + if(i3GEO.Interface.ATUAL === "openlayers"){ | |
| 868 | 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 | 890 | {$i("wdocai").src = i3GEO.configura.locaplic+"/ferramentas/scielo/index.htm";} |
| 889 | 891 | else{ |
| 890 | 892 | i3GEO.eventos.NAVEGAMAPA.remove("atualizascielo()"); |
| 891 | - if(i3GEO.Interface.ATUAL == "googlemaps"){ | |
| 893 | + if(i3GEO.Interface.ATUAL === "googlemaps"){ | |
| 892 | 894 | GEvent.removeListener(scieloDragend); |
| 893 | 895 | GEvent.removeListener(scieloZoomend); |
| 894 | 896 | } |
| ... | ... | @@ -898,11 +900,11 @@ i3GEO.configura = { |
| 898 | 900 | }; |
| 899 | 901 | if(i3GEO.eventos.NAVEGAMAPA.toString().search("atualizascielo()") < 0){ |
| 900 | 902 | i3GEO.eventos.NAVEGAMAPA.push("atualizascielo()"); |
| 901 | - if(i3GEO.Interface.ATUAL == "googlemaps"){ | |
| 903 | + if(i3GEO.Interface.ATUAL === "googlemaps"){ | |
| 902 | 904 | scieloDragend = GEvent.addListener(i3GeoMap, "dragend", function() {atualizascielo();}); |
| 903 | 905 | scieloZoomend = GEvent.addListener(i3GeoMap, "zoomend", function() {atualizascielo();}); |
| 904 | 906 | } |
| 905 | - if(i3GEO.Interface.ATUAL == "openlayers"){ | |
| 907 | + if(i3GEO.Interface.ATUAL === "openlayers"){ | |
| 906 | 908 | i3geoOL.events.register("moveend",i3geoOL,function(e){atualizascielo();}); |
| 907 | 909 | } |
| 908 | 910 | } |
| ... | ... | @@ -925,7 +927,7 @@ i3GEO.configura = { |
| 925 | 927 | {$i("wdocai").src = i3GEO.configura.locaplic+"/ferramentas/confluence/index.htm";} |
| 926 | 928 | else{ |
| 927 | 929 | i3GEO.eventos.NAVEGAMAPA.remove("atualizaconfluence()"); |
| 928 | - if(i3GEO.Interface.ATUAL == "googlemaps"){ | |
| 930 | + if(i3GEO.Interface.ATUAL === "googlemaps"){ | |
| 929 | 931 | GEvent.removeListener(confluenceDragend); |
| 930 | 932 | GEvent.removeListener(confluenceZoomend); |
| 931 | 933 | } |
| ... | ... | @@ -933,11 +935,11 @@ i3GEO.configura = { |
| 933 | 935 | }; |
| 934 | 936 | if(i3GEO.eventos.NAVEGAMAPA.toString().search("atualizaconfluence()") < 0){ |
| 935 | 937 | i3GEO.eventos.NAVEGAMAPA.push("atualizaconfluence()"); |
| 936 | - if(i3GEO.Interface.ATUAL == "googlemaps"){ | |
| 938 | + if(i3GEO.Interface.ATUAL === "googlemaps"){ | |
| 937 | 939 | confluenceDragend = GEvent.addListener(i3GeoMap, "dragend", function() {atualizaconfluence();}); |
| 938 | 940 | confluenceZoomend = GEvent.addListener(i3GeoMap, "zoomend", function() {atualizaconfluence();}); |
| 939 | 941 | } |
| 940 | - if(i3GEO.Interface.ATUAL == "openlayers"){ | |
| 942 | + if(i3GEO.Interface.ATUAL === "openlayers"){ | |
| 941 | 943 | i3geoOL.events.register("moveend",i3geoOL,function(e){atualizaconfluence();}); |
| 942 | 944 | } |
| 943 | 945 | } |
| ... | ... | @@ -950,7 +952,7 @@ i3GEO.configura = { |
| 950 | 952 | dica:$trad("d18"), |
| 951 | 953 | funcaoonclick:function() |
| 952 | 954 | { |
| 953 | - if (i3GEO.navega.lente.ESTAATIVA == "nao") | |
| 955 | + if (i3GEO.navega.lente.ESTAATIVA === "nao") | |
| 954 | 956 | {i3GEO.navega.lente.inicia();} |
| 955 | 957 | else |
| 956 | 958 | {i3GEO.navega.lente.desativa();} |
| ... | ... | @@ -1073,18 +1075,18 @@ i3GEO.configura = { |
| 1073 | 1075 | tipo:"", |
| 1074 | 1076 | dica:"Rota", |
| 1075 | 1077 | funcaoonclick:function(){ |
| 1076 | - if(i3GEO.Interface.ATUAL != "googlemaps") | |
| 1078 | + if(i3GEO.Interface.ATUAL !== "googlemaps") | |
| 1077 | 1079 | {alert("Operacao disponivel apenas na interface Google Maps");return;} |
| 1078 | 1080 | counterClick = 1; |
| 1079 | 1081 | var parametrosRota = function(overlay,latlng){ |
| 1080 | 1082 | var temp,janela; |
| 1081 | - if(counterClick == 1){ | |
| 1083 | + if(counterClick === 1){ | |
| 1082 | 1084 | counterClick++; |
| 1083 | 1085 | alert("Clique o ponto de destino da rota"); |
| 1084 | 1086 | pontoRota1 = latlng; |
| 1085 | 1087 | return; |
| 1086 | 1088 | } |
| 1087 | - if(counterClick == 2){ | |
| 1089 | + if(counterClick === 2){ | |
| 1088 | 1090 | pontoRota2 = latlng; |
| 1089 | 1091 | counterClick = 0; |
| 1090 | 1092 | GEvent.removeListener(rotaEvento); | ... | ... |
classesjs/classe_desenho.js
classesjs/classe_eventos.js
| 1 | +/*jslint plusplus:false,white:false,undef: false, rhino: true, onevar: true, evil: false */ | |
| 1 | 2 | /* |
| 2 | 3 | Title: Eventos |
| 3 | 4 | |
| ... | ... | @@ -27,7 +28,7 @@ GNU junto com este programa; se não, escreva para a |
| 27 | 28 | Free Software Foundation, Inc., no endereço |
| 28 | 29 | 59 Temple Street, Suite 330, Boston, MA 02111-1307 USA. |
| 29 | 30 | */ |
| 30 | -if(typeof(i3GEO) == 'undefined'){ | |
| 31 | +if(typeof(i3GEO) === 'undefined'){ | |
| 31 | 32 | i3GEO = []; |
| 32 | 33 | } |
| 33 | 34 | objposicaocursor = { |
| ... | ... | @@ -76,9 +77,7 @@ i3GEO.eventos = { |
| 76 | 77 | Default: |
| 77 | 78 | {["atualizaEscalaNumerica()"]} |
| 78 | 79 | */ |
| 79 | - NAVEGAMAPA: new Array( | |
| 80 | - "atualizaEscalaNumerica()" | |
| 81 | - ), | |
| 80 | + NAVEGAMAPA: ["atualizaEscalaNumerica()"], | |
| 82 | 81 | /* |
| 83 | 82 | Propriedade: MOUSEPARADO |
| 84 | 83 | |
| ... | ... | @@ -91,9 +90,7 @@ i3GEO.eventos = { |
| 91 | 90 | Default: |
| 92 | 91 | {["i3GEO.navega.mostraRosaDosVentos()"]} |
| 93 | 92 | */ |
| 94 | - MOUSEPARADO: new Array( | |
| 95 | - "i3GEO.navega.mostraRosaDosVentos()" | |
| 96 | - ), | |
| 93 | + MOUSEPARADO: ["i3GEO.navega.mostraRosaDosVentos()"], | |
| 97 | 94 | /* |
| 98 | 95 | Propriedade: MOUSEMOVE |
| 99 | 96 | |
| ... | ... | @@ -141,9 +138,7 @@ i3GEO.eventos = { |
| 141 | 138 | Default: |
| 142 | 139 | {["i3GEO.eventos.cliqueCapturaPt()"]} |
| 143 | 140 | */ |
| 144 | - MOUSECLIQUE: new Array( | |
| 145 | - "i3GEO.eventos.cliqueCapturaPt()" | |
| 146 | - ), | |
| 141 | + MOUSECLIQUE: ["i3GEO.eventos.cliqueCapturaPt()"], | |
| 147 | 142 | /* |
| 148 | 143 | Variavel: TIMERPARADO |
| 149 | 144 | |
| ... | ... | @@ -165,20 +160,15 @@ i3GEO.eventos = { |
| 165 | 160 | try |
| 166 | 161 | {clearTimeout(i3GEO.eventos.TIMERPARADO);} |
| 167 | 162 | catch(e){i3GEO.eventos.TIMERPARADO = "";} |
| 168 | - if(objposicaocursor.dentroDomapa == false){return;} | |
| 163 | + if(objposicaocursor.dentroDomapa === false){return;} | |
| 169 | 164 | try{ |
| 170 | - if(objposicaocursor.imgy == ""){ | |
| 165 | + if(objposicaocursor.imgy === ""){ | |
| 171 | 166 | objposicaocursor.imgy = 1; |
| 172 | 167 | objposicaocursor.imgx = 1; |
| 173 | 168 | } |
| 174 | 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 | 174 | }catch(e){} |
| ... | ... | @@ -189,19 +179,7 @@ i3GEO.eventos = { |
| 189 | 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 | 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 | 185 | Function: mousemoveMapa |
| ... | ... | @@ -209,19 +187,7 @@ i3GEO.eventos = { |
| 209 | 187 | Executa as funções armazenadas em MOUSEMOVE. |
| 210 | 188 | */ |
| 211 | 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 | 193 | Function: mousedownMapa |
| ... | ... | @@ -229,19 +195,7 @@ i3GEO.eventos = { |
| 229 | 195 | Executa as funções armazenadas em MOUSEDOWN. |
| 230 | 196 | */ |
| 231 | 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 | 201 | Function: mouseupMapa |
| ... | ... | @@ -249,36 +203,53 @@ i3GEO.eventos = { |
| 249 | 203 | Executa as funções armazenadas em MOUSEUP. |
| 250 | 204 | */ |
| 251 | 205 | mouseupMapa: function(){ |
| 206 | + i3GEO.eventos.executaEventos(i3GEO.eventos.MOUSEUP); | |
| 207 | + /* | |
| 252 | 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 | 211 | if (f >= 0){ |
| 255 | 212 | do{ |
| 256 | - var temp = i3GEO.eventos.MOUSEUP[f].replace("()", ""); | |
| 213 | + temp = i3GEO.eventos.MOUSEUP[f].replace("()", ""); | |
| 257 | 214 | if(eval('typeof ' + temp) == 'function'){ |
| 258 | 215 | eval(i3GEO.eventos.MOUSEUP[f]); |
| 259 | 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 | 225 | Function: mousecliqueMapa |
| 268 | 226 | |
| 269 | 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 | 255 | Function posicaoMouseMapa |
| ... | ... | @@ -321,85 +292,83 @@ i3GEO.eventos = { |
| 321 | 292 | //Entretanto, nas ferramentas que usam o richdraw (distância e área) o posicionamento |
| 322 | 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 | 296 | try{ |
| 326 | 297 | //verifica se o richdraw está sendo usaado |
| 327 | - var container = e.target.parentNode.id; | |
| 298 | + container = e.target.parentNode.id; | |
| 328 | 299 | } |
| 329 | 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 | 303 | {return;} |
| 333 | 304 | } |
| 334 | - if (!e) var e = window.event; | |
| 305 | + if (!e){e = window.event;} | |
| 335 | 306 | // |
| 336 | 307 | //verifica sob qual objeto o mouse está se movendo |
| 337 | 308 | // |
| 338 | 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 | 315 | //se estiver no modo pan, o movimento deve ser obtido do elemento |
| 345 | 316 | //onde está a imagem do mapa e não diretamente sobre o elemento 'img' |
| 346 | 317 | //se não for feito assim, o deslocamento do mapa não é capturado |
| 347 | 318 | // |
| 348 | 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 | 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 | 325 | pos[0] = pos[0] - i3GEO.parametros.w; |
| 355 | 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 | 331 | //pega a posicao correta do mouse |
| 361 | 332 | // |
| 362 | - var mousex = 0; | |
| 363 | - var mousey = 0; | |
| 333 | + mousex = 0; | |
| 334 | + mousey = 0; | |
| 364 | 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 | 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 | 344 | //faz os cálculos de posicionamento |
| 376 | 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 | 354 | //celula e extent são necessários para se fazer a |
| 386 | 355 | //conversão de coordenadas de tela para coordenadas geográficas |
| 387 | 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 | 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 | 365 | if(r) |
| 397 | - r.style.display = "none" | |
| 366 | + {r.style.display = "none";} | |
| 398 | 367 | } |
| 399 | 368 | } |
| 400 | 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 | 372 | objposicaocursor = { |
| 404 | 373 | ddx: teladd[0], |
| 405 | 374 | ddy: teladd[1], |
| ... | ... | @@ -435,57 +404,61 @@ i3GEO.eventos = { |
| 435 | 404 | try{ |
| 436 | 405 | try |
| 437 | 406 | {clearTimeout(i3GEO.eventos.TIMERPARADO);} |
| 438 | - catch(e){var a = e;} | |
| 407 | + catch(e){} | |
| 439 | 408 | i3GEO.eventos.TIMERPARADO = setTimeout('i3GEO.eventos.mouseParado()',i3GEO.configura.tempoMouseParado); |
| 440 | 409 | } |
| 441 | - catch(e){var e = "";} | |
| 410 | + catch(e){} | |
| 442 | 411 | try |
| 443 | 412 | {i3GEO.eventos.mousemoveMapa();} |
| 444 | - catch(e){var e = "";} | |
| 413 | + catch(e){} | |
| 445 | 414 | }; |
| 446 | 415 | }; |
| 447 | 416 | docMapa.onmouseout = function(){ |
| 448 | 417 | objposicaocursor.dentroDomapa = true; |
| 449 | 418 | try |
| 450 | 419 | {objmapaparado="parar";} |
| 451 | - catch(e){var e = "";} | |
| 420 | + catch(e){} | |
| 452 | 421 | }; |
| 453 | 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 | 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 | 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 | 462 | Function: cliqueCapturaPt |
| 490 | 463 | |
| 491 | 464 | Captura um ponto na tela e retorna o resultado para a janela interna que estiver aberta. |
| ... | ... | @@ -495,13 +468,14 @@ i3GEO.eventos = { |
| 495 | 468 | ixg,ixm,ixs,iyg,iym,iys |
| 496 | 469 | */ |
| 497 | 470 | cliqueCapturaPt: function(){ |
| 498 | - if (g_tipoacao != "capturaponto"){return;} | |
| 471 | + var x,y,doc; | |
| 472 | + if (g_tipoacao !== "capturaponto"){return;} | |
| 499 | 473 | else{ |
| 500 | 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 | 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 | 479 | if (doc.getElementById("ixg")) |
| 506 | 480 | {doc.getElementById("ixg").value = x[0];} |
| 507 | 481 | if (doc.getElementById("ixm")) | ... | ... |
classesjs/classe_janela.js
| ... | ... | @@ -314,11 +314,14 @@ i3GEO.janela = { |
| 314 | 314 | else if ($i("contemImg")) |
| 315 | 315 | {var pos = YAHOO.util.Dom.getXY($i("contemImg"));} |
| 316 | 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 | 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 | 322 | eval ('YAHOO.aguarde.'+id+'.setBody(texto)'); |
| 320 | 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> <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> <span style=font-size:8px >'+contador+'</span>")'); | |
| 322 | 325 | eval ('YAHOO.aguarde.'+id+'.render(document.body)'); |
| 323 | 326 | if($i("flamingo")) |
| 324 | 327 | {eval ('YAHOO.aguarde.'+id+'.moveTo(0,0)');} | ... | ... |