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,9 +552,10 @@ i3GEO.configura = { | ||
552 | tipo:"dinamico", | 552 | tipo:"dinamico", |
553 | dica:$trad("d3"), | 553 | dica:$trad("d3"), |
554 | funcaoonclick:function(){ | 554 | funcaoonclick:function(){ |
555 | - var temp = "zoom"; | 555 | + var temp; |
556 | + temp = "zoom"; | ||
556 | if(i3GEO.Interface.ATIVAMENUCONTEXTO) | 557 | if(i3GEO.Interface.ATIVAMENUCONTEXTO) |
557 | - var temp = "zoom_contexto"; | 558 | + {temp = "zoom_contexto";} |
558 | i3GEO.util.mudaCursor(i3GEO.configura.cursores,temp,"img",i3GEO.configura.locaplic); | 559 | i3GEO.util.mudaCursor(i3GEO.configura.cursores,temp,"img",i3GEO.configura.locaplic); |
559 | g_operacao='navega'; | 560 | g_operacao='navega'; |
560 | g_tipoacao='zoomli'; | 561 | g_tipoacao='zoomli'; |
@@ -565,7 +566,7 @@ i3GEO.configura = { | @@ -565,7 +566,7 @@ i3GEO.configura = { | ||
565 | return; | 566 | return; |
566 | } | 567 | } |
567 | if(!$i("i3geoboxZoom")) | 568 | if(!$i("i3geoboxZoom")) |
568 | - i3GEO.navega.zoomBox.criaBox(); | 569 | + {i3GEO.navega.zoomBox.criaBox();} |
569 | if(i3GEO.eventos.MOUSEDOWN.toString().search("i3GEO.navega.zoomBox.inicia()") < 0) | 570 | if(i3GEO.eventos.MOUSEDOWN.toString().search("i3GEO.navega.zoomBox.inicia()") < 0) |
570 | {i3GEO.eventos.MOUSEDOWN.push("i3GEO.navega.zoomBox.inicia()");} | 571 | {i3GEO.eventos.MOUSEDOWN.push("i3GEO.navega.zoomBox.inicia()");} |
571 | if(i3GEO.eventos.MOUSEUP.toString().search("i3GEO.navega.zoomBox.termina()") < 0) | 572 | if(i3GEO.eventos.MOUSEUP.toString().search("i3GEO.navega.zoomBox.termina()") < 0) |
@@ -579,15 +580,16 @@ i3GEO.configura = { | @@ -579,15 +580,16 @@ i3GEO.configura = { | ||
579 | tipo:"dinamico", | 580 | tipo:"dinamico", |
580 | dica:$trad("d4"), | 581 | dica:$trad("d4"), |
581 | funcaoonclick:function(){ | 582 | funcaoonclick:function(){ |
583 | + var temp; | ||
582 | g_tipoacao='pan'; | 584 | g_tipoacao='pan'; |
583 | g_operacao='navega'; | 585 | g_operacao='navega'; |
584 | i3GEO.barraDeBotoes.ativaIcone("pan"); | 586 | i3GEO.barraDeBotoes.ativaIcone("pan"); |
585 | i3GEO.barraDeBotoes.BOTAOPADRAO = "pan"; | 587 | i3GEO.barraDeBotoes.BOTAOPADRAO = "pan"; |
586 | if($i(i3GEO.Interface.IDMAPA)){ | 588 | if($i(i3GEO.Interface.IDMAPA)){ |
587 | $i(i3GEO.Interface.IDMAPA).title = ""; | 589 | $i(i3GEO.Interface.IDMAPA).title = ""; |
588 | - var temp = "pan"; | 590 | + temp = "pan"; |
589 | if(i3GEO.Interface.ATIVAMENUCONTEXTO) | 591 | if(i3GEO.Interface.ATIVAMENUCONTEXTO) |
590 | - var temp = "pan_contexto"; | 592 | + {temp = "pan_contexto";} |
591 | i3GEO.util.mudaCursor(i3GEO.configura.cursores,temp,i3GEO.Interface.IDMAPA,i3GEO.configura.locaplic); | 593 | i3GEO.util.mudaCursor(i3GEO.configura.cursores,temp,i3GEO.Interface.IDMAPA,i3GEO.configura.locaplic); |
592 | } | 594 | } |
593 | marcadorZoom = ""; | 595 | marcadorZoom = ""; |
@@ -596,19 +598,20 @@ i3GEO.configura = { | @@ -596,19 +598,20 @@ i3GEO.configura = { | ||
596 | return; | 598 | return; |
597 | } | 599 | } |
598 | panMapaInicia = function(exy){ | 600 | panMapaInicia = function(exy){ |
601 | + var k; | ||
599 | if ($i("img") && (g_tipoacao == "pan")){ | 602 | if ($i("img") && (g_tipoacao == "pan")){ |
600 | try{ | 603 | try{ |
601 | if(navm) | 604 | if(navm) |
602 | - {var k = event.button;} | 605 | + {k = event.button;} |
603 | else | 606 | else |
604 | - {var k = exy.button;} | 607 | + {k = exy.button;} |
605 | if(k == 2){return;} | 608 | if(k == 2){return;} |
606 | } | 609 | } |
607 | catch(h){} | 610 | catch(h){} |
608 | g_panM = "sim"; | 611 | g_panM = "sim"; |
609 | if($i("corpoMapa")){ | 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 | clicinicialx = objposicaocursor.imgx; | 616 | clicinicialx = objposicaocursor.imgx; |
614 | clicinicialy = objposicaocursor.imgy; | 617 | clicinicialy = objposicaocursor.imgy; |
@@ -619,24 +622,25 @@ i3GEO.configura = { | @@ -619,24 +622,25 @@ i3GEO.configura = { | ||
619 | // | 622 | // |
620 | boxrefObj = $i("boxref"); | 623 | boxrefObj = $i("boxref"); |
621 | if(boxrefObj){ | 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 | panMapaDesloca = function(){ | 631 | panMapaDesloca = function(){ |
632 | + var nx,ny,l,t; | ||
629 | if ($i(i3GEO.Interface.IDMAPA) && (g_panM == "sim")){ | 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 | if (i3GEO.configura.entorno == "nao"){ | 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 | $i(i3GEO.Interface.IDMAPA).style.left = nx - l; | 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 | $i(i3GEO.Interface.IDMAPA).style.top = ny - t; | 644 | $i(i3GEO.Interface.IDMAPA).style.top = ny - t; |
641 | if(boxrefObj){ | 645 | if(boxrefObj){ |
642 | boxrefObj.style.left = boxrefObjLeft - (nx / proporcaoBox); | 646 | boxrefObj.style.left = boxrefObjLeft - (nx / proporcaoBox); |
@@ -707,11 +711,12 @@ i3GEO.configura = { | @@ -707,11 +711,12 @@ i3GEO.configura = { | ||
707 | dica:$trad("d7"), | 711 | dica:$trad("d7"), |
708 | funcaoonclick:function() | 712 | funcaoonclick:function() |
709 | { | 713 | { |
714 | + var temp; | ||
710 | if(i3GEO.Interface.ATUAL=="padrao"){ | 715 | if(i3GEO.Interface.ATUAL=="padrao"){ |
711 | $i("img").title = ""; | 716 | $i("img").title = ""; |
712 | - var temp = "identifica"; | 717 | + temp = "identifica"; |
713 | if(i3GEO.Interface.ATIVAMENUCONTEXTO) | 718 | if(i3GEO.Interface.ATIVAMENUCONTEXTO) |
714 | - var temp = "identifica_contexto"; | 719 | + {temp = "identifica_contexto";} |
715 | i3GEO.util.mudaCursor(i3GEO.configura.cursores,temp,"img",i3GEO.configura.locaplic); | 720 | i3GEO.util.mudaCursor(i3GEO.configura.cursores,temp,"img",i3GEO.configura.locaplic); |
716 | } | 721 | } |
717 | i3GEO.barraDeBotoes.ativaIcone("identifica"); | 722 | i3GEO.barraDeBotoes.ativaIcone("identifica"); |
@@ -759,13 +764,14 @@ i3GEO.configura = { | @@ -759,13 +764,14 @@ i3GEO.configura = { | ||
759 | tipo:"", | 764 | tipo:"", |
760 | dica:$trad("d11"), | 765 | dica:$trad("d11"), |
761 | funcaoonclick:function(){ | 766 | funcaoonclick:function(){ |
767 | + var docel; | ||
762 | 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 | 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 | g_operacao = "navega"; | 769 | g_operacao = "navega"; |
764 | 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>"); | 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 | atualizawiki = function(){ | 771 | atualizawiki = function(){ |
766 | if(!$i("wdocai")) | 772 | if(!$i("wdocai")) |
767 | {i3GEO.eventos.NAVEGAMAPA.remove("atualizawiki()");return;} | 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 | if (docel.getElementById("resultadowiki")) | 775 | if (docel.getElementById("resultadowiki")) |
770 | {$i("wdocai").src = i3GEO.configura.locaplic+"/ferramentas/wiki/index.htm";} | 776 | {$i("wdocai").src = i3GEO.configura.locaplic+"/ferramentas/wiki/index.htm";} |
771 | else{ | 777 | else{ |
@@ -779,8 +785,8 @@ i3GEO.configura = { | @@ -779,8 +785,8 @@ i3GEO.configura = { | ||
779 | if(i3GEO.eventos.NAVEGAMAPA.toString().search("atualizawiki()") < 0){ | 785 | if(i3GEO.eventos.NAVEGAMAPA.toString().search("atualizawiki()") < 0){ |
780 | i3GEO.eventos.NAVEGAMAPA.push("atualizawiki()"); | 786 | i3GEO.eventos.NAVEGAMAPA.push("atualizawiki()"); |
781 | if(i3GEO.Interface.ATUAL == "googlemaps"){ | 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 | if(i3GEO.Interface.ATUAL == "openlayers"){ | 791 | if(i3GEO.Interface.ATUAL == "openlayers"){ |
786 | i3geoOL.events.register("moveend",i3geoOL,function(e){atualizawiki();}); | 792 | i3geoOL.events.register("moveend",i3geoOL,function(e){atualizawiki();}); |
@@ -835,14 +841,15 @@ i3GEO.configura = { | @@ -835,14 +841,15 @@ i3GEO.configura = { | ||
835 | else | 841 | else |
836 | {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>");} | 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 | atualizagoogle = function(){ | 843 | atualizagoogle = function(){ |
844 | + var doc; | ||
838 | try{ | 845 | try{ |
839 | if (navn){ | 846 | if (navn){ |
840 | if ($i("wdocai")) | 847 | if ($i("wdocai")) |
841 | - {var doc = $i("wdocai").contentDocument;} | 848 | + {doc = $i("wdocai").contentDocument;} |
842 | } | 849 | } |
843 | else{ | 850 | else{ |
844 | if(document.frames("wdocai")) | 851 | if(document.frames("wdocai")) |
845 | - {var doc = document.frames("wdocai").document;} | 852 | + {doc = document.frames("wdocai").document;} |
846 | } | 853 | } |
847 | if(window.parent.frames["wdocai"].panTogoogle) | 854 | if(window.parent.frames["wdocai"].panTogoogle) |
848 | {window.parent.frames["wdocai"].panTogoogle();} | 855 | {window.parent.frames["wdocai"].panTogoogle();} |
@@ -874,8 +881,9 @@ i3GEO.configura = { | @@ -874,8 +881,9 @@ i3GEO.configura = { | ||
874 | g_operacao = "navega"; | 881 | g_operacao = "navega"; |
875 | i3GEO.janela.cria("450px","190px",i3GEO.configura.locaplic+"/ferramentas/scielo/index.htm","","","Scielo"); | 882 | i3GEO.janela.cria("450px","190px",i3GEO.configura.locaplic+"/ferramentas/scielo/index.htm","","","Scielo"); |
876 | atualizascielo = function(){ | 883 | atualizascielo = function(){ |
884 | + var docel; | ||
877 | try{ | 885 | try{ |
878 | - var docel = (navm) ? document.frames("wdocai").document : $i("wdocai").contentDocument; | 886 | + docel = (navm) ? document.frames("wdocai").document : $i("wdocai").contentDocument; |
879 | if (docel.getElementById("resultadoscielo")) | 887 | if (docel.getElementById("resultadoscielo")) |
880 | {$i("wdocai").src = i3GEO.configura.locaplic+"/ferramentas/scielo/index.htm";} | 888 | {$i("wdocai").src = i3GEO.configura.locaplic+"/ferramentas/scielo/index.htm";} |
881 | else{ | 889 | else{ |
@@ -891,8 +899,8 @@ i3GEO.configura = { | @@ -891,8 +899,8 @@ i3GEO.configura = { | ||
891 | if(i3GEO.eventos.NAVEGAMAPA.toString().search("atualizascielo()") < 0){ | 899 | if(i3GEO.eventos.NAVEGAMAPA.toString().search("atualizascielo()") < 0){ |
892 | i3GEO.eventos.NAVEGAMAPA.push("atualizascielo()"); | 900 | i3GEO.eventos.NAVEGAMAPA.push("atualizascielo()"); |
893 | if(i3GEO.Interface.ATUAL == "googlemaps"){ | 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 | if(i3GEO.Interface.ATUAL == "openlayers"){ | 905 | if(i3GEO.Interface.ATUAL == "openlayers"){ |
898 | i3geoOL.events.register("moveend",i3geoOL,function(e){atualizascielo();}); | 906 | i3geoOL.events.register("moveend",i3geoOL,function(e){atualizascielo();}); |
@@ -926,8 +934,8 @@ i3GEO.configura = { | @@ -926,8 +934,8 @@ i3GEO.configura = { | ||
926 | if(i3GEO.eventos.NAVEGAMAPA.toString().search("atualizaconfluence()") < 0){ | 934 | if(i3GEO.eventos.NAVEGAMAPA.toString().search("atualizaconfluence()") < 0){ |
927 | i3GEO.eventos.NAVEGAMAPA.push("atualizaconfluence()"); | 935 | i3GEO.eventos.NAVEGAMAPA.push("atualizaconfluence()"); |
928 | if(i3GEO.Interface.ATUAL == "googlemaps"){ | 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 | if(i3GEO.Interface.ATUAL == "openlayers"){ | 940 | if(i3GEO.Interface.ATUAL == "openlayers"){ |
933 | i3geoOL.events.register("moveend",i3geoOL,function(e){atualizaconfluence();}); | 941 | i3geoOL.events.register("moveend",i3geoOL,function(e){atualizaconfluence();}); |
@@ -942,10 +950,10 @@ i3GEO.configura = { | @@ -942,10 +950,10 @@ i3GEO.configura = { | ||
942 | dica:$trad("d18"), | 950 | dica:$trad("d18"), |
943 | funcaoonclick:function() | 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 | else | 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,8 +1077,9 @@ i3GEO.configura = { | ||
1069 | {alert("Operacao disponivel apenas na interface Google Maps");return;} | 1077 | {alert("Operacao disponivel apenas na interface Google Maps");return;} |
1070 | counterClick = 1; | 1078 | counterClick = 1; |
1071 | var parametrosRota = function(overlay,latlng){ | 1079 | var parametrosRota = function(overlay,latlng){ |
1080 | + var temp,janela; | ||
1072 | if(counterClick == 1){ | 1081 | if(counterClick == 1){ |
1073 | - counterClick++;; | 1082 | + counterClick++; |
1074 | alert("Clique o ponto de destino da rota"); | 1083 | alert("Clique o ponto de destino da rota"); |
1075 | pontoRota1 = latlng; | 1084 | pontoRota1 = latlng; |
1076 | return; | 1085 | return; |
@@ -1079,11 +1088,11 @@ i3GEO.configura = { | @@ -1079,11 +1088,11 @@ i3GEO.configura = { | ||
1079 | pontoRota2 = latlng; | 1088 | pontoRota2 = latlng; |
1080 | counterClick = 0; | 1089 | counterClick = 0; |
1081 | GEvent.removeListener(rotaEvento); | 1090 | GEvent.removeListener(rotaEvento); |
1082 | - var janela = i3GEO.janela.cria("300px","300px","","center","","Rota"); | 1091 | + janela = i3GEO.janela.cria("300px","300px","","center","","Rota"); |
1083 | janela[2].style.overflow = "auto"; | 1092 | janela[2].style.overflow = "auto"; |
1084 | janela[2].style.height = "300px"; | 1093 | janela[2].style.height = "300px"; |
1085 | directions = new GDirections(i3GeoMap,janela[2]); | 1094 | directions = new GDirections(i3GeoMap,janela[2]); |
1086 | - var temp = function(){ | 1095 | + temp = function(){ |
1087 | $i("wdoca_corpo").innerHTML = "Não foi possível criar a rota"; | 1096 | $i("wdoca_corpo").innerHTML = "Não foi possível criar a rota"; |
1088 | }; | 1097 | }; |
1089 | GEvent.addListener(directions, "error", temp); | 1098 | GEvent.addListener(directions, "error", temp); |