[ Avaa Bypassed ]




Upload:

Command:

hmhc3928@3.15.15.31: ~ $
(function (blocks, editor, element, components) {


    const el = element.createElement;
    const {registerBlockType} = blocks;
    const { RichText, InspectorControls, withColors, PanelColorSettings, getColorClassName, AlignmentToolbar, BlockControls } = editor;
    const { Fragment } = element;
    const { TextControl, RadioControl, Panel, PanelBody, PanelRow, SelectControl, RangeControl } = components;
    const colorSamples = [
        {
            name: 'GREEN SEA',
            slug: 'GREENSEA',
            color: '#16A085'
        },
        {
            name: 'NEPHRITIS',
            slug: 'NEPHRITIS',
            color: '#27AE60'
        },
        {
            name: 'BELIZE HOLE',
            slug: 'BELIZEHOLE',
            color: '#2980B9'
        },
        {
            name: 'WISTERIA',
            slug: 'WISTERIA',
            color: '#8E44AD'
        },
        {
            name: 'MIDNIGHT BLUE',
            slug: 'MIDNIGHTBLUE',
            color: '#2C3E50'
        },
        {
            name: 'ORANGE',
            slug: 'ORANGE',
            color: '#F39C12'
        },
        {
            name: 'ALIZARIN',
            slug: 'ALIZARIN',
            color: '#E74C3C'
        },
        {
            name: 'WHITE',
            slug: 'WHITE',
            color: '#FFFFFF'
        },
        {
            name: 'CLOUDS',
            slug: 'CLOUDS',
            color: '#ECF0F1'
        },
        {
            name: 'ASBESTOS',
            slug: 'ASBESTOS',
            color: '#7F8C8D'
        }
    ];

    registerBlockType('tnp/minimal', {
        title: 'Newsletter subscription form',
        icon: 'email',
        category: 'common',
        keywords: ['newsletter', 'subscription', 'form'],
        attributes: {
            formtype: {type: 'string', default: 'minimal'},
            content: { type: 'array', source: 'children', selector: 'p', default: 'Subscribe to our newsletter!'},
            list_ids: { type: 'string' },
            rowColor: { type: 'string'},
            customRowColor: { type: 'string'},
            textColor: { type: 'string'},
            customTextColor: { type: 'string'},
            buttonColor: { type: 'string'},
            customButtonColor: { type: 'string'},
            padding: {type: 'integer', default: 20},
            alignment: { type: 'string'}
        },

        edit: withColors('rowColor', 'textColor', 'buttonColor')(function (props) {

            function onChangeContent( newContent ) {
                props.setAttributes( { content: newContent } );
            }

            function onChangeAlignment( newAlignment ) {
                props.setAttributes( { alignment: newAlignment } );
            }

            return el( Fragment, {},
                el( InspectorControls, {},

                    // 1st Panel - Form Settings
                    el( PanelBody, { title: 'Form Settings', initialOpen: true },

                        /* Form type */
                        el( RadioControl,
                            {
                                label: 'Form type',
                                options : [
                                    { label: 'Minimal', value: 'minimal' },
                                    { label: 'Full', value: 'full' },
                                ],
                                onChange: ( value ) => {
                                    props.setAttributes( { formtype: value } );
                                },
                                selected: props.attributes.formtype
                            }
                        ),

                        /* Lists field */
                        el( PanelRow, {},
                            el( TextControl,
                                {
                                    label: 'Lists IDs (comma separated)',
                                    onChange: ( value ) => {
                                        props.setAttributes( { list_ids: value } );
                                    },
                                    value: props.attributes.list_ids
                                }
                            )
                        )
                    ),

                        /* Style */
                        el( PanelColorSettings, {
                            title: 'Style',
                            colorSettings: [
                                {
                                    colors: colorSamples, // here you can pass custom colors
                                    value: props.rowColor.color,
                                    label: 'Background color',
                                    onChange: props.setRowColor,
                                },
                                {
                                    colors: colorSamples, // here you can pass custom colors
                                    value: props.textColor.color,
                                    label: 'Text color',
                                    onChange: props.setTextColor,
                                },
                                {
                                    colors: colorSamples, // here you can pass custom colors
                                    value: props.buttonColor.color,
                                    label: 'Button color',
                                    onChange: props.setButtonColor,
                                }
                            ]
                        }),

                    el( RangeControl,
                        {
                            label: 'Padding',
                            min: 0,
                            max: 100,
                            onChange: ( value ) => {
                                props.setAttributes( { padding: value } );
                            },
                            value: props.attributes.padding
                        }
                    )

                ),

            el(
                "div",
                {style: {backgroundColor: props.rowColor.color, color: props.textColor.color, padding: props.attributes.padding, textAlign: props.attributes.alignment}},
                el(
                    BlockControls,
                    { key: 'controls' },
                    el(
                        AlignmentToolbar,
                        {
                            value: props.attributes.alignment,
                            onChange: onChangeAlignment
                        }
                    )
                ),
                el(RichText,
                {
                    tagName: 'p',
                    format: 'string',
                    onChange: onChangeContent,
                    value: props.attributes.content,
                    // formattingControls: [ 'bold' ]
                }),
                el('div',
                    {style: {backgroundColor: 'lightGrey', margin: '20px', padding: '5px',
                            fontFamily: '-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif'}},
                    el('svg',
                        {
                            width: 20,
                            height: 20
                        },
                        wp.element.createElement( 'path',
                            {
                                d: "M6 14H4V6h2V4H2v12h4M7.1 17h2.1l3.7-14h-2.1M14 4v2h2v8h-2v2h4V4"
                            }
                        )
                    ),
                    ' Newsletter Form'
                ),
                ))
        }),
        save: function (props) {

            var rowClass = getColorClassName( 'row-color', props.attributes.rowColor );
            var textClass = getColorClassName( 'text-color', props.attributes.textColor );
            var buttonClass = getColorClassName( 'button-color', props.attributes.buttonColor );

            formtype_attr = "";
            if (props.attributes.formtype != "full") {
                formtype_attr = " type=\"minimal\"";
            }

            lists_attr = "";
            if (props.attributes.list_ids) {
                lists_attr = " lists=\"" + props.attributes.list_ids + "\"";
            }

            button_color_attr = "";
            button_color = buttonClass ? undefined : props.attributes.customButtonColor;
            if (button_color) {
                button_color_attr = " button_color=\"" + button_color + "\"";
            }

            var formStyles = {
                backgroundColor: rowClass ? undefined : props.attributes.customRowColor,
                color: textClass ? undefined : props.attributes.customTextColor,
                padding: props.attributes.padding,
                textAlign: props.attributes.alignment
            };

            return (
                el('div', {style: formStyles},
                    el( RichText.Content, {
                        tagName: 'p',
                        value: props.attributes.content
                    }),
                el(
                "div",
                {},
                "[newsletter_form" + formtype_attr + lists_attr + button_color_attr + "]"
            )));
        }
    });

})(
    window.wp.blocks,
    window.wp.blockEditor,
    window.wp.element,
    window.wp.components,
);

