
/* -- FILE: [javascripts/cookies-optin.js]*/
/****
Nastavení prezentace, nezapomenout změnit!!!:
- cookie_name
*****/
var cookie_name = 'cookie_jewishmuseum';



// obtain plugin
var cc = initCookieConsent();
var iframemanager = iframemanager();

urlStyle = cookies_content_url + '/files/cookies/cookieconsent.css';

iframemanager.run({
    currLang: 'cs',
    services : {
        youtube : {
            embedUrl: 'https://www.youtube-nocookie.com/embed/{data-id}',
            thumbnailUrl: 'https://i3.ytimg.com/vi/{data-id}/hqdefault.jpg',
            iframe : {
                allow : 'accelerometer; encrypted-media; gyroscope; picture-in-picture; fullscreen;',
            },
            cookie : {
                name : 'cc_youtube'
            },
            languages : {
                en : {
                    notice: 'This content is hosted by a third party. By showing the external content you accept the <a rel="noreferrer" href="https://www.youtube.com/t/terms" title="Terms and conditions" target="_blank">terms and conditions</a> of youtube.com.',
                    cookieBtn: 'Load video'
                },
                cs : {
                    notice: 'Pro přehrání videa je potřeba souhlasit s podmínkami cookies.',
                    cookieBtn: 'Zobrazit nastavení cookies'
                }
            }
        }
    }
});

cc.run({
    //current_lang: 'cs',
    autoclear_cookies: true,                   // default: false
    //theme_css: urlStyle,                       // 🚨 replace with a valid path
    page_scripts: true,                        // default: false
    auto_language: "document",

    // mode: 'opt-in'                          // default: 'opt-in'; value: 'opt-in' or 'opt-out'
    // delay: 0,                               // default: 0
    // auto_language: null                     // default: null; could also be 'browser' or 'document'
    // autorun: true,                          // default: true
     force_consent: false,                   // default: false
    // hide_from_bots: false,                  // default: false
     remove_cookie_tables: true,             // default: false
     cookie_name: cookie_name,               // default: 'cc_cookie'
    // cookie_expiration: 182,                 // default: 182 (days)
    // cookie_necessary_only_expiration: 182   // default: disabled
    // cookie_domain: location.hostname,       // default: current domain
    // cookie_path: '/',                       // default: root
    // cookie_same_site: 'Lax',                // default: 'Lax'
    // use_rfc_cookie: false,                  // default: false
    // revision: 0,                            // default: 0
    gui_options: {
        consent_modal: {
            layout: 'box',               // box/cloud/bar
            position: 'bottom left',     // bottom/middle/top + left/right/center
            transition: 'slide',           // zoom/slide
            swap_buttons: true            // enable to invert buttons
        },
        settings_modal: {
            layout: 'bar',                 // box/bar
            position: 'left',           // left/right
            transition: 'slide'            // zoom/slide
        }
    },
		

    onFirstAction: function(user_preferences, cookie){
        
        
        
        
    },

    onAccept: function (cookie) {
        
        if(cc.allowedCategory('analytics_storage') === true) {
            iframemanager.acceptService('all')
        }
        
        if(cc.allowedCategory('analytics_storage') === false) {
            iframemanager.rejectService('all');
        }
        
    },

    onChange: function (cookie, changed_preferences) {
        
        if(cc.allowedCategory('analytics_storage') === true) {
            iframemanager.acceptService('all')
        }
        
        if(cc.allowedCategory('analytics_storage') === false) {
            iframemanager.rejectService('all');
        }
        
    },

    languages: {
        'en': {
            consent_modal: {
                title: 'Jewishmuseum používá cookies',
                description: 'K personalizaci obsahu a reklam, poskytování funkcí sociálních médií a analýze naší návštěvnosti využíváme soubory cookie. Informace o tom, jak náš web používáte, sdílíme se svými partnery pro sociální média, inzerci a analýzy. <button type="button" data-cc="c-settings" class="cc-link">Zobrazit podrobnosti</button>',
                primary_btn: {
                    text: 'Povolit vše',
                    role: 'accept_all'              // 'accept_selected' or 'accept_all'
                },
                secondary_btn: {
                    text: 'Upravit nastavení',
                    role: 'settings'        // 'settings' or 'accept_necessary'
                }
            },
            settings_modal: {
                title: 'Předvolby souborů cookie',
                save_settings_btn: 'Uložit nastavení',
                accept_all_btn: 'Povolit vše',
                reject_all_btn: 'Zakázat vše',
                close_btn_label: 'Zavřít',
                cookie_table_headers: [
                    {col1: 'Název'},
                    {col2: 'Doména'},
                    {col3: 'Expirace'},
                    {col4: 'Popis'}
                ],
                blocks: [
                    {
                        title: 'Používání souborů cookie',
                        description: 'Soubory cookie používáme k zajištění základních funkcí webu a ke zlepšení vašeho online zážitku. Pro každou kategorii si můžete vybrat, zda se chcete přihlásit/odhlásit. Další podrobnosti týkající se souborů cookie a dalších citlivých údajů naleznete v úplném znění <a href="https://policies.google.com/privacy?hl=cs" target="_blank" class="cc-link">zásady ochrany osobních údajů</a>.'
                    }, {
                        title: 'Nezbytné cookies',
                        description: 'Tyto soubory cookie jsou nezbytné pro správné fungování našich webových stránek. Bez těchto cookies by web nefungoval správně.',
                        toggle: {
                            value: 'necessary',
                            enabled: true,
                            readonly: true 
                        }
                    }, {
                        title: 'Analytické a statistické cookies',
                        description: 'Umožňuje ukládání informací (jako jsou soubory cookie) souvisejících s analýzou, např. délka návštěvy.',
                        toggle: {
                            value: 'analytics_storage',  
                            enabled: false,
                            readonly: false
                        },
                    }, {
                        title: 'Reklamní cookies',
                        description: 'Umožňuje ukládání informací (jako jsou soubory cookie) souvisejících s inzercí.',
                        toggle: {
                            value: 'ad_storage',
                            enabled: false,
                            readonly: false
                        }
                    }
                ]
            }
        },
    }
});
