SocialShare
10 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
mce-button.js
96 lines
| 1 | jQuery(document).ready(function($){ |
| 2 | 'use strict'; |
| 3 | |
| 4 | /*======================================================================== |
| 5 | * Tutor WP Editor Button |
| 6 | *======================================================================== */ |
| 7 | /** |
| 8 | * editor.getLang translation support added |
| 9 | * |
| 10 | * @since 1.9.7 |
| 11 | */ |
| 12 | tinymce.PluginManager.add('tutor_button', function( editor, url ) { |
| 13 | editor.addButton( 'tutor_button', { |
| 14 | text: editor.getLang('tutor_button.tutor_shortcode'), |
| 15 | icon: false, |
| 16 | type: 'menubutton', |
| 17 | menu: [ |
| 18 | { |
| 19 | text: editor.getLang('tutor_button.student_registration_form'), |
| 20 | onclick: function() { |
| 21 | editor.insertContent('[tutor_student_registration_form]'); |
| 22 | } |
| 23 | }, |
| 24 | { |
| 25 | text: editor.getLang('tutor_button.instructor_registration_form'), |
| 26 | onclick: function() { |
| 27 | editor.insertContent('[tutor_instructor_registration_form]'); |
| 28 | } |
| 29 | }, |
| 30 | { |
| 31 | text: editor.getLang('tutor_button.courses'), |
| 32 | onclick: function() { |
| 33 | editor.windowManager.open( { |
| 34 | title: editor.getLang('tutor_button.courses_shortcode'), |
| 35 | body: [ |
| 36 | { |
| 37 | type: 'textbox', |
| 38 | name: 'id', |
| 39 | label: editor.getLang('tutor_button.courses_separate_by'), |
| 40 | value: '' |
| 41 | },{ |
| 42 | type: 'textbox', |
| 43 | name: 'exclude_ids', |
| 44 | label: editor.getLang('tutor_button.exclude_course_ids'), |
| 45 | value: '' |
| 46 | }, |
| 47 | { |
| 48 | type: 'textbox', |
| 49 | name: 'category', |
| 50 | label: editor.getLang('tutor_button.category_ids'), |
| 51 | value: '' |
| 52 | }, |
| 53 | {type: 'listbox', |
| 54 | name: 'orderby', |
| 55 | label: editor.getLang('tutor_button.order_by'), |
| 56 | onselect: function(e) { |
| 57 | |
| 58 | }, |
| 59 | 'values': [ |
| 60 | {text: 'ID', value: 'ID'}, |
| 61 | {text: 'title', value: 'title'}, |
| 62 | {text: 'rand', value: 'rand'}, |
| 63 | {text: 'date', value: 'date'}, |
| 64 | {text: 'menu_order', value: 'menu_order'}, |
| 65 | {text: 'post__in', value: 'post__in'}, |
| 66 | ] |
| 67 | }, |
| 68 | {type: 'listbox', |
| 69 | name: 'order', |
| 70 | label: editor.getLang('tutor_button.order'), |
| 71 | onselect: function(e) { |
| 72 | |
| 73 | }, |
| 74 | 'values': [ |
| 75 | {text: 'DESC', value: 'DESC'}, |
| 76 | {text: 'ASC', value: 'ASC'} |
| 77 | ] |
| 78 | }, |
| 79 | ,{ |
| 80 | type: 'textbox', |
| 81 | name: 'count', |
| 82 | label: editor.getLang('tutor_button.count'), |
| 83 | value: '6', |
| 84 | } |
| 85 | ], |
| 86 | onsubmit: function( e ) { |
| 87 | editor.insertContent( '[tutor_course id="' + e.data.id + '" exclude_ids="'+e.data.exclude_ids+'" category="'+e.data.category+'" orderby="'+e.data.orderby+'" order="'+e.data.order+'" count="'+e.data.count+'"]'); |
| 88 | } |
| 89 | }); |
| 90 | } |
| 91 | } |
| 92 | ] |
| 93 | }); |
| 94 | }); |
| 95 | }); |
| 96 |