diff options
author | Friendika <info@friendika.com> | 2011-06-30 15:31:25 -0700 |
---|---|---|
committer | Friendika <info@friendika.com> | 2011-06-30 15:31:25 -0700 |
commit | 4f1213b69f12e6df2350cd21c6de06128a03411d (patch) | |
tree | cb68ecdcadb886e15cc502b633ca71b874740e55 /library/tinymce/jscripts/tiny_mce/plugins/bbcode/editor_plugin_cmp.js | |
parent | 8819c73ba1ae1cbf19d2c517a87d30104d1a5da1 (diff) | |
parent | 7778dbb67b2c033473b0da9b34df01d28162b5ee (diff) | |
download | volse-hubzilla-4f1213b69f12e6df2350cd21c6de06128a03411d.tar.gz volse-hubzilla-4f1213b69f12e6df2350cd21c6de06128a03411d.tar.bz2 volse-hubzilla-4f1213b69f12e6df2350cd21c6de06128a03411d.zip |
Merge pull request #132 from fabrixxm/master
Some works on addons and other
Diffstat (limited to 'library/tinymce/jscripts/tiny_mce/plugins/bbcode/editor_plugin_cmp.js')
-rw-r--r-- | library/tinymce/jscripts/tiny_mce/plugins/bbcode/editor_plugin_cmp.js | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/library/tinymce/jscripts/tiny_mce/plugins/bbcode/editor_plugin_cmp.js b/library/tinymce/jscripts/tiny_mce/plugins/bbcode/editor_plugin_cmp.js new file mode 100644 index 000000000..b0926c92a --- /dev/null +++ b/library/tinymce/jscripts/tiny_mce/plugins/bbcode/editor_plugin_cmp.js @@ -0,0 +1 @@ +(function(){tinymce.create('tinymce.plugins.BBCodePlugin',{init:function(ed,url){var t=this,dialect=ed.getParam('bbcode_dialect','dfrn').toLowerCase();ed.onBeforeSetContent.add(function(ed,o){o.content=t['_'+dialect+'_bbcode2html'](o.content)});ed.onPostProcess.add(function(ed,o){if(o.set)o.content=t['_'+dialect+'_bbcode2html'](o.content);if(o.get)o.content=t['_'+dialect+'_html2bbcode'](o.content)})},getInfo:function(){return{longname:'BBCode Plugin',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',infourl:'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/bbcode',version:tinymce.majorVersion+"."+tinymce.minorVersion version:tinymce.majorVersion+"."+tinymce.minorVersion}},_dfrn_html2bbcode:function(s){s=tinymce.trim(s);function rep(re,str){s=s.replace(re,str)};rep(/<a.*?href=\"(.*?)\".*?>(.*?)<\/a>/gi,"[url=$1]$2[/url]");rep(/<span style=\"font-size:(.*?);\">(.*?)<\/span>/gi,"[size=$1]$2[/size]");rep(/<font>(.*?)<\/font>/gi,"$1");rep(/<img.*?src=\"(.*?)\".*?\/>/gi,"[img]$1[/img]");rep(/<code>(.*?)<\/code>/gi,"[code]$1[/code]");rep(/<\/(strong|b)>/gi,"[/b]");rep(/<(strong|b)>/gi,"[b]");rep(/<\/(em|i)>/gi,"[/i]");rep(/<(em|i)>/gi,"[i]");rep(/<\/u>/gi,"[/u]");rep(/<span style=\"text-decoration: ?underline;\">(.*?)<\/span>/gi,"[u]$1[/u]");rep(/<u>/gi,"[u]");rep(/<blockquote[^>]*>/gi,"[quote]");rep(/<\/blockquote>/gi,"[/quote]");rep(/<br \/>/gi,"\n");rep(/<br\/>/gi,"\n");rep(/<br>/gi,"\n");rep(/<p>/gi,"");rep(/<\/p>/gi,"\n");rep(/ /gi," ");rep(/"/gi,"\"");rep(/</gi,"<");rep(/>/gi,">");rep(/&/gi,"&");return s},_dfrn_bbcode2html:function(s){s=tinymce.trim(s);function rep(re,str){s=s.replace(re,str)};rep(/\n/gi,"<br />");rep(/\[b\]/gi,"<strong>");rep(/\[\/b\]/gi,"</strong>");rep(/\[i\]/gi,"<em>");rep(/\[\/i\]/gi,"</em>");rep(/\[u\]/gi,"<u>");rep(/\[\/u\]/gi,"</u>");rep(/\[url=([^\]]+)\](.*?)\[\/url\]/gi,"<a href=\"$1\">$2</a>");rep(/\[url\](.*?)\[\/url\]/gi,"<a href=\"$1\">$1</a>");rep(/\[img\](.*?)\[\/img\]/gi,"<img src=\"$1\" />");rep(/\[color=(.*?)\](.*?)\[\/color\]/gi,"<font color=\"$1\">$2</font>");rep(/\[code\](.*?)\[\/code\]/gi,"<code>$1</code>");rep(/\[quote.*?\](.*?)\[\/quote\]/gi,"<blockquote>$1</blockquote>");return s}});tinymce.PluginManager.add('bbcode',tinymce.plugins.BBCodePlugin)})();
\ No newline at end of file |