<commit_before><?php
/**
 * @package      ETD EU Cookie
 *
 * @version      1.0
 * @copyright    Copyright (C) 2015 ETD Solutions. Tous droits réservés.
 * @license      Apache Version 2 (https://raw.githubusercontent.com/jbanety/etdeucookie/master/LICENSE.md)
 * @author       ETD Solutions http://etd-solutions.com
 **/

// no direct access
defined('_JEXEC') or die('Restricted access');

jimport('joomla.plugin.plugin');

class  plgSystemEtdeucookie extends JPlugin {

    function onBeforeRender() {

        $app = JFactory::getApplication();
        $doc = JFactory::getDocument();

        // Seulement sur le site.
        if ($app->isSite()) {

            // On récupère le cookie.
            $cookie = $app->input->cookie->get('etdeucookie');

            // On ne travaille que si le cookie n'est pas accepté.
            if ($cookie !== "ok") {

                // On récupère les paramètres.
                $bg          = $this->params->get('bg', '#000000');
                $color       = $this->params->get('color', '#FFFFFF');
                $message     = $this->params->get('message', '');
                //$article_id  = $this->params->get('article_id', '');

                $html = array();

                $doc->addStyleDeclaration('
#etd-cookie{font:normal 12px/16px Arial,Verdana,sans-serif;position:fixed;z-index:99999;top:0;right:0;margin:0 auto;color:' . $color . ';background:' . $bg. ';padding:5px}
#etd-cookie-t{float:left;padding:5px;width:90%}
#etd-cookie-b{float:left;padding:5px;width:10%}');

                $html[] = '<div id="etd-cookie">';
                $html[] = '  <div id="etd-cookie-t">' . addslashes($message) . '</div>';
                $html[] = '  <div id="etd-cookie-b"><button type="button" class="btn btn-default btn-sm">Poursuivre</button>';
                $html[] = '</div>';

                JHtml::_('jquery.framework');
                $doc->addScriptDeclaration("
jQuery(document).on('ready', function() {
    $('body').append('" . implode($html) . "');
    $('#etd-cookie-b button').on('click', function(e) {
        e.preventDefault();
        var t = new Date();
        t.setMilliseconds(t.getMilliseconds() + 30 * 864e+5)
        document.cookie = 'etdeucookie=ok; expires=' + t.toUTCString();
        $('#etd-cookie').remove();
    });
});");

            }

        }
    }
}<commit_msg>Responsive pour les mobiles<commit_after><?php
/**
 * @package      ETD EU Cookie
 *
 * @version      1.0
 * @copyright    Copyright (C) 2015 ETD Solutions. Tous droits réservés.
 * @license      Apache Version 2 (https://raw.githubusercontent.com/jbanety/etdeucookie/master/LICENSE.md)
 * @author       ETD Solutions http://etd-solutions.com
 **/

// no direct access
defined('_JEXEC') or die('Restricted access');

jimport('joomla.plugin.plugin');

class  plgSystemEtdeucookie extends JPlugin {

    function onBeforeRender() {

        $app = JFactory::getApplication();
        $doc = JFactory::getDocument();

        // Seulement sur le site.
        if ($app->isSite()) {

            // On récupère le cookie.
            $cookie = $app->input->cookie->get('etdeucookie');

            // On ne travaille que si le cookie n'est pas accepté.
            if ($cookie !== "ok") {

                // On récupère les paramètres.
                $bg          = $this->params->get('bg', '#000000');
                $color       = $this->params->get('color', '#FFFFFF');
                $message     = $this->params->get('message', '');
                //$article_id  = $this->params->get('article_id', '');

                $html = array();

                $doc->addStyleDeclaration('
#etd-cookie{font:normal 12px/16px Arial,Verdana,sans-serif;position:fixed;z-index:99999;top:0;right:0;margin:0 auto;color:' . $color . ';background:' . $bg. ';padding:5px}
#etd-cookie-t{float:left;padding:5px;width:85%}
#etd-cookie-b{float:left;padding:5px;width:15%}
@media(max-width:767px){#etd-cookie-t,#etd-cookie-b{float:none;width:100%;text-align:center}}');

                $html[] = '<div id="etd-cookie">';
                $html[] = '  <div id="etd-cookie-t">' . addslashes($message) . '</div>';
                $html[] = '  <div id="etd-cookie-b"><button type="button" class="btn btn-default btn-sm">Poursuivre</button>';
                $html[] = '</div>';

                JHtml::_('jquery.framework');
                $doc->addScriptDeclaration("
jQuery(document).on('ready', function() {
    $('body').append('" . implode($html) . "');
    $('#etd-cookie-b button').on('click', function(e) {
        e.preventDefault();
        var t = new Date();
        t.setMilliseconds(t.getMilliseconds() + 30 * 864e+5)
        document.cookie = 'etdeucookie=ok; expires=' + t.toUTCString();
        $('#etd-cookie').remove();
    });
});");

            }

        }
    }
}

{'fraction_non_alphanumeric': 0.18322918766377747, 'fraction_numerical': 0.01652892561983471, 'mean_word_length': 2.1524777636594665, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 45, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7080799', 'n_tokens_mistral': 1685, 'n_tokens_neox': 1552, 'n_words': 272}