broadcast2html.xslt 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!--
  3. Turn broadcast xml into html, used client-side, by the browser.
  4. Supposed to be either
  5. - linked to (ln -s) from stations/<name>/app/broadcast2html.xslt
  6. - xsl:import-ed from a custom stations/<name>/app/broadcast2html.xslt,
  7. - automatically rewritten to from stations/<name>/app/broadcast2html.xslt
  8. so each station can provide a custom skin but uses the generic one as a fallback.
  9. See stations/dlf/app/broadcast2html.xslt for an example for xsl:import.
  10. Copyright (c) 2013-2021 Marcus Rohrmoser, https://mro.name/radio-privatkopie
  11. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
  12. associated documentation files (the "Software"), to deal in the Software without restriction,
  13. including without limitation the rights to use, copy, modify, merge, publish, distribute,
  14. sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is
  15. furnished to do so, subject to the following conditions:
  16. The above copyright notice and this permission notice shall be included in all copies or
  17. substantial portions of the Software.
  18. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT
  19. NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
  20. NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES
  21. OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
  22. CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  23. MIT License http://opensource.org/licenses/MIT
  24. CSS classes use https://en.wikipedia.org/wiki/HCalendar#Example
  25. http://www.w3.org/TR/xslt/
  26. -->
  27. <xsl:stylesheet
  28. exclude-result-prefixes="rec foaf dctype rdf svg xlink"
  29. xmlns:dctype="http://purl.org/dc/dcmitype/"
  30. xmlns:foaf="http://xmlns.com/foaf/0.1/"
  31. xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
  32. xmlns:rec="../../../../../assets/2013/radio-pi.rdf"
  33. xmlns:svg="http://www.w3.org/2000/svg"
  34. xmlns:xlink="http://www.w3.org/1999/xlink"
  35. xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  36. version="1.0">
  37. <!-- replace linefeeds with <br> tags -->
  38. <xsl:template name="linefeed2br">
  39. <xsl:param name="string" select="''"/>
  40. <xsl:param name="pattern" select="'&#10;'"/>
  41. <xsl:choose>
  42. <xsl:when test="contains($string, $pattern)">
  43. <xsl:value-of select="substring-before($string, $pattern)"/><br class="br"/><xsl:comment> Why do we see 2 br on Safari and output/@method=html here? http://purl.mro.name/safari-xslt-br-bug </xsl:comment>
  44. <xsl:call-template name="linefeed2br">
  45. <xsl:with-param name="string" select="substring-after($string, $pattern)"/>
  46. <xsl:with-param name="pattern" select="$pattern"/>
  47. </xsl:call-template>
  48. </xsl:when>
  49. <xsl:otherwise>
  50. <xsl:value-of select="$string"/>
  51. </xsl:otherwise>
  52. </xsl:choose>
  53. </xsl:template>
  54. <xsl:output
  55. method="html"
  56. doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"
  57. doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN"/>
  58. <!-- load external additional xml documents -->
  59. <xsl:variable name="station_about_rdf" select="document('../about.rdf')"/>
  60. <!--
  61. <xsl:variable name="now_fellows_xml" select="document('../../../../app/onair.cgi')"/>
  62. -->
  63. <xsl:template name="broadcast_station_source">
  64. <a class="via" href="{rec:meta[@name='DC.source']/@content}" rel="via">Sendung</a>
  65. <xsl:text> </xsl:text>
  66. </xsl:template>
  67. <xsl:template name="station_rdf_logo">
  68. <xsl:variable name="station_rdf0" select="$station_about_rdf/rdf:RDF/foaf:Document[ '' = @rdf:about ]"/>
  69. <xsl:variable name="station_rdf1" select="$station_about_rdf/rdf:RDF/*[ $station_rdf0/foaf:primaryTopic/@rdf:resource = @rdf:about ]"/>
  70. <xsl:variable name="station_rdf" select="$station_about_rdf/rdf:RDF/rdf:Description">
  71. <!-- currently there's only 1 rdf:Description, all others are of different dctype -->
  72. </xsl:variable>
  73. <xsl:choose>
  74. <xsl:when test="$station_rdf">
  75. <a title="{$station_rdf/foaf:name} Programm" href="{$station_rdf/../dctype:Text/@rdf:about}">
  76. <!-- img class="station logo" alt="Senderlogo {$station_rdf/foaf:name}" src="{$station_rdf/foaf:logo/@rdf:resource}"/ -->
  77. <img class="station logo" alt="Senderlogo {$station_rdf/foaf:name}" src=" ../../../logo.svg"/>
  78. </a>
  79. </xsl:when>
  80. <xsl:otherwise>
  81. <span title="No station RDF found at ../../../about.rdf" style="color:red;font-weight:bolder">!</span>
  82. </xsl:otherwise>
  83. </xsl:choose>
  84. <xsl:text> </xsl:text>
  85. </xsl:template>
  86. <xsl:template name="station_rdf_stream">
  87. <xsl:variable name="stream_rdf" select="$station_about_rdf/rdf:RDF/dctype:Sound[@rdf:about]"/>
  88. <xsl:choose>
  89. <xsl:when test="$stream_rdf">
  90. <a class="location" title="{$stream_rdf/@rdf:about}" href="{$stream_rdf/@rdf:about}">Live Stream</a>
  91. </xsl:when>
  92. <xsl:otherwise>
  93. <!-- keep the fallback to jquery + GET station.cfg for now: -->
  94. <a id="stream" style="display:none">Live Stream</a>
  95. </xsl:otherwise>
  96. </xsl:choose>
  97. </xsl:template>
  98. <xsl:template name="station_logo">
  99. <img class="station logo" alt="Senderlogo" src=" ../../../logo.svg"/>
  100. </xsl:template>
  101. <xsl:template match="/rec:broadcast">
  102. <xsl:variable name="timestart" select="rec:meta[@name='DC.format.timestart']/@content"/>
  103. <xsl:variable name="timeend" select="rec:meta[@name='DC.format.timeend']/@content"/>
  104. <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="{rec:meta[@name='DC.language']/@content}">
  105. <head>
  106. <meta content="text/html; charset=utf-8" http-equiv="content-type"/>
  107. <!-- https://developer.apple.com/library/IOS/documentation/AppleApplications/Reference/SafariWebContent/UsingtheViewport/UsingtheViewport.html#//apple_ref/doc/uid/TP40006509-SW26 -->
  108. <!-- http://maddesigns.de/meta-viewport-1817.html -->
  109. <!-- meta name="viewport" content="width=device-width"/ -->
  110. <!-- http://www.quirksmode.org/blog/archives/2013/10/initialscale1_m.html -->
  111. <meta name="viewport" content="width=device-width,initial-scale=1.0"/>
  112. <!-- meta name="viewport" content="width=400"/ -->
  113. <link href="../../../../../assets/favicon-32x32.png" rel="shortcut icon" type="image/png" />
  114. <link href="../../../../../assets/favicon-512x512.png" rel="apple-touch-icon" type="image/png" />
  115. <link href="../../../app/style.css" rel="stylesheet" type="text/css"/>
  116. <title>
  117. <xsl:value-of select="rec:meta[@name='DC.title']/@content"/>
  118. </title>
  119. <link href="{rec:meta[@name='DC.source']/@content}" rel="via"/>
  120. <link href="../../../../../app/prev.cgi" rel="prev"/>
  121. <link href="../../../../../app/next.cgi" rel="next"/>
  122. <link href="index.html" rel="parent"/>
  123. <!-- link href='../../../../../enclosures/app/schedule.lua?uri=referer' rel='edit-media'/ -->
  124. <xsl:for-each select="rec:meta">
  125. <meta content="{@content}" name="{@name}"/>
  126. </xsl:for-each>
  127. <!-- https://github.com/csswizardry/ct
  128. via https://news.ycombinator.com/item?id=29087538 -->
  129. <!-- link rel="stylesheet" href="https://csswizardry.com/ct/ct.css" class="ct" / -->
  130. </head>
  131. <body id="broadcast" class="vevent">
  132. <noscript><p>JavaScript ist aus, es geht zwar (fast) alles auch ohne, aber mit ist's <b>schöner</b>. (Datumsformatierung, Aufnahmen wieder stornieren, Tagesübersicht, RDF Urls in der Fußzeile)</p></noscript>
  133. <ul id="navigation" class="buttongroup" title="Navigation">
  134. <li><a id="prevP1W" title="Woche vorher">&lt;&lt;&lt;<br class="br"/><span>-1W</span></a></li>
  135. <li><a id="prevP1D" title="Tag vorher">&lt;&lt;<br class="br"/><span>-1D</span></a></li>
  136. <li><a id="prevPT1M" rel="prev" title="Sendung vorher">&lt;</a></li>
  137. <li class="now"><a href="../../../now">aktuell</a></li>
  138. <li><a id="nextPT1M" rel="next" title="Sendung nachher">&gt;</a></li>
  139. <li><a id="nextP1D" title="Tag nachher">&gt;&gt;<br class="br"/><span>+1D</span></a></li>
  140. <li><a id="nextP1W" title="Woche nachher">&gt;&gt;&gt;<br class="br"/><span>+1W</span></a></li>
  141. </ul>
  142. <div class="summary">
  143. <h2 id="series">
  144. <xsl:value-of select="rec:meta[@name='DC.title.series']/@content"/>
  145. </h2><xsl:text> </xsl:text>
  146. <h1 id="title">
  147. <xsl:value-of select="rec:meta[@name='DC.title']/@content"/>
  148. </h1>
  149. <h2 id="summary">
  150. <xsl:value-of select="rec:meta[@name='DC.title.episode']/@content"/>
  151. </h2>
  152. </div>
  153. <p>
  154. <xsl:call-template name="station_rdf_logo"/>
  155. <xsl:call-template name="station_rdf_stream"/>
  156. </p>
  157. <h3 id="date">
  158. <span id="dtstart" class="dtstart" data-rfc3339="{$timestart}">
  159. <!-- xsl:value-of select="date:day-abbreviation($timestart)"/>, -->
  160. <xsl:value-of select="substring(translate($timestart, 'T', ' '), 0, 17)"/>
  161. </span> bis <span id="dtend" class="dtend" data-rfc3339="{$timeend}">
  162. <xsl:value-of select="substring($timeend, 12, 5)"/>
  163. </span> Uhr
  164. </h3>
  165. <p class="image">
  166. <a title="Beim Sender" class="via" href="{rec:meta[@name='DC.source']/@content}" rel="via">
  167. <img alt="Bild zur Sendung" id="image" class="border animated fadeInRotate" src="{rec:meta[@name='DC.image']/@content}"/>
  168. </a>
  169. </p>
  170. <div id="content" class="description border">
  171. <p>
  172. <xsl:call-template name="linefeed2br">
  173. <xsl:with-param name="string" select="rec:meta[@name='DC.description']/@content"/>
  174. </xsl:call-template>
  175. </p>
  176. </div>
  177. <h3>Podcast</h3>
  178. <p id="podcasts" class="podcasts">keiner</p>
  179. <form id="ad_hoc" method="post" action="../../../../../enclosures/app/ad_hoc.cgi">
  180. <fieldset>
  181. <input id="ad_hoc_action" type="hidden" name="add" value="referer"/>
  182. <input id="ad_hoc_submit" type="submit" value="Aufnehmen"/>
  183. </fieldset>
  184. </form>
  185. <p id="enclosure">
  186. <!-- audio controls="controls" style="display:none">Doesn't play well with auth...<source type="audio/mpeg" /></audio -->
  187. <a id="enclosure_link">✇ mp3</a>
  188. </p>
  189. <hr style="clear:both"/>
  190. <ul id="allday" class="nobullet" style="display:none"><li>Dummy</li></ul>
  191. <p><a href=".">Verzeichnis Index</a></p>
  192. <ul id="whatsonnow" class="buttongroup">
  193. <!-- xsl:for-each select="$now_fellows_xml/*/rec:broadcast" -->
  194. <xsl:for-each select="/foo">
  195. <xsl:variable name="fellow_station_name" select="substring-before(rec:meta[@name='DC.identifier']/@content, '/')"/>
  196. <li id="station_{$fellow_station_name}"><a href="../../../../{rec:meta[@name='DC.identifier']/@content}">
  197. <span class="station"><xsl:value-of select="$fellow_station_name"/></span><xsl:text> </xsl:text>
  198. <!-- safari doesn't like that:
  199. <xsl:variable name="station_logo">
  200. <xsl:call-template name="station_logo"><xsl:with-param name="id" select="$fellow_station_name"/></xsl:call-template>
  201. </xsl:variable>
  202. <img style="max-height:1.7ex;max-width:15ex" alt="" src="{$station_logo}"/>
  203. -->
  204. <br class='br'/>
  205. <span class="broadcast"><xsl:value-of select="rec:meta[@name='DC.title']/@content"/></span>
  206. </a></li>
  207. </xsl:for-each>
  208. </ul>
  209. <hr style="clear:both"/>
  210. <p id="footer">
  211. <!--
  212. <a style="display:none" href="http://validator.w3.org/check?uri=referer">
  213. <img alt="Valid XHTML 1.0 Strict" height="31" src="http://www.w3.org/Icons/valid-xhtml10-blue.png" width="88"/>
  214. </a>
  215. <a style="display:none" href="http://jigsaw.w3.org/css-validator/check/referer?profile=css3&amp;usermedium=screen&amp;warning=2&amp;vextwarning=false&amp;lang=de">
  216. <img alt="CSS ist valide!" src="http://jigsaw.w3.org/css-validator/images/vcss-blue" style="border:0;width:88px;height:31px"/>
  217. </a>
  218. -->
  219. Powered by <a href="https://mro.name/radio-privatkopie">mro.name/radio-privatkopie</a><br class="br"/>
  220. <a href="http://www.w3.org/RDF/">RDF</a>:<br class="br"/>
  221. <tt>$ <a href="http://librdf.org/raptor/rapper.html">rapper</a> -i grddl -o turtle '<span class="canonical-url url">&lt;url from address bar&gt;</span>'</tt><br class="br"/>
  222. <tt>$ <a href="http://librdf.org/raptor/rapper.html">rapper</a> -i grddl -o rdfxml-abbrev '<span class="canonical-url">&lt;url from address bar&gt;</span>'</tt><br class="br"/>
  223. <tt>$ <a href="http://xmlsoft.org/XSLT/xsltproc.html">xsltproc</a> --stringparam canonical_url '<span class="canonical-url">&lt;url from address bar&gt;</span>' '<span class="base-url">&lt;url from address bar&gt;/../../../../../..</span>/assets/2013/broadcast2rdf.xslt' '<span class="canonical-url">&lt;url from address bar&gt;</span>'</tt>
  224. </p>
  225. <script type="text/javascript" src="../../../app/broadcast2html.js" />
  226. </body>
  227. </html>
  228. </xsl:template>
  229. <xsl:template match="/rec:broadcasts">
  230. <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="{rec:broadcast[1]/rec:meta[@name='DC.language']/@content}">
  231. <head>
  232. <meta content="text/html; charset=utf-8" http-equiv="content-type"/>
  233. <!-- https://developer.apple.com/library/IOS/documentation/AppleApplications/Reference/SafariWebContent/UsingtheViewport/UsingtheViewport.html#//apple_ref/doc/uid/TP40006509-SW26 -->
  234. <!-- http://www.quirksmode.org/blog/archives/2013/10/initialscale1_m.html -->
  235. <meta name="viewport" content="width=device-width,initial-scale=1.0"/>
  236. <!-- meta name="viewport" content="width=400"/ -->
  237. <link href="../../../../../assets/favicon-32x32.png" rel="shortcut icon" type="image/png" />
  238. <link href="../../../../../assets/favicon-512x512.png" rel="apple-touch-icon" type="image/png" />
  239. <link rel="profile" href="http://microformats.org/profile/hcalendar"/>
  240. <style type="text/css">
  241. /*&lt;![CDATA[<![CDATA[*/
  242. .broadcast img {
  243. width: 40%;
  244. }
  245. #broadcasts li {
  246. border-bottom: 1px solid #888;
  247. }
  248. a.glyphicon {
  249. width: 2ex;
  250. }
  251. a.glyphicon-play {
  252. color: red;
  253. }
  254. .text-capitalize {
  255. font-variant: small-caps;
  256. }
  257. #overview > li.selected::before {
  258. content: '· ';
  259. }
  260. /* This is a workaround for Browsers that insert additional <br> tags.
  261. * See http://purl.mro.name/safari-xslt-br-bug */
  262. br { display:none; }
  263. br.br { display:inline; }
  264. /*]]>]]&gt;*/
  265. </style>
  266. <title><xsl:value-of select="@date"/> foobar</title>
  267. </head>
  268. <body>
  269. <div class="container">
  270. <noscript><p>JavaScript ist aus, es geht zwar (fast) alles auch ohne, aber mit ist's <b>schöner</b>. (Zeitgleiche Sendungen anderer Sender, Datumsformatierung, Aufnahmen wieder stornieren, Tagesübersicht, RDF Url)</p></noscript>
  271. <h1 title="{@date}">
  272. <span id="date" class="moment_date" title="{@date}"><xsl:value-of select="@date"/></span><xsl:text> </xsl:text>
  273. <span id="station_logo"><xsl:call-template name="station_rdf_logo"/></span><xsl:text> </xsl:text>
  274. <small id="station_stream"><xsl:call-template name="station_rdf_stream"/></small>
  275. </h1>
  276. <ol id="broadcasts" class="list-unstyled">
  277. <xsl:for-each select="rec:broadcast">
  278. <xsl:variable name="dtstart" select="rec:meta[@name='DC.format.timestart']/@content"/>
  279. <xsl:variable name="rowid" select="translate(substring($dtstart, 11, 6), ':', '')"/>
  280. <xsl:variable name="duration_minutes" select="number(rec:meta[@name='DC.format.duration']/@content) div 60"/>
  281. <li class="broadcast vevent is_past clearfix" id="{$rowid}">
  282. <h4 class="pull-right">
  283. <a title="Woche vorher" href="../../../../../app/now.lua?t={$dtstart}P-7D" class="glyphicon glyphicon-fast-backward"/>
  284. <a title="Tag vorher" href="../../../../../app/now.lua?t={$dtstart}P-1D" class="glyphicon glyphicon-step-backward"/>
  285. <xsl:variable name="prev_rowid" select="translate(substring(preceding-sibling::rec:broadcast[1]/rec:meta[@name='DC.format.timestart']/@content, 11, 6), ':', '')"/>
  286. <xsl:choose>
  287. <xsl:when test="$prev_rowid"><a title="Sendung vorher" href="index#{$prev_rowid}" class="glyphicon glyphicon-chevron-left"/></xsl:when>
  288. <xsl:otherwise><a title="Sendung vorher" class="text-muted glyphicon glyphicon-chevron-left"/></xsl:otherwise>
  289. </xsl:choose>
  290. <span style="display:none">
  291. <a class="dtstart moment_time" href="index#{$rowid}" title="{rec:meta[@name='DC.format.timestart']/@content}"><xsl:value-of select="substring(rec:meta[@name='DC.format.timestart']/@content, 12, 5)"/></a>
  292. bis
  293. <a class="dtend moment_time" title="{rec:meta[@name='DC.format.timeend']/@content}"><xsl:value-of select="substring(rec:meta[@name='DC.format.timeend']/@content, 12, 5)"/></a>
  294. </span>
  295. <xsl:variable name="next_rowid" select="translate(substring(following-sibling::rec:broadcast[1]/rec:meta[@name='DC.format.timestart']/@content, 11, 6), ':', '')"/>
  296. <xsl:choose>
  297. <xsl:when test="$next_rowid"><a title="Sendung nachher" href="index#{$next_rowid}" class="glyphicon glyphicon-chevron-right"/></xsl:when>
  298. <xsl:otherwise><a title="Sendung nachher" class="text-muted glyphicon glyphicon-chevron-right"/></xsl:otherwise>
  299. </xsl:choose>
  300. <a title="Tag nachher" href="../../../../../app/now.lua?t={$dtstart}P+1D" class="glyphicon glyphicon-step-forward"/>
  301. <a title="Woche nachher" href="../../../../../app/now.lua?t={$dtstart}P+7D" class="glyphicon glyphicon-fast-forward"/>
  302. </h4>
  303. <h4 class="clearfix">
  304. <a class="dtstart moment_time" href="index#{$rowid}" title="{rec:meta[@name='DC.format.timestart']/@content}"><xsl:value-of select="substring(rec:meta[@name='DC.format.timestart']/@content, 12, 5)"/></a>
  305. bis
  306. <a class="dtend moment_time" title="{rec:meta[@name='DC.format.timeend']/@content}"><xsl:value-of select="substring(rec:meta[@name='DC.format.timeend']/@content, 12, 5)"/></a>:
  307. </h4>
  308. <p class="image">
  309. <a title="Original Sendungsseite beim Sender" class="via" href="{rec:meta[@name='DC.source']/@content}" rel="via">
  310. <img alt="Original Sendungsseite beim Sender" class="img-responsive pull-right" src="{rec:meta[@name='DC.image']/@content}"/>
  311. </a>
  312. </p>
  313. <xsl:if test="rec:meta[@name='DC.title.series']/@content">
  314. <h3 class="series"><xsl:value-of select="rec:meta[@name='DC.title.series']/@content"/></h3>
  315. </xsl:if>
  316. <h2 class="summary"><xsl:value-of select="rec:meta[@name='DC.title']/@content"/></h2>
  317. <xsl:if test="rec:meta[@name='DC.title.episode']/@content">
  318. <h3 class="episode"><xsl:value-of select="rec:meta[@name='DC.title.episode']/@content"/></h3>
  319. </xsl:if>
  320. <p class="description border detect-urls">
  321. <xsl:call-template name="linefeed2br">
  322. <xsl:with-param name="string" select="rec:meta[@name='DC.description']/@content"/>
  323. </xsl:call-template>
  324. </p>
  325. <h3>Aufnahme</h3>
  326. <p style="display:none" class="podcasts">keiner</p>
  327. <p class="enclosure">
  328. <!-- audio controls="controls" style="display:none">Doesn't play well with auth...<source type="audio/mpeg" /></audio -->
  329. <a title="Abspielen" class="glyphicon glyphicon-headphones"/>
  330. <a title="Aufnehmen" class="glyphicon glyphicon-play"/>
  331. <a title="Nicht Aufnehmen" class="glyphicon glyphicon-stop"/>
  332. <a title="Play" class="enclosure_link" href="../../../../../enclosures/{rec:meta[@name='DC.identifier']/@content}.mp3">
  333. ✇ mp3
  334. </a>
  335. </p>
  336. </li>
  337. </xsl:for-each>
  338. </ol>
  339. <ol id="overview" class="hidden list-unstyled small">
  340. <li class="is_past"><a href="#">Alle aufklappen</a></li>
  341. <!-- TODO: aktuell ? -->
  342. <xsl:for-each select="rec:broadcast">
  343. <xsl:variable name="rowid" select="translate(substring(rec:meta[@name='DC.format.timestart']/@content, 11, 6), ':', '')"/>
  344. <li class="broadcast is_past" id="mini_{$rowid}">
  345. <a href="#{$rowid}">
  346. <xsl:value-of select="substring(rec:meta[@name='DC.format.timestart']/@content, 12, 5)"/>
  347. <xsl:text> </xsl:text>
  348. <xsl:value-of select="rec:meta[@name='DC.title']/@content"/>
  349. </a>
  350. </li>
  351. </xsl:for-each>
  352. </ol>
  353. <hr/>
  354. <h2 id="stations">Aktuell auf anderen Sendern</h2>
  355. <table>
  356. <tbody>
  357. <!-- xsl:for-each select="$now_fellows_xml/*/rec:broadcast" -->
  358. <xsl:for-each select="/foo">
  359. <xsl:variable name="fellow_station_name" select="substring-before(rec:meta[@name='DC.identifier']/@content, '/')"/>
  360. <tr id="station_{$fellow_station_name}">
  361. <td class="text-capitalize"><xsl:value-of select="$fellow_station_name"/></td>
  362. <td class="text-right">
  363. <!-- safari doesn't like that: -->
  364. <!-- xsl:variable name="station_logo">
  365. <xsl:call-template name="station_logo"><xsl:with-param name="id" select="$fellow_station_name"/></xsl:call-template>
  366. </xsl:variable -->
  367. <img style="max-height:2.7ex;max-width:15ex;" alt="" src="../../../../{$fellow_station_name}/app/logo.svg"/>
  368. </td>
  369. <td>
  370. <a href="../../../../{rec:meta[@name='DC.identifier']/@content}">
  371. <xsl:value-of select="rec:meta[@name='DC.title']/@content"/>
  372. </a>
  373. </td>
  374. </tr>
  375. </xsl:for-each>
  376. </tbody>
  377. </table>
  378. <hr/>
  379. <p id="footer" class="small">
  380. <!--
  381. <a style="display:none" href="http://validator.w3.org/check?uri=referer">
  382. <img alt="Valid XHTML 1.0 Strict" height="31" src="http://www.w3.org/Icons/valid-xhtml10-blue.png" width="88"/>
  383. </a>
  384. <a style="display:none" href="http://jigsaw.w3.org/css-validator/check/referer?profile=css3&amp;usermedium=screen&amp;warning=2&amp;vextwarning=false&amp;lang=de">
  385. <img alt="CSS ist valide!" src="http://jigsaw.w3.org/css-validator/images/vcss-blue" style="border:0;width:88px;height:31px"/>
  386. </a>
  387. -->
  388. Powered by <a href="https://mro.name/radio-privatkopie">codeberg.org/mro/internet-radio-recorder</a>,
  389. Icons from <a href="http://danklammer.com/bytesize-icons/">Bytesize</a>,
  390. <a href="http://getbootstrap.com/components/#glyphicons">Glyphicons</a> and
  391. <a href="http://fontawesome.io/">Font Awesome</a>.<br class="br"/>
  392. <a href="http://www.w3.org/RDF/">RDF</a>:<br class="br"/>
  393. <tt>$ url='<span class="canonical-url">&lt;url from address bar&gt;</span>' ; curl "${url}" | gunzip | <a href="http://librdf.org/raptor/rapper.html">rapper</a> -i grddl -o turtle - "${url}"</tt><br class="br"/>
  394. <tt>$ url='<span class="canonical-url">&lt;url from address bar&gt;</span>' ; curl "${url}" | gunzip | <a href="http://librdf.org/raptor/rapper.html">rapper</a> -i grddl -o rdfxml-abbrev - "${url}"</tt><br class="br"/>
  395. <tt>$ url='<span class="canonical-url">&lt;url from address bar&gt;</span>' ; <a href="http://xmlsoft.org/XSLT/xsltproc.html">xsltproc</a> --stringparam canonical_url "${url}" '<span class="base-url">&lt;url from address bar&gt;/../../../../../..</span>/assets/2013/broadcast2rdf.xslt' "${url}"</tt>
  396. </p>
  397. </div><xsl:comment> /container </xsl:comment>
  398. <script type="text/javascript" src="../../../../../assets/broadcast2html.js" />
  399. <script type="text/javascript">
  400. // <![CDATA[
  401. console.log('rec:broadcasts');
  402. $('.detect-urls').html(function(i, value) { return amendClickableURLsInHTML(value); });
  403. function updateForTimeHash(has) {
  404. $('#broadcasts li.broadcast').toggleClass('hidden', true);
  405. $('#broadcasts li' + has).toggleClass('hidden', false);
  406. $('#overview li > a').toggleClass('bg-primary', false);
  407. $('#mini_' + has.replace('#','') + ' > a').toggleClass('bg-primary', true);
  408. // looks stupid but forces scroll (on Firefox):
  409. location.hash = has;
  410. }
  411. window.onhashchange = function(){ updateForTimeHash(location.hash); };
  412. /*
  413. http://stackoverflow.com/questions/265774/programmatically-scroll-to-an-anchor-tag
  414. document.getElementById('MyID').scrollIntoView(true)
  415. */
  416. window.addEventListener("DOMContentLoaded", function(event) {
  417. $('#overview').toggleClass('hidden', false);
  418. updateForTimeHash(location.hash);
  419. });
  420. //]]>
  421. </script>
  422. </body>
  423. </html>
  424. </xsl:template>
  425. </xsl:stylesheet>