Skip to main content
Topic: Editor Broken in latest Master? (Read 1465 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Editor Broken in latest Master?

Seems something got broken with the rich text editor in the Master.  Did a pull and smileys and buttons are missing. 

I believe something got messed up when checking the css mod to make quotes work in GenericControls.template.php.    Look at the forth line of the inline script from the post page.  "Unterminated string literal".  Which then leads to $editor_data is not defined.

$editor_data['message'] = $("#message").data("sceditor");
$editor_container['message'] = $(".sceditor-container");
$editor_data['message'].css('code {white-space: pre;}').createPermanentDropDown();
$editor_container['message'].width("100%").height("100%");message'].setTextMode();





Re: Editor Broken in latest Master?

Reply #2
No, it's here in GenericControls.template.php

Code: [Select]
        $editor_container[\'', $editor_id, '\'].width("100%").height("100%");', $editor_context['rich_active'] ? '' : '

        $editor_data[\'', $editor_id, '\'].setTextMode();', '
When rich_active is false it prints $editor_id'].setTextMode(); into the script because only 'the $editor_data[\'' is viewed as the other half of the ? : operation.

You need to make the whole '

        $editor_data[\'', $editor_id, '\'].setTextMode();'

be one operation after the ? : operator.


BTW is there a way to NOT use this editor in elk and get the old one in SMF back?  This editor just seems buggy in general to me.  I've been fighting the thing trying to post this as cut and past into it awful.  It gets totally confused on my linux box with cut and paste.  It lets me middle mouse click to paste sometimes, other times not.  It often doesn't know how to undo after pastes.  When I was trying to fix the code tag problem it would often get get locked into code mode where everytime I hit enter it would open a new code box even though the code icon had been unclicked.

I'm really not sure what this editor is supposed to bring to the table.

Re: Editor Broken in latest Master?

Reply #3
No, it's here in GenericControls.template.php

Code: [Select]
        $editor_container[\'', $editor_id, '\'].width("100%").height("100%");', $editor_context['rich_active'] ? '' : '

        $editor_data[\'', $editor_id, '\'].setTextMode();', '
When rich_active is false it prints $editor_id'].setTextMode(); into the script because only 'the $editor_data[\'' is viewed as the other half of the ? : operation.


You need to make the whole '

        $editor_data[\'', $editor_id, '\'].setTextMode();'

be one operation after the ? : operator.
Ohhh... I see! My fault as usual... :-[
Fixed here:
https://github.com/emanuele45/Dialogo/commit/0b8a2f434938f931520cb0010bf0b819e3f3cf18


BTW is there a way to NOT use this editor in elk and get the old one in SMF back?  This editor just seems buggy in general to me.  I've been fighting the thing trying to post this as cut and past into it awful.  It gets totally confused on my linux box with cut and paste.  It lets me middle mouse click to paste sometimes, other times not.  It often doesn't know how to undo after pastes.  When I was trying to fix the code tag problem it would often get get locked into code mode where everytime I hit enter it would open a new code box even though the code icon had been unclicked.

I'm really not sure what this editor is supposed to bring to the table.
Well, I still have to find a perfectly working WYSIWYG editor, even those relying on HTML alone are far from perfect.
That said, this is not perfect, true, but as far as I've seen (I don't use WYSIWYG that much) is much less buggy than the old SMF one.

If you want to use the old one I'm afraid you'd have to write an addon/mod to "bring it back" (and it would require some efforts because the two have a quite different behaviour in general), the code is long gone (since "early" SMF 2.1) without almost any trace.
If you have any other idea about alternative editors I'm open to suggestions. ;D
Bugs creator.
Features destroyer.
Template killer.

Re: Editor Broken in latest Master?

Reply #4
The annoyance was probably because it in wysiwyg mode to test if the buttons appeared.  It was just really annoying me as it kept breaking what I wrote.  I always use text mode.  Never have even tried the old editor in SMF in wysiwyg mode.  As bad as they are I'm not really sure who uses that mode.