diff options
author | Friendika <info@friendika.com> | 2011-05-23 18:18:01 -0700 |
---|---|---|
committer | Friendika <info@friendika.com> | 2011-05-23 18:18:01 -0700 |
commit | 19ccd658ebcf13a7cc208a3e460e44d152dda32f (patch) | |
tree | a6cfc22e4e40fe00ef5aac27023ccbfa8789958a /tinymce | |
parent | 78b2db3a9840f551c951bf0a58a54cce08133bcf (diff) | |
parent | cde888f7f87449d4f5a281b8a23abcf3234ce9b9 (diff) | |
download | volse-hubzilla-19ccd658ebcf13a7cc208a3e460e44d152dda32f.tar.gz volse-hubzilla-19ccd658ebcf13a7cc208a3e460e44d152dda32f.tar.bz2 volse-hubzilla-19ccd658ebcf13a7cc208a3e460e44d152dda32f.zip |
Merge branch 'pull'
Diffstat (limited to 'tinymce')
-rw-r--r-- | tinymce/jscripts/tiny_mce/plugins/bbcode/editor_plugin_src.js | 43 |
1 files changed, 41 insertions, 2 deletions
diff --git a/tinymce/jscripts/tiny_mce/plugins/bbcode/editor_plugin_src.js b/tinymce/jscripts/tiny_mce/plugins/bbcode/editor_plugin_src.js index aad83280d..db676cd90 100644 --- a/tinymce/jscripts/tiny_mce/plugins/bbcode/editor_plugin_src.js +++ b/tinymce/jscripts/tiny_mce/plugins/bbcode/editor_plugin_src.js @@ -47,6 +47,27 @@ function rep(re, str) {
s = s.replace(re, str);
};
+ + + + + /* oembed */ + function _h2b_cb(match) { + text = bin2hex(match); + function s_h2b(data) { + match = data; + } + $.ajax({ + url: 'oembed/h2b?text=' + text, + async: false, + success: s_h2b, + dataType: 'html' + }); + return match; + } + s = s.replace(/<span class=\"oembed(.*?)<\/span>/gi, _h2b_cb); + /* /oembed */ + // example: <strong> to [b]
rep(/<a.*?href=\"(.*?)\".*?>(.*?)<\/a>/gi,"[url=$1]$2[/url]");
@@ -55,8 +76,8 @@ rep(/<font>(.*?)<\/font>/gi,"$1");
rep(/<img.*?width=\"(.*?)\".*?height=\"(.*?)\".*?src=\"(.*?)\".*?\/>/gi,"[img=$1x$2]$3[/img]");
rep(/<img.*?height=\"(.*?)\".*?width=\"(.*?)\".*?src=\"(.*?)\".*?\/>/gi,"[img=$2x$1]$3[/img]");
- rep(/<img.*?src=\"(.*?)\".*?height=\"(.*?)\".*?width=\"(.*?)\".*?\/>/gi,"[img=$3x$2]$1[/img]");
- rep(/<img.*?src=\"(.*?)\".*?width=\"(.*?)\".*?height=\"(.*?)\".*?\/>/gi,"[img=$2x$3]$1[/img]");
+ rep(/<img.*?src=\"(.*?)\".*?height=\"(.*?)\".*?width=\"(.*?)\".*?\/>/gi,"[img=$3x$2]$1[/img]");
+ rep(/<img.*?src=\"(.*?)\".*?width=\"(.*?)\".*?height=\"(.*?)\".*?\/>/gi,"[img=$2x$3]$1[/img]");
rep(/<img.*?src=\"(.*?)\".*?\/>/gi,"[img]$1[/img]");
rep(/<code>(.*?)<\/code>/gi,"[code]$1[/code]");
rep(/<\/(strong|b)>/gi,"[/b]");
@@ -106,6 +127,24 @@ rep(/\[size=(.*?)\](.*?)\[\/size\]/gi,"<span style=\"font-size: $1;\">$2</span>");
rep(/\[code\](.*?)\[\/code\]/gi,"<code>$1</code>");
rep(/\[quote.*?\](.*?)\[\/quote\]/gi,"<blockquote>$1</blockquote>");
+ + /* oembed */ + function _b2h_cb(match, url) { + url = bin2hex(url); + function s_b2h(data) { + match = data; + } + $.ajax({ + url: 'oembed/b2h?url=' + url, + async: false, + success: s_b2h, + dataType: 'html' + }); + return match; + } + s = s.replace(/\[embed\](.*?)\[\/embed\]/gi, _b2h_cb); + + /* /oembed */ return s;
}
|