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