Jump to content

MediaWiki:Common.js: Difference between revisions

No edit summary
No edit summary
 
(8 intermediate revisions by the same user not shown)
Line 1: Line 1:
/* Any JavaScript here will be loaded for all users on every page load. */
/* Any JavaScript here will be loaded for all users on every page load. */
// 2. LÓGICA DA SETA (ALL MODELS)
    // Deteta o clique no contentor nativo do MediaWiki que criaste
    $('.variations-toggle').css('cursor', 'pointer').click(function() {
        // Encontra a seta com a classe .arrow-icon dentro do bloco clicado
        var $arrow = $(this).find('.arrow-icon');
       
        // Alterna a classe de rotação configurada no CSS
        $arrow.toggleClass('rotated');
    });
$(function() {
    // Procura apenas por blocos de código técnicos e ignora a área de produtos
    $('.mw-highlight pre, .syntaxhighlight pre, pre.mw-code-example').each(function() {
        var $this = $(this);
       
        // Verifica se o elemento já tem um botão para não duplicar
        if ($this.parent().find('.copy-code-button').length > 0) return;
        var $button = $('<button>')
            .text('Copy')
            .addClass('copy-code-button')
            .click(function() {
                var text = $this.text();
                navigator.clipboard.writeText(text).then(function() {
                    $button.text('Copied!');
                    setTimeout(function() { $button.text('Copy'); }, 2000);
                });
            });
        // Insere o botão antes do bloco de código
        $this.before($button);
    });
});




Line 56: Line 94:
                     '<a '+linkStyle+' href="https://atronia.eu/hardware/" target="_blank">Hardware</a>' +
                     '<a '+linkStyle+' href="https://atronia.eu/hardware/" target="_blank">Hardware</a>' +
                     '<a '+linkStyle+' href="https://atronia.eu/solutions/" target="_blank">Solutions</a>' +
                     '<a '+linkStyle+' href="https://atronia.eu/solutions/" target="_blank">Solutions</a>' +
                '</div>' +
                '<div><h4 '+titleStyle+'>Hardware</h4>' +
                    '<a '+linkStyle+' href="https://atronia.eu/hardware/monarch/" target="_blank">Monarch</a>' +                   
                    '<a '+linkStyle+' href="https://atronia.eu/hardware/atlas/" target="_blank">Atlas</a>' +
                    '<a '+linkStyle+'  target="_blank">Probes</a>' +
                    '<a '+linkStyle+'  target="_blank">Accessories</a>' +
                 '</div>' +
                 '</div>' +
                 '<div><h4 '+titleStyle+'>Solutions</h4>' +
                 '<div><h4 '+titleStyle+'>Solutions</h4>' +
Line 63: Line 107:
                     '<a '+linkStyle+' href="https://atronia.eu/solutions/prevent/" target="_blank">Prevent</a>' +
                     '<a '+linkStyle+' href="https://atronia.eu/solutions/prevent/" target="_blank">Prevent</a>' +
                 '</div>' +
                 '</div>' +
                 '<div><h4 '+titleStyle+'>Shop</h4>' +
                 '<div><h4 '+titleStyle+'>Knowledge</h4>' +
                    '<a '+linkStyle+' href="https://atronia.eu/product/monarch/" target="_blank">Monarch</a>' +
                    '<a '+linkStyle+' href="https://atronia.eu/product-category/probes/" target="_blank">Probes</a>' +
                '</div>' +
                '<div><h4 '+titleStyle+'>Support</h4>' +
                     '<a '+linkStyle+' href="https://wiki.atronia.eu">Wiki</a>' +
                     '<a '+linkStyle+' href="https://wiki.atronia.eu">Wiki</a>' +
                 '</div>' +
                 '</div>' +
