# You must use a tab-size of 4 spaces to edit this file.
---
site_settings:
    setting_group: head_and_foot
    title: Site-wide <head> and <body> HTML/JavaScript
    save_and_continue_button_message: Save & continue
    save_button_message: Save & close
    tabs:
        head:
            label: HTML/JS in <head>
            edit_mode:
                enabled: true
                priv: _PRIV_EDIT_SITE_SETTING
            notices:
                note_about_editing_html:
                    type: warning
                    show: true
                    message: >
                        This interface allows you to enter tags and attributes that could
                        potentially be used for cross-site scripting attacks (XSS) on this
                        site.
                        Please be sure that you understand what the code does, and do not
                        copy-paste code from third party sources that you don't trust!
                always:
                    type: warning
                    show: true
                    html: true
                    message: |
                        If this code may set cookies, and if you wish to control this, you need to place it in the Cookie-creating HTML/JS tab.
                no_snippets_found:
                    type: error
                    show: true
                    visible_if: |
                       lib.value('run_twig') && _.isEmpty(lib.field('twig_snippet').values)
                    html: true
                    message: >
                        No Twig snippets were found.
                        To make a Twig snippet, create a file with an extension <code>.twig.html</code>,
                        and place it in the directory <code>zenario_custom/twig/head/</code>.
                        (You should create this directory if it doesn't exist.)
            fields:
                description:
                    full_width: true
                    snippet:
                        html: >
                            Add HTML/Javascript to go within the <code>&lt;head&gt;</code> tag of all content items (irrespective of cookie settings and visitor acceptance):
                sitewide_head:
                    site_setting:
                        name: sitewide_head
                    full_width: true
                    row_class: zfab_use_wider_notes
                    type: code_editor
                    tall_as_possible: true
                    dont_trim: true
                    language: html
                    value: ''
                    style: >
                        height: 25em;
                        width: 99%;
                    note_below: >
                        Typically used for <code>&lt;meta&gt;</code> and <code>&lt;style&gt;</code> tags.
                        HTML or JavaScript entered here will take effect across the entire site.
                        <br/>
                        Use the Layout tab in the admin toolbar to enter HTML/JS to be applied to all content items with that layout; or the Edit tab to enter additional HTML/JS for a specific content item.
                run_twig:
                    site_setting:
                        name: sitewide_head.run_twig
                    type: checkbox
                    label: Run Twig code
                    redraw_onchange: true
                twig_snippet:
                    site_setting:
                        name: sitewide_head.twig_snippet
                    #indent: 1
                    same_row: true
                    visible_if:
                        lib.value: run_twig
                    type: select
                    empty_value: " -- Select -- "
                    validation:
                        required_if_not_hidden: Please select a Twig snippet
                    format_onchange: true
                    side_note: "Select a snippet to view file contents in the box below."
                twig_path:
                    indent: 2
                    visible_if:
                        lib.value: run_twig
                    #row_class: zenario_fbInfo zenario_fbInfo_small
                    snippet:
                        label: ''
                twig:
                    indent: 1
                    visible_if:
                        lib.value: run_twig
                    label: 'Twig code:'
                    type: code_editor
                    readonly: true
                    #tall_as_possible: true
                    style: |
                        height: 150px
                        width: 99%;
                    dont_trim: true
                    language: twig
                twig_vars:
                    indent: 1
                    visible_if:
                        lib.value: run_twig
                    site_setting:
                        name: sitewide_head.twig_vars
                    label: 'Variables:'
                    tooltip: |
                        Declare any variables that should be passed to the Twig script.
                        Must use valid YAML syntax and have a space after each colon, e.g. "key: value".
                    type: code_editor
                    value: |
                        variableName1: value1
                        variableName2: value2
                    language: yaml
                    style: >
                        height: 5em;
                        width: 99%;
                    
        body:
            label: HTML/JS in start of <body>
            edit_mode:
                enabled: true
                priv: _PRIV_EDIT_SITE_SETTING
            notices:
                note_about_editing_html:
                    type: warning
                    show: true
                    message: >
                        This interface allows you to enter tags and attributes that could
                        potentially be used for cross-site scripting attacks (XSS) on this
                        site.
                        Please be sure that you understand what the code does, and do not
                        copy-paste code from third party sources that you don't trust!
                always:
                    type: warning
                    show: true
                    html: true
                    message: |
                        If this code may set cookies, and if you wish to control this, you need to place it in the Cookie-creating HTML/JS tab.
            fields:
                description:
                    full_width: true
                    snippet:
                        html: >
                            Add HTML/Javascript immediately after the <code>&lt;body&gt;</code> tag of all content items (irrespective of cookie settings and visitor acceptance):

                sitewide_body:
                    site_setting:
                        name: sitewide_body
                    full_width: true
                    type: code_editor
                    tall_as_possible: true
                    dont_trim: true
                    language: html
                    value: ''
                    style: >
                        height: 25em;
                        width: 99%;
        foot:
            label: HTML/JS before </body>
            edit_mode:
                enabled: true
                priv: _PRIV_EDIT_SITE_SETTING
            notices:
                note_about_editing_html:
                    type: warning
                    show: true
                    message: >
                        This interface allows you to enter tags and attributes that could
                        potentially be used for cross-site scripting attacks (XSS) on this
                        site.
                        Please be sure that you understand what the code does, and do not
                        copy-paste code from third party sources that you don't trust!
                always:
                    type: warning
                    show: true
                    html: true
                    message: |
                        If this code may set cookies, and if you wish to control this, you need to place it in the Cookie-creating HTML/JS tab.
            fields:
                description:
                    full_width: true
                    snippet:
                        html: >
                            Add HTML/Javascript immediately before the <code>&lt;/body&gt;</code> tag of all content items (irrespective of cookie settings and visitor acceptance):
                sitewide_foot:
                    site_setting:
                        name: sitewide_foot
                    full_width: true
                    type: code_editor
                    tall_as_possible: true
                    dont_trim: true
                    language: html
                    value: ''
                    style: >
                        height: 25em;
                        width: 99%;
                    note_below: |
                        <p>The following JavaScript libraries are available for you to use:</p>
                        <ul class="zenario_js_libs_available">
                            <li><a href="http://www.jacklmoore.com/colorbox/" target="_blank">Colorbox</a></li>
                            <li><a href="https://jquery.com/" target="_blank">jQuery</a></li>
                            <li><a href="http://jqueryui.com/" target="_blank">jQuery UI core, effects and tooltips</a></li>
                            <li><a href="https://modernizr.com/" target="_blank">Modernizr</a></li>
                            <li><a href="http://underscorejs.org/" target="_blank">Underscore.js</a></li>
                        </ul>
        cookie_content:
            label: Cookie-creating HTML/JS
            edit_mode:
                enabled: true
                priv: _PRIV_EDIT_SITE_SETTING
            notices:
                note_about_editing_html:
                    type: warning
                    show: true
                    message: >
                        This interface allows you to enter tags and attributes that could
                        potentially be used for cross-site scripting attacks (XSS) on this
                        site.
                        Please be sure that you understand what the code does, and do not
                        copy-paste code from third party sources that you don't trust!
                not_required:
                    type: warning
                    show: true
                    html: true
                    visible_if: |
                        !zenarioA.siteSettings.cookie_require_consent
                    message: |
                        This site has
                        <a target="_blank" href='organizer.php#zenario__administration/panels/site_settings//cookies~.site_settings~tcookies~k{"id"%3A"cookies"}' >
                        cookie consent</a> set to "don't inform or require", any Javascript here will always be run.
                
                implied:
                    type: warning
                    show: true
                    html: true
                    visible_if: |
                        zenarioA.siteSettings.cookie_require_consent == 'implied'
                    message: |
                        This site has
                        <a target="_blank" href='organizer.php#zenario__administration/panels/site_settings//cookies~.site_settings~tcookies~k{"id"%3A"cookies"}' >
                        cookie consent</a> set to "implied consent", any Javascript here will always be run.
                
                individual:
                    type: warning
                    show: true
                    html: true
                    visible_if: |
                        zenarioA.siteSettings.cookie_require_consent == 'explicit'
                    message: |
                        This site has
                        <a target="_blank" href='organizer.php#zenario__administration/panels/site_settings//cookies~.site_settings~tcookies~k{"id"%3A"cookies"}' >
                        cookie consent</a> set to "explicit consent", Javascipt in each box below will only be served to the client (and run on the client browser) when the client accepts the appropriate type of cookie.
            fields:
                sitewide_analytics_html_location:
                    site_setting:
                        name: sitewide_analytics_html_location
                    type: select
                    pre_field_html: '<b>Analytics</b>: if visitor has accepted Analytics cookies (or all cookies), add HTML/JavaScript&nbsp;'
                    values:
                        head:
                            label: within the <head> tag
                        body:
                            label: immediately after the <body> tag
                        foot:
                            label: immediately before the </body> tag
                    post_field_html: '&nbsp;of all pages:'

                sitewide_analytics_html:
                    site_setting:
                        name: sitewide_analytics_html
                    type: code_editor
                    dont_trim: true
                    language: html
                    value: ''
                    style: >
                        height: 20em;
                        width: 99%;
                
                #If Matomo Analytics module is running, it will display a note here.
                
                sitewide_social_media_html_location:
                    site_setting:
                        name: sitewide_social_media_html_location
                    type: select
                    pre_field_html: '<b>Social Media</b>: if visitor has accepted Social Media cookies (or all cookies), add HTML/JS&nbsp;'
                    values:
                        head:
                            label: within the <head> tag
                        body:
                            label: immediately after the <body> tag
                        foot:
                            label: immediately before the </body> tag
                    post_field_html: '&nbsp;of all pages:'

                sitewide_social_media_html:
                    site_setting:
                        name: sitewide_social_media_html
                    type: code_editor
                    dont_trim: true
                    language: html
                    value: ''
                    style: >
                        height: 20em;
                        width: 99%;
    confirm:
        show: true
        message: >
            <p>You are changing HTML and/or JavaScript that is used across the entire site.</p>

            <p>The change will be <strong>immediate</strong> and cannot be undone.</p>

        html: true
        button_message: Save
        cancel_button_message: Cancel
        message_type: warning
    
