Commit 7a4b770ff3e6fb62f1ef2054cafa701b7e78c8f4
1 parent
51851efa
Exists in
master
and in
7 other branches
Adaptação da opção de vincular tabelas, da ferramanta Tabela, para Bootstrap
Showing
57 changed files
with
98 additions
and
85 deletions
Show diff stats
ferramentas/tabela/index.js
| @@ -24,6 +24,7 @@ i3GEOF.tabela = | @@ -24,6 +24,7 @@ i3GEOF.tabela = | ||
| 24 | */ | 24 | */ |
| 25 | MUSTACHE : "", | 25 | MUSTACHE : "", |
| 26 | MUSTACHELISTA : "", | 26 | MUSTACHELISTA : "", |
| 27 | + MUSTACHEVINCULO: "", | ||
| 27 | /** | 28 | /** |
| 28 | * Susbtitutos para o template | 29 | * Susbtitutos para o template |
| 29 | */ | 30 | */ |
| @@ -124,11 +125,13 @@ i3GEOF.tabela = | @@ -124,11 +125,13 @@ i3GEOF.tabela = | ||
| 124 | inicia : function(iddiv, idjanela) { | 125 | inicia : function(iddiv, idjanela) { |
| 125 | if(i3GEOF.tabela.MUSTACHE == ""){ | 126 | if(i3GEOF.tabela.MUSTACHE == ""){ |
| 126 | var t1 = i3GEO.configura.locaplic + "/ferramentas/tabela/template_mst.html", | 127 | var t1 = i3GEO.configura.locaplic + "/ferramentas/tabela/template_mst.html", |
| 127 | - t2 = i3GEO.configura.locaplic + "/ferramentas/tabela/templateLista_mst.html"; | 128 | + t2 = i3GEO.configura.locaplic + "/ferramentas/tabela/templateLista_mst.html", |
| 129 | + t3 = i3GEO.configura.locaplic + "/ferramentas/tabela/templateVinculo_mst.html"; | ||
| 128 | 130 | ||
| 129 | - $.when( $.get(t1),$.get(t2) ).done(function(r1,r2) { | 131 | + $.when( $.get(t1),$.get(t2),$.get(t3) ).done(function(r1,r2,r3) { |
| 130 | i3GEOF.tabela.MUSTACHE = r1[0]; | 132 | i3GEOF.tabela.MUSTACHE = r1[0]; |
| 131 | i3GEOF.tabela.MUSTACHELISTA = r2[0]; | 133 | i3GEOF.tabela.MUSTACHELISTA = r2[0]; |
| 134 | + i3GEOF.tabela.MUSTACHEVINCULO = r3[0]; | ||
| 132 | i3GEOF.tabela.inicia(iddiv, idjanela); | 135 | i3GEOF.tabela.inicia(iddiv, idjanela); |
| 133 | }).fail(function() { | 136 | }).fail(function() { |
| 134 | i3GEO.janela.closeMsg($trad("erroTpl")); | 137 | i3GEO.janela.closeMsg($trad("erroTpl")); |
| @@ -249,7 +252,10 @@ i3GEOF.tabela = | @@ -249,7 +252,10 @@ i3GEOF.tabela = | ||
| 249 | i3GEOF.tabela.iniciaJanelaFlutuante(); | 252 | i3GEOF.tabela.iniciaJanelaFlutuante(); |
| 250 | }; | 253 | }; |
| 251 | // cria a janela flutuante | 254 | // cria a janela flutuante |
| 252 | - titulo = "<span class='i3GeoTituloJanelaBsNolink' >"+$trad('tabela', i3GEOF.tabela.dicionario)+"</span></div>"; | 255 | + titulo = "<span class='i3GeoTituloJanelaBsNolink' >" |
| 256 | + + $trad('tabela', i3GEOF.tabela.dicionario) | ||
| 257 | + + " (" + id + " )" | ||
| 258 | + + "</span></div>"; | ||
| 253 | 259 | ||
| 254 | janela = i3GEO.janela.cria( | 260 | janela = i3GEO.janela.cria( |
| 255 | "570px", | 261 | "570px", |
| @@ -405,28 +411,43 @@ i3GEOF.tabela = | @@ -405,28 +411,43 @@ i3GEOF.tabela = | ||
| 405 | }, | 411 | }, |
| 406 | vinculos : { | 412 | vinculos : { |
| 407 | ligacoes : [], | 413 | ligacoes : [], |
| 414 | + /** | ||
| 415 | + * Susbtitutos para o template | ||
| 416 | + */ | ||
| 417 | + mustacheHash : function() { | ||
| 418 | + var dicionario = i3GEO.idioma.objetoIdioma(i3GEOF.tabela.dicionario); | ||
| 419 | + dicionario["locaplic"] = i3GEO.configura.locaplic; | ||
| 420 | + dicionario["comboJanelas1"] = i3GEOF.tabela.comboJanelas("i3GEOFTabelaOpcoesAdicionaVinculoT1", "i3GEOF.tabela.vinculos.comboColunasT1()"); | ||
| 421 | + dicionario["comboJanelas2"] = i3GEOF.tabela.comboJanelas("i3GEOFTabelaOpcoesAdicionaVinculoT2", "i3GEOF.tabela.vinculos.comboColunasT2()"); | ||
| 422 | + return dicionario; | ||
| 423 | + }, | ||
| 408 | iniciaJanelaFlutuante : function() { | 424 | iniciaJanelaFlutuante : function() { |
| 409 | var janela, titulo; | 425 | var janela, titulo; |
| 410 | // cria a janela flutuante | 426 | // cria a janela flutuante |
| 411 | - titulo = | ||
| 412 | - "<div class='i3GeoTituloJanela'>" + $trad("vinculos", i3GEOF.tabela.dicionario) | ||
| 413 | - + "<a class=ajuda_usuario href='javascript:void(0)' onclick='i3GEO.ajuda.ferramenta(120)' ><b> </b></a></div>"; | 427 | + titulo = "<span class='i3GeoTituloJanelaBsNolink' >" |
| 428 | + + $trad('vinculos', i3GEOF.tabela.dicionario) | ||
| 429 | + + "</span></div>"; | ||
| 414 | janela = | 430 | janela = |
| 415 | i3GEO.janela.cria( | 431 | i3GEO.janela.cria( |
| 416 | - "300px", | ||
| 417 | - "300px", | 432 | + "400px", |
| 433 | + "350px", | ||
| 418 | "", | 434 | "", |
| 419 | "", | 435 | "", |
| 420 | "", | 436 | "", |
| 421 | titulo, | 437 | titulo, |
| 422 | "i3GEOFtabelaVinculos", | 438 | "i3GEOFtabelaVinculos", |
| 423 | - true, | 439 | + false, |
| 424 | "hd", | 440 | "hd", |
| 425 | "", | 441 | "", |
| 426 | "", | 442 | "", |
| 427 | "", | 443 | "", |
| 428 | true, | 444 | true, |
| 429 | - i3GEO.configura.locaplic + "/imagens/oxygen/16x16/edit-table-cell-merge.png"); | 445 | + "", |
| 446 | + "", | ||
| 447 | + "", | ||
| 448 | + "", | ||
| 449 | + "120" | ||
| 450 | + ); | ||
| 430 | divid = janela[2].id; | 451 | divid = janela[2].id; |
| 431 | if (i3GEOF.tabela.janelas.length > 1) { | 452 | if (i3GEOF.tabela.janelas.length > 1) { |
| 432 | temp = janela[0].cfg.config; | 453 | temp = janela[0].cfg.config; |
| @@ -437,84 +458,58 @@ i3GEOF.tabela = | @@ -437,84 +458,58 @@ i3GEOF.tabela = | ||
| 437 | i3GEOF.tabela.vinculos.inicia(); | 458 | i3GEOF.tabela.vinculos.inicia(); |
| 438 | }, | 459 | }, |
| 439 | html : function() { | 460 | html : function() { |
| 440 | - var ins = | ||
| 441 | - "" + " <fieldset class=subbloco >" | ||
| 442 | - + " <p class=paragrafo >" | ||
| 443 | - + $trad('selecionaTabela', i3GEOF.tabela.dicionario) | ||
| 444 | - + "<br>" | ||
| 445 | - + i3GEOF.tabela.comboJanelas("i3GEOFTabelaOpcoesAdicionaVinculoT1", "i3GEOF.tabela.vinculos.comboColunasT1()") | ||
| 446 | - + " <div id=i3GEOFTabelaVinculoT1Colunas style=position:relative;left:10px ></div>" | ||
| 447 | - + " <p class=paragrafo >" | ||
| 448 | - + $trad('selecionaSegundaTabela', i3GEOF.tabela.dicionario) | ||
| 449 | - + "<br>" | ||
| 450 | - + i3GEOF.tabela.comboJanelas("i3GEOFTabelaOpcoesAdicionaVinculoT2", "i3GEOF.tabela.vinculos.comboColunasT2()") | ||
| 451 | - + " <div id=i3GEOFTabelaVinculoT2Colunas style=position:relative;left:10px ></div>" | ||
| 452 | - + " <p class=paragrafo ><input id=i3GEOFTabelaVinculoBotaoCriar size=25 type=button value='" | ||
| 453 | - + $trad('criaVinculo', i3GEOF.tabela.dicionario) | ||
| 454 | - + "' /></p>" | ||
| 455 | - + " </fieldset>" | ||
| 456 | - + " <fieldset class=subbloco id=i3GEOFtabelaVinculosLista >" | ||
| 457 | - + " </fieldset>"; | 461 | + var ins = Mustache.render(i3GEOF.tabela.MUSTACHEVINCULO, i3GEOF.tabela.vinculos.mustacheHash()); |
| 458 | return ins; | 462 | return ins; |
| 459 | }, | 463 | }, |
| 460 | - inicia : function() { | ||
| 461 | - $i("i3GEOFtabelaVinculos_corpo").innerHTML = i3GEOF.tabela.vinculos.html(); | ||
| 462 | - new YAHOO.widget.Button( | ||
| 463 | - "i3GEOFTabelaVinculoBotaoCriar", | ||
| 464 | - { | ||
| 465 | - onclick : { | ||
| 466 | - fn : function() { | ||
| 467 | - var t1 = $i("i3GEOFTabelaOpcoesAdicionaVinculoT1").value, t2 = | ||
| 468 | - $i("i3GEOFTabelaOpcoesAdicionaVinculoT2").value, c1 = | ||
| 469 | - $i("i3GEOFTabelaOpcoesAdicionaVinculoColunaT1").value, c2 = | ||
| 470 | - $i("i3GEOFTabelaOpcoesAdicionaVinculoColunaT1").value; | ||
| 471 | - if (t1 != "" && t2 != "" && c1 != "" && c2 != "") { | ||
| 472 | - i3GEOF.tabela.vinculos.ligacoes.push({ | ||
| 473 | - "t1" : t1, | ||
| 474 | - "t2" : t2, | ||
| 475 | - "c1" : c1, | ||
| 476 | - "c2" : c2 | ||
| 477 | - }); | ||
| 478 | - } | ||
| 479 | - i3GEOF.tabela.vinculos.lista(); | ||
| 480 | - } | ||
| 481 | - } | 464 | + vincular: function(){ |
| 465 | + var t1 = $i("i3GEOFTabelaOpcoesAdicionaVinculoT1").value, t2 = | ||
| 466 | + $i("i3GEOFTabelaOpcoesAdicionaVinculoT2").value, c1 = | ||
| 467 | + $i("i3GEOFTabelaOpcoesAdicionaVinculoColunaT1").value, c2 = | ||
| 468 | + $i("i3GEOFTabelaOpcoesAdicionaVinculoColunaT1").value; | ||
| 469 | + if (t1 != "" && t2 != "" && c1 != "" && c2 != "") { | ||
| 470 | + i3GEOF.tabela.vinculos.ligacoes.push({ | ||
| 471 | + "t1" : t1, | ||
| 472 | + "t2" : t2, | ||
| 473 | + "c1" : c1, | ||
| 474 | + "c2" : c2 | ||
| 482 | }); | 475 | }); |
| 476 | + } | ||
| 477 | + i3GEOF.tabela.vinculos.lista(); | ||
| 478 | + }, | ||
| 479 | + inicia : function() { | ||
| 480 | + var ins = i3GEOF.tabela.vinculos.html(); | ||
| 481 | + $i("i3GEOFtabelaVinculos_corpo").innerHTML = ins; | ||
| 483 | i3GEOF.tabela.vinculos.lista(); | 482 | i3GEOF.tabela.vinculos.lista(); |
| 484 | }, | 483 | }, |
| 485 | comboColunasT1 : function() { | 484 | comboColunasT1 : function() { |
| 486 | - var colunas = | ||
| 487 | - i3GEOF.tabela | ||
| 488 | - .comboColunas($i("i3GEOFTabelaOpcoesAdicionaVinculoT1").value, "i3GEOFTabelaOpcoesAdicionaVinculoColunaT1"), ins = | ||
| 489 | - ""; | ||
| 490 | - ins = " <p class=paragrafo >" + $trad('colunaLigacao', i3GEOF.tabela.dicionario) + "<br>" + colunas; | ||
| 491 | - $i("i3GEOFTabelaVinculoT1Colunas").innerHTML = ins; | 485 | + var colunas = ""; |
| 486 | + if($i("i3GEOFTabelaOpcoesAdicionaVinculoT1").value != ""){ | ||
| 487 | + colunas = i3GEOF.tabela.comboColunas($i("i3GEOFTabelaOpcoesAdicionaVinculoT1").value, "i3GEOFTabelaOpcoesAdicionaVinculoColunaT1"); | ||
| 488 | + } | ||
| 489 | + $i("i3GEOFTabelaVinculoT1Colunas").innerHTML = colunas; | ||
| 492 | }, | 490 | }, |
| 493 | comboColunasT2 : function() { | 491 | comboColunasT2 : function() { |
| 494 | - var colunas = | ||
| 495 | - i3GEOF.tabela | ||
| 496 | - .comboColunas($i("i3GEOFTabelaOpcoesAdicionaVinculoT2").value, "i3GEOFTabelaOpcoesAdicionaVinculoColunaT2"), ins = | ||
| 497 | - ""; | ||
| 498 | - ins = " <p class=paragrafo >" + $trad('colunaLigacao', i3GEOF.tabela.dicionario) + "<br>" + colunas; | ||
| 499 | - $i("i3GEOFTabelaVinculoT2Colunas").innerHTML = ins; | 492 | + var colunas = ""; |
| 493 | + if($i("i3GEOFTabelaOpcoesAdicionaVinculoT2").value != ""){ | ||
| 494 | + colunas = i3GEOF.tabela.comboColunas($i("i3GEOFTabelaOpcoesAdicionaVinculoT2").value, "i3GEOFTabelaOpcoesAdicionaVinculoColunaT2"); | ||
| 495 | + } | ||
| 496 | + $i("i3GEOFTabelaVinculoT2Colunas").innerHTML = colunas; | ||
| 500 | }, | 497 | }, |
| 501 | lista : function() { | 498 | lista : function() { |
| 502 | var v = i3GEOF.tabela.vinculos.ligacoes, n = v.length, ins = | 499 | var v = i3GEOF.tabela.vinculos.ligacoes, n = v.length, ins = |
| 503 | - "<p class=paragrafo ><b>" + $trad('vinculos', i3GEOF.tabela.dicionario) + "</b></p>", i; | 500 | + "<h5>" + $trad('vinculos', i3GEOF.tabela.dicionario) + "</h5>", i; |
| 504 | for (i = 0; i < n; i++) { | 501 | for (i = 0; i < n; i++) { |
| 505 | - ins += | ||
| 506 | - "<p class=paragrafo ><img style='cursor:pointer;float:left;' src='" + i3GEO.configura.locaplic | ||
| 507 | - + "/imagens/oxygen/16x16/edit-delete.png' title='excluir' onclick='i3GEOF.tabela.vinculos.excluir(\"" | ||
| 508 | - + i | ||
| 509 | - + "\")' />" | ||
| 510 | - + v[i].t1 | ||
| 511 | - + " " | ||
| 512 | - + v[i].c1 | ||
| 513 | - + " -> " | ||
| 514 | - + v[i].t2 | ||
| 515 | - + " " | ||
| 516 | - + v[i].c2 | ||
| 517 | - + "<p>"; | 502 | + ins += '<button title="excluir" onclick="i3GEOF.tabela.vinculos.excluir(\'' |
| 503 | + + i + '\')"' | ||
| 504 | + + ' class="btn btn-xs" style="vertical-align:top;margin: 2px; padding: 2px; display:inline-block;"><span class="material-icons">clear</span></button>' | ||
| 505 | + + "<h5 style='display:inline-block;vertical-align:top;'>" + v[i].t1 | ||
| 506 | + + " " | ||
| 507 | + + v[i].c1 | ||
| 508 | + + " -> <br>" | ||
| 509 | + + v[i].t2 | ||
| 510 | + + " " | ||
| 511 | + + v[i].c2 | ||
| 512 | + + "</h5>"; | ||
| 518 | } | 513 | } |
| 519 | $i("i3GEOFtabelaVinculosLista").innerHTML = ins; | 514 | $i("i3GEOFtabelaVinculosLista").innerHTML = ins; |
| 520 | }, | 515 | }, |
| @@ -618,7 +613,7 @@ i3GEOF.tabela = | @@ -618,7 +613,7 @@ i3GEOF.tabela = | ||
| 618 | w = 260; | 613 | w = 260; |
| 619 | } | 614 | } |
| 620 | ins = | 615 | ins = |
| 621 | - "" + " <select style='width:" | 616 | + "" + " <select class='form-control' style='width:" |
| 622 | + w | 617 | + w |
| 623 | + "px;' id='" | 618 | + "px;' id='" |
| 624 | + idcombo | 619 | + idcombo |
| @@ -632,18 +627,12 @@ i3GEOF.tabela = | @@ -632,18 +627,12 @@ i3GEOF.tabela = | ||
| 632 | ins += "</select>"; | 627 | ins += "</select>"; |
| 633 | return ins; | 628 | return ins; |
| 634 | }, | 629 | }, |
| 635 | - comboColunas : function(idJanela, idcombo, funcao, w) { | 630 | + comboColunas : function(idJanela, idcombo, funcao) { |
| 636 | var i, c = i3GEOF.tabela.propJanelas[idJanela].colunas, n = c.itens.length; | 631 | var i, c = i3GEOF.tabela.propJanelas[idJanela].colunas, n = c.itens.length; |
| 637 | if (!funcao) { | 632 | if (!funcao) { |
| 638 | funcao = ""; | 633 | funcao = ""; |
| 639 | } | 634 | } |
| 640 | - if (!w) { | ||
| 641 | - w = 250; | ||
| 642 | - } | ||
| 643 | - ins = | ||
| 644 | - "" + " <select style='width:" | ||
| 645 | - + w | ||
| 646 | - + "px;' id='" | 635 | + ins = "<select class='form-control' id='" |
| 647 | + idcombo | 636 | + idcombo |
| 648 | + "' onchange='" | 637 | + "' onchange='" |
| 649 | + funcao | 638 | + funcao |
| @@ -0,0 +1,24 @@ | @@ -0,0 +1,24 @@ | ||
| 1 | +<div class="container-fluid"> | ||
| 2 | + <div style="width: 100%;" class='form-group label-fixed condensed'> | ||
| 3 | + <label class="control-label" for="">{{{selecionaTabela}}}</label> | ||
| 4 | + <div style="width: 100%;" class="input-group">{{{comboJanelas1}}}</div> | ||
| 5 | + </div> | ||
| 6 | + <div style="width: 100%;" class='form-group label-fixed condensed'> | ||
| 7 | + <label class="control-label" for="">{{{colunaLigacao}}}</label> | ||
| 8 | + <div style="width: 100%;" class="input-group"> | ||
| 9 | + <div id="i3GEOFTabelaVinculoT1Colunas" ></div> | ||
| 10 | + </div> | ||
| 11 | + </div> | ||
| 12 | + <div style="width: 100%;" class='form-group label-fixed condensed'> | ||
| 13 | + <label class="control-label" for="">{{{selecionaSegundaTabela}}}</label> | ||
| 14 | + <div style="width: 100%;" class="input-group">{{{comboJanelas2}}}</div> | ||
| 15 | + </div> | ||
| 16 | + <div style="width: 100%;" class='form-group label-fixed condensed'> | ||
| 17 | + <label class="control-label" for="">{{{colunaLigacao}}}</label> | ||
| 18 | + <div style="width: 100%;" class="input-group"> | ||
| 19 | + <div id="i3GEOFTabelaVinculoT2Colunas" ></div> | ||
| 20 | + </div> | ||
| 21 | + </div> | ||
| 22 | + <button onclick="i3GEOF.tabela.vinculos.vincular()" class='btn btn-primary btn-sm btn-raised'>{{{criaVinculo}}}</button> | ||
| 23 | + <div id=i3GEOFtabelaVinculosLista></div> | ||
| 24 | +</div> | ||
| 0 | \ No newline at end of file | 25 | \ No newline at end of file |
pacotes/yui290/build/container/container_compacto.js
100755 → 100644
pacotes/yui290/build/container/container_core_compacto.js
100755 → 100644
pacotes/yui290/build/utilities/utilities_compacto.js
100755 → 100644