diff options
author | Tim Almdal <tnalmdal@shaw.ca> | 2009-07-04 17:14:21 -0700 |
---|---|---|
committer | Tim Almdal <tnalmdal@shaw.ca> | 2009-07-04 17:14:21 -0700 |
commit | 50462edd9c72156d841991245a4ef34624f9a3c7 (patch) | |
tree | 32679c2aac5ab38d9e3978a74102f5939aee6ade | |
parent | 799d82fd6a47196bc69d1e9f23fc61ea2d331208 (diff) |
Change the BBCode Transformation to use the <span class=""> where possible
-rw-r--r-- | modules/g2_import/helpers/g2_import.php | 9 | ||||
-rw-r--r-- | themes/default/css/screen.css | 19 |
2 files changed, 24 insertions, 4 deletions
diff --git a/modules/g2_import/helpers/g2_import.php b/modules/g2_import/helpers/g2_import.php index 91fcbe8e..cba1d429 100644 --- a/modules/g2_import/helpers/g2_import.php +++ b/modules/g2_import/helpers/g2_import.php @@ -756,15 +756,16 @@ class g2_import_Core { } static $bbcode_mappings = array( - "#\\[b\\](.*?)\\[/b\\]#" => "<span style=\"font-weight: bold;\">$1</span>", - "#\\[i\\](.*?)\\[/i\\]#" => "<span style=\"font-style: italic;\">$1</span>", - "#\\[u\\](.*?)\\[/u\\]#" => "<span style=\"text-decoration: underline: bold;\">$1</span>", - "#\\[s\\](.*?)\\[/s\\]#" => "<span style=\"font-decoration: line-through;\">$1</span>", + "#\\[b\\](.*?)\\[/b\\]#" => "<span class=\"gBBCodeBold\">$1</span>", + "#\\[i\\](.*?)\\[/i\\]#" => "<span class=\"gBBCodeItalic\">$1</span>", + "#\\[u\\](.*?)\\[/u\\]#" => "<span class=\"gBBCodeUnderline\">$1</span>", + "#\\[s\\](.*?)\\[/s\\]#" => "<span class=\"gBBCodeStrike\">$1</span>", "#\\[url\\](.*?)\[/url\\]#" => "<a href=\"$1\">$1</a>", "#\\[url=(.*?)\\](.*?)\[/url\\]#" => "<a href=\"$1\">$2</a>", "#\\[img\\](.*?)\\[/img\\]#" => "<img src=\"$1\"/>", "#\\[quote\\](.*?)\\[/quote\\]#" => "<blockquote><p>$1</p></blockquote>", "#\\[code\\](.*?)\\[/code\\]#" => "<pre>$1</pre>", + "#\\[size=([^\\[]*)\\]([^\\[]*)\\[/size\\]#" => "<span style=\"font-size: $1;\">$2</span>", "#\\[color=([^\\[]*)\\]([^\\[]*)\\[/color\\]#" => "<span style=\"font-color: $1;\">$2/span>", "#\\[ul\\](.*?)\\/ul\\]#" => "<ul>$1</ul>", "#\\[li\\](.*?)\\[/li\\]#" => "<li>$1</li>", diff --git a/themes/default/css/screen.css b/themes/default/css/screen.css index 7a41e970..750639f1 100644 --- a/themes/default/css/screen.css +++ b/themes/default/css/screen.css @@ -13,6 +13,7 @@ * 7) Browser hacks * 8) jQuery and jQuery UI * 9) Right-to-left language styles + * 10) BBCode Styles */ /** ******************************************************************* @@ -1064,3 +1065,21 @@ form .gError, .rtl .ui-icon-left .ui-icon { float: right; } + +/* BBCode ~~~~~~~~~~~~~~~~~~~~ */ +.gBBCodeBold { + font-weight: bold; +} + +.gBBCodeItalic { + font-style: italic; +} + +.gBBCodeUnderline { + text-decoration: underline; +} + +.gBBCodeStrike { + font-decoration: line-through; +} + |