friendica/friendica — pull request #130 by CatoTH (2012-03-13 21:55:15+00:00)
Title: HTML2BBCode with [EMBED]: Compute in JS instead of PHP

Only line 80-113 in library/tinymce/jscripts/tiny_mce/plugins/bbcode/editor_plugin_src.js are changed; the other lines are white-space-changes done unintentionally.

In _dfrn_html2bbcode:
when converting HTML-code to BBcode, fetching the URL of [EMBED] should be done using JavaScript instead of a ajax-call to a php-script. The convert is done after every single keypress. So, once there actually is embedded Code in the HTML, one ajax-call after every key pressed is made. This is not only bandith intensive - it also makes typing hard / slow. Making a lot of JavaScript-RegExp-Computation isn't exactly great either, but still performs better.