Commit 663d47bd4e429c970cd947e527b1c4080394c1c0

Authored by Edmar Moretti
1 parent cfd71e7d

Ajustes na disposição dos elementos do editor de mapfiles

admin/html/admin.css
... ... @@ -27,12 +27,25 @@
27 27 background: url("../../pacotes/yui290/build/assets/skins/sam/sprite.png") repeat-x scroll 0 0 #D8D8D8;
28 28 z-index: 3000;
29 29 }
30   -.yui-skin-sam .yui-button button, .yui-skin-sam .yui-button a, .yui-skin-sam .yui-button a:visited{
31   - font-size:1em;
  30 +
  31 +.yui-skin-sam .yui-button button,.yui-skin-sam .yui-button a {
  32 + color: #000000;
  33 + font-size: 95%;
  34 + line-height: 1.5;
  35 + min-height: 1em;
  36 + padding: 0 10px;
32 37 }
33 38 .yui-skin-sam .yui-button {
34   - margin: 0.25em;
  39 + border-color: #D3D3D3;
  40 + border-radius: 6px;
  41 + box-shadow: 0px 0px 0px 0px rgb(230,230,230);
  42 +}
  43 +.yui-skin-sam .yui-button .first-child {
  44 + border-color: #D3D3D3;
  45 + border-radius: 7px;
35 46 }
  47 +
  48 +
36 49 .ajuda_usuario
37 50 {
38 51 background-image:url(../../imagens/external.png);
... ...
admin/js/core.js
... ... @@ -162,16 +162,18 @@ function cabecalhoUsuarios(id,excluir){
162 162 //temp.style.border = "solid 1px gray";
163 163 //temp.style.padding = "10px";
164 164 }
165   -function cabecalhoGeral(id,excluir){
  165 +function cabecalhoGeral(id,excluir,prefixo){
  166 + if(!prefixo){
  167 + prefixo = "";
  168 + }
166 169 var i,n,temp,
167 170 ins = "<fieldset ><legend>Atalhos</legend>",
168 171 u = i3GEO.util.pegaCookie("i3geousuarionome"),
169 172 botoes = [
170   - {id:"principal",titulo:"In&iacute;cio",link:"../principal.html"},
171   - {id:"menus",titulo:"Menus",link:"menus.html"},
172   - {id:"arvore",titulo:"&Aacute;rvore de temas",link:"arvore.html"},
173   - {id:"editormapfile",titulo:"Mapfiles",link:"editormapfile.html"},
174   - {id:"atlas",titulo:"Atlas",link:"atlas.html"},
  173 + {id:"principal",titulo:"In&iacute;cio",link:prefixo+"../principal.html"},
  174 + {id:"menus",titulo:"Menus",link:prefixo+"menus.html"},
  175 + {id:"arvore",titulo:"&Aacute;rvore de temas",link:prefixo+"arvore.html"},
  176 + {id:"editormapfile",titulo:"Mapfiles",link:prefixo+"editormapfile.html"},
175 177 {id:"login",titulo:"Login",js:"i3GEO.login.dialogo.abreLogin()"}
176 178 ];
177 179 n = botoes.length;
... ... @@ -1638,7 +1640,7 @@ function core_ativaforms(lista){
1638 1640 }
1639 1641 }
1640 1642 }
1641   -function core_listaDeLetras(onde,nomeFuncao){
  1643 +function core_listaDeLetras(onde,nomeFuncao,semLetras){
1642 1644 //letraAtual guarda a ultima letra clicada
1643 1645 var o,i,ins= "<p><b>",
1644 1646 letras = ["Todos","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","X","Y","Z","_","1","2","3","4","5","6","7","8","9"],
... ... @@ -1651,17 +1653,27 @@ function core_listaDeLetras(onde,nomeFuncao){
1651 1653 if(i3GEO.util.pegaCookie("I3GEOletraAdmin")) {
1652 1654 letraAtual = i3GEO.util.pegaCookie("I3GEOletraAdmin");
1653 1655 }
1654   - for (i = 0; i < nletras; i++) {
1655   - ins += "<span onclick='"+nomeFuncao+"(\""
1656   - + letras[i]
1657   - + "\")' style='color:blue;cursor:pointer;padding:1px;border: 1px solid #C8C8FA'>"
1658   - + letras[i] + "</span>&nbsp;";
  1656 + if(!semLetras){
  1657 + for (i = 0; i < nletras; i++) {
  1658 + ins += "<span onclick='"+nomeFuncao+"(\""
  1659 + + letras[i]
  1660 + + "\")' style='color:blue;cursor:pointer;padding:1px;border: 1px solid #C8C8FA'>"
  1661 + + letras[i] + "</span>&nbsp;";
  1662 + }
  1663 + ins += "</b></p>";
  1664 + }
  1665 + else{
  1666 + ins = "";
1659 1667 }
1660   - ins += "</b></p>";
1661 1668 if(onde && onde != ""){
1662 1669 o = document.getElementById(onde);
1663 1670 if(o){
1664   - o.innerHTML = "<fieldset style=padding:2px; class=letras ><form id=forminiciais ><p><b>Iniciais: <input name='' onchange='' value='"+letraAtual+"' id=iniciaisLetras type=text style=width:40px;cursor:pointer /> ou </form><div style=position:relative;top:1px; id='_listaDeLetras' >"+ins+"</div></b></p></fieldset>";
  1671 + if(!semLetras){
  1672 + o.innerHTML = "<fieldset style=padding:2px; class=letras ><form id=forminiciais ><p><b>Iniciais: <input name='' onchange='' value='"+letraAtual+"' id=iniciaisLetras type=text style=width:40px;cursor:pointer /></form><div style=position:relative;top:1px; id='_listaDeLetras' >"+ins+"</div></b></p></fieldset>";
  1673 + }
  1674 + else{
  1675 + o.innerHTML = "<form id=forminiciais >Iniciais: <input name='' onchange='' value='' id=iniciaisLetras type=text style=width:40px;cursor:pointer /></form>";
  1676 + }
1665 1677 if(document.getElementById("forminiciais")){
1666 1678 document.getElementById("forminiciais").onsubmit = function(){
1667 1679 var v = document.getElementById("iniciaisLetras").value;
... ... @@ -1670,9 +1682,11 @@ function core_listaDeLetras(onde,nomeFuncao){
1670 1682 return false;
1671 1683 };
1672 1684 }
1673   - document.getElementById("_listaDeLetras").onclick = function(){
1674   - document.getElementById("iniciaisLetras").value = letraAtual;
1675   - };
  1685 + if(!semLetras){
  1686 + document.getElementById("_listaDeLetras").onclick = function(){
  1687 + document.getElementById("iniciaisLetras").value = letraAtual;
  1688 + };
  1689 + }
1676 1690 }
1677 1691 }
1678 1692 else{
... ...
admin/php/editortexto.php
... ... @@ -46,16 +46,19 @@ body {
46 46 </head>
47 47 <body class=" yui-skin-sam ">
48 48 <div class="" id="divGeral" style="width: 100%;">
49   - <div style="position: relative; float: left; height: 200px; width:500px;margin: 5px;">
50   - <input type=button value="<--- Voltar" onclick="window.location.href='../html/editormapfile.html'" />
51   - <h2>Editor de mapfiles</h2>
  49 + <div id=cabecalhoPrincipal ></div>
  50 + <fieldset>
52 51 Mais detalhes sobre a edi&ccedil;&atilde;o de mapfiles: <a href="http://mapserver.org/mapfile/index.html#mapfile" target="_new">Documenta&ccedil;&atilde;o do Mapserver</a>
53 52 <br><br>
54 53 <form style="width: 98%;" onsubmit="atualizaTextArea()" action="editortexto.php?mapfile=<?php echo $_GET["mapfile"];?>" method=post>
55   - <input type=submit value="Salvar e atualizar o mapa" />
  54 + <input type=submit value="Salvar" />
56 55 <input type=button value="Testar" onclick="testar()" />
57 56 <input type=button value="Testar no i3Geo" onclick="abrirI3geo()" />
58   - (Salve antes de testar)<br> <br>
  57 + (Salve antes de testar)
  58 + </fieldset>
  59 + <fieldset style="position: relative; float: left; width:500px;margin: 5px;padding:5px;">
  60 + <legend>Editor</legend>
  61 +
59 62 <?php
60 63 //evita erros removendo caracteres PHP
61 64 if(isset($_POST["texto"])){
... ... @@ -91,6 +94,8 @@ body {
91 94 fclose($fp);
92 95 }
93 96 ?>
  97 +
  98 +
94 99 <div style=float:left; >
95 100 Estilo: <select onchange="mudaEstilo(this.value)">
96 101 <option value=elegant >Elegant</option>
... ... @@ -99,29 +104,35 @@ body {
99 104 <option value=night >Night</option>
100 105 <option value=neo >Neo</option>
101 106 </select>
102   - <br><br>
103   - <input type=button value="+ extender" onclick="editorCM.setSize('100%')" />
  107 + <input type=button value="+ extender" onclick="editorCM.setSize('1100px')" />
104 108 <input type=button value="- reduzir" onclick="editorCM.setSize('500px')" />
105 109 </div>
106   - <TEXTAREA style='margin-left:35px;width:250px;height:55px;text-align:left;'>
107   -Ctrl+a - Seleciona tudo
108   -Ctrl+d - Apaga a linha
109   -Ctrl-z - Desfazer
110   -Ctrl-Up - Sobe
111   -Alt-left - Início da linha
112   - </TEXTAREA>
113   - </div>
114   - <div style="position: relative; float: left; height: 200px; width:520px;margin: 5px;">
115   - <h2>Mapfile em edi&ccedil;&atilde;o</h2>
116   - <div id="comboMapfiles" >Aguarde...</div>
117   - </div>
  110 +
  111 + <br><br>
118 112 <?php
119 113 echo "<TEXTAREA id=editor name=texto cols=100 rows=20 style='width:500px;float:left;height:500px'>";
120 114 echo file_get_contents($mapfile);
121 115 echo "</TEXTAREA>";
  116 + ?>
  117 + <br><br>
  118 +
  119 +Ctrl+a - Seleciona tudo<br>
  120 +Ctrl+d - Apaga a linha<br>
  121 +Ctrl-z - Desfazer<br>
  122 +Ctrl-Up - Sobe<br>
  123 +Alt-left - Início da linha<br>
  124 +
  125 +
  126 + </fieldset>
  127 +
  128 + <fieldset style="position: relative; float: left; width:520px;margin: 5px;padding:10px;left:10px;">
  129 + <legend>Mapfile em edi&ccedil;&atilde;o</legend>
  130 + <div id=filtroDeLetras ></div>
  131 + <div id="comboMapfiles" >Aguarde...</div>
  132 + <?php
122 133 $mapfile = str_replace("\\","/",$mapfile);
123 134  
124   - echo "<iframe id='mapaPreview' src='../../mashups/openlayers.php?nocache=sim&DESLIGACACHE=sim&controles=navigation,panzoombar,scaleline,mouseposition&botoes=identifica&largura=450&fundo=".$mapfile."&temas=".$mapfile."' cols=100 rows=20 style='left:10px;position:relative;top:2px;overflow:hidden;width:525px;height:500px;border:1px solid gray;'>";
  135 + echo "<iframe id='mapaPreview' src='../../mashups/openlayers.php?nocache=sim&DESLIGACACHE=sim&controles=navigation,panzoombar,scaleline,mouseposition&botoes=identifica&largura=450&fundo=".$mapfile."&temas=".$mapfile."' cols=100 rows=20 style='position:relative;top:2px;overflow:hidden;width:525px;height:500px;border:1px solid gray;'>";
125 136 echo "</iframe>";
126 137 echo "<input type=hidden name=tipo value=gravar />";
127 138  
... ... @@ -144,6 +155,7 @@ Alt-left - Início da linha
144 155 }
145 156 }
146 157 ?>
  158 + </fieldset>
147 159 </form>
148 160 </div>
149 161 <script type="text/javascript" src="../js/core.js"></script>
... ... @@ -162,7 +174,8 @@ else{
162 174 letraAtual = "";
163 175 }
164 176 */
165   -
  177 +cabecalhoGeral("cabecalhoPrincipal","","../html/");
  178 +core_listaDeLetras("filtroDeLetras","filtraLetra",true);
166 179 var editorCM = CodeMirror.fromTextArea(document.getElementById("editor"), {
167 180 mode: 'scribe',
168 181 tabMode: 'indent',
... ... @@ -188,7 +201,7 @@ function filtraLetra(letra) {
188 201 function comboMapfiles(){
189 202 var n = $mapfiles.length,
190 203 i,ins;
191   - ins = "<select size=9 id='selectComboMapfile' onchange='mudaMapfile(this)'><option value=''>Edite outro mapfile</option>";
  204 + ins = "<select size=8 id='selectComboMapfile' onchange='mudaMapfile(this)'><option value=''>Edite outro mapfile</option>";
192 205 for(i=0;i<n;i++){
193 206 if($mapfiles[i].extensao === "map"){
194 207 ins += "<option title='"+$mapfiles[i].nome+"' value='"+$mapfiles[i].codigo+"'>"+$mapfiles[i].codigo+" - "+$mapfiles[i].nome+"</optiona>";
... ...
classesjs/classe_editorgm.js
... ... @@ -2,7 +2,7 @@
2 2 //TODO traduzir
3 3 //TODO incluir opcao para selecionar todas as figuras
4 4 //TODO incluir balao de informacoes como um elemento grafico de desenho
5   -//TODO uncluir caixas de texto
  5 +//TODO incluir caixas de texto
6 6  
7 7 /*
8 8 Editor vetorial de limites para a interface google maps
... ...
classesjs/classe_editorol.js
... ... @@ -2,7 +2,7 @@
2 2 //TODO traduzir
3 3 //TODO incluir opcao para selecionar todas as figuras
4 4 //TODO incluir balao de informacoes como um elemento grafico de desenho
5   -//TODO uncluir caixas de texto
  5 +//TODO incluir caixas de texto
6 6  
7 7 /*
8 8 Title: Editor vetorial para OpenLayers
... ...
classesjs/classe_navega.js
... ... @@ -107,9 +107,6 @@ i3GEO.navega =
107 107 * Registra uma extensao na variavel EXTENSOES
108 108 */
109 109 registraExt : function(ext) {
110   - if (typeof (console) !== 'undefined')
111   - console.warn("registraExt");
112   -
113 110 var l = i3GEO.navega.EXTENSOES.lista,
114 111 n = l.length;
115 112 //precisa ter cuidado para nao registrar a mesma extensao atual
... ...
temas/_lbairros.map
1   -MAP
2   - FONTSET "/var/www/i3geo/symbols/fontes.txt"
3   - SYMBOLSET "/var/www/i3geo/symbols/simbolosv6.sym"
4   - LAYER
5   - CONNECTION "user=postgres password=postgres dbname=i3geosaude host=localhost port=5432 options='-c client_encoding=LATIN1'"
6   - CONNECTIONTYPE POSTGIS
7   - DATA "the_geom from (select gid, st_setsrid(the_geom,4326) as the_geom,co_bairro,no_bairro,no_distr,no_municip from i3geo_metaestat.bairros /*FW*//*FW*/) as foo using unique co_bairro using srid=4326"
8   - METADATA
9   - "TIP" "no_bairro"
10   - "cache" ""
11   - "CLASSE" "SIM"
12   - "ITENSDESC" "id,Código bairro,Nome,Distrito,Município"
13   - "EDITAVEL" "SIM"
14   - "ESQUEMATABELAEDITAVEL" "i3geo_metaestat"
15   - "ITENS" "gid,co_bairro,no_bairro,no_distr,no_municip"
16   - "TEMA" "Bairro via mapfile"
17   - "COLUNAIDUNICO" "gid"
18   - "COLUNAGEOMETRIA" "the_geom"
19   - "TABELAEDITAVEL" "bairros"
20   - END # METADATA
21   - NAME "_lbairros"
22   - STATUS DEFAULT
23   - TEMPLATE "none.htm"
24   - TILEITEM "location"
25   - TYPE POLYGON
26   - UNITS METERS
27   - CLASS
28   - NAME ""
29   - STYLE
30   - OUTLINECOLOR 255 100 0
31   - END # STYLE
32   - END # CLASS
33   - END # LAYER
34   -
35   -END # MAP
36   -
  1 +MAP
  2 + FONTSET "/var/www/i3geo/symbols/fontes.txt"
  3 + SYMBOLSET "/var/www/i3geo/symbols/simbolosv6.sym"
  4 + LAYER
  5 + CONNECTION "user=postgres password=postgres dbname=i3geosaude host=localhost port=5432 options='-c client_encoding=LATIN1'"
  6 + CONNECTIONTYPE POSTGIS
  7 + DATA "the_geom from (select gid, st_setsrid(the_geom,4326) as the_geom,co_bairro,no_bairro,no_distr,no_municip from i3geo_metaestat.bairros /*FW*//*FW*/) as foo using unique co_bairro using srid=4326"
  8 + METADATA
  9 + "TIP" "no_bairro"
  10 + "cache" ""
  11 + "CLASSE" "SIM"
  12 + "ITENSDESC" "id,Código bairro,Nome,Distrito,Município"
  13 + "EDITAVEL" "SIM"
  14 + "ESQUEMATABELAEDITAVEL" "i3geo_metaestat"
  15 + "ITENS" "gid,co_bairro,no_bairro,no_distr,no_municip"
  16 + "TEMA" "Bairro via mapfile"
  17 + "COLUNAIDUNICO" "gid"
  18 + "COLUNAGEOMETRIA" "the_geom"
  19 + "TABELAEDITAVEL" "bairros"
  20 + END # METADATA
  21 + NAME "_lbairros"
  22 + STATUS DEFAULT
  23 + TEMPLATE "none.htm"
  24 + TILEITEM "location"
  25 + TYPE POLYGON
  26 + UNITS METERS
  27 + CLASS
  28 + NAME ""
  29 + STYLE
  30 + OUTLINECOLOR 255 100 0
  31 + END # STYLE
  32 + END # CLASS
  33 + END # LAYER
  34 +
  35 +END # MAP
  36 +
... ...