1 | 1 | simandl | <?xml version="1.0" encoding="ISO-8859-1"?> |
2 | | | <!-- |
3 | | | star-light - version 1.0.2 (2005/06/06) |
4 | | | Copyright 2005, Dean Edwards |
5 | | | License: http://creativecommons.org/licenses/LGPL/2.1/ |
6 | | | --> |
7 | | | <public:component xmlns:public="urn:HTMLComponent" lightweight="true"> |
8 | | | <public:attach event="ondocumentready" handler="init"/> |
9 | | | <script type="text/javascript"> |
10 | | | //<![CDATA[ |
11 | | | |
12 | | | function init() { |
13 | | | // default text colour |
14 | | | style.color = "black"; |
15 | | | |
16 | | | // escape character |
17 | | | parser.escapeChar = "\\"; |
18 | | | |
19 | | | tabStop = 4; |
20 | | | |
21 | | | // comments |
22 | | | parser.add(BLOCK_COMMENT, "color:green"); |
23 | | | |
24 | | | // strings |
25 | | | parser.add(STRING1, "color:maroon"); |
26 | | | parser.add(STRING2, "color:maroon"); |
27 | | | |
28 | | | // urls/email |
29 | | | urls = true; |
30 | | | |
31 | | | // keywords |
32 | | | parser.add(/@\w[\w\s]*/, "color:teal"); |
33 | | | // brackets |
34 | | | parser.add(/\([^'")]*\)/, IGNORE); |
35 | | | // selectors |
36 | | | parser.add(/([\w-:\[.#][^{};]*)\{/, "color:maroon", "<span>$2</span>{"); |
37 | | | // proprietary (e.g. -moz-box-sizing) |
38 | | | parser.add(/(-[\w-]+)\s*:/, "color:red", "<span>$2</span>:"); |
39 | | | // properties |
40 | | | parser.add(/([\w-]+)\s*:/, "color:blue", "<span>$2</span>:"); |
41 | | | //# // colors |
42 | | | //# parser.add(/#[\da-fA-F]{3,}/, "color:maroon"); |
43 | | | //# // numeric (e.g 2em) |
44 | | | //# parser.add(/\b[.\d]+(cm|em|ex|pt|px|%)\b/, "color:maroon"); |
45 | | | // keywords |
46 | | | parser.add(/attr|rect|rgb|url/, "color:teal"); |
47 | | | }; |
48 | | | |
49 | | | //]]> |
50 | | | </script> |
51 | | | </public:component> |