简体   繁体   中英

CKEditor: how to change editor behaviour without changing it's source code?

I mean next thing: I want to add some specific class to table when it's creating in editor area (iframe) for default styling reasons. I now how to do this with changing it's source code of plugin table , but it is bad decision to change that files... And it is impossible to do through configs. Maybe there is some way to redefine table behaviour on the fly...

What will be the best solution in this case?

Thanks in advance!

I think changing the source code for "styling reasons" is a bad idea.

You can easily change the default CSS by changing the default skin (v2 skin I think) or by adding a custom skin to CKEditor.

Documentation

Developers Guide

You can write a plugin to modify the behavior of the table dialog or any other one on the fly. How far you can go with this approach depends on your abilities and which changes do you want. If it becomes too complex to adjust this way then the second approach is to copy the original plugin that you want to modify and create your own version based on that (but outside the CKEditor source folder)

This plugin for example adds a field in the Table and Cell dialogs to pick a background image: http://cksource.com/forums/viewtopic.php?f=18&t=23607

You can learn how to write your plugins by following the CKEditor tutorials .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM