Chart.bundle.min.js
7 years ago
gutenberg_blocks.js
7 years ago
mce-button.js
7 years ago
tutor-admin.js
7 years ago
tutor-front.js
7 years ago
gutenberg_blocks.js
99 lines
| 1 | var el = wp.element.createElement, |
| 2 | registerBlockType = wp.blocks.registerBlockType, |
| 3 | withSelect = wp.data.withSelect; |
| 4 | |
| 5 | |
| 6 | |
| 7 | |
| 8 | /** |
| 9 | * Block for student registration |
| 10 | * |
| 11 | */ |
| 12 | |
| 13 | |
| 14 | registerBlockType( 'tutor-gutenberg/student-registration', { |
| 15 | title: 'Student Registration', |
| 16 | icon: 'welcome-learn-more', |
| 17 | category: 'tutor', |
| 18 | edit: function( props ) { |
| 19 | var dataHtml; |
| 20 | jQuery.ajax({ |
| 21 | url : ajaxurl, |
| 22 | type : 'POST', |
| 23 | async: false, |
| 24 | data : {shortcode: 'tutor_student_registration_form', action : 'render_block_tutor'}, |
| 25 | success: function (response) { |
| 26 | dataHtml = response.data; |
| 27 | }, |
| 28 | }); |
| 29 | |
| 30 | return el('div', { |
| 31 | dangerouslySetInnerHTML: { |
| 32 | __html: dataHtml |
| 33 | } |
| 34 | }) |
| 35 | }, |
| 36 | |
| 37 | save: function() { |
| 38 | return null; |
| 39 | //return el( 'div', { }, '[tutor_student_registration_form]' ); |
| 40 | }, |
| 41 | } ); |
| 42 | |
| 43 | /* |
| 44 | registerBlockType( 'tutor-gutenberg/student-dashboard', { |
| 45 | title: 'Tutor Student Dashboard', |
| 46 | icon: 'welcome-learn-more', |
| 47 | category: 'tutor', |
| 48 | edit: function( props ) { |
| 49 | var dataHtml; |
| 50 | jQuery.ajax({ |
| 51 | url : ajaxurl, |
| 52 | type : 'POST', |
| 53 | async: false, |
| 54 | data : {shortcode: 'tutor_dashboard', action : 'render_block_tutor'}, |
| 55 | success: function (response) { |
| 56 | dataHtml = response.data; |
| 57 | }, |
| 58 | }); |
| 59 | return el('div', { |
| 60 | dangerouslySetInnerHTML: { |
| 61 | __html: dataHtml |
| 62 | } |
| 63 | }) |
| 64 | }, |
| 65 | save: function() { |
| 66 | return null; |
| 67 | }, |
| 68 | } ); |
| 69 | */ |
| 70 | |
| 71 | |
| 72 | //tutor_instructor_registration_form |
| 73 | |
| 74 | registerBlockType( 'tutor-gutenberg/instructor-registration', { |
| 75 | title: 'Instructor Registration', |
| 76 | icon: 'welcome-learn-more', |
| 77 | category: 'tutor', |
| 78 | edit: function( props ) { |
| 79 | var dataHtml; |
| 80 | jQuery.ajax({ |
| 81 | url : ajaxurl, |
| 82 | type : 'POST', |
| 83 | async: false, |
| 84 | data : {shortcode: 'tutor_instructor_registration_form', action : 'render_block_tutor'}, |
| 85 | success: function (response) { |
| 86 | dataHtml = response.data; |
| 87 | }, |
| 88 | }); |
| 89 | return el('div', { |
| 90 | dangerouslySetInnerHTML: { |
| 91 | __html: dataHtml |
| 92 | } |
| 93 | }) |
| 94 | }, |
| 95 | save: function() { |
| 96 | return null; |
| 97 | }, |
| 98 | } ); |
| 99 |