HEX
Server: Apache/2.4.54 (Unix) OpenSSL/1.0.2k-fips
System: Linux f17.eelserver.com 3.10.0-1160.80.1.el7.x86_64 #1 SMP Tue Nov 8 15:48:59 UTC 2022 x86_64
User: zulfiqar (1155)
PHP: 8.2.0
Disabled: mail, exec, system, popen, proc_open, shell_exec, passthru, show_source
Upload Files
File: /home/zulfiqar/public_html/wp-content/plugins/gallery-videos/admin/js/tsvg-block.js
(function (blocks, editor, element) {
    let createElement = element.createElement,
        SelectControl = wp.components.SelectControl,
        Placeholder = wp.components.Placeholder,
        el = wp.element.createElement,
        Fragment = wp.element.Fragment;
    if (tsvg_block_data.tsvg_records_count >= 1) {
        var tsvg_records_list = tsvg_block_data.tsvg_records_list
        blocks.registerBlockType('tsvideogallery/gallery-block', {
            title: 'TS Gallery',
            icon: 'format-video',
            category: 'widgets',
            description: 'Gallery is a user-friendly plugin to display user or hashtag-based gallery feeds as a responsive customizable gallery.',
            keywords: ['gallery', 'video gallery', 'video', 'mp4', 'youTube', 'vimeo', 'wistia'],
            example: {
                attributes: {
                    'preview': true,
                },
            },
            edit: props => {
                if (props.attributes.tsvg_id) {
                    return [
                        createElement(
                            SelectControl, {
                            className: 'tsvg-select-block',
                            value: props.attributes.tsvg_id,
                            options: tsvg_records_list,
                            onChange: function (newValue) {
                                if (parseInt(newValue) > 0) {
                                    props.setAttributes({ tsvg_id: newValue });
                                    createElement(wp.serverSideRender, {
                                        key: 'tsvg-control',
                                        block: 'tsvideogallery/gallery-block',
                                        className: 'tsvg-guttenberg-block',
                                        attributes: props.attributes,
                                    });
                                } else {
                                    props.setAttributes({ tsvg_id: '' });
                                }
                            }
                        }
                        ),
                        createElement(wp.serverSideRender, {
                            key: 'tsvg-control',
                            block: 'tsvideogallery/gallery-block',
                            className: 'tsvg-guttenberg-block',
                            attributes: props.attributes,
                        })
                    ]
                } else if (props.attributes.preview) {
                    return [
                        createElement(
                            Fragment, {
                            key: "tsvg-preview-control",
                            className: "tsvg-preview-control",
                        },
                            el(
                                'img', {
                                src: tsvg_block_data.ts_video_gallery_preview,
                                style: {
                                    width: '100%',
                                    height: '100%'
                                }
                            },
                            ),
                        ),
                    ]
                } else {
                    return [
                        createElement(
                            Placeholder, {
                            key: "tsvg-selector-block",
                            className: "tsvg-selector-block",
                        },
                            el(
                                'img', {
                                width: 100,
                                height: 100,
                                src: tsvg_block_data.ts_video_gallery_logo
                            },
                            ),
                            el(
                                'h3', {
                                key: "tsvg-h3",
                                className: "tsvg-h3",
                            },
                                'TS Video Gallery'
                            ),
                            createElement(
                                SelectControl, {
                                className: 'tsvg-select-block',
                                value: props.attributes.tsvg_id,
                                options: tsvg_records_list,
                                onChange: function (newValue) {
                                    if (parseInt(newValue) > 0) {
                                        props.setAttributes({ tsvg_id: newValue });
                                        createElement(wp.serverSideRender, {
                                            key: 'tsvg-control',
                                            block: 'tsvideogallery/gallery-block',
                                            className: 'tsvg-guttenberg-block',
                                            attributes: props.attributes,
                                        })
                                    } else {
                                        props.setAttributes({ tsvg_id: '' });
                                    }
                                }
                            }
                            ),
                        ),
                    ]
                }
            },
            save: props => {
                return null;
            },
        })
    } else {
        return null;
    }
}(
    window.wp.blocks,
    window.wp.editor,
    window.wp.element
))