Plugin Directory

Changeset 2740858


Ignore:
Timestamp:
06/11/2022 02:46:04 PM (4 years ago)
Author:
vabtopic
Message:

add SVG icon

Location:
vab-forms-with-chart
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • vab-forms-with-chart/tags/1.1.9/includes/controller.php

    r2738778 r2740858  
    105105    wp_localize_script('vabfwc-add-gutenberg', 'vabfwc_local',
    106106        array(
    107             'selectformname' => esc_html__( 'Form name', 'VABFWC' ),
    108             'emptyformname' => esc_html__( 'is empty', 'VABFWC' ),
    109             'textforid' => esc_html__( 'Specify an ID for the form', 'VABFWC' ),
    110             'textforclass' => esc_html__( 'Specify an class for the form', 'VABFWC' ),
    111             'selectform' => esc_html__( 'Select form', 'VABFWC' ),
    112             'idtoform' => esc_html__( 'Id to a form', 'VABFWC' ),
    113             'classtoform' => esc_html__( 'Сlass to a form', 'VABFWC' ),
    114             'formtag' => esc_html__( 'Tag for the title', 'VABFWC' ),
    115             'formtitle' => esc_html__( 'Title to the chart', 'VABFWC' ),
    116             'chartsshort' => esc_html__( 'Display form charts', 'VABFWC' ),
    117             'textfortitle' => esc_html__( 'Specify an title for the chart', 'VABFWC' ),
    118             'texttagfortitle' => esc_html__( 'Choose a tag for the title', 'VABFWC' ),
    119             'classtotag' => esc_html__( 'Сlass for the tag in title', 'VABFWC' ),
    120             'textclassfortag' => esc_html__( 'Specify an class for the tag', 'VABFWC' ),
     107            'selectformname'        => esc_html__( 'Form name', 'VABFWC' ),
     108            'emptyformname'         => esc_html__( 'is empty', 'VABFWC' ),
     109            'textforid'                 => esc_html__( 'Specify an ID for the form', 'VABFWC' ),
     110            'textforclass'          => esc_html__( 'Specify an class for the form', 'VABFWC' ),
     111            'selectform'                => esc_html__( 'Select form', 'VABFWC' ),
     112            'idtoform'                  => esc_html__( 'Id to a form', 'VABFWC' ),
     113            'classtoform'               => esc_html__( 'Сlass to a form', 'VABFWC' ),
     114            'formtag'                       => esc_html__( 'Choose a tag for the title', 'VABFWC' ),
     115            'formtitle'                 => esc_html__( 'Title to the chart', 'VABFWC' ),
     116            'chartsshort'               => esc_html__( 'Display form charts', 'VABFWC' ),
     117            'textfortitle'          => esc_html__( 'Specify an title for the chart', 'VABFWC' ),
     118            'classtotag'                => esc_html__( 'Сlass for the tag in title', 'VABFWC' ),
     119            'textclassfortag'       => esc_html__( 'Specify an class for the tag', 'VABFWC' ),
    121120        )
    122121    );
     
    153152                    'slug'  =>  'vabfwc_category',
    154153                    'title' =>  esc_html__( 'Forms with chart from VAB', 'VABFWC' ),
    155                     'icon'  =>  'wordpress',
     154                    // 'icon'   =>  'wordpress',
    156155                ),
    157156            ),
  • vab-forms-with-chart/tags/1.1.9/includes/js/admin/vabfwc-add-gutenberg.js

    r2739420 r2740858  
    11jQuery(function($){
    22"use strict";
    3 //array name form
    4 var arrayName = [ vabfwc_local.selectformname ],
    5         arrayTag=['','h1','h2','h3','h4','h5','h6','div','p','center'];
     3var arrayName       = [ vabfwc_local.selectformname ],
     4        arrayTag        = ['','h1','h2','h3','h4','h5','h6','div','p','center'],
     5        vabfwcPhoto = wp.element.createElement('svg',
     6                                        { role:'img', width:"24.000000pt", height:"24.000000pt", viewBox:"0 0 24.000000 24.000000" },
     7                                        wp.element.createElement( 'g',
     8                                            { transform:'translate(0.000000,24.000000) scale(0.100000,-0.100000)', fill:'#008B8B', stroke:'none' },
     9                                            wp.element.createElement( 'path',
     10                                                { d: 'M102 212 c-12 -2 -34 -14 -48 -27 -20 -19 -24 -31 -22 -64 1 -25 9 -48 20 -58 10 -9 18 -13 18 -10 0 4 9 -2 20 -13 16 -16 24 -18 50 -9 28 10 43 39 20 39 -10 0 -9 35 2 46 14 13 -6 34 -33 34 -33 0 -38 19 -10 37 22 14 33 5 46 -36 6 -18 9 -21 16 -10 6 9 7 1 4 -23 -3 -29 0 -38 10 -38 23 0 20 83 -2 102 -26 21 -65 34 -91 30z m23 -102 c3 -5 1 -10 -4 -10 -6 0 -11 5 -11 10 0 6 2 10 4 10 3 0 8 -4 11 -10z' }
     11                                            )
     12                                        )
     13                                    );
    614$('#vabfwc_name_form').find('label span').each(function(){
    715    let idForm = $(this).closest('label').prev('input').attr('data-id'),
     
    2634    return idForm;
    2735}
    28 //custom block in gutenberg
    2936( function( blocks, element ) {
    3037    const el = element.createElement;
     
    3239    registerBlockType( 'vabfwc-form/custom-block', {
    3340        title: 'Forms with chart from VAB',
    34         icon:{background:'#fff',foreground:'#0374A0',src:'wordpress',},//schedule wordpress
     41                icon: vabfwcPhoto,
    3542                category:'vabfwc_category',
    3643        keywords: [ 'email', 'subscribe', 'misha' ],
     
    6370                                                el( 'div', { className: 'swap-select-vabfwc-form' },
    6471                                                    el( 'select', {  className: 'select-add-vabfwc-form', 'value':props.attributes.nameform,  onChange: function(value) { props.setAttributes({ nameform: event.target.value }) }, },
    65                                                         //array name form
    6672                                                        arrayName.map(function( valueThis ) {
    6773                                                            let optionText = valueThis;
     
    130136    registerBlockType( 'vabfwc-chart/custom-block', {
    131137        title: vabfwc_local.chartsshort,
    132         icon:{background:'#fff',foreground:'#0374A0',src:'wordpress',},
     138                icon: vabfwcPhoto,
    133139                category:'vabfwc_category',
    134140        keywords: [ 'email', 'subscribe', 'misha' ],
     
    187193                                            ),
    188194                                            el( 'div', { className: 'block-add-vabfwc-form button-text-vabfwc-form' },
    189                                                 el( 'div', { className: 'text-add-vabfwc-form' }, vabfwc_local.formtag + ' ( ' + vabfwc_local.texttagfortitle + ' ) ' ),
     195                                                el( 'div', { className: 'text-add-vabfwc-form' }, vabfwc_local.formtag ),
    190196                                                el( 'div', { className: 'swap-select-vabfwc-form' },
    191197                                                    el( 'select', {  className: 'select-add-vabfwc-form', 'value':props.attributes.form_tag,  onChange: function(value) { props.setAttributes({ form_tag: event.target.value }) }, },
     
    241247    window.wp.element
    242248);
     249wp.blocks.updateCategory( 'vabfwc_category', { icon: vabfwcPhoto } );
    243250});
  • vab-forms-with-chart/trunk/includes/controller.php

    r2738778 r2740858  
    105105    wp_localize_script('vabfwc-add-gutenberg', 'vabfwc_local',
    106106        array(
    107             'selectformname' => esc_html__( 'Form name', 'VABFWC' ),
    108             'emptyformname' => esc_html__( 'is empty', 'VABFWC' ),
    109             'textforid' => esc_html__( 'Specify an ID for the form', 'VABFWC' ),
    110             'textforclass' => esc_html__( 'Specify an class for the form', 'VABFWC' ),
    111             'selectform' => esc_html__( 'Select form', 'VABFWC' ),
    112             'idtoform' => esc_html__( 'Id to a form', 'VABFWC' ),
    113             'classtoform' => esc_html__( 'Сlass to a form', 'VABFWC' ),
    114             'formtag' => esc_html__( 'Tag for the title', 'VABFWC' ),
    115             'formtitle' => esc_html__( 'Title to the chart', 'VABFWC' ),
    116             'chartsshort' => esc_html__( 'Display form charts', 'VABFWC' ),
    117             'textfortitle' => esc_html__( 'Specify an title for the chart', 'VABFWC' ),
    118             'texttagfortitle' => esc_html__( 'Choose a tag for the title', 'VABFWC' ),
    119             'classtotag' => esc_html__( 'Сlass for the tag in title', 'VABFWC' ),
    120             'textclassfortag' => esc_html__( 'Specify an class for the tag', 'VABFWC' ),
     107            'selectformname'        => esc_html__( 'Form name', 'VABFWC' ),
     108            'emptyformname'         => esc_html__( 'is empty', 'VABFWC' ),
     109            'textforid'                 => esc_html__( 'Specify an ID for the form', 'VABFWC' ),
     110            'textforclass'          => esc_html__( 'Specify an class for the form', 'VABFWC' ),
     111            'selectform'                => esc_html__( 'Select form', 'VABFWC' ),
     112            'idtoform'                  => esc_html__( 'Id to a form', 'VABFWC' ),
     113            'classtoform'               => esc_html__( 'Сlass to a form', 'VABFWC' ),
     114            'formtag'                       => esc_html__( 'Choose a tag for the title', 'VABFWC' ),
     115            'formtitle'                 => esc_html__( 'Title to the chart', 'VABFWC' ),
     116            'chartsshort'               => esc_html__( 'Display form charts', 'VABFWC' ),
     117            'textfortitle'          => esc_html__( 'Specify an title for the chart', 'VABFWC' ),
     118            'classtotag'                => esc_html__( 'Сlass for the tag in title', 'VABFWC' ),
     119            'textclassfortag'       => esc_html__( 'Specify an class for the tag', 'VABFWC' ),
    121120        )
    122121    );
     
    153152                    'slug'  =>  'vabfwc_category',
    154153                    'title' =>  esc_html__( 'Forms with chart from VAB', 'VABFWC' ),
    155                     'icon'  =>  'wordpress',
     154                    // 'icon'   =>  'wordpress',
    156155                ),
    157156            ),
  • vab-forms-with-chart/trunk/includes/js/admin/vabfwc-add-gutenberg.js

    r2739420 r2740858  
    11jQuery(function($){
    22"use strict";
    3 //array name form
    4 var arrayName = [ vabfwc_local.selectformname ],
    5         arrayTag=['','h1','h2','h3','h4','h5','h6','div','p','center'];
     3var arrayName       = [ vabfwc_local.selectformname ],
     4        arrayTag        = ['','h1','h2','h3','h4','h5','h6','div','p','center'],
     5        vabfwcPhoto = wp.element.createElement('svg',
     6                                        { role:'img', width:"24.000000pt", height:"24.000000pt", viewBox:"0 0 24.000000 24.000000" },
     7                                        wp.element.createElement( 'g',
     8                                            { transform:'translate(0.000000,24.000000) scale(0.100000,-0.100000)', fill:'#008B8B', stroke:'none' },
     9                                            wp.element.createElement( 'path',
     10                                                { d: 'M102 212 c-12 -2 -34 -14 -48 -27 -20 -19 -24 -31 -22 -64 1 -25 9 -48 20 -58 10 -9 18 -13 18 -10 0 4 9 -2 20 -13 16 -16 24 -18 50 -9 28 10 43 39 20 39 -10 0 -9 35 2 46 14 13 -6 34 -33 34 -33 0 -38 19 -10 37 22 14 33 5 46 -36 6 -18 9 -21 16 -10 6 9 7 1 4 -23 -3 -29 0 -38 10 -38 23 0 20 83 -2 102 -26 21 -65 34 -91 30z m23 -102 c3 -5 1 -10 -4 -10 -6 0 -11 5 -11 10 0 6 2 10 4 10 3 0 8 -4 11 -10z' }
     11                                            )
     12                                        )
     13                                    );
    614$('#vabfwc_name_form').find('label span').each(function(){
    715    let idForm = $(this).closest('label').prev('input').attr('data-id'),
     
    2634    return idForm;
    2735}
    28 //custom block in gutenberg
    2936( function( blocks, element ) {
    3037    const el = element.createElement;
     
    3239    registerBlockType( 'vabfwc-form/custom-block', {
    3340        title: 'Forms with chart from VAB',
    34         icon:{background:'#fff',foreground:'#0374A0',src:'wordpress',},//schedule wordpress
     41                icon: vabfwcPhoto,
    3542                category:'vabfwc_category',
    3643        keywords: [ 'email', 'subscribe', 'misha' ],
     
    6370                                                el( 'div', { className: 'swap-select-vabfwc-form' },
    6471                                                    el( 'select', {  className: 'select-add-vabfwc-form', 'value':props.attributes.nameform,  onChange: function(value) { props.setAttributes({ nameform: event.target.value }) }, },
    65                                                         //array name form
    6672                                                        arrayName.map(function( valueThis ) {
    6773                                                            let optionText = valueThis;
     
    130136    registerBlockType( 'vabfwc-chart/custom-block', {
    131137        title: vabfwc_local.chartsshort,
    132         icon:{background:'#fff',foreground:'#0374A0',src:'wordpress',},
     138                icon: vabfwcPhoto,
    133139                category:'vabfwc_category',
    134140        keywords: [ 'email', 'subscribe', 'misha' ],
     
    187193                                            ),
    188194                                            el( 'div', { className: 'block-add-vabfwc-form button-text-vabfwc-form' },
    189                                                 el( 'div', { className: 'text-add-vabfwc-form' }, vabfwc_local.formtag + ' ( ' + vabfwc_local.texttagfortitle + ' ) ' ),
     195                                                el( 'div', { className: 'text-add-vabfwc-form' }, vabfwc_local.formtag ),
    190196                                                el( 'div', { className: 'swap-select-vabfwc-form' },
    191197                                                    el( 'select', {  className: 'select-add-vabfwc-form', 'value':props.attributes.form_tag,  onChange: function(value) { props.setAttributes({ form_tag: event.target.value }) }, },
     
    241247    window.wp.element
    242248);
     249wp.blocks.updateCategory( 'vabfwc_category', { icon: vabfwcPhoto } );
    243250});
Note: See TracChangeset for help on using the changeset viewer.