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 | | | /* copied from firefox's nice view-source style */ |
13 | | | |
14 | | | function init() { |
15 | | | // default text colour |
16 | | | style.color = "black"; |
17 | | | |
18 | | | // comments |
19 | | | parser.add(SGML_COMMENT, "color:green;font-style:italic"); |
20 | | | |
21 | | | // strings |
22 | | | parser.add(STRING1, "color:blue;font-weight:550"); |
23 | | | parser.add(STRING2, "color:blue;font-weight:550"); |
24 | | | |
25 | | | // indentation |
26 | | | tabStop = 1; |
27 | | | |
28 | | | // doctype |
29 | | | parser.add(/<!DOCTYPE[^>]+>/, "color:#4682B4;font-style:italic"); |
30 | | | |
31 | | | // processing instruction |
32 | | | parser.add(/<\?[\w-]+[^>]+>/, IGNORE); |
33 | | | |
34 | | | // script and style blocks |
35 | | | parser.add(/(>([^<][^\/]*<+)*\/)(script|style)>/, "color:#800080;font-weight:bold", "$2<span>$4</span>>"); |
36 | | | |
37 | | | // tags |
38 | | | parser.add(/(<\/?)(\w+)/, "color:#800080;font-weight:bold", "$2<span>$3</span>"); |
39 | | | |
40 | | | // atributes |
41 | | | parser.add(/\w+=/, "font-weight:bold"); |
42 | | | |
43 | | | // entity references (this doesn't work) |
44 | | | parser.add(/&#?\w+;/, "color:#FF4500"); |
45 | | | }; |
46 | | | |
47 | | | //]]> |
48 | | | </script> |
49 | | | </public:component> |
50 | | | |