SocialShare
11 months ago
countdown
1 year ago
plyr
1 year ago
select2
1 year ago
tinymce
1 year ago
Chart.bundle.min.js
1 year ago
gutenberg_blocks.js
1 year ago
mce-button.js
1 year ago
gutenberg_blocks.js
67 lines
| 1 | var el = wp.element.createElement, |
| 2 | registerBlockType = wp.blocks.registerBlockType, |
| 3 | withSelect = wp.data.withSelect; |
| 4 | |
| 5 | /** |
| 6 | * Block for student registration |
| 7 | * |
| 8 | */ |
| 9 | registerBlockType('tutor-gutenberg/student-registration', { |
| 10 | title: 'Student Registration', |
| 11 | icon: 'welcome-learn-more', |
| 12 | category: 'tutor', |
| 13 | edit: function (props) { |
| 14 | var dataHtml; |
| 15 | jQuery.ajax({ |
| 16 | url: ajaxurl, |
| 17 | type: 'POST', |
| 18 | async: false, |
| 19 | data: { shortcode: 'tutor_student_registration_form', action: 'render_block_tutor' }, |
| 20 | success: function (response) { |
| 21 | dataHtml = response.data; |
| 22 | }, |
| 23 | }); |
| 24 | |
| 25 | return el('div', { |
| 26 | dangerouslySetInnerHTML: { |
| 27 | __html: dataHtml |
| 28 | } |
| 29 | }) |
| 30 | }, |
| 31 | |
| 32 | save: function () { |
| 33 | return null; |
| 34 | //return el( 'div', { }, '[tutor_student_registration_form]' ); |
| 35 | }, |
| 36 | }); |
| 37 | |
| 38 | /** |
| 39 | * Block for instructor registration |
| 40 | * |
| 41 | */ |
| 42 | registerBlockType('tutor-gutenberg/instructor-registration', { |
| 43 | title: 'Instructor Registration', |
| 44 | icon: 'welcome-learn-more', |
| 45 | category: 'tutor', |
| 46 | edit: function (props) { |
| 47 | var dataHtml; |
| 48 | jQuery.ajax({ |
| 49 | url: ajaxurl, |
| 50 | type: 'POST', |
| 51 | async: false, |
| 52 | data: { shortcode: 'tutor_instructor_registration_form', action: 'render_block_tutor' }, |
| 53 | success: function (response) { |
| 54 | dataHtml = response.data; |
| 55 | }, |
| 56 | }); |
| 57 | return el('div', { |
| 58 | dangerouslySetInnerHTML: { |
| 59 | __html: dataHtml |
| 60 | } |
| 61 | }) |
| 62 | }, |
| 63 | save: function () { |
| 64 | return null; |
| 65 | }, |
| 66 | }); |
| 67 |