# You must use a tab-size of 4 spaces to edit this file.
---
plugin_settings:
    module_class_name: zenario_multiple_image_container
    tabs:
        first_tab:
            edit_mode:
                format_on_edit: true
                format_on_cancel_edit: true
                format_on_revert: true
            label: Choose images
            notices:
                docstore_warning:
                    show: false
                    type: warning
                    html: true
                    message: ''
            fields:
                image:
                    plugin_setting:
                        name: image
                        foreign_key_to: 'multiple_files'
                    label: Images
                    pick_items:
                        path: zenario__library/panels/mic_image_library
                        min_path: zenario__library/panels/mic_image_library
                        max_path: zenario__library/panels/mic_image_library
                        target_path: zenario__library/panels/mic_image_library
                        multiple_select: true
                        select_phrase: Select from Organizer...
                    format_onchange: true
                    upload:
                        usage: 'mic'
                        location: 'docstore'
                        multi: true
                        accept: 'image/*'
                        extensions:
                            - .gif
                            - .jpg
                            - .jpeg
                            - .png
                        drag_and_drop: true
                        reorder_items: true
                    validation:
                        required_if_not_hidden: Please select an image.
                
                canvas:
                    plugin_setting:
                        name: canvas
                    label: 'Thumbnail image canvas:'
                    type: select
                    value: crop_and_zoom
                    values:
                        crop_and_zoom:
                            label: Crop and zoom
                        fixed_width:
                            label: Constrain by width
                        fixed_height:
                            label: Constrain by height
                        fixed_width_and_height:
                            label: Constrain by width and height
                        unlimited:
                            label: Unlimited size
                    format_onchange: true
                retina:
                    indent: 1
                    plugin_setting:
                        name: retina
                    label: 'This is a retina image'
                    type: checkbox
                    same_row: true
                    value: ""
                    visible_if: |
                        !zenarioAB.svgSelected('image') &&
                        !zenarioAB.svgSelected('images')
                    side_note: |
                        Display image at double density.
                width:
                    indent: 1
                    plugin_setting:
                        name: width
                    label: 'Width:'
                    type: text
                    validation:
                        required_if_not_hidden: Please enter a width in pixels.
                        numeric: The width must be a number.
                    value: 600
                    maxlength: 5
                    style: 'width: 5em;'
                    post_field_html: '&nbsp;pixels'
                height:
                    indent: 1
                    plugin_setting:
                        name: height
                    label: 'Height:'
                    type: text
                    validation:
                        required_if_not_hidden: Please enter a height in pixels.
                        numeric: The height must be a number.
                    value: 400
                    maxlength: 5
                    style: 'width: 5em;'
                    post_field_html: '&nbsp;pixels'
                
                show_caption_on_image:
                    plugin_setting:
                        name: show_caption_on_image
                    label: "Show caption on thumbnail"
                    type: checkbox
                    redraw_onchange: true
                show_caption_above_thumbnail:
                    indent: 1
                    plugin_setting:
                        name: show_caption_above_thumbnail
                    label: "Show caption above thumbnail"
                    type: checkbox
                    visible_if: lib.value('show_caption_on_image')
                    side_note: "Captions normally appear below the thumbnail; check here for captions to appear first."
                show_image_credit_on_thumbnail:
                    plugin_setting:
                        name: show_image_credit_on_thumbnail
                    label: 'Show image credit on thumbnail'
                    type: checkbox
                lazy_load:
                    plugin_setting:
                        name: lazy_load
                    label: Lazy load images
                    type: checkbox
                    side_note: |
                        This will cause the images to be loaded when they scroll into view,
                        rather than loading them all at once.
                zip_archive_enabled:
                    label: 'Offer to create zip of downloads'
                    type: checkbox
                    plugin_setting:
                        name: zip_archive_enabled
                    redraw_onchange: true
                zip_archive_name:
                    indent: 1
                    hide_with_previous_outdented_field: true
                    hide_if_previous_value_isnt: 1
                    label: 'Zip archive name:'
                    placeholder: 'images'
                    plugin_setting:
                        name: zip_archive_name
                    type: text
                    side_note: >
                        You can specify the name of the target zip archive. If you
                        leave this field empty, the "images.zip" name is assumed.
                    post_field_html: '.zip'
                    note_below: ''
                
                title:
                    plugin_setting:
                        name: title
                        is_searchable_content: true
                        translate: true
                    label: 'Title:'
                    type: text
                    width: 150
                    maxlength: 255
                    value: ""
                
                title_tags:
                    plugin_setting:
                        name: title_tags
                    label: 'Title heading tags:'
                    type: select
                    values:
                        h1: Heading 1
                        h2: Heading 2
                        h3: Heading 3
                        h4: Heading 4
                        h5: Heading 5
                        h6: Heading 6
                        p: Paragraph
                    value: h2
                    same_row: true
                
                set_an_anchor:
                    plugin_setting:
                        name: set_an_anchor
                    label: 'Set an anchor'
                    type: checkbox
                    value: false
                    format_onchange: true
                anchor_name:
                    plugin_setting:
                        name: anchor_name
                    indent: 1
                    type: text
                    label: 'Anchor name:'
                    validation:
                        required_if_not_hidden: 'Please enter the anchor name.'
                    visible_if: zenarioAB.value('set_an_anchor')
                    #This field has an oninput event, set in the fillAdminBox method,
                    #and a side_note, set in the formatAdminBox method.
        
        links:
            label: Captions, links, enlarging
            custom_template_fields:

                image_thumb_znz: 
                    type: grouping
                    name: image_thumb_znz
                    grouping_css_class: zenario_grouping__image_thumb
                    #row_class: image_grouping
                
                image_znz:
                    grouping: image_thumb_znz
                    row_class: zfab_just_show_image_thumb
                    readonly: true
                    pick_items:
                        path: zenario__library/panels/mic_image_library
                        min_path: zenario__library/panels/mic_image_library
                        max_path: zenario__library/panels/mic_image_library
                        target_path: zenario__library/panels/mic_image_library
                    value: znz
                    upload:
                        multi: true
                        accept: 'image/*'
                        extensions:
                            - .gif
                            - .jpg
                            - .jpeg
                            - .png
                    values: {}
                
                image_link_znz:
                    type: grouping
                    name: image_link_znz
                    grouping_css_class: zenario_grouping__image_link
                
                image_title_znz:
                    grouping: image_link_znz
                    plugin_setting:
                        name: image_title_znz
                    label: 'Caption:'
                    type: text
                
                alt_tag_znz:
                    #This field is not editable, and has no plugin setting value.
                    grouping: image_link_znz
                    label: 'Alt-tag:'
                    type: text
                    read_only: true
                    side_note: 'To edit ALT tag, go to Organizer.'
                
                link_type_znz:
                    grouping: image_link_znz
                    plugin_setting:
                        name: link_type_znz
                    type: select
                    value: _ENLARGE_IMAGE
                    values:
                        _ENLARGE_IMAGE:
                            label: Enlarge image in floating box
                        _CONTENT_ITEM:
                            label: Link to a content item
                        _EXTERNAL_URL:
                            label: Link to an external URL
                        _NO_LINK:
                            label: — Don't link/enlarge —
                    format_onchange: true
              
                target_blank_znz:
                    indent: 1
                    visible_if: |
                        zenario.IN(zenarioAB.value('link_type_znz'), '_CONTENT_ITEM', '_EXTERNAL_URL')
                    grouping: image_link_znz
                    plugin_setting:
                        name: target_blank_znz
                    type: select
                    empty_value: 'Open in the same window'
                    values:
                        1:
                            label: Open in a new window
                        2:
                            label: Open in a floating box
                    value: "" 
                    same_row: true
                hyperlink_target_znz:
                    indent: 1
                    visible_if: |
                        zenarioAB.value('link_type_znz') == '_CONTENT_ITEM'
                    grouping: image_link_znz
                    plugin_setting:
                        name: hyperlink_target_znz
                        foreign_key_to: content
                    pick_items:
                        path: zenario__content/panels/content/refiners/filter_by_lang////
                        min_path: zenario__content/panels/content
                        max_path: zenario__content/panels/content
                        target_path: zenario__content/panels/content
                        select_phrase: Select a content item...
                        hide_remove_button: true
                url_znz:
                    indent: 1
                    visible_if: |
                        zenarioAB.value('link_type_znz') == '_EXTERNAL_URL'
                    grouping: image_link_znz
                    plugin_setting:
                        name: url_znz
                    type: url
                    maxlength: 255
                    value: ""
                
                link_to_anchor_znz:
                    indent: 1
                    grouping: image_link_znz
                    plugin_setting:
                        name: link_to_anchor_znz
                    label: Link to anchor
                    type: checkbox
                    visible_if: |
                        zenarioAB.value('link_type_znz') == '_CONTENT_ITEM'
                    redraw_onchange: true
                  
                hyperlink_anchor_znz:
                    indent: 2
                    grouping: image_link_znz
                    plugin_setting:
                        name: hyperlink_anchor_znz
                    label: 'Anchor name:'
                    type: text
                    maxlength: 255
                    visible_if: |
                        zenarioAB.value('link_type_znz') == '_CONTENT_ITEM' && zenarioAB.value('link_to_anchor_znz')
                    side_note: >
                        If you have an anchor on the page, you can specify it here and you'll be
                        taken to its location on navigation.
                    same_row: true
            fields:
                options_for_all_images:
                    ord: 999999999
                    type: grouping
                    snippet:
                        label: 'Options for all images'
                        label_class: subheading
                no_captions:
                    grouping: image_settings
                    snippet:
                        html: 'Captions can be attached to images. Please upload some images, then return to this tab to add captions.'
                    readonly: true
                enlarge_canvas:
                    grouping: options_for_all_images
                    plugin_setting:
                        name: enlarge_canvas
                    label: 'Enlarged image canvas:'
                    type: select
                    value: unlimited
                    values:
                        unlimited:
                            label: Unlimited size
                        fixed_width:
                            label: Constrain by width
                        fixed_height:
                            label: Constrain by height
                        fixed_width_and_height:
                            label: Constrain by width and height
                    format_onchange: true
                enlarge_width:
                    grouping: options_for_all_images
                    indent: 1
                    plugin_setting:
                        name: enlarge_width
                    label: 'Width:'
                    type: text
                    validation:
                        required_if_not_hidden: Please enter an enlarged width.
                        numeric: The enlarged width must be a number.
                    value: ""
                    maxlength: 5
                    style: 'width: 5em;'
                    post_field_html: '&nbsp;pixels'
                enlarge_height:
                    grouping: options_for_all_images
                    indent: 1
                    plugin_setting:
                        name: enlarge_height
                    label: 'Height:'
                    type: text
                    validation:
                        required_if_not_hidden: Please enter an enlarged height.
                        numeric: The enlarged height must be a number.
                    value: ""
                    maxlength: 5
                    style: 'width: 5em;'
                    post_field_html: '&nbsp;pixels'
                show_caption_on_enlarged_image:
                    grouping: options_for_all_images
                    plugin_setting:
                        name: show_caption_on_enlarged_image
                    label: "Show caption on enlarged image"
                    type: checkbox
                    redraw_onchange: true
                    value: true
                    side_note: 'This only has effect when you select "Enlarge image in a floating box" for an image.'
                show_image_credit_on_enlarged_image:
                    grouping: options_for_all_images
                    plugin_setting:
                        name: show_image_credit_on_enlarged_image
                    label: 'Show image credit on enlarged image'
                    type: checkbox
                show_link_to_download_original:
                    grouping: options_for_all_images
                    type: checkbox
                    plugin_setting:
                        name: show_link_to_download_original
                    label: "Show link to download original file"
                    redraw_onchange: true
                show_file_size:
                    grouping: options_for_all_images
                    indent: 1
                    hide_if_previous_outdented_value_isnt: 1
                    type: checkbox
                    plugin_setting:
                        name: show_file_size
                    label: "Show file size"
                show_image_uploaded_date:
                    grouping: options_for_all_images
                    type: checkbox
                    plugin_setting:
                        name: show_image_uploaded_date
                    label: "Show image uploaded date"
                    redraw_onchange: true
