TinyMCE Quattro and its wysiwyg bbcodes

TinyMCE Quattro and its wysiwyg bbcodes 2.7.2

No permission to download
I just ran across a new bug, not sure if it was reported yet.

If you try to paste in text from Word, any lines with a single word are just lost when you paste them in. If I go to the BBEditor it isn't there either. Double spacing is also removed upon pasting.

For example:

This is a test.

Testing, one.

Two.

Three.

Four.

This concludes the test.


I pasted that in from Word. If I do it with the quattro editor, I get:

This is a test.
Testing, one.
This concludes the test.
 
@Isil`Zha
I will ask Spoke (TinyMCE main developer) [done], but if you check the html content of the copied text from Word you will see the structure is using <p> tags to split paragraphs:
Code:
<p class=MsoNormal><span lang=EN-US style='mso-ansi-language:EN-US'>This is the
first paragraph<br>
<span class=GramE>This</span> is a break from the first paragraph<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US style='color:#76923C;mso-themecolor:accent3;
mso-themeshade:191;mso-ansi-language:EN-US'>Now the second paragraph<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US style='mso-ansi-language:EN-US'>The third
goes there; now what about a last one?<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US style='mso-ansi-language:EN-US'>Done<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US style='mso-ansi-language:EN-US'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

With the editor those <p> tags are used to split lines, that why the paragraphs can't be seen.
 

Attachments

  • mce---word---paragraphs.webp
    mce---word---paragraphs.webp
    63.7 KB · Views: 3
Last edited:
@cclaerhout the major issue is it is deleting single word with a fullstop punctuation on a line.

In @Isil`Zha post, the lines:
Code:
Two.
Three.
Four.
end up missing once copied into TinyMCE.

But;
Code:
Two
Three
Four
Does work.
 
Tried to update and received this error:

Fatal error: Call to undefined method XenForo_Model_Smilie::getAllSmilieCategoriesWithSmilies() in /home/forumdof/public_html/library/Sedo/TinyQuattro/Helper/Smilie.php on line 160

I'm on Xenforo 1.2.5.

Edit: nevermind, updated Xenforo to 1.3.4 and seems to be working now.
 
Last edited:
@cclaerhout
If you have a bbcode with multiple accepted definitions (ie; :p :P :-p :-P), it inserts one of each instead instead of just the first one.

This causes inserting bb codes via the picker to insert what might as well be arbitrary number of them.

It's easy to see why; the data provided to TinyMCE has the following, incorrect, alt string:
Code:
<img title="Stick Out Tongue" class="mceQuattroSmilie mceQuattroSmilieSprite mceSmilie7" alt=":p&#10;:P&#10;:-p&#10;:-P" src="styles/default/xenforo/clear.png" data-smilie="yes" data-mce-src="styles/default/xenforo/clear.png">

Note; #10 is \n
 
Last edited:
one thing i will never understand......why is it that if you want to inset an image it has to be a url......why not have the option to upload an image? this is a dealbreaker
 
Tried to update and received this error:

Fatal error: Call to undefined method XenForo_Model_Smilie::getAllSmilieCategoriesWithSmilies() in /home/forumdof/public_html/library/Sedo/TinyQuattro/Helper/Smilie.php on line 160

I'm on Xenforo 1.2.5.

Edit: nevermind, updated Xenforo to 1.3.4 and seems to be working now.
I'm going to install the 1.2.x version to check and fix this. Thanks.
-Fixed- tested on XenForo 1.2.x with and without the Smilie Manager of Milano

@cclaerhout
If you have a bbcode with multiple accepted definitions (ie; :p :P :-p :-P), it inserts one of each instead instead of just the first one.

This causes inserting bb codes via the picker to insert what might as well be arbitrary number of them.

It's easy to see why; the data provided to TinyMCE has the following, incorrect, alt string:
Code:
<img title="Stick Out Tongue" class="mceQuattroSmilie mceQuattroSmilieSprite mceSmilie7" alt=":p&#10;:P&#10;:-p&#10;:-P" src="styles/default/xenforo/clear.png" data-smilie="yes" data-mce-src="styles/default/xenforo/clear.png">

Note; #10 is \n
I will fix this, but on which browser does it break ? I can confirm the "alt" tag has too much information but it still works on Firefox for example.
-Fixed-

one thing i will never understand......why is it that if you want to inset an image it has to be a url......why not have the option to upload an image? this is a dealbreaker
XenForo has its own attachement system which you can use to insert attached images. For people who don't want to use attachements, they can use a direct img url, which is the base of html. Anyway, this addon only follows the way how XenForo works.
 
Last edited:
@Frigeri @Xon
A fixed version has been released on Github (ref).
By the way, a new official version of TinyMCE has been released but hasn't corrected yet the copy/paste (Word To Mce) problem. I will decide what to do this weekend.
 
@Frigeri @Xon
A fixed version has been released on Github (ref).
By the way, a new official version of TinyMCE has been released but hasn't corrected yet the copy/paste (Word To Mce) problem. I will decide what to do this weekend.
Please excuse my ignorance, but it's not clear to me how to download the updated files from Github. Do I have to signin to download the upload folder?
 
@Frigeri @Xon
A fixed version has been released on Github (ref).
By the way, a new official version of TinyMCE has been released but hasn't corrected yet the copy/paste (Word To Mce) problem. I will decide what to do this weekend.
Thanks, I'll get that implemented ASAP

Please excuse my ignorance, but it's not clear to me how to download the updated files from Github. Do I have to signin to download the upload folder?
There is a "Download Zip" button on the right. Here is a direct link; https://github.com/cclaerhout/xen_TinyQuattro/archive/master.zip

Just grab the upload folder out of that.
 
I will fix this, but on which browser does it break ? I can confirm the "alt" tag has too much information but it still works on Firefox for example.
-Fixed-
Chrome and IE exhibit the problem.

Cache building when ticking/unticking visibility of groups appears broken. It doesn't regenerate categorized Smilies.
 
Last edited:
Cache building when ticking/unticking visibility of groups appears broken. It doesn't regenerate categorized Smilies.
"Groups"? What do you mean?
@cclaerhout
Pull request on github to fix the extra categories not being populated. php is being wierd when comparing the SpriteMode param.
Thanks, I've modified the pull and explained you why the sprite mode checks is using this syntax.
 
"Groups"? What do you mean?
I thought Smile Categories (or groups) where bugged. But it was actually the result of the sprite mode check failing for all the non-standard Smilies I have which somehow have contents

Thanks, I've modified the pull and explained you why the sprite mode checks is using this syntax.
Ah.

Your change isn't sufficient to make $spriteCheck work properly, as this is causing the images to fail to render.

Dumping one of the Smilies which has an invisible image;
Code:
var_dump($smilie);
$a = empty($smilie['sprite_mode']);
var_dump($a);
...

array (size=9)
  'smilie_id' => int 47
  'title' => string 'Rolleyes' (length=8)
  'smilie_text' => string ':eyeroll:' (length=9)
  'image_url' => string 'styles/sv_smiles/xenforo/rolleyes.gif' (length=37)
  'sprite_mode' => int 0
  'sprite_params' => string 'a:4:{s:1:"w";i:18;s:1:"h";i:18;s:1:"x";i:0;s:1:"y";i:0;}' (length=56)
  'smilie_category_id' => int 4
  'display_order' => int 10
  'display_in_editor' => int 1
boolean false
 
Last edited:
Top Bottom