开发者

TinyMCE get node CSS attributes

开发者 https://www.devze.com 2023-04-06 01:16 出处:网络
I am building an app which uses TinyMCE to edit contents in TD blocks. Function tinyMCE.execCommand(...) is binded to many custom buttons, these buttons are not built with TinyMCE ControllManager, the

I am building an app which uses TinyMCE to edit contents in TD blocks. Function tinyMCE.execCommand(...) is binded to many custom buttons, these buttons are not built with TinyMCE ControllManager, they are just some DIVs with onClick event, which sends execCommand to tinyMCE.

When editing content with default TinyMCE buttons, they show the current state of the node. E.g. we click in a bold, italic text of ordered list - we can see button "B"," I" and "OL" are active in the controls. I need to do something similar - get attributes of current node, so I can add some class to my custom buttons.

There is handle_node_change_callback , where I should get these attributes. Does TinyMCE have some built-in function that shows current node properties?

What i expect it to be: node.getAllProperties() returns ['Bold',开发者_如何转开发 'Italic', 'OrderedList']


No, there is no such function in tinymce. I suggest you retrieve a node from the tinymce content and search down the node for subnodes.

0

精彩评论

暂无评论...
验证码 换一张
取 消