]> git.mxchange.org Git - friendica.git/blobdiff - library/tinymce/jscripts/tiny_mce/plugins/bbcode/editor_plugin_src.js
oembed. fix html2bbcode when oembed html contains span and utf8 chars
[friendica.git] / library / tinymce / jscripts / tiny_mce / plugins / bbcode / editor_plugin_src.js
index 789e75c399a5b921cd3ee94d1c25ea221552ff2f..9e680e104c5b4568c026abafca34d259dcdcc5ad 100644 (file)
 
                        /* oembed */
                        function _h2b_cb(match) {
-                               text = bin2hex(match);
                                function s_h2b(data) {
                                                match = data;
-                               }
-                               $.ajax({
-                                       url: 'oembed/h2b?text=' + text,
+                               }\r
+                               $.ajax({\r
+                                       type:"POST",
+                                       url: 'oembed/h2b',\r
+                                       data: {text: match},
                                        async: false,
                                        success: s_h2b,
                                        dataType: 'html'
                                });
                                return match;
                        }
-                       s = s.replace(/<span class=\"oembed(.*?)<\/span>/gi, _h2b_cb);
+                       if (s.indexOf('class="oembed')>=0){\r
+                               //alert("request oembed html2bbcode");\r
+                               s = _h2b_cb(s);\r
+                       }\r
+                       
                        /* /oembed */
 
 \r
 \r
        // Register plugin\r
        tinymce.PluginManager.add('bbcode', tinymce.plugins.BBCodePlugin);\r
-})();
\ No newline at end of file
+})();\r