| 1 |
<?xml version="1.0" encoding="UTF-8"?> |
|---|
| 2 |
<!-- |
|---|
| 3 |
Licensed to Jasig under one or more contributor license |
|---|
| 4 |
agreements. See the NOTICE file distributed with this work |
|---|
| 5 |
for additional information regarding copyright ownership. |
|---|
| 6 |
Jasig licenses this file to you under the Apache License, |
|---|
| 7 |
Version 2.0 (the "License"); you may not use this file |
|---|
| 8 |
except in compliance with the License. You may obtain a |
|---|
| 9 |
copy of the License at: |
|---|
| 10 |
|
|---|
| 11 |
http://www.apache.org/licenses/LICENSE-2.0 |
|---|
| 12 |
|
|---|
| 13 |
Unless required by applicable law or agreed to in writing, |
|---|
| 14 |
software distributed under the License is distributed on |
|---|
| 15 |
an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
|---|
| 16 |
KIND, either express or implied. See the License for the |
|---|
| 17 |
specific language governing permissions and limitations |
|---|
| 18 |
under the License. |
|---|
| 19 |
--> |
|---|
| 20 |
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> |
|---|
| 21 |
<xsl:output method="html" indent="yes" media-type="text/html" doctype-public="-//W3C//DTD HTML 4.01 Transitional//EN" doctype-system="http://www.w3.org/TR/html4/loose.dtd" standalone="yes"/> |
|---|
| 22 |
<!-- ======================= --> |
|---|
| 23 |
<!-- VIDEO FEED STYLESHEET --> |
|---|
| 24 |
<!-- ======================= --> |
|---|
| 25 |
|
|---|
| 26 |
<!-- Run your browser full screen at 800 x 600 and feed this to video. |
|---|
| 27 |
There are better approaches to this, but it's an interesting example. --> |
|---|
| 28 |
|
|---|
| 29 |
<!-- URL of html resources (images, css, other html); by default this is |
|---|
| 30 |
set to the current theme directory --> |
|---|
| 31 |
<xsl:variable name="resourcesRoot"><xsl:value-of select="/bedework/browserResourceRoot"/>/themes/videocalTheme</xsl:variable> |
|---|
| 32 |
|
|---|
| 33 |
<!-- Duration of each slide in seconds; set this to your preference --> |
|---|
| 34 |
<xsl:variable name="slideDuration">10</xsl:variable> |
|---|
| 35 |
|
|---|
| 36 |
<!-- Number of consecutive days to iterate over; set this to your preference --> |
|---|
| 37 |
<xsl:variable name="dayCount">5</xsl:variable> |
|---|
| 38 |
|
|---|
| 39 |
<!-- Skin name --> |
|---|
| 40 |
<xsl:variable name="skinName">videocal</xsl:variable> |
|---|
| 41 |
|
|---|
| 42 |
<!-- Position of the current day to be displayed --> |
|---|
| 43 |
<xsl:variable name="day"> |
|---|
| 44 |
<xsl:choose> |
|---|
| 45 |
<xsl:when test="/bedework/appvar[key='day']"> |
|---|
| 46 |
<xsl:choose> |
|---|
| 47 |
<xsl:when test="/bedework/appvar[key='day']/value > $dayCount">1</xsl:when> |
|---|
| 48 |
<xsl:otherwise> |
|---|
| 49 |
<xsl:value-of select="/bedework/appvar[key='day']/value"/> |
|---|
| 50 |
</xsl:otherwise> |
|---|
| 51 |
</xsl:choose> |
|---|
| 52 |
</xsl:when> |
|---|
| 53 |
<xsl:otherwise>1</xsl:otherwise> |
|---|
| 54 |
</xsl:choose> |
|---|
| 55 |
</xsl:variable> |
|---|
| 56 |
|
|---|
| 57 |
<!-- Position of the next day (add 1)--> |
|---|
| 58 |
<xsl:variable name="nextDay" select="number($day)+1"/> |
|---|
| 59 |
|
|---|
| 60 |
<!-- Event count for the current day --> |
|---|
| 61 |
<xsl:variable name="eventCount" select="count(/bedework/eventscalendar/year/month/week/day[date=$curdate]/event)"/> |
|---|
| 62 |
|
|---|
| 63 |
<!-- Position of the current event being displayed --> |
|---|
| 64 |
<xsl:variable name="event"> |
|---|
| 65 |
<xsl:choose> |
|---|
| 66 |
<xsl:when test="/bedework/appvar[key='event']"> |
|---|
| 67 |
<xsl:choose> |
|---|
| 68 |
<xsl:when test="/bedework/appvar[key='event']/value > $eventCount">1</xsl:when> |
|---|
| 69 |
<xsl:otherwise> |
|---|
| 70 |
<xsl:value-of select="/bedework/appvar[key='event']/value"/> |
|---|
| 71 |
</xsl:otherwise> |
|---|
| 72 |
</xsl:choose> |
|---|
| 73 |
</xsl:when> |
|---|
| 74 |
<xsl:otherwise>1</xsl:otherwise> |
|---|
| 75 |
</xsl:choose> |
|---|
| 76 |
</xsl:variable> |
|---|
| 77 |
|
|---|
| 78 |
<!-- Position of the next event (add 1)--> |
|---|
| 79 |
<xsl:variable name="nextEvent" select="number($event)+1"/> |
|---|
| 80 |
|
|---|
| 81 |
<!-- MAIN TEMPLATE --> |
|---|
| 82 |
<xsl:template match="/"> |
|---|
| 83 |
<html lang="en"> |
|---|
| 84 |
<head> |
|---|
| 85 |
<title>Event Calendar Video Feed</title> |
|---|
| 86 |
<link rel="stylesheet" href="{$resourcesRoot}/videocal.css"/> |
|---|
| 87 |
<meta name="robots" content="noindex,nofollow"/> |
|---|
| 88 |
<script language="JavaScript"> |
|---|
| 89 |
function today() { |
|---|
| 90 |
var now = new Date(); |
|---|
| 91 |
var today; |
|---|
| 92 |
today = now.getFullYear().toString(); |
|---|
| 93 |
if (now.getMonth() < 9) { |
|---|
| 94 |
today += "0"; |
|---|
| 95 |
} |
|---|
| 96 |
today += (now.getMonth() + 1).toString(); |
|---|
| 97 |
today += now.getDate().toString(); |
|---|
| 98 |
return today; |
|---|
| 99 |
} |
|---|
| 100 |
</script> |
|---|
| 101 |
<xsl:choose> |
|---|
| 102 |
<xsl:when test="/bedework/periodname!='Day'"> |
|---|
| 103 |
<!-- we're starting up on the wrong view; go to today and begin with the first event; |
|---|
| 104 |
the title slide will display during this switch. --> |
|---|
| 105 |
<meta http-equiv="refresh" content="{$slideDuration};url={$setViewPeriod}&viewType=todayView&setappvar=event(1)&setappvar=day(1)&skinNameSticky={$skinName}&setappvar=summaryMode(details)"/> |
|---|
| 106 |
</xsl:when> |
|---|
| 107 |
<xsl:when test="($nextDay > $dayCount) and ($nextEvent > $eventCount)"> |
|---|
| 108 |
<!-- passed the last day, and all events have been displayed, |
|---|
| 109 |
so start over: go to today, set day=1 and *event=0* to allow |
|---|
| 110 |
for the title slide "calPlug" --> |
|---|
| 111 |
<meta http-equiv="refresh" content="{$slideDuration};url={$setViewPeriod}&viewType=todayView&setappvar=event(0)&setappvar=day(1)&skinNameSticky={$skinName}&setappvar=summaryMode(details)"/> |
|---|
| 112 |
</xsl:when> |
|---|
| 113 |
<xsl:when test="$nextEvent > $eventCount"> |
|---|
| 114 |
<!-- passed the last event for the day; go to the next day and set event=1 --> |
|---|
| 115 |
<meta http-equiv="refresh" content="{$slideDuration};url={$setViewPeriod}&date={$nextdate}&viewType=dayView&setappvar=event(1)&setappvar=day({$nextDay})&skinNameSticky={$skinName}&setappvar=summaryMode(details)"/> |
|---|
| 116 |
</xsl:when> |
|---|
| 117 |
<xsl:otherwise> |
|---|
| 118 |
<!-- otherwise, go to the next event on the same day --> |
|---|
| 119 |
<meta http-equiv="refresh" content="{$slideDuration};url={$setup}&viewType=dayView&setappvar=event({$nextEvent})&setappvar=day({$day})&skinNameSticky={$skinName}&setappvar=summaryMode(details)"/> |
|---|
| 120 |
</xsl:otherwise> |
|---|
| 121 |
</xsl:choose> |
|---|
| 122 |
</head> |
|---|
| 123 |
<body> |
|---|
| 124 |
<xsl:choose> |
|---|
| 125 |
<xsl:when test="($eventCount = 0) or ($event = 0) or (/bedework/periodname!='Day')"> |
|---|
| 126 |
<div id="calPlug"> |
|---|
| 127 |
<h1> |
|---|
| 128 |
Bedework Calendar of Events |
|---|
| 129 |
Video Feed |
|---|
| 130 |
</h1> |
|---|
| 131 |
<h2>http://www.jasig.org/bedework</h2> |
|---|
| 132 |
</div> |
|---|
| 133 |
</xsl:when> |
|---|
| 134 |
<xsl:otherwise> |
|---|
| 135 |
<h2 id="calTitle"> |
|---|
| 136 |
BEDEWORK CALENDAR OF EVENTS |
|---|
| 137 |
</h2> |
|---|
| 138 |
<h2 id="dayTitle"> |
|---|
| 139 |
<xsl:value-of select="/bedework/firstday/longdate"/><!-- |
|---|
| 140 |
<br/>Events: <xsl:value-of select="$event"/> of <xsl:value-of select="$eventCount"/> |
|---|
| 141 |
<br/>Days: <xsl:value-of select="$day"/> of <xsl:value-of select="$dayCount"/> --> |
|---|
| 142 |
</h2> |
|---|
| 143 |
<xsl:apply-templates select="/bedework/eventscalendar/year/month/week/day[date=$curdate]/event[position()=$event]"/> |
|---|
| 144 |
</xsl:otherwise> |
|---|
| 145 |
</xsl:choose> |
|---|
| 146 |
<!-- remove the following two divs if used for video --> |
|---|
| 147 |
<div id="getBack"> |
|---|
| 148 |
(<a href="{$setup}&skinNameSticky=default">restore normal calendar</a>) |
|---|
| 149 |
</div> |
|---|
| 150 |
<div id="info"> |
|---|
| 151 |
This stylesheet will rotate through five days of events at ten |
|---|
| 152 |
second intervals. It is intended as a video feed running full screen |
|---|
| 153 |
at 800x600px. It's settings |
|---|
| 154 |
can be set from the top of |
|---|
| 155 |
the videocal.xsl stylesheet. |
|---|
| 156 |
</div> |
|---|
| 157 |
</body> |
|---|
| 158 |
</html> |
|---|
| 159 |
</xsl:template> |
|---|
| 160 |
|
|---|
| 161 |
<!--==== SINGLE EVENT ====--> |
|---|
| 162 |
<xsl:template match="event"> |
|---|
| 163 |
<h1> |
|---|
| 164 |
<xsl:value-of select="summary"/> |
|---|
| 165 |
</h1> |
|---|
| 166 |
<xsl:if test="(start/allday = 'false')"> |
|---|
| 167 |
<div id="time"> |
|---|
| 168 |
<!-- this logic needs to be updated for new event model --> |
|---|
| 169 |
<xsl:choose> |
|---|
| 170 |
<xsl:when test="start/time=''"> |
|---|
| 171 |
<xsl:value-of select="start/shortdate"/> |
|---|
| 172 |
</xsl:when> |
|---|
| 173 |
<xsl:when test="start/date != /bedework/firstday"> |
|---|
| 174 |
<xsl:value-of select="start/shortdate"/> |
|---|
| 175 |
<xsl:value-of select="start/time"/> |
|---|
| 176 |
</xsl:when> |
|---|
| 177 |
<xsl:otherwise> |
|---|
| 178 |
<xsl:value-of select="start/time"/> |
|---|
| 179 |
</xsl:otherwise> |
|---|
| 180 |
</xsl:choose> |
|---|
| 181 |
- |
|---|
| 182 |
<xsl:if test="end/longdate != start/longdate"> |
|---|
| 183 |
<xsl:value-of select="end/shortdate"/> |
|---|
| 184 |
<xsl:text> </xsl:text> |
|---|
| 185 |
</xsl:if> |
|---|
| 186 |
<xsl:value-of select="end/time"/> |
|---|
| 187 |
</div> |
|---|
| 188 |
</xsl:if> |
|---|
| 189 |
<xsl:if test="location/address!='Campus-wide'"> |
|---|
| 190 |
<div id="location"> |
|---|
| 191 |
<xsl:value-of select="location/address"/> |
|---|
| 192 |
</div> |
|---|
| 193 |
</xsl:if> |
|---|
| 194 |
<div id="description"> |
|---|
| 195 |
<xsl:value-of select="description"/> |
|---|
| 196 |
</div> |
|---|
| 197 |
</xsl:template> |
|---|
| 198 |
|
|---|
| 199 |
</xsl:stylesheet> |
|---|