Changeset 2740858
- Timestamp:
- 06/11/2022 02:46:04 PM (4 years ago)
- Location:
- vab-forms-with-chart
- Files:
-
- 5 edited
-
assets/screenshot-7.jpg (modified) (previous)
-
tags/1.1.9/includes/controller.php (modified) (2 diffs)
-
tags/1.1.9/includes/js/admin/vabfwc-add-gutenberg.js (modified) (7 diffs)
-
trunk/includes/controller.php (modified) (2 diffs)
-
trunk/includes/js/admin/vabfwc-add-gutenberg.js (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
vab-forms-with-chart/tags/1.1.9/includes/controller.php
r2738778 r2740858 105 105 wp_localize_script('vabfwc-add-gutenberg', 'vabfwc_local', 106 106 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' ), 121 120 ) 122 121 ); … … 153 152 'slug' => 'vabfwc_category', 154 153 'title' => esc_html__( 'Forms with chart from VAB', 'VABFWC' ), 155 'icon' => 'wordpress',154 // 'icon' => 'wordpress', 156 155 ), 157 156 ), -
vab-forms-with-chart/tags/1.1.9/includes/js/admin/vabfwc-add-gutenberg.js
r2739420 r2740858 1 1 jQuery(function($){ 2 2 "use strict"; 3 //array name form 4 var arrayName = [ vabfwc_local.selectformname ], 5 arrayTag=['','h1','h2','h3','h4','h5','h6','div','p','center']; 3 var 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 ); 6 14 $('#vabfwc_name_form').find('label span').each(function(){ 7 15 let idForm = $(this).closest('label').prev('input').attr('data-id'), … … 26 34 return idForm; 27 35 } 28 //custom block in gutenberg29 36 ( function( blocks, element ) { 30 37 const el = element.createElement; … … 32 39 registerBlockType( 'vabfwc-form/custom-block', { 33 40 title: 'Forms with chart from VAB', 34 icon:{background:'#fff',foreground:'#0374A0',src:'wordpress',},//schedule wordpress 41 icon: vabfwcPhoto, 35 42 category:'vabfwc_category', 36 43 keywords: [ 'email', 'subscribe', 'misha' ], … … 63 70 el( 'div', { className: 'swap-select-vabfwc-form' }, 64 71 el( 'select', { className: 'select-add-vabfwc-form', 'value':props.attributes.nameform, onChange: function(value) { props.setAttributes({ nameform: event.target.value }) }, }, 65 //array name form66 72 arrayName.map(function( valueThis ) { 67 73 let optionText = valueThis; … … 130 136 registerBlockType( 'vabfwc-chart/custom-block', { 131 137 title: vabfwc_local.chartsshort, 132 icon:{background:'#fff',foreground:'#0374A0',src:'wordpress',},138 icon: vabfwcPhoto, 133 139 category:'vabfwc_category', 134 140 keywords: [ 'email', 'subscribe', 'misha' ], … … 187 193 ), 188 194 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 ), 190 196 el( 'div', { className: 'swap-select-vabfwc-form' }, 191 197 el( 'select', { className: 'select-add-vabfwc-form', 'value':props.attributes.form_tag, onChange: function(value) { props.setAttributes({ form_tag: event.target.value }) }, }, … … 241 247 window.wp.element 242 248 ); 249 wp.blocks.updateCategory( 'vabfwc_category', { icon: vabfwcPhoto } ); 243 250 }); -
vab-forms-with-chart/trunk/includes/controller.php
r2738778 r2740858 105 105 wp_localize_script('vabfwc-add-gutenberg', 'vabfwc_local', 106 106 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' ), 121 120 ) 122 121 ); … … 153 152 'slug' => 'vabfwc_category', 154 153 'title' => esc_html__( 'Forms with chart from VAB', 'VABFWC' ), 155 'icon' => 'wordpress',154 // 'icon' => 'wordpress', 156 155 ), 157 156 ), -
vab-forms-with-chart/trunk/includes/js/admin/vabfwc-add-gutenberg.js
r2739420 r2740858 1 1 jQuery(function($){ 2 2 "use strict"; 3 //array name form 4 var arrayName = [ vabfwc_local.selectformname ], 5 arrayTag=['','h1','h2','h3','h4','h5','h6','div','p','center']; 3 var 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 ); 6 14 $('#vabfwc_name_form').find('label span').each(function(){ 7 15 let idForm = $(this).closest('label').prev('input').attr('data-id'), … … 26 34 return idForm; 27 35 } 28 //custom block in gutenberg29 36 ( function( blocks, element ) { 30 37 const el = element.createElement; … … 32 39 registerBlockType( 'vabfwc-form/custom-block', { 33 40 title: 'Forms with chart from VAB', 34 icon:{background:'#fff',foreground:'#0374A0',src:'wordpress',},//schedule wordpress 41 icon: vabfwcPhoto, 35 42 category:'vabfwc_category', 36 43 keywords: [ 'email', 'subscribe', 'misha' ], … … 63 70 el( 'div', { className: 'swap-select-vabfwc-form' }, 64 71 el( 'select', { className: 'select-add-vabfwc-form', 'value':props.attributes.nameform, onChange: function(value) { props.setAttributes({ nameform: event.target.value }) }, }, 65 //array name form66 72 arrayName.map(function( valueThis ) { 67 73 let optionText = valueThis; … … 130 136 registerBlockType( 'vabfwc-chart/custom-block', { 131 137 title: vabfwc_local.chartsshort, 132 icon:{background:'#fff',foreground:'#0374A0',src:'wordpress',},138 icon: vabfwcPhoto, 133 139 category:'vabfwc_category', 134 140 keywords: [ 'email', 'subscribe', 'misha' ], … … 187 193 ), 188 194 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 ), 190 196 el( 'div', { className: 'swap-select-vabfwc-form' }, 191 197 el( 'select', { className: 'select-add-vabfwc-form', 'value':props.attributes.form_tag, onChange: function(value) { props.setAttributes({ form_tag: event.target.value }) }, }, … … 241 247 window.wp.element 242 248 ); 249 wp.blocks.updateCategory( 'vabfwc_category', { icon: vabfwcPhoto } ); 243 250 });
Note: See TracChangeset
for help on using the changeset viewer.