|
71 | 71 | gparam.inicioToque = 0; |
72 | 72 | gparam.mobile = gparam.inicio.mobile; |
73 | 73 | gparam.safari = false; |
| 74 | + gparam.macos = /(Mac|iPhone|iPod|iPad)/i.test(navigator.platform); |
74 | 75 | gparam.eventclick = 'click'; //no safari ='touchend' |
75 | 76 | //gparam.bRotulosCompletos = true; |
76 | 77 | gparam.kTipoRotulo = 0; //rotulo completo, |
|
503 | 504 | return imagem; |
504 | 505 | } //function iconeF |
505 | 506 |
|
| 507 | +function teclaCtrlF(event) { |
| 508 | + return gparam.macos ? event.metaKey: event.ctrlKey; |
| 509 | +} |
| 510 | + |
506 | 511 | graphics.node(function(node) { |
507 | 512 | // This time it's a group of elements: http://www.w3.org/TR/SVG/struct.html#Groups |
508 | 513 | let ui = Viva.Graph.svg('g'); |
|
624 | 629 | return; |
625 | 630 | } |
626 | 631 |
|
627 | | - if (!event.ctrlKey) { |
| 632 | + if (!teclaCtrlF(event)) { |
628 | 633 | event.preventDefault(); |
629 | 634 | selecionaNoid(node.id, event.shiftKey); |
630 | 635 | //pinarNoTemp(node.id, 500); //pausar layout é melhor que só pinar o nó |
|
913 | 918 | Setup:function() { |
914 | 919 | /*seleção retangular */ |
915 | 920 | var multiSelectOverlay; |
| 921 | + gparam.whichCTRLKey = 17; |
| 922 | + if (gparam.macos) { |
| 923 | + {% if parametros.firefox %} |
| 924 | + gparam.whichCTRLKey = 224; |
| 925 | + {% else %} |
| 926 | + gparam.whichCTRLKey = 91; |
| 927 | + {% endif %} |
| 928 | + } |
916 | 929 | document.addEventListener('keydown', function(e) { |
917 | | - if (e.which === 17 && !multiSelectOverlay) { // ctrl key |
| 930 | + if (e.which === gparam.whichCTRLKey && !multiSelectOverlay) { // ctrl key |
918 | 931 | multiSelectOverlay = gparam.AreaSelecaoRetangular.startMultiSelect(graph, gparam.renderer, gparam.layout); |
919 | 932 | } |
920 | | - if (e.which != 17 && multiSelectOverlay) { // pressionou outro botão (corrige problema quando se pressiona CTRL+botão para outro comando, que o tipo de cursor não mudava para o padrão |
| 933 | + if (e.which != gparam.whichCTRLKey && multiSelectOverlay) { // pressionou outro botão (corrige problema quando se pressiona CTRL+botão para outro comando, que o tipo de cursor não mudava para o padrão |
921 | 934 | multiSelectOverlay.destroy(); |
922 | 935 | multiSelectOverlay = null; |
923 | 936 | } |
|
5364 | 5377 | function evento_teclasDown(e) { |
5365 | 5378 | function testa(keyIn, pressShift, pressCtrl) { |
5366 | 5379 | //não dá para usar alt key, porque isso abre o menu do navegador |
5367 | | - if (keyIn!=e.code) { |
5368 | | - return false; |
5369 | | - } else if (pressShift!=e.shiftKey) { |
5370 | | - return false; |
5371 | | - } else if (pressCtrl!=e.ctrlKey) { |
| 5380 | + //if ((keyIn==e.code) && (pressShift==e.shiftKey) && (pressCtrl==e.ctrlKey)) { |
| 5381 | + if ((keyIn==e.code) && (pressShift==e.shiftKey) && (pressCtrl==teclaCtrlF(e))) { |
| 5382 | + return true; |
| 5383 | + } else { |
5372 | 5384 | return false; |
5373 | | - } |
5374 | | - return true; |
5375 | | - } |
| 5385 | + } |
| 5386 | + } //.function testa |
5376 | 5387 | if ((e.code.startsWith('Digit') && (e.code.length==6)) || (e.code.startsWith('Numpad') && (e.code.length==7) && (e.getModifierState('NumLock')))){ |
5377 | 5388 | var ns = e.code.substr(-1); |
5378 | 5389 | var tipo = 'cnpj'; |
5379 | | - if (e.shiftKey && !e.ctrlKey) { |
| 5390 | + if (e.shiftKey && !teclaCtrlF(e)) { |
5380 | 5391 | tipo = 'links'; |
5381 | 5392 | //} else if (!e.shiftKey && e.ctrlKey) { |
5382 | | - } else if (e.ctrlKey) { |
| 5393 | + } else if (teclaCtrlF(e)) { |
5383 | 5394 | tipo = 'caminhos'; |
5384 | 5395 | } |
5385 | 5396 | if (('0' <= ns) && (ns <='9')) { |
|
5780 | 5791 | <button class='botaosuperior' type="button" onclick="javascript:menu_rendererAtivarParar(true, true);" title='Ativar Leiaute (Barra de Espaço)'><i class="fa fa-play"></i></button> |
5781 | 5792 | <button class='botaosuperior' type="button" onclick="javascript:menu_rendererAtivarParar(false, true);" title='Parar Leiaute (Barra de Espaço)'><i class="fa fa-stop"></i></button> |
5782 | 5793 | {% endif %} |
5783 | | - <button class='botaosuperior' type="button" onclick="javascript:menu_zoomin(event.shiftKey, event.ctrlKey);" title='Aumenta visualização. A roda do mouse também faz isso. Pressionando SHIFT+click aumenta apenas o tamanho das ligações.'><i class="fa fa-search-plus"></i></button> |
| 5794 | + <button class='botaosuperior' type="button" onclick="javascript:menu_zoomin(event.shiftKey, teclaCtrlF(event));" title='Aumenta visualização. A roda do mouse também faz isso. Pressionando SHIFT+click aumenta apenas o tamanho das ligações.'><i class="fa fa-search-plus"></i></button> |
5784 | 5795 | {% if not parametros.mobile %} |
5785 | | - <button class='botaosuperior' type="button" onclick="javascript:menu_zoomout(event.shiftKey, event.ctrlKey);" title='Diminui visualização. A roda do mouse também faz isso. Pressionando SHIFT+click diminui apenas o tamanho das ligações.'><i class="fa fa-search-minus"></i></button> |
| 5796 | + <button class='botaosuperior' type="button" onclick="javascript:menu_zoomout(event.shiftKey, teclaCtrlF(event));" title='Diminui visualização. A roda do mouse também faz isso. Pressionando SHIFT+click diminui apenas o tamanho das ligações.'><i class="fa fa-search-minus"></i></button> |
5786 | 5797 | {% endif %} |
5787 | 5798 | <button class='botaosuperior' type="button" onclick="gparam.renderer.reset();" title='Reinicia escala de visualização'><i class="fa fa-compress"></i></button> |
5788 | 5799 |
|
|
5792 | 5803 | onfocusin="ativaAtalhos(false)" onfocusout="ativaAtalhos(true);" |
5793 | 5804 | title='Digite {% if parametros.bBaseReceita %} CNPJ, Razão Social, Nome Fantasia, CPF de sócio ou Nome de sócio {% endif %}e pressione Enter. Os nomes podem ter acentuação ou estar com letras minúsculas, pois o texto é convertido em maiúsculas sem acentuação. CNPJS e CPFs podem ter pontos, traços ou barras. Para buscar por Unidade Gestora, coloque UG_NNNNNN, onde NNNNNN é o código da UG. A busca por endereço, por telefone ou por email ainda não foi implementada.'> |
5794 | 5805 | {% endif %} |
5795 | | - <button id='botao_inserir' class='botaosuperior' type="button" onclick="javascript:menu_inserir(null, event.shiftKey, event.ctrlKey);" title='Inserir{% if parametros.bBaseReceita %} CNPJ ou CPF do Banco de Dados {% endif %}(Tecla I)'><i class="fa fa-user-plus"></i></button> |
| 5806 | + <button id='botao_inserir' class='botaosuperior' type="button" onclick="javascript:menu_inserir(null, event.shiftKey, teclaCtrlF(event));" title='Inserir{% if parametros.bBaseReceita %} CNPJ ou CPF do Banco de Dados {% endif %}(Tecla I)'><i class="fa fa-user-plus"></i></button> |
5796 | 5807 | <button class='botaosuperior' type="button" onclick="javascript:menu_dados(event.shiftKey);" title='Exibir Dados do Item (D). SHIFT+Click ou SHIFT+D abre os dados de CNPJ em nova aba.'><i class="fa fa-newspaper"></i></button> |
5797 | 5808 |
|
5798 | 5809 | {% if not parametros.mobile %} |
|
0 commit comments