Filemanager

Name Type Size Permission Actions
_ Folder 0555
TNP.php File 23.32 KB 0555
addon-admin.php File 21.52 KB 0555
addon.php File 42.58 KB 0555
antibot-subscription.php File 19.66 KB 0555
antibot-unsubscription.php File 17.59 KB 0555
antispam.php File 22.36 KB 0555
classes.php File 27.08 KB 0555
codemirror.php File 16.87 KB 0555
composer-class.php File 48.28 KB 0555
composer.php File 53.34 KB 0555
controls-logs.php File 17.54 KB 0555
controls.php File 107.31 KB 0555
cron.php File 17.63 KB 0555
defaults.php File 25.24 KB 0555
email.html File 2.37 KB 0644
fields.php File 46.66 KB 0555
helper.php File 30.71 KB 0555
logger.php File 19.3 KB 0555
mailer.php File 26.81 KB 0555
module-admin.php File 37.48 KB 0555
module-base.php File 58.43 KB 0555
module.php File 59.46 KB 0555
notification.html File 1.26 KB 0644
paginator.php File 20.22 KB 0555
store.php File 23.71 KB 0555
test-message.html File 8.49 KB 0644
themes.php File 21.94 KB 0555
tnp-blocks.js File 9.41 KB 0644
upgrade.php File 39.06 KB 0555