protected function _enqueue_javascript() { wp_enqueue_script('underscore'); wp_enqueue_script('jquery-ui-sortable'); wp_enqueue_script('jquery-effects-highlight'); Script::enqueue_admin_inline_script('wpkit-meta-box-related-posts', $this->_render_javascript()); parent::_enqueue_javascript(); }
protected function _enqueue_javascript() { wp_enqueue_script('jquery-effects-highlight'); parent::_enqueue_javascript(); add_action('admin_print_footer_scripts', function () { echo "<script>\n\t\t\t\t\tjQuery(function (\$) {\n\t\t\t\t\t\t'use strict';\n\t\t\t\t\t\tvar get_editor_settings=function(id){\n\t\t\t\t\t\t var settings={};\n\t\t\t\t\t\t if(typeof tinymce != 'undefined'){\n\t\t\t\t\t\t var main_id=id.substring(0,(id.length-1))+'0';\n\t\t\t\t\t\t var main_editor=tinyMCE.get(main_id);\n\n\t\t\t\t\t\t if(main_editor){\n\t\t\t\t\t\t settings=main_editor.settings;\n\t\t\t\t\t\t settings.selector='#'+id;\n\t\t\t\t\t\t settings.id=id;\n\t\t\t\t\t\t }\n\t\t\t\t\t\t return settings;\n\t\t\t\t\t\t }\n\t\t\t\t\t\t return {};\n\t\t\t\t\t\t};\n\t\t\t\t\t\tvar reInitEditor = function (id) {\n\t\t\t\t\t\t if(typeof tinymce != 'undefined' && typeof id !== 'undefined'){\n\t\t\t\t\t\t var settings = get_editor_settings(id);\n\t\t\t\t\t\t\t tinymce.EditorManager.execCommand('mceRemoveEditor', true, id);\n tinyMCE.init(settings);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t};\n\t\t\t\t\t\t\$(document).on('repeatable_row_added', function (e,el) {\n\t\t\t\t\t\t\treInitEditor(\$(el).find('.wp-editor-area').attr('id'));\n\t\t\t\t\t\t\tif(typeof wp.wpkit != 'undefined'){\n\t\t\t\t\t\t\t if(typeof wp.wpkit.datepicker != 'undefined'){\n wp.wpkit.datepicker.reinit();\n\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\t\t\t\t\t\tjQuery('#{$this->get_key()}').on('sortstop', function (event, ui) {\n\t\t\t\t\t\t\tui.item.find('.wp-editor-area').each(function () {\n\t\t\t\t\t\t\t\treInitEditor(\$(this).attr('id'));\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t});\n\t\t\t\t\t});\n\t\t\t\t</script>"; }); }
protected function _enqueue_javascript() { wp_enqueue_script('jquery-effects-highlight'); parent::_enqueue_javascript(); }