Commit f0b1890f7d105e6c4bf2642d0eaa724e5b77c345
1 parent
42e1d860
Exists in
master
and in
7 other branches
Validacao com JSLint
Showing
1 changed file
with
47 additions
and
38 deletions
Show diff stats
classesjs/classe_configura.js
| ... | ... | @@ -552,9 +552,10 @@ i3GEO.configura = { |
| 552 | 552 | tipo:"dinamico", |
| 553 | 553 | dica:$trad("d3"), |
| 554 | 554 | funcaoonclick:function(){ |
| 555 | - var temp = "zoom"; | |
| 555 | + var temp; | |
| 556 | + temp = "zoom"; | |
| 556 | 557 | if(i3GEO.Interface.ATIVAMENUCONTEXTO) |
| 557 | - var temp = "zoom_contexto"; | |
| 558 | + {temp = "zoom_contexto";} | |
| 558 | 559 | i3GEO.util.mudaCursor(i3GEO.configura.cursores,temp,"img",i3GEO.configura.locaplic); |
| 559 | 560 | g_operacao='navega'; |
| 560 | 561 | g_tipoacao='zoomli'; |
| ... | ... | @@ -565,7 +566,7 @@ i3GEO.configura = { |
| 565 | 566 | return; |
| 566 | 567 | } |
| 567 | 568 | if(!$i("i3geoboxZoom")) |
| 568 | - i3GEO.navega.zoomBox.criaBox(); | |
| 569 | + {i3GEO.navega.zoomBox.criaBox();} | |
| 569 | 570 | if(i3GEO.eventos.MOUSEDOWN.toString().search("i3GEO.navega.zoomBox.inicia()") < 0) |
| 570 | 571 | {i3GEO.eventos.MOUSEDOWN.push("i3GEO.navega.zoomBox.inicia()");} |
| 571 | 572 | if(i3GEO.eventos.MOUSEUP.toString().search("i3GEO.navega.zoomBox.termina()") < 0) |
| ... | ... | @@ -579,15 +580,16 @@ i3GEO.configura = { |
| 579 | 580 | tipo:"dinamico", |
| 580 | 581 | dica:$trad("d4"), |
| 581 | 582 | funcaoonclick:function(){ |
| 583 | + var temp; | |
| 582 | 584 | g_tipoacao='pan'; |
| 583 | 585 | g_operacao='navega'; |
| 584 | 586 | i3GEO.barraDeBotoes.ativaIcone("pan"); |
| 585 | 587 | i3GEO.barraDeBotoes.BOTAOPADRAO = "pan"; |
| 586 | 588 | if($i(i3GEO.Interface.IDMAPA)){ |
| 587 | 589 | $i(i3GEO.Interface.IDMAPA).title = ""; |
| 588 | - var temp = "pan"; | |
| 590 | + temp = "pan"; | |
| 589 | 591 | if(i3GEO.Interface.ATIVAMENUCONTEXTO) |
| 590 | - var temp = "pan_contexto"; | |
| 592 | + {temp = "pan_contexto";} | |
| 591 | 593 | i3GEO.util.mudaCursor(i3GEO.configura.cursores,temp,i3GEO.Interface.IDMAPA,i3GEO.configura.locaplic); |
| 592 | 594 | } |
| 593 | 595 | marcadorZoom = ""; |
| ... | ... | @@ -596,19 +598,20 @@ i3GEO.configura = { |
| 596 | 598 | return; |
| 597 | 599 | } |
| 598 | 600 | panMapaInicia = function(exy){ |
| 601 | + var k; | |
| 599 | 602 | if ($i("img") && (g_tipoacao == "pan")){ |
| 600 | 603 | try{ |
| 601 | 604 | if(navm) |
| 602 | - {var k = event.button;} | |
| 605 | + {k = event.button;} | |
| 603 | 606 | else |
| 604 | - {var k = exy.button;} | |
| 607 | + {k = exy.button;} | |
| 605 | 608 | if(k == 2){return;} |
| 606 | 609 | } |
| 607 | 610 | catch(h){} |
| 608 | 611 | g_panM = "sim"; |
| 609 | 612 | if($i("corpoMapa")){ |
| 610 | - leftinicial = parseInt($i(i3GEO.Interface.IDCORPO).style.left); | |
| 611 | - topinicial = parseInt($i(i3GEO.Interface.IDCORPO).style.top); | |
| 613 | + leftinicial = parseInt($i(i3GEO.Interface.IDCORPO).style.left,10); | |
| 614 | + topinicial = parseInt($i(i3GEO.Interface.IDCORPO).style.top,10); | |
| 612 | 615 | } |
| 613 | 616 | clicinicialx = objposicaocursor.imgx; |
| 614 | 617 | clicinicialy = objposicaocursor.imgy; |
| ... | ... | @@ -619,24 +622,25 @@ i3GEO.configura = { |
| 619 | 622 | // |
| 620 | 623 | boxrefObj = $i("boxref"); |
| 621 | 624 | if(boxrefObj){ |
| 622 | - proporcaoBox = i3GEO.parametros.w / parseInt(boxrefObj.style.width); | |
| 623 | - boxrefObjLeft = parseInt(boxrefObj.style.left); | |
| 624 | - boxrefObjTop = parseInt(boxrefObj.style.top); | |
| 625 | + proporcaoBox = i3GEO.parametros.w / parseInt(boxrefObj.style.width,10); | |
| 626 | + boxrefObjLeft = parseInt(boxrefObj.style.left,10); | |
| 627 | + boxrefObjTop = parseInt(boxrefObj.style.top,10); | |
| 625 | 628 | } |
| 626 | 629 | } |
| 627 | 630 | }; |
| 628 | 631 | panMapaDesloca = function(){ |
| 632 | + var nx,ny,l,t; | |
| 629 | 633 | if ($i(i3GEO.Interface.IDMAPA) && (g_panM == "sim")){ |
| 630 | - var nx = objposicaocursor.telax - leftinicial - clicinicialx; | |
| 631 | - var ny = objposicaocursor.telay - topinicial - clicinicialy; | |
| 634 | + nx = objposicaocursor.telax - leftinicial - clicinicialx; | |
| 635 | + ny = objposicaocursor.telay - topinicial - clicinicialy; | |
| 632 | 636 | if (i3GEO.configura.entorno == "nao"){ |
| 633 | - var l = 0; | |
| 634 | - if (parseInt($i("i3geo").style.left)) | |
| 635 | - {var l = parseInt($i("i3geo").style.left);} | |
| 637 | + l = 0; | |
| 638 | + if (parseInt($i("i3geo").style.left,10)) | |
| 639 | + {l = parseInt($i("i3geo").style.left,10);} | |
| 636 | 640 | $i(i3GEO.Interface.IDMAPA).style.left = nx - l; |
| 637 | - var t = 0; | |
| 638 | - if (parseInt($i("i3geo").style.top)) | |
| 639 | - {var t = parseInt($i("i3geo").style.top);} | |
| 641 | + t = 0; | |
| 642 | + if (parseInt($i("i3geo").style.top,10)) | |
| 643 | + {t = parseInt($i("i3geo").style.top,10);} | |
| 640 | 644 | $i(i3GEO.Interface.IDMAPA).style.top = ny - t; |
| 641 | 645 | if(boxrefObj){ |
| 642 | 646 | boxrefObj.style.left = boxrefObjLeft - (nx / proporcaoBox); |
| ... | ... | @@ -707,11 +711,12 @@ i3GEO.configura = { |
| 707 | 711 | dica:$trad("d7"), |
| 708 | 712 | funcaoonclick:function() |
| 709 | 713 | { |
| 714 | + var temp; | |
| 710 | 715 | if(i3GEO.Interface.ATUAL=="padrao"){ |
| 711 | 716 | $i("img").title = ""; |
| 712 | - var temp = "identifica"; | |
| 717 | + temp = "identifica"; | |
| 713 | 718 | if(i3GEO.Interface.ATIVAMENUCONTEXTO) |
| 714 | - var temp = "identifica_contexto"; | |
| 719 | + {temp = "identifica_contexto";} | |
| 715 | 720 | i3GEO.util.mudaCursor(i3GEO.configura.cursores,temp,"img",i3GEO.configura.locaplic); |
| 716 | 721 | } |
| 717 | 722 | i3GEO.barraDeBotoes.ativaIcone("identifica"); |
| ... | ... | @@ -759,13 +764,14 @@ i3GEO.configura = { |
| 759 | 764 | tipo:"", |
| 760 | 765 | dica:$trad("d11"), |
| 761 | 766 | funcaoonclick:function(){ |
| 767 | + var docel; | |
| 762 | 768 | wikiAtivo = false;//esta variável é utilizada pela ferramenta durante a navegação no mapa. Se estiver true significa que a ferramenta está sendo atualizada durante um processo de navegação no mapa |
| 763 | 769 | g_operacao = "navega"; |
| 764 | 770 | i3GEO.janela.cria("450px","190px",i3GEO.configura.locaplic+"/ferramentas/wiki/index.htm","","","Wiki <a class=ajuda_usuario target=_blank href='"+i3GEO.configura.locaplic+"/ajuda_usuario.php?idcategoria=8&idajuda=73' > </a>"); |
| 765 | 771 | atualizawiki = function(){ |
| 766 | 772 | if(!$i("wdocai")) |
| 767 | 773 | {i3GEO.eventos.NAVEGAMAPA.remove("atualizawiki()");return;} |
| 768 | - var docel = (navm) ? document.frames("wdocai").document : $i("wdocai").contentDocument; | |
| 774 | + docel = (navm) ? document.frames("wdocai").document : $i("wdocai").contentDocument; | |
| 769 | 775 | if (docel.getElementById("resultadowiki")) |
| 770 | 776 | {$i("wdocai").src = i3GEO.configura.locaplic+"/ferramentas/wiki/index.htm";} |
| 771 | 777 | else{ |
| ... | ... | @@ -779,8 +785,8 @@ i3GEO.configura = { |
| 779 | 785 | if(i3GEO.eventos.NAVEGAMAPA.toString().search("atualizawiki()") < 0){ |
| 780 | 786 | i3GEO.eventos.NAVEGAMAPA.push("atualizawiki()"); |
| 781 | 787 | if(i3GEO.Interface.ATUAL == "googlemaps"){ |
| 782 | - wikiDragend = GEvent.addListener(i3GeoMap, "dragend", function() {atualizawiki()}); | |
| 783 | - wikiZoomend = GEvent.addListener(i3GeoMap, "zoomend", function() {atualizawiki()}); | |
| 788 | + wikiDragend = GEvent.addListener(i3GeoMap, "dragend", function() {atualizawiki();}); | |
| 789 | + wikiZoomend = GEvent.addListener(i3GeoMap, "zoomend", function() {atualizawiki();}); | |
| 784 | 790 | } |
| 785 | 791 | if(i3GEO.Interface.ATUAL == "openlayers"){ |
| 786 | 792 | i3geoOL.events.register("moveend",i3geoOL,function(e){atualizawiki();}); |
| ... | ... | @@ -835,14 +841,15 @@ i3GEO.configura = { |
| 835 | 841 | else |
| 836 | 842 | {i3GEO.janela.cria("500px","380px",i3GEO.configura.locaplic+"/ferramentas/googlemaps/index.php","","","Google maps <a class=ajuda_usuario target=_blank href='"+i3GEO.configura.locaplic+"/ajuda_usuario.php?idcategoria=7&idajuda=68' > </a>");} |
| 837 | 843 | atualizagoogle = function(){ |
| 844 | + var doc; | |
| 838 | 845 | try{ |
| 839 | 846 | if (navn){ |
| 840 | 847 | if ($i("wdocai")) |
| 841 | - {var doc = $i("wdocai").contentDocument;} | |
| 848 | + {doc = $i("wdocai").contentDocument;} | |
| 842 | 849 | } |
| 843 | 850 | else{ |
| 844 | 851 | if(document.frames("wdocai")) |
| 845 | - {var doc = document.frames("wdocai").document;} | |
| 852 | + {doc = document.frames("wdocai").document;} | |
| 846 | 853 | } |
| 847 | 854 | if(window.parent.frames["wdocai"].panTogoogle) |
| 848 | 855 | {window.parent.frames["wdocai"].panTogoogle();} |
| ... | ... | @@ -874,8 +881,9 @@ i3GEO.configura = { |
| 874 | 881 | g_operacao = "navega"; |
| 875 | 882 | i3GEO.janela.cria("450px","190px",i3GEO.configura.locaplic+"/ferramentas/scielo/index.htm","","","Scielo"); |
| 876 | 883 | atualizascielo = function(){ |
| 884 | + var docel; | |
| 877 | 885 | try{ |
| 878 | - var docel = (navm) ? document.frames("wdocai").document : $i("wdocai").contentDocument; | |
| 886 | + docel = (navm) ? document.frames("wdocai").document : $i("wdocai").contentDocument; | |
| 879 | 887 | if (docel.getElementById("resultadoscielo")) |
| 880 | 888 | {$i("wdocai").src = i3GEO.configura.locaplic+"/ferramentas/scielo/index.htm";} |
| 881 | 889 | else{ |
| ... | ... | @@ -891,8 +899,8 @@ i3GEO.configura = { |
| 891 | 899 | if(i3GEO.eventos.NAVEGAMAPA.toString().search("atualizascielo()") < 0){ |
| 892 | 900 | i3GEO.eventos.NAVEGAMAPA.push("atualizascielo()"); |
| 893 | 901 | if(i3GEO.Interface.ATUAL == "googlemaps"){ |
| 894 | - scieloDragend = GEvent.addListener(i3GeoMap, "dragend", function() {atualizascielo()}); | |
| 895 | - scieloZoomend = GEvent.addListener(i3GeoMap, "zoomend", function() {atualizascielo()}); | |
| 902 | + scieloDragend = GEvent.addListener(i3GeoMap, "dragend", function() {atualizascielo();}); | |
| 903 | + scieloZoomend = GEvent.addListener(i3GeoMap, "zoomend", function() {atualizascielo();}); | |
| 896 | 904 | } |
| 897 | 905 | if(i3GEO.Interface.ATUAL == "openlayers"){ |
| 898 | 906 | i3geoOL.events.register("moveend",i3geoOL,function(e){atualizascielo();}); |
| ... | ... | @@ -926,8 +934,8 @@ i3GEO.configura = { |
| 926 | 934 | if(i3GEO.eventos.NAVEGAMAPA.toString().search("atualizaconfluence()") < 0){ |
| 927 | 935 | i3GEO.eventos.NAVEGAMAPA.push("atualizaconfluence()"); |
| 928 | 936 | if(i3GEO.Interface.ATUAL == "googlemaps"){ |
| 929 | - confluenceDragend = GEvent.addListener(i3GeoMap, "dragend", function() {atualizaconfluence()}); | |
| 930 | - confluenceZoomend = GEvent.addListener(i3GeoMap, "zoomend", function() {atualizaconfluence()}); | |
| 937 | + confluenceDragend = GEvent.addListener(i3GeoMap, "dragend", function() {atualizaconfluence();}); | |
| 938 | + confluenceZoomend = GEvent.addListener(i3GeoMap, "zoomend", function() {atualizaconfluence();}); | |
| 931 | 939 | } |
| 932 | 940 | if(i3GEO.Interface.ATUAL == "openlayers"){ |
| 933 | 941 | i3geoOL.events.register("moveend",i3geoOL,function(e){atualizaconfluence();}); |
| ... | ... | @@ -942,10 +950,10 @@ i3GEO.configura = { |
| 942 | 950 | dica:$trad("d18"), |
| 943 | 951 | funcaoonclick:function() |
| 944 | 952 | { |
| 945 | - if (i3GEO.navega.lente.ESTAATIVA == "nao"){ | |
| 946 | - i3GEO.navega.lente.inicia();} | |
| 953 | + if (i3GEO.navega.lente.ESTAATIVA == "nao") | |
| 954 | + {i3GEO.navega.lente.inicia();} | |
| 947 | 955 | else |
| 948 | - i3GEO.navega.lente.desativa(); | |
| 956 | + {i3GEO.navega.lente.desativa();} | |
| 949 | 957 | } |
| 950 | 958 | }, |
| 951 | 959 | { |
| ... | ... | @@ -1069,8 +1077,9 @@ i3GEO.configura = { |
| 1069 | 1077 | {alert("Operacao disponivel apenas na interface Google Maps");return;} |
| 1070 | 1078 | counterClick = 1; |
| 1071 | 1079 | var parametrosRota = function(overlay,latlng){ |
| 1080 | + var temp,janela; | |
| 1072 | 1081 | if(counterClick == 1){ |
| 1073 | - counterClick++;; | |
| 1082 | + counterClick++; | |
| 1074 | 1083 | alert("Clique o ponto de destino da rota"); |
| 1075 | 1084 | pontoRota1 = latlng; |
| 1076 | 1085 | return; |
| ... | ... | @@ -1079,11 +1088,11 @@ i3GEO.configura = { |
| 1079 | 1088 | pontoRota2 = latlng; |
| 1080 | 1089 | counterClick = 0; |
| 1081 | 1090 | GEvent.removeListener(rotaEvento); |
| 1082 | - var janela = i3GEO.janela.cria("300px","300px","","center","","Rota"); | |
| 1091 | + janela = i3GEO.janela.cria("300px","300px","","center","","Rota"); | |
| 1083 | 1092 | janela[2].style.overflow = "auto"; |
| 1084 | 1093 | janela[2].style.height = "300px"; |
| 1085 | 1094 | directions = new GDirections(i3GeoMap,janela[2]); |
| 1086 | - var temp = function(){ | |
| 1095 | + temp = function(){ | |
| 1087 | 1096 | $i("wdoca_corpo").innerHTML = "Não foi possível criar a rota"; |
| 1088 | 1097 | }; |
| 1089 | 1098 | GEvent.addListener(directions, "error", temp); | ... | ... |