Add button to restore CKEditor remove_plugins to default value

This commit is contained in:
Kijin Sung 2021-01-09 22:40:37 +09:00
parent fac3a9b7a7
commit e3fa780295

View file

@ -207,7 +207,10 @@
<label class="x_control-label" for="font_size">{$lang->guide_remove_plugins}</label> <label class="x_control-label" for="font_size">{$lang->guide_remove_plugins}</label>
<div class="x_controls"> <div class="x_controls">
<input type="text" id="remove_plugins" name="remove_plugins" value="{implode(', ', $editor_config->remove_plugins)}" /> <input type="text" id="remove_plugins" name="remove_plugins" value="{implode(', ', $editor_config->remove_plugins)}" />
<p class="x_help-block">{$lang->about_remove_plugins}</p> <p class="x_help-block">
{$lang->about_remove_plugins}
<a href="#" class="default_remove_plugins" data-default-list="{implode(', ', Editor::$default_editor_config['remove_plugins'])}">{lang('admin.restore_default_viewport')}</a>
</p>
</div> </div>
</div> </div>
<div class="x_control-group"> <div class="x_control-group">
@ -361,6 +364,14 @@
</section> </section>
<script> <script>
jQuery(function($){ jQuery(function($){
// Restore default list of editor plugins to remove
$('.default_remove_plugins').on('click', function(e) {
var default_list = $(this).data('default-list');
$('#remove_plugins').val(default_list);
e.preventDefault();
});
// Editor Preview // Editor Preview
function preview(){ function preview(){
$('._preview iframe').css({ $('._preview iframe').css({