From dfd3cef734be3bc1bf2d16dfe8b2f71d6aff18a7 Mon Sep 17 00:00:00 2001 From: Mike Macgirvin Date: Thu, 12 Aug 2010 01:47:08 -0700 Subject: added code, quote styles to editor --- .../tiny_mce/plugins/bbcode/editor_plugin_src.js | 31 +++++++--------------- 1 file changed, 10 insertions(+), 21 deletions(-) (limited to 'tinymce') 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 5586637f3..86f9e3d62 100644 --- a/tinymce/jscripts/tiny_mce/plugins/bbcode/editor_plugin_src.js +++ b/tinymce/jscripts/tiny_mce/plugins/bbcode/editor_plugin_src.js @@ -8,10 +8,12 @@ * Contributing: http://tinymce.moxiecode.com/contributing */ +/* Macgirvin Aug-2010 changed from punbb to dfrn dialect */ + (function() { tinymce.create('tinymce.plugins.BBCodePlugin', { init : function(ed, url) { - var t = this, dialect = ed.getParam('bbcode_dialect', 'punbb').toLowerCase(); + var t = this, dialect = ed.getParam('bbcode_dialect', 'dfrn').toLowerCase(); ed.onBeforeSetContent.add(function(ed, o) { o.content = t['_' + dialect + '_bbcode2html'](o.content); @@ -38,8 +40,8 @@ // Private methods - // HTML -> BBCode in PunBB dialect - _punbb_html2bbcode : function(s) { + // HTML -> BBCode in DFRN dialect + _dfrn_html2bbcode : function(s) { s = tinymce.trim(s); function rep(re, str) { @@ -48,23 +50,10 @@ // example: to [b] rep(/(.*?)<\/a>/gi,"[url=$1]$2[/url]"); - rep(/(.*?)<\/font>/gi,"[code][color=$1]$2[/color][/code]"); - rep(/(.*?)<\/font>/gi,"[quote][color=$1]$2[/color][/quote]"); - rep(/(.*?)<\/font>/gi,"[code][color=$1]$2[/color][/code]"); - rep(/(.*?)<\/font>/gi,"[quote][color=$1]$2[/color][/quote]"); - rep(/(.*?)<\/span>/gi,"[color=$1]$2[/color]"); - rep(/(.*?)<\/font>/gi,"[color=$1]$2[/color]"); rep(/(.*?)<\/span>/gi,"[size=$1]$2[/size]"); rep(/(.*?)<\/font>/gi,"$1"); rep(//gi,"[img]$1[/img]"); - rep(/(.*?)<\/span>/gi,"[code]$1[/code]"); - rep(/(.*?)<\/span>/gi,"[quote]$1[/quote]"); - rep(/(.*?)<\/strong>/gi,"[code][b]$1[/b][/code]"); - rep(/(.*?)<\/strong>/gi,"[quote][b]$1[/b][/quote]"); - rep(/(.*?)<\/em>/gi,"[code][i]$1[/i][/code]"); - rep(/(.*?)<\/em>/gi,"[quote][i]$1[/i][/quote]"); - rep(/(.*?)<\/u>/gi,"[code][u]$1[/u][/code]"); - rep(/(.*?)<\/u>/gi,"[quote][u]$1[/u][/quote]"); + rep(/(.*?)<\/code>/gi,"[code]$1[/code]"); rep(/<\/(strong|b)>/gi,"[/b]"); rep(/<(strong|b)>/gi,"[b]"); rep(/<\/(em|i)>/gi,"[/i]"); @@ -88,8 +77,8 @@ return s; }, - // BBCode -> HTML from PunBB dialect - _punbb_bbcode2html : function(s) { + // BBCode -> HTML from DFRN dialect + _dfrn_bbcode2html : function(s) { s = tinymce.trim(s); function rep(re, str) { @@ -108,8 +97,8 @@ rep(/\[url\](.*?)\[\/url\]/gi,"$1"); rep(/\[img\](.*?)\[\/img\]/gi,""); rep(/\[color=(.*?)\](.*?)\[\/color\]/gi,"$2"); - rep(/\[code\](.*?)\[\/code\]/gi,"$1 "); - rep(/\[quote.*?\](.*?)\[\/quote\]/gi,"$1 "); + rep(/\[code\](.*?)\[\/code\]/gi,"$1"); + rep(/\[quote.*?\](.*?)\[\/quote\]/gi,"
$1
"); return s; } -- cgit v1.2.3