stef775 wrote:Well, I answered your mail december 30 but still didn't get an answer.
Yes I did: viewtopic.php?p=125135#p125135
Anyway, as of now, the editor is integrated fully and all is working properly. All the bugs that I have found (and others have found) are fixed. I haven't run into any more lately, so I think it's OK.
The whole thing about paragraphs (<p> tags) is rather complicated. In certain cases, I strip the <p> out and convert </p> to a <br /> (like for code and quote BBCodes).
When pasting text from another source (like a text editor), newlines (\n) are converted to <br />.
Paragraphs that the EDITOR itself produces are kept, since a line like this:
<p>This is a test</p>
...is functionally equal to...
This is a test<br />
Now, the editor works with DOM elements. A string with a <br /> at the end is not an element. However, <p>string</p> is, so those need to be left alone.
If you can picture a flow diagram, data flows between the editor and the user. THIS data is all in element form (usually <p> paragraphs). However, data that flows between the editor and PHPBB is plain text (that is, string<br />).
It took a lot of experimentation and study of the source code of TinyMCE to understand what's going on under the hood and get it to play properly with PHPBB. I can imagine that a less stubborn person would have given up long ago (and maybe that's why PHPBB doesn't have a WYSIWYG editor out of the box).
I don't know if you know yet, but I have the user defined BBCodes also integrated in the editor. If an admin creates a BBCode, it appears in a dynamically generated drop down selector. Originally, I had all the BBCodes in the drop down (like bold, italic, code, quote, etc...) but I thought "why duplicate functions that the editor itself does better (like bold, etc..)?".
So, I took them all out. Only code and quote remain (as separate buttons) and if the admin writes new BBCodes, they appear in the toolbar automatically.
Here's a screenshot:
Notice the smiley panel to the right. It's not needed, since there's a smiley dropdown in the toolbar with all the "display on posting page" smileys visible and a selection called "More..." to access the rest (via the popup).
You should try it out now and see what you think. If you like it I'll give you all the latest code.