Commit 871309976b04c9eb88b53bca20224e0a8d1054bd
1 parent
209a9e98
Exists in
master
and in
7 other branches
Adaptação da ferramenta Upload do catálogo de temas
Showing
2 changed files
with
109 additions
and
152 deletions
Show diff stats
ferramentas/uploadarquivos/index.js
| ... | ... | @@ -6,126 +6,110 @@ if (typeof (i3GEOF) === 'undefined') { |
| 6 | 6 | */ |
| 7 | 7 | i3GEOF.uploadarquivos = |
| 8 | 8 | { |
| 9 | - /** | |
| 10 | - * Template no formato mustache. E preenchido na carga do javascript com o programa dependencias.php | |
| 11 | - */ | |
| 12 | - MUSTACHE : "", | |
| 13 | - /** | |
| 14 | - * Susbtitutos para o template | |
| 15 | - */ | |
| 16 | - mustacheHash : function() { | |
| 17 | - var dicionario = i3GEO.idioma.objetoIdioma(i3GEOF.uploadarquivos.dicionario); | |
| 18 | - dicionario["locaplic"] = i3GEO.configura.locaplic; | |
| 19 | - return dicionario; | |
| 20 | - }, | |
| 21 | - /* | |
| 22 | - * Function: inicia | |
| 23 | - * | |
| 24 | - * Inicia a ferramenta. É chamado por criaJanelaFlutuante | |
| 25 | - * | |
| 26 | - * Parametro: | |
| 27 | - * | |
| 28 | - * iddiv {String} - id do div que receberá o conteudo HTML da ferramenta | |
| 29 | - */ | |
| 30 | - inicia : function(iddiv) { | |
| 31 | - if(i3GEOF.uploadarquivos.MUSTACHE == ""){ | |
| 32 | - $.get(i3GEO.configura.locaplic + "/ferramentas/uploadarquivos/template_mst.html", function(template) { | |
| 33 | - i3GEOF.uploadarquivos.MUSTACHE = template; | |
| 34 | - i3GEOF.uploadarquivos.inicia(iddiv); | |
| 35 | - }); | |
| 36 | - return; | |
| 37 | - } | |
| 38 | - $i(iddiv).innerHTML = i3GEOF.uploadarquivos.html(); | |
| 39 | - new YAHOO.widget.Button("i3GEOFuploadarquivosShp", { | |
| 40 | - onclick : { | |
| 41 | - fn : function() { | |
| 42 | - i3GEO.util.scriptTag(i3GEO.configura.locaplic | |
| 43 | - + "/ferramentas/upload/index.js", | |
| 44 | - "i3GEOF.upload.criaJanelaFlutuante()", | |
| 45 | - "i3GEOF.upload_script"); | |
| 46 | - } | |
| 47 | - } | |
| 48 | - }); | |
| 49 | - new YAHOO.widget.Button("i3GEOFuploadarquivosDbfCsv", { | |
| 50 | - onclick : { | |
| 51 | - fn : function() { | |
| 52 | - i3GEO.util.scriptTag(i3GEO.configura.locaplic | |
| 53 | - + "/ferramentas/uploaddbf/dependencias.php", | |
| 54 | - "i3GEOF.uploaddbf.iniciaJanelaFlutuante()", | |
| 55 | - "i3GEOF.uploaddbf_script"); | |
| 56 | - } | |
| 57 | - } | |
| 58 | - }); | |
| 59 | - new YAHOO.widget.Button("i3GEOFuploadarquivosGpx", { | |
| 60 | - onclick : { | |
| 61 | - fn : function() { | |
| 62 | - i3GEO.util.scriptTag(i3GEO.configura.locaplic | |
| 63 | - + "/ferramentas/uploadgpx/dependencias.php", | |
| 64 | - "i3GEOF.uploadgpx.iniciaJanelaFlutuante()", | |
| 65 | - "i3GEOF.uploadgpx_script"); | |
| 66 | - } | |
| 9 | + /** | |
| 10 | + * Template no formato mustache. E preenchido na carga do javascript com o programa dependencias.php | |
| 11 | + */ | |
| 12 | + MUSTACHE : "", | |
| 13 | + /** | |
| 14 | + * Susbtitutos para o template | |
| 15 | + */ | |
| 16 | + mustacheHash : function() { | |
| 17 | + var dicionario = i3GEO.idioma.objetoIdioma(i3GEOF.uploadarquivos.dicionario); | |
| 18 | + dicionario["locaplic"] = i3GEO.configura.locaplic; | |
| 19 | + return dicionario; | |
| 20 | + }, | |
| 21 | + /* | |
| 22 | + * Function: inicia | |
| 23 | + * | |
| 24 | + * Inicia a ferramenta. É chamado por criaJanelaFlutuante | |
| 25 | + * | |
| 26 | + * Parametro: | |
| 27 | + * | |
| 28 | + * iddiv {String} - id do div que receberá o conteudo HTML da ferramenta | |
| 29 | + */ | |
| 30 | + inicia : function(iddiv) { | |
| 31 | + if(i3GEOF.uploadarquivos.MUSTACHE == ""){ | |
| 32 | + $.get(i3GEO.configura.locaplic + "/ferramentas/uploadarquivos/template_mst.html", function(template) { | |
| 33 | + i3GEOF.uploadarquivos.MUSTACHE = template; | |
| 34 | + i3GEOF.uploadarquivos.inicia(iddiv); | |
| 35 | + }); | |
| 36 | + return; | |
| 67 | 37 | } |
| 68 | - }); | |
| 69 | - new YAHOO.widget.Button("i3GEOFuploadarquivosKml", { | |
| 70 | - onclick : { | |
| 71 | - fn : function() { | |
| 72 | - i3GEO.util.scriptTag(i3GEO.configura.locaplic | |
| 73 | - + "/ferramentas/uploadkml/dependencias.php", | |
| 74 | - "i3GEOF.uploadkml.iniciaJanelaFlutuante()", | |
| 75 | - "i3GEOF.uploadkml_script"); | |
| 76 | - } | |
| 77 | - } | |
| 78 | - }); | |
| 79 | - }, | |
| 80 | - /* | |
| 81 | - * Function: html | |
| 82 | - * | |
| 83 | - * Gera o código html para apresentação das opções da ferramenta | |
| 84 | - * | |
| 85 | - * Retorno: | |
| 86 | - * | |
| 87 | - * String com o código html | |
| 88 | - */ | |
| 89 | - html : function() { | |
| 90 | - var ins = Mustache.render(i3GEOF.uploadarquivos.MUSTACHE, i3GEOF.uploadarquivos.mustacheHash()); | |
| 91 | - return ins; | |
| 92 | - }, | |
| 93 | - /* | |
| 94 | - * Function: criaJanelaFlutuante | |
| 95 | - * | |
| 96 | - * Cria a janela flutuante para controle da ferramenta. | |
| 97 | - */ | |
| 98 | - iniciaJanelaFlutuante : function() { | |
| 99 | - var minimiza, cabecalho, janela, divid, titulo; | |
| 38 | + $i(iddiv).innerHTML = i3GEOF.uploadarquivos.html(); | |
| 39 | + }, | |
| 40 | + shp: function() { | |
| 41 | + i3GEO.util.scriptTag(i3GEO.configura.locaplic | |
| 42 | + + "/ferramentas/upload/index.js", | |
| 43 | + "i3GEOF.upload.criaJanelaFlutuante()", | |
| 44 | + "i3GEOF.upload_script"); | |
| 45 | + }, | |
| 46 | + dbfcsv: function() { | |
| 47 | + i3GEO.util.scriptTag(i3GEO.configura.locaplic | |
| 48 | + + "/ferramentas/uploaddbf/dependencias.php", | |
| 49 | + "i3GEOF.uploaddbf.iniciaJanelaFlutuante()", | |
| 50 | + "i3GEOF.uploaddbf_script"); | |
| 51 | + }, | |
| 52 | + gpx: function() { | |
| 53 | + i3GEO.util.scriptTag(i3GEO.configura.locaplic | |
| 54 | + + "/ferramentas/uploadgpx/dependencias.php", | |
| 55 | + "i3GEOF.uploadgpx.iniciaJanelaFlutuante()", | |
| 56 | + "i3GEOF.uploadgpx_script"); | |
| 57 | + }, | |
| 58 | + kml: function() { | |
| 59 | + i3GEO.util.scriptTag(i3GEO.configura.locaplic | |
| 60 | + + "/ferramentas/uploadkml/dependencias.php", | |
| 61 | + "i3GEOF.uploadkml.iniciaJanelaFlutuante()", | |
| 62 | + "i3GEOF.uploadkml_script"); | |
| 63 | + }, | |
| 64 | + /* | |
| 65 | + * Function: html | |
| 66 | + * | |
| 67 | + * Gera o código html para apresentação das opções da ferramenta | |
| 68 | + * | |
| 69 | + * Retorno: | |
| 70 | + * | |
| 71 | + * String com o código html | |
| 72 | + */ | |
| 73 | + html : function() { | |
| 74 | + var ins = Mustache.render(i3GEOF.uploadarquivos.MUSTACHE, i3GEOF.uploadarquivos.mustacheHash()); | |
| 75 | + return ins; | |
| 76 | + }, | |
| 77 | + /* | |
| 78 | + * Function: criaJanelaFlutuante | |
| 79 | + * | |
| 80 | + * Cria a janela flutuante para controle da ferramenta. | |
| 81 | + */ | |
| 82 | + iniciaJanelaFlutuante : function() { | |
| 83 | + var minimiza, cabecalho, janela, divid, titulo; | |
| 100 | 84 | |
| 101 | - if ($i("i3GEOF.uploadarquivos")) { | |
| 102 | - return; | |
| 85 | + if ($i("i3GEOF.uploadarquivos")) { | |
| 86 | + return; | |
| 87 | + } | |
| 88 | + cabecalho = function() { | |
| 89 | + }; | |
| 90 | + minimiza = function() { | |
| 91 | + i3GEO.janela.minimiza("i3GEOF.uploadarquivos"); | |
| 92 | + }; | |
| 93 | + // cria a janela flutuante | |
| 94 | + titulo = "</div><div class='i3GeoTituloJanelaBs'>" + $trad("upload",i3GEOF.uploadarquivos.dicionario) + "</div>"; | |
| 95 | + janela = | |
| 96 | + i3GEO.janela.cria( | |
| 97 | + "230px", | |
| 98 | + "240px", | |
| 99 | + "", | |
| 100 | + "", | |
| 101 | + "", | |
| 102 | + titulo, | |
| 103 | + "i3GEOF.uploadarquivos", | |
| 104 | + false, | |
| 105 | + "hd", | |
| 106 | + cabecalho, | |
| 107 | + minimiza, | |
| 108 | + "", | |
| 109 | + true | |
| 110 | + ); | |
| 111 | + divid = janela[2].id; | |
| 112 | + $i("i3GEOF.uploadarquivos_corpo").style.backgroundColor = "white"; | |
| 113 | + i3GEOF.uploadarquivos.inicia(divid); | |
| 103 | 114 | } |
| 104 | - cabecalho = function() { | |
| 105 | - }; | |
| 106 | - minimiza = function() { | |
| 107 | - i3GEO.janela.minimiza("i3GEOF.uploadarquivos"); | |
| 108 | - }; | |
| 109 | - // cria a janela flutuante | |
| 110 | - titulo = "</div><div class='i3GeoTituloJanelaBs'>" + $trad("upload",i3GEOF.uploadarquivos.dicionario) + "</div>"; | |
| 111 | - janela = | |
| 112 | - i3GEO.janela.cria( | |
| 113 | - "230px", | |
| 114 | - "140px", | |
| 115 | - "", | |
| 116 | - "", | |
| 117 | - "", | |
| 118 | - titulo, | |
| 119 | - "i3GEOF.uploadarquivos", | |
| 120 | - false, | |
| 121 | - "hd", | |
| 122 | - cabecalho, | |
| 123 | - minimiza, | |
| 124 | - "", | |
| 125 | - true | |
| 126 | - ); | |
| 127 | - divid = janela[2].id; | |
| 128 | - $i("i3GEOF.uploadarquivos_corpo").style.backgroundColor = "white"; | |
| 129 | - i3GEOF.uploadarquivos.inicia(divid); | |
| 130 | - } | |
| 131 | 115 | }; | ... | ... |
ferramentas/uploadarquivos/template_mst.html
| 1 | -<style> | |
| 2 | -.yui-button#i3GEOFuploadarquivosKml button { | |
| 3 | - background: url('../imagens/oxygen/16x16/text-xml.png') 5% 50% no-repeat; | |
| 4 | - width: 200px; | |
| 5 | -} | |
| 6 | -.yui-button#i3GEOFuploadarquivosGpx button { | |
| 7 | - background: url('../imagens/oxygen/16x16/pda.png') 5% 50% no-repeat; | |
| 8 | - width: 200px; | |
| 9 | -} | |
| 10 | -.yui-button#i3GEOFuploadarquivosDbfCsv button { | |
| 11 | - background: url('../imagens/oxygen/16x16/application-x-sqlite2.png') 5% 50% no-repeat; | |
| 12 | - width: 200px; | |
| 13 | -} | |
| 14 | -.yui-button#i3GEOFuploadarquivosShp button { | |
| 15 | - background: url('../imagens/gisicons/shape.png') 5% 50% no-repeat; | |
| 16 | - background-size: 16px; | |
| 17 | - width: 200px; | |
| 18 | -} | |
| 19 | -</style> | |
| 20 | -<div style='margin-left: 5px'> | |
| 21 | - <p class='paragrafo'> | |
| 22 | - <input id='i3GEOFuploadarquivosShp' type='button' value='Shape File' /> | |
| 23 | - </p> | |
| 24 | - <p class='paragrafo'> | |
| 25 | - <input id='i3GEOFuploadarquivosDbfCsv' type='button' value='DBF / CSV' /> | |
| 26 | - </p> | |
| 27 | - <p class='paragrafo'> | |
| 28 | - <input id='i3GEOFuploadarquivosGpx' type='button' value='GPX' /> | |
| 29 | - </p> | |
| 30 | - <p class='paragrafo'> | |
| 31 | - <input id='i3GEOFuploadarquivosKml' type='button' value='KML' /> | |
| 32 | - </p> | |
| 33 | -</div> | |
| 1 | +<div class='container-fluid'> | |
| 2 | + <a href='javascript:void(0)' onclick="i3GEOF.uploadarquivos.shp()" class='btn btn-primary btn-lg btn-block btn-raised'>Shape File</a> | |
| 3 | + <a href='javascript:void(0)' onclick="i3GEOF.uploadarquivos.dbfcsv()" class='btn btn-primary btn-lg btn-block btn-raised'>DBF / CSV</a> | |
| 4 | + <a href='javascript:void(0)' onclick="i3GEOF.uploadarquivos.gpx()" class='btn btn-primary btn-lg btn-block btn-raised'>Gpx</a> | |
| 5 | + <a href='javascript:void(0)' onclick="i3GEOF.uploadarquivos.kml()" class='btn btn-primary btn-lg btn-block btn-raised'>Kml</a> | |
| 6 | +</div> | |
| 34 | 7 | \ No newline at end of file | ... | ... |