<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

jQuery(document).ready(function ($) {


    /* Noty logic */
    Noty.overrideDefaults({
        theme: 'semanticui',
        closeWith: ['click', 'button'],
        timeout: 2000,
        animation: {
            open: 'animated fadeInRight',
            close: 'animated fadeOutRight'
        }
    });


    $('.clip-var').click(function (event) {
        var range = document.createRange();
        range.selectNodeContents(this);

        window.getSelection().addRange(range);
        /* Copy the text inside the text field */
        document.execCommand("copy");

        new Noty({
            type: 'success',
            text: '&lt;b&gt;' + $(this).html() + '&lt;/b&gt;&lt;br/&gt;copié dans le presse papier :)',
        }).show();
    });


    $('.copy-content').on('click', function () {
        $(this).addClass('pulse');
        text = $(this).attr('data-tocopy');
        navigator.clipboard.writeText(text)
                .then(() =&gt; {
                    copytrue($(this));
                })
                .catch(err =&gt; {
                    alert('Error in copying text: ', err);
                });
        $(this).removeClass('pulse');
    });

    function copytrue(obj) {
        obj.parent().append("&lt;span class='copy-true right '&gt;📋&lt;/span&gt;");
        setTimeout(function () {
            ct = obj.parent().find('.copy-true');
            ct.remove();
        }, 2000);
    }


});

jQuery(document).ajaxComplete(function ($) {

    jQuery('.copy-content').on('click', function () {
        jQuery(this).addClass('pulse');
        text = jQuery(this).attr('data-tocopy');
        navigator.clipboard.writeText(text)
                .then(() =&gt; {
                    copytrue($(this));
                })
                .catch(err =&gt; {
                    alert('Error in copying text: ', err);
                });
        jQuery(this).removeClass('pulse');
    });

    function copytrue(obj) {
        obj.parent().append("&lt;span class='copy-true right '&gt;📋&lt;/span&gt;");
        setTimeout(function () {
            ct = obj.parent().find('.copy-true');
            ct.remove();
        }, 2000);
    }

});

</pre></body></html>