1 | <?xml version="1.0" encoding="UTF-8"?> |
---|
2 | <xsl:stylesheet version="1.0" |
---|
3 | xmlns:xsl="http://www.w3.org/1999/XSL/Transform" |
---|
4 | xmlns:content="http://purl.org/rss/1.0/modules/content/" |
---|
5 | xmlns="http://www.w3.org/1999/xhtml"> |
---|
6 | |
---|
7 | <xsl:output method="html"/> |
---|
8 | |
---|
9 | <xsl:template match="/"> |
---|
10 | <html> |
---|
11 | <head> |
---|
12 | <title>{{tpl:lang Subscribe to}} <xsl:value-of select="/rss/channel/title"/></title> |
---|
13 | <style type="text/css"> |
---|
14 | <![CDATA[ |
---|
15 | body { |
---|
16 | font: 80% Verdana,Arial,sans-serif; |
---|
17 | margin: 20px 0; |
---|
18 | padding: 0 0; |
---|
19 | background: #fff; |
---|
20 | color: #000; |
---|
21 | } |
---|
22 | a { color: #039; } |
---|
23 | h1, h2 { font-family: Arial,sans-serif; } |
---|
24 | h1 { font-size: 160%; margin: 0; } |
---|
25 | h2 { font-size: 140%; font-weight: bold; margin: 0.5em 0 0.2em 0; } |
---|
26 | h2 a { text-decoration: none; } |
---|
27 | p { margin: 0 0 0.5em 0; } |
---|
28 | #page { |
---|
29 | margin: 0 80px; |
---|
30 | } |
---|
31 | #top { |
---|
32 | background: #036; |
---|
33 | padding : 1em; |
---|
34 | color: #fff; |
---|
35 | } |
---|
36 | #top a { |
---|
37 | color: #fff; |
---|
38 | text-decoration: none; |
---|
39 | } |
---|
40 | #what { |
---|
41 | padding: 1em; |
---|
42 | background: #eee; |
---|
43 | border-bottom: 1px solid #000; |
---|
44 | font-size: 80%; |
---|
45 | } |
---|
46 | #what p { |
---|
47 | margin: 0 0 0.5em 0; |
---|
48 | } |
---|
49 | #footer { |
---|
50 | border-top: 1px solid #000; |
---|
51 | } |
---|
52 | #items { |
---|
53 | background: #fff; |
---|
54 | color: inherit; |
---|
55 | } |
---|
56 | #items div { |
---|
57 | margin: 0 0 1em 0; |
---|
58 | } |
---|
59 | ]]> |
---|
60 | </style> |
---|
61 | <script type="text/javascript"><![CDATA[ |
---|
62 | window.onload = function() { |
---|
63 | document.getElementById('feedurl').value = window.location.href; |
---|
64 | |
---|
65 | // Ugly but works ;) |
---|
66 | var c = document.getElementsByTagName('div'); |
---|
67 | var t = ''; |
---|
68 | for (var i=0; c.length-i != 0; i++) { |
---|
69 | if (c[i].className == 'item-content') { |
---|
70 | if (c[i].textContent) { |
---|
71 | t = c[i].textContent; |
---|
72 | } else if (c[i].innerText) { |
---|
73 | t = c[i].innerText; |
---|
74 | } else { |
---|
75 | t = ''; |
---|
76 | } |
---|
77 | |
---|
78 | if (t) { c[i].innerHTML = t; } |
---|
79 | } |
---|
80 | } |
---|
81 | }; |
---|
82 | ]]></script> |
---|
83 | </head> |
---|
84 | <body> |
---|
85 | <div id="page"> |
---|
86 | <div id="top"> |
---|
87 | <h1><a href="{/rss/channel/link}"><xsl:value-of select="/rss/channel/title"/></a></h1> |
---|
88 | <p><xsl:value-of select="/rss/channel/description"/></p> |
---|
89 | </div> |
---|
90 | <div id="what"> |
---|
91 | <h3>{{tpl:lang What is an RSS feed?}}</h3> |
---|
92 | <p>{{tpl:lang RSS feed is a free blog summary. It provides content |
---|
93 | (either posts or comments) or summaries of content, together with links |
---|
94 | to the full versions, and other metadata. The last published items may |
---|
95 | then be read by your favorite RSS |
---|
96 | <a href="http://en.wikipedia.org/wiki/Aggregator">aggregator</a>.}}</p> |
---|
97 | <h3>{{tpl:lang Subscribe}}</h3> |
---|
98 | <p>{{tpl:lang Simply copy the following URL into your aggregator:}}</p> |
---|
99 | <p><input type="text" size="60" value="" id="feedurl" /></p> |
---|
100 | </div> |
---|
101 | <div id="items"> |
---|
102 | <xsl:apply-templates select="//item"/> |
---|
103 | </div> |
---|
104 | <div id="footer"> |
---|
105 | <p><xsl:value-of select="/rss/channel/copyright"/></p> |
---|
106 | </div> |
---|
107 | </div> |
---|
108 | </body> |
---|
109 | </html> |
---|
110 | </xsl:template> |
---|
111 | |
---|
112 | <!-- Item template --> |
---|
113 | <xsl:template match="item"> |
---|
114 | <div> |
---|
115 | <h2><a href="{link}"><xsl:value-of select="title"/></a></h2> |
---|
116 | <div class="item-content"><xsl:value-of select="description" /></div> |
---|
117 | </div> |
---|
118 | </xsl:template> |
---|
119 | |
---|
120 | </xsl:stylesheet> |
---|