资 源 简 介
During my work for Journalizer I created a plugin for TinyMCE. What does it do? Well, it solves a problem, but which one? We have list of TinyMCE-controlled textareas and it is so common that you use the tab-key to jump to the next field that we wanted that as well. Unfortunately, this doesn"t work in TinyMCE.
Why is that? When using TinyMCE, you declare a HTML form element as "managed" by TinyMCE. What it does is substituting the actual HTML element with an iframe that can be edited like rich text. I.e. you can make things bold and italic and all that just with a click on button and you immediately see the results — nice. But because the actual textarea gets replaced by the iframe, common "tabbing" through your form elements no longer works because iframes are no form elements — not so nice.
What the plugin does is intercepting keyboard events for the current iframe. When tab is hit, it looks up the next element to focus and voilà turns over the