Line 75: Line 115:
         '<div class="atronia-full-width-line"></div>' +
         '<div class="atronia-full-width-line"></div>' +


         // 4. SECÇÃO FINAL (LOGOS)
         // 4. SECÇÃO FINAL (LOGOS COM ESPAÇAMENTO REDUZIDO)
         '<div style="padding: 40px 20px; max-width: 1300px; margin: 0 auto; display: flex; flex-wrap: wrap; align-items: flex-start; gap: 40px;">' +
         '<div style="padding: 40px 20px; max-width: 1300px; margin: 0 auto; display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: flex-start; gap: 60px;">' +
             '<div style="flex: 1.2; min-width: 320px; display: flex; flex-direction: column; gap: 25px;">' +  
           
                 '<div style="display: flex; gap: 30px; align-items: flex-start;">' +
            // 1. Approved by
                    // Approved by (Selo ID)
             '<div style="flex: 0 1 auto; min-width: 120px;">' +
                    '<div>' +
                 '<p style="font-size:11px; opacity:0.6; color:#ffffff !important; margin-bottom:15px; font-weight:bold; text-transform: uppercase;">Approved by:</p>' +
                        '<p style="font-size:11px; opacity:0.6; color:#ffffff !important; margin-bottom:15px; font-weight:bold; text-transform: uppercase;">Approved by:</p>' +
                '<img src="'+img.selo+'" style="height: auto; width: 90px; display: block; border:none;">' +
                        '<img src="'+img.selo+'" style="height: auto; width: 100px; display: block; border:none;">' +
            '</div>' +
                    '</div>' +
 
                    // Powered by (igus)
            // 2. Powered by
                    '<div>' +
            '<div style="flex: 0 1 auto; min-width: 150px;">' +
                        '<p style="font-size:11px; opacity:0.6; color:#ffffff !important; margin-bottom:15px; font-weight:bold; text-transform: uppercase;">Powered by:</p>' +
                '<p style="font-size:11px; opacity:0.6; color:#ffffff !important; margin-bottom:15px; font-weight:bold; text-transform: uppercase;">Powered by:</p>' +
                        '<a href="https://www.igus.pt/" target="_blank"><img src="'+img.igus+'" style="height: auto; width: 140px; display: block; border:none;"></a>' +
                '<a href="https://www.igus.pt/" target="_blank"><img src="'+img.igus+'" style="height: auto; width: 130px; display: block; border:none;"></a>' +
                    '</div>' +
                '</div>' +
                '<div>' +
                    '<p style="font-size: 13px; color: #ffffff !important;">' +
                        '<strong><a href="https://www.livroreclamacoes.pt/" target="_blank" style="color: #ffffff !important; text-decoration: underline;">Livro de Reclamações</a> | <a href="https://atronia.eu/privacy-policy/" target="_blank" style="color: #ffffff !important; text-decoration: underline;">Privacy Policy</a></strong>' +
                    '</p>' +
                '</div>' +
             '</div>' +
             '</div>' +
             '<div style="flex: 2;">' +
 
            // 3. Co-sponsored by
             '<div style="flex: 0 1 auto; min-width: 300px;">' +
                 '<p style="font-size:11px; opacity:0.6; color:#ffffff !important; margin-bottom:15px; font-weight:bold; text-transform: uppercase;">Co-sponsored by:</p>' +
                 '<p style="font-size:11px; opacity:0.6; color:#ffffff !important; margin-bottom:15px; font-weight:bold; text-transform: uppercase;">Co-sponsored by:</p>' +
                 '<div style="display: grid; grid-template-columns: repeat(2, auto); gap: 20px 40px; justify-content: start; align-items: center;">' +
                 '<div style="display: grid; grid-template-columns: repeat(2, auto); gap: 15px 30px; justify-content: start; align-items: center;">' +
                     '<a href="https://atronia.eu/wp-content/uploads/2025/12/Ficha-do-projeto-ATRONIA-LDA.pdf" target="_blank"><img src="'+img.cp+'" style="height: 45px; max-width: 300px; width: auto; object-fit: contain; border:none;"></a>' +
                     '<a href="https://atronia.eu/wp-content/uploads/2025/12/Ficha-do-projeto-ATRONIA-LDA.pdf" target="_blank"><img src="'+img.cp+'" style="height: 40px; max-width: 250px; width: auto; object-fit: contain; border:none;"></a>' +
                     '<a href="https://atronia.eu/wp-content/uploads/2025/09/Ficha-de-Operacao_Tilt-Wind.pdf" target="_blank"><img src="'+img.ce+'" style="height: 45px; max-width: 300px; width: auto; object-fit: contain; border:none;"></a>' +
                     '<a href="https://atronia.eu/wp-content/uploads/2025/09/Ficha-de-Operacao_Tilt-Wind.pdf" target="_blank"><img src="'+img.ce+'" style="height: 40px; max-width: 250px; width: auto; object-fit: contain; border:none;"></a>' +
                     '<a href="https://atronia.eu/wp-content/uploads/2025/01/Pessoas2030.jpg" target="_blank"><img src="'+img.ps+'" style="height: 45px; max-width: 300px; width: auto; object-fit: contain; border:none;"></a>' +
                     '<a href="https://atronia.eu/wp-content/uploads/2025/01/Pessoas2030.jpg" target="_blank"><img src="'+img.ps+'" style="height: 40px; max-width: 250px; width: auto; object-fit: contain; border:none;"></a>' +
                     '<a href="https://atronia.eu/wp-content/uploads/2025/02/Ficha-de-Projeto.pdf" target="_blank"><img src="'+img.pr+'" style="height: 45px; max-width: 300px; width: auto; object-fit: contain; border:none;"></a>' +
                     '<a href="https://atronia.eu/wp-content/uploads/2025/02/Ficha-de-Projeto.pdf" target="_blank"><img src="'+img.pr+'" style="height: 40px; max-width: 250px; width: auto; object-fit: contain; border:none;"></a>' +
                 '</div>' +
                 '</div>' +
             '</div>' +
             '</div>' +
         '</div>' +
         '</div>' +
        // Links Legais (alinhados abaixo dos logos)
        '<div style="padding: 0 20px 40px 20px; max-width: 1300px; margin: 0 auto;">' +
            '<p style="font-size: 13px; color: #ffffff !important;">' +
                '<strong><a href="https://www.livroreclamacoes.pt/" target="_blank" style="color: #ffffff !important; text-decoration: underline;">Livro de Reclamações</a> | <a href="https://atronia.eu/privacy-policy/" target="_blank" style="color: #ffffff !important; text-decoration: underline;">Privacy Policy</a></strong>' +
            '</p>' +
        '</div>' +
     '</div>';
     '</div>';