From: Andrew Dolgov Date: Fri, 10 Aug 2007 05:22:04 +0000 (+0100) Subject: add XSL stylesheet to generated feeds X-Git-Tag: 1.2.14~98 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=a5472764c9bcd3eda58540e2cc97c5a42bb1bc1c;p=tt-rss.git add XSL stylesheet to generated feeds --- diff --git a/functions.php b/functions.php index 7a959153..eb14f52e 100644 --- a/functions.php +++ b/functions.php @@ -2722,9 +2722,11 @@ $feed_site_url = $qfh_ret[2]; $last_error = $qfh_ret[3]; -# if (!$feed_site_url) $feed_site_url = "http://localhost/"; +// if (!$feed_site_url) $feed_site_url = "http://localhost/"; - print " + print " + + $feed_title $feed_site_url diff --git a/images/active_tab_new.png b/images/active_tab_new.png new file mode 100644 index 00000000..a08308c0 Binary files /dev/null and b/images/active_tab_new.png differ diff --git a/images/feed-icon-64x64.png b/images/feed-icon-64x64.png new file mode 100644 index 00000000..240e45e3 Binary files /dev/null and b/images/feed-icon-64x64.png differ diff --git a/images/ttrss_logo_blackred.png b/images/ttrss_logo_blackred.png new file mode 100644 index 00000000..a9b081ab Binary files /dev/null and b/images/ttrss_logo_blackred.png differ diff --git a/images/ttrss_logo_blackred.svg b/images/ttrss_logo_blackred.svg new file mode 100644 index 00000000..6205a40f --- /dev/null +++ b/images/ttrss_logo_blackred.svg @@ -0,0 +1,144 @@ + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + tiny tiny + rss + + diff --git a/rss.xsl b/rss.xsl new file mode 100644 index 00000000..04da62d3 --- /dev/null +++ b/rss.xsl @@ -0,0 +1,59 @@ + + + + + + + + + <xsl:value-of select="rss/channel/title"/> + + + + + + + + +
+ + feed icon + +

+ +

This is an RSS feed exported from + Tiny Tiny RSS. + You must install a news aggregator to subscribe to it. + This feed contains the following items:

+ + + + +

+ +
+ +
+ +
+ + +

Extra...

+
+ +
+ +
+ +
+ + + +
+ +
+ diff --git a/utility.css b/utility.css index d6cac4f2..b94b0d5d 100644 --- a/utility.css +++ b/utility.css @@ -76,3 +76,46 @@ h2 { border-color : black; border-style : solid; */ } + +div.rss h1 { + border-width : 0px 0px 1px 0px; + border-color : gray; + border-style : dotted; + color : gray; + margin-right : 90px; +} + +div.rss h2 { + font-size : 12pt; + margin : 0px; +} + +div.rss a.extlink { + color : gray; + border-width : 0px 0px 1px 0px; + border-color : #778899; + border-style : dotted; + font-size : 9pt; +} + +div.rss p.description { + color : gray; + font-size : 9pt; +} + +div.rss p.content { + margin-left : 2em; + +} + +div.rss img.feedicon { + float : right; +} + +div.rss hr { + border-width : 0px 0px 1px 0px; + border-style : dashed; + border-color : #e0e0e0; +} + + diff --git a/xsl_mop-up.js b/xsl_mop-up.js new file mode 100644 index 00000000..87c96709 --- /dev/null +++ b/xsl_mop-up.js @@ -0,0 +1,86 @@ +// -*-coding: latin-1;-*- +// Time-stamp: "2006-05-17 22:06:46 ADT" sburke@cpan.org + +// A workaround for XSL-to-XHTML systems that don't +// implement XSL 'disable-output-escaping="yes"'. +// +// sburke@cpan.org, Sean M. Burke. +// - I hereby release this JavaScript code into the public domain. + +var is_decoding; +var DEBUG = 0; + +function complaining (s) { alert(s); return new Error(s,s); } + +if(!( document.getElementById && document.getElementsByName )) + throw complaining("Your browser is too old to render this page properly." + + " Consider going to getfirefox.com to upgrade."); + +function check_decoding () { + var d = document.getElementById('cometestme'); + if(!d) { + throw complaining("Can't find an id='cometestme' element?"); + } else if(!('textContent' in d)) { + // It's a browser with a halfassed DOM implementation (like IE6) + // that doesn't implement textContent! Assume that if it's that + // dumb, it probably doesn't implement disable-content-encoding. + + } else { + var ampy = d.textContent; + if(DEBUG > 1) { alert("Got " + ampy); } + + if(ampy == undefined) throw complaining("'cometestme' element has undefined text content?!"); + if(ampy == '' ) throw complaining("'cometestme' element has empty text content?!" ); + + if (ampy == "\x26" ) { is_decoding = true; } + else if (ampy == "\x26amp;" ) { is_decoding = false; } + else { throw complaining('Insane value: "' + ampy + '"!'); } + } + + var msg = + (is_decoding == undefined) ? "I can't tell whether the XSL processor supports disable-content-encoding!D" + : is_decoding ? "The XSL processor DOES support disable-content-encoding" + : "The XSL processor does NOT support disable-content-encoding" + ; + if(DEBUG) alert(msg); + return msg; +} + + +function go_decoding () { + check_decoding(); + + if(is_decoding) { + DEBUG && alert("No work needs doing -- already decoded!"); + return; + } + + var to_decode = document.getElementsByName('decodeme'); + if(!( to_decode && to_decode.length )) { + DEBUG && alert("No work needs doing -- no elements to decode!"); + return; + } + + if(!( ( "innerHTML" in to_decode[0]) && ( "textContent" in to_decode[0]) )) + throw complaining( "Your JavaScript version doesn't implement DOM " + + "properly enough to show this page correctly. " + + "Consider going to getfirefox.com to upgrade."); + + var s; + for(var i = to_decode.length - 1; i >= 0; i--) { + s = to_decode[i].textContent; + + if( + s == undefined || + (s.indexOf('&') == -1 && s.indexOf('<') == -1) + ) { + // the null or markupless element needs no reworking + } else { + to_decode[i].innerHTML = s; // that's the magic + } + } + + return; +} + +//End