From: <var...@us...> - 2009-06-25 14:35:36
|
Revision: 6961 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=6961&view=rev Author: vargenau Date: 2009-06-25 14:35:00 +0000 (Thu, 25 Jun 2009) Log Message: ----------- More colors Modified Paths: -------------- trunk/lib/InlineParser.php trunk/pgsrc/Help%2FTextFormattingRules Modified: trunk/lib/InlineParser.php =================================================================== --- trunk/lib/InlineParser.php 2009-06-25 12:47:08 UTC (rev 6960) +++ trunk/lib/InlineParser.php 2009-06-25 14:35:00 UTC (rev 6961) @@ -857,7 +857,31 @@ function markup ($match, $body) { $color = strtolower(substr($match, 7, -1)); - if (in_array($color, array('red', 'blue', 'gray', 'yellow', 'green', 'cyan', 'black')) + $morecolors = array('beige' => '#f5f5dc', + 'brown' => '#a52a2a', + 'chocolate' => '#d2691e', + 'cyan' => '#00ffff', + 'gold' => '#ffd700', + 'ivory' => '#fffff0', + 'indigo' => '#4b0082', + 'magenta' => '#ff00ff', + 'orange' => '#ffa500', + 'pink' => '#ffc0cb', + 'salmon' => '#fa8072', + 'snow' => '#fffafa', + 'turquoise' => '#40e0d0', + 'violet' => '#ee82ee', + ); + + if (isset($morecolors[$color])) { + $color = $morecolors[$color]; + } + + // HTML 4 defines the following 16 colors + if (in_array($color, array('aqua', 'black', 'blue', 'fuchsia', + 'gray', 'green', 'lime', 'maroon', + 'navy', 'olive', 'purple', 'red', + 'silver', 'teal', 'white', 'yellow')) or ((substr($color,0,1) == '#') and ((strlen($color) == 4) or (strlen($color) == 7)) and (strspn(substr($color,1),'0123456789abcdef') == strlen($color)-1))) { Modified: trunk/pgsrc/Help%FTextFormattingRules =================================================================== --- trunk/pgsrc/Help%2FTextFormattingRules 2009-06-25 12:47:08 UTC (rev 6960) +++ trunk/pgsrc/Help%2FTextFormattingRules 2009-06-25 14:35:00 UTC (rev 6961) @@ -91,11 +91,46 @@ %color=green% green text %% and back to normal The easiest way to do it is to use the COLOR button in the Edit Toolbar. -The text will be in green by default. You can change the color. +The text will be in green by default. You can then change the color. Allowed colors are: -* %color=red% red %%, %color=blue% blue %%, %color=gray% gray %%, %color=yellow% yellow %%, %color=green% green %%, %color=cyan% cyan %%, %color=black% black %%; -* an HTML color number (# followed by 3 or 6 digits). +* an HTML color number (# followed by 3 or 6 digits), +* the following predefined color names: +{| class="bordered" +|- +| %color=aqua% aqua %% +| bgcolor="#565c5e" | %color=beige% beige %% +| %color=black% black %% +| %color=blue% blue %% +| %color=brown% brown %% +| %color=chocolate% chocolate %% +| %color=cyan% cyan %% +| %color=fuchsia% fuchsia %% +| %color=gold% gold %% +| %color=gray% gray %% +|- +| %color=green% green %% +| bgcolor="#565c5e" | %color=ivory% ivory %% +| %color=indigo% indigo %% +| %color=lime% lime %% +| %color=magenta% magenta %% +| %color=maroon% maroon %% +| %color=navy% navy %% +| %color=olive% olive %% +| %color=orange% orange %% +| %color=pink% pink %% +|- +| %color=purple% purple %% +| %color=red% red %% +| %color=salmon% salmon %% +| %color=silver% silver %% +| bgcolor="#565c5e" | %color=snow% snow %% +| %color=teal% teal %% +| %color=turquoise% turquoise %% +| %color=violet% violet %% +| bgcolor="#565c5e" | %color=white% white %% +| %color=yellow% yellow %% +|} Note: you can put the headers in color, but only if you do not have a table of content. For now, the table of content is incompatible with color headers. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |