Changeset 1624

Show
Ignore:
Timestamp:
11/30/07 07:28:56
Author:
kllin
Message:

broken out of default.xsl

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/xslt-rewrite/deployment/resources/xsl/default/default/clock.xsl

    r1622 r1624  
    7878 
    7979</xsl:stylesheet> 
     80<?xml version="1.0" encoding="UTF-8"?> 
     81<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> 
     82 
     83  <xsl:template name="clock"> 
     84    <div id="bwClock"> 
     85      <!-- Bedework 24-Hour Clock time selection widget 
     86           used with resources/bwClock.js and resources/bwClock.css --> 
     87      <xsl:variable name="hour24" select="/bedework/hour24"/><!-- true or false --> 
     88      <div id="bwClockClock"> 
     89        <img id="clockMap" src="{$resourcesRoot}/resources/clockMap.gif" width="368" height="368" border="0" alt="bwClock" usemap="#bwClockMap" /> 
     90      </div> 
     91      <div id="bwClockCover"> 
     92        &#160; 
     93        <!-- this is a special effect div used simply to cover the pixelated edge 
     94             where the clock meets the clock box title --> 
     95      </div> 
     96      <div id="bwClockBox"> 
     97        <h2> 
     98          Bedework 24-Hour Clock 
     99        </h2> 
     100        <div id="bwClockDateTypeIndicator"> 
     101          type 
     102        </div> 
     103        <div id="bwClockTime"> 
     104          select time 
     105        </div> 
     106        <div id="bwClockSwitch"> 
     107          switch 
     108        </div> 
     109        <div id="bwClockCloseText"> 
     110          close 
     111        </div> 
     112        <div id="bwClockCloseButton"> 
     113          <a href="javascript:bwClockClose();">X</a> 
     114        </div> 
     115      </div> 
     116      <map name="bwClockMap" id="bwClockMap"> 
     117        <area shape="rect" alt="close clock" title="close clock" coords="160,167, 200,200" href="javascript:bwClockClose()"/> 
     118        <area shape="poly" alt="minute 00:55" title="minute 00:55" coords="156,164, 169,155, 156,107, 123,128" href="javascript:bwClockUpdateDateTimeForm('minute','55')" /> 
     119        <area shape="poly" alt="minute 00:50" title="minute 00:50" coords="150,175, 156,164, 123,128, 103,161" href="javascript:bwClockUpdateDateTimeForm('minute','50')" /> 
     120        <area shape="poly" alt="minute 00:45" title="minute 00:45" coords="150,191, 150,175, 103,161, 103,206" href="javascript:bwClockUpdateDateTimeForm('minute','45')" /> 
     121        <area shape="poly" alt="minute 00:40" title="minute 00:40" coords="158,208, 150,191, 105,206, 123,237" href="javascript:bwClockUpdateDateTimeForm('minute','40')" /> 
     122        <area shape="poly" alt="minute 00:35" title="minute 00:35" coords="171,218, 158,208, 123,238, 158,261" href="javascript:bwClockUpdateDateTimeForm('minute','35')" /> 
     123        <area shape="poly" alt="minute 00:30" title="minute 00:30" coords="193,218, 172,218, 158,263, 209,263" href="javascript:bwClockUpdateDateTimeForm('minute','30')" /> 
     124        <area shape="poly" alt="minute 00:25" title="minute 00:25" coords="209,210, 193,218, 209,261, 241,240" href="javascript:bwClockUpdateDateTimeForm('minute','25')" /> 
     125        <area shape="poly" alt="minute 00:20" title="minute 00:20" coords="216,196, 209,210, 241,240, 261,206" href="javascript:bwClockUpdateDateTimeForm('minute','20')" /> 
     126        <area shape="poly" alt="minute 00:15" title="minute 00:15" coords="216,178, 216,196, 261,206, 261,159" href="javascript:bwClockUpdateDateTimeForm('minute','15')" /> 
     127        <area shape="poly" alt="minute 00:10" title="minute 00:10" coords="209,164, 216,178, 261,159, 240,126" href="javascript:bwClockUpdateDateTimeForm('minute','10')" /> 
     128        <area shape="poly" alt="minute 00:05" title="minute 00:05" coords="196,155, 209,164, 238,126, 206,107" href="javascript:bwClockUpdateDateTimeForm('minute','5')" /> 
     129        <area shape="poly" alt="minute 00:00" title="minute 00:00" coords="169,155, 196,155, 206,105, 156,105" href="javascript:bwClockUpdateDateTimeForm('minute','0')" /> 
     130        <area shape="poly" alt="11 PM, 2300 hour" title="11 PM, 2300 hour" coords="150,102, 172,96, 158,1, 114,14" href="javascript:bwClockUpdateDateTimeForm('hour','23',{$hour24})" /> 
     131        <area shape="poly" alt="10 PM, 2200 hour" title="10 PM, 2200 hour" coords="131,114, 150,102, 114,14, 74,36" href="javascript:bwClockUpdateDateTimeForm('hour','22',{$hour24})" /> 
     132        <area shape="poly" alt="9 PM, 2100 hour" title="9 PM, 2100 hour" coords="111,132, 131,114, 74,36, 40,69" href="javascript:bwClockUpdateDateTimeForm('hour','21',{$hour24})" /> 
     133        <area shape="poly" alt="8 PM, 2000 hour" title="8 PM, 2000 hour" coords="101,149, 111,132, 40,69, 15,113" href="javascript:bwClockUpdateDateTimeForm('hour','20',{$hour24})" /> 
     134        <area shape="poly" alt="7 PM, 1900 hour" title="7 PM, 1900 hour" coords="95,170, 101,149, 15,113, 1,159" href="javascript:bwClockUpdateDateTimeForm('hour','19',{$hour24})" /> 
     135        <area shape="poly" alt="6 PM, 1800 hour" title="6 PM, 1800 hour" coords="95,196, 95,170, 0,159, 0,204" href="javascript:bwClockUpdateDateTimeForm('hour','18',{$hour24})" /> 
     136        <area shape="poly" alt="5 PM, 1700 hour" title="5 PM, 1700 hour" coords="103,225, 95,196, 1,205, 16,256" href="javascript:bwClockUpdateDateTimeForm('hour','17',{$hour24})" /> 
     137        <area shape="poly" alt="4 PM, 1600 hour" title="4 PM, 1600 hour" coords="116,245, 103,225, 16,256, 41,298" href="javascript:bwClockUpdateDateTimeForm('hour','16',{$hour24})" /> 
     138        <area shape="poly" alt="3 PM, 1500 hour" title="3 PM, 1500 hour" coords="134,259, 117,245, 41,298, 76,332" href="javascript:bwClockUpdateDateTimeForm('hour','15',{$hour24})" /> 
     139        <area shape="poly" alt="2 PM, 1400 hour" title="2 PM, 1400 hour" coords="150,268, 134,259, 76,333, 121,355" href="javascript:bwClockUpdateDateTimeForm('hour','14',{$hour24})" /> 
     140        <area shape="poly" alt="1 PM, 1300 hour" title="1 PM, 1300 hour" coords="169,273, 150,268, 120,356, 165,365" href="javascript:bwClockUpdateDateTimeForm('hour','13',{$hour24})" /> 
     141        <area shape="poly" alt="Noon, 1200 hour" title="Noon, 1200 hour" coords="193,273, 169,273, 165,365, 210,364" href="javascript:bwClockUpdateDateTimeForm('hour','12',{$hour24})" /> 
     142        <area shape="poly" alt="11 AM, 1100 hour" title="11 AM, 1100 hour" coords="214,270, 193,273, 210,363, 252,352" href="javascript:bwClockUpdateDateTimeForm('hour','11',{$hour24})" /> 
     143        <area shape="poly" alt="10 AM, 1000 hour" title="10 AM, 1000 hour" coords="232,259, 214,270, 252,352, 291,330" href="javascript:bwClockUpdateDateTimeForm('hour','10',{$hour24})" /> 
     144        <area shape="poly" alt="9 AM, 0900 hour" title="9 AM, 0900 hour" coords="251,240, 232,258, 291,330, 323,301" href="javascript:bwClockUpdateDateTimeForm('hour','9',{$hour24})" /> 
     145        <area shape="poly" alt="8 AM, 0800 hour" title="8 AM, 0800 hour" coords="263,219, 251,239, 323,301, 349,261" href="javascript:bwClockUpdateDateTimeForm('hour','8',{$hour24})" /> 
     146        <area shape="poly" alt="7 AM, 0700 hour" title="7 AM, 0700 hour" coords="269,194, 263,219, 349,261, 363,212" href="javascript:bwClockUpdateDateTimeForm('hour','7',{$hour24})" /> 
     147        <area shape="poly" alt="6 AM, 0600 hour" title="6 AM, 0600 hour" coords="269,172, 269,193, 363,212, 363,155" href="javascript:bwClockUpdateDateTimeForm('hour','6',{$hour24})" /> 
     148        <area shape="poly" alt="5 AM, 0500 hour" title="5 AM, 0500 hour" coords="263,150, 269,172, 363,155, 351,109" href="javascript:bwClockUpdateDateTimeForm('hour','5',{$hour24})" /> 
     149        <area shape="poly" alt="4 AM, 0400 hour" title="4 AM, 0400 hour" coords="251,130, 263,150, 351,109, 325,68" href="javascript:bwClockUpdateDateTimeForm('hour','4',{$hour24})" /> 
     150        <area shape="poly" alt="3 AM, 0300 hour" title="3 AM, 0300 hour" coords="234,112, 251,130, 325,67, 295,37" href="javascript:bwClockUpdateDateTimeForm('hour','3',{$hour24})" /> 
     151        <area shape="poly" alt="2 AM, 0200 hour" title="2 AM, 0200 hour" coords="221,102, 234,112, 295,37, 247,11" href="javascript:bwClockUpdateDateTimeForm('hour','2',{$hour24})" /> 
     152        <area shape="poly" alt="1 AM, 0100 hour" title="1 AM, 0100 hour" coords="196,96, 221,102, 247,10, 209,-1, 201,61, 206,64, 205,74, 199,75" href="javascript:bwClockUpdateDateTimeForm('hour','1',{$hour24})" /> 
     153        <area shape="poly" alt="Midnight, 0000 hour" title="Midnight, 0000 hour" coords="172,96, 169,74, 161,73, 161,65, 168,63, 158,-1, 209,-1, 201,61, 200,62, 206,64, 205,74, 198,75, 196,96, 183,95" href="javascript:bwClockUpdateDateTimeForm('hour','0',{$hour24})" /> 
     154      </map> 
     155    </div> 
     156  </xsl:template> 
     157 
     158</xsl:stylesheet> 
  • branches/xslt-rewrite/deployment/resources/xsl/default/default/freebusy.xsl

    r1622 r1624  
    232232 
    233233</xsl:stylesheet> 
     234<?xml version="1.0" encoding="UTF-8"?> 
     235<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> 
     236 
     237  <!--+++++++++++++++ Free / Busy ++++++++++++++++++++--> 
     238  <xsl:template match="freebusy" mode="freeBusyPage"> 
     239    <span id="freeBusyShareLink"> 
     240      <a href="{$calendar-fetch}">share my free-busy</a> 
     241      <!--<div dojoType="FloatingPane" id="bwHelpWidget-shareFreeBusy" 
     242               title="Bedework Help" toggle="plain" 
     243               windowState="minimized" hasShadow="true" 
     244               displayMinimizeAction="true" resizable="false" 
     245               constrainToContainer="true"> 
     246        You may share your free busy with a user or group 
     247        by <a href="{$calendar-fetch}">setting 
     248        access to "read freebusy" on calendars</a> you wish to share. 
     249        To share all your free busy, grant 
     250        "read freebusy" access on your root folder. 
     251      </div> 
     252      <span class="contextHelp"> 
     253        <a href="javascript:launchHelpWidget('bwHelpWidget-shareFreeBusy')"> 
     254          <img src="{$resourcesRoot}/resources/std-button-help.gif" width="13" height="13" border="0" alt="help"/> 
     255        </a> 
     256      </span>--> 
     257      <span class="contextHelp"> 
     258        <img src="{$resourcesRoot}/resources/std-button-help.gif" width="13" height="13" alt="help" onmouseover="changeClass('helpShareFreeBusy','visible helpBox');" onmouseout="changeClass('helpShareFreeBusy','invisible');"/> 
     259      </span> 
     260      <div id="helpShareFreeBusy" class="helpBox invisible"> 
     261          You may share your free busy with a user or group 
     262          by setting access to "read freebusy" on calendars you wish to share. 
     263          To share all your free busy, grant 
     264          "read freebusy" access on your root folder. 
     265      </div> 
     266    </span> 
     267    <h2> 
     268      Free / Busy 
     269    </h2> 
     270 
     271    <div id="freeBusyPage"> 
     272      <form name="viewFreeBusyForm" id="viewFreeBusyForm" method="post" action="{$freeBusy-fetch}"> 
     273        View user's free/busy: 
     274        <input type="text" name="userid" size="20"/> 
     275        <input type="submit" name="submit" value="Submit"/> 
     276      </form> 
     277      <xsl:apply-templates select="." mode="freeBusyGrid"> 
     278        <xsl:with-param name="type">normal</xsl:with-param> 
     279      </xsl:apply-templates> 
     280    </div> 
     281  </xsl:template> 
     282 
     283 
     284 
     285 
     286 
     287 
     288  <xsl:template match="freebusy" mode="freeBusyGrid"> 
     289    <xsl:param name="aggregation">false</xsl:param> 
     290    <xsl:param name="type">normal</xsl:param> 
     291      <table id="freeBusy"> 
     292        <tr> 
     293          <td></td> 
     294          <th colspan="24" class="left"> 
     295            Freebusy for 
     296            <span class="who"> 
     297              <xsl:choose> 
     298                <xsl:when test="$aggregation = 'true'"> 
     299                  all attendees 
     300                </xsl:when> 
     301                <xsl:when test="starts-with(fbattendee/recipient,'mailto:')"> 
     302                  <xsl:value-of select="substring-after(fbattendee/recipient,'mailto:')"/> 
     303                </xsl:when> 
     304                <xsl:otherwise> 
     305                  <xsl:value-of select="fbattendee/recipient"/> 
     306                </xsl:otherwise> 
     307              </xsl:choose> 
     308            </span> 
     309          </th> 
     310          <!-- at some point allow switching of timezones: 
     311          <th colspan="32" class="right"> 
     312            <xsl:variable name="currentTimezone">America/Los_Angeles</xsl:variable> 
     313            <xsl:value-of select="$formattedStartDate"/> to <xsl:value-of select="$formattedEndDate"/> 
     314            <select name="timezone" id="timezonesDropDown" onchange="submit()"> 
     315              <xsl:for-each select="/bedework-fbaggregator/timezones/tzid"> 
     316                <option> 
     317                  <xsl:attribute name="value"><xsl:value-of select="."/></xsl:attribute> 
     318                  <xsl:if test="node() = $currentTimezone"><xsl:attribute name="selected">selected</xsl:attribute></xsl:if> 
     319                  <xsl:value-of select="."/> 
     320                </option> 
     321              </xsl:for-each> 
     322            </select> 
     323          </th>--> 
     324        </tr> 
     325        <tr> 
     326          <td>&#160;</td> 
     327          <td colspan="12" class="morning">AM</td> 
     328          <td colspan="12" class="evening">PM</td> 
     329        </tr> 
     330        <tr> 
     331          <td>&#160;</td> 
     332          <xsl:for-each select="day[position()=1]/period"> 
     333            <td class="timeLabels"> 
     334              <xsl:choose> 
     335                <xsl:when test="number(start) mod 200 = 0"> 
     336                  <xsl:call-template name="timeFormatter"> 
     337                    <xsl:with-param name="timeString" select="start"/> 
     338                    <xsl:with-param name="showMinutes">no</xsl:with-param> 
     339                    <xsl:with-param name="showAmPm">no</xsl:with-param> 
     340                  </xsl:call-template> 
     341                </xsl:when> 
     342                <xsl:otherwise> 
     343                  &#160; 
     344                </xsl:otherwise> 
     345              </xsl:choose> 
     346            </td> 
     347          </xsl:for-each> 
     348        </tr> 
     349        <xsl:for-each select="day"> 
     350          <tr> 
     351            <td class="dayDate"><xsl:value-of select="number(substring(dateString,5,2))"/>-<xsl:value-of select="number(substring(dateString,7,2))"/></td> 
     352            <xsl:for-each select="period"> 
     353              <xsl:variable name="startTime" select="start"/> 
     354              <!-- the start date for the add event link is a concat of the day's date plus the period's time (+ seconds)--> 
     355              <xsl:variable name="startDate"><xsl:value-of select="../dateString"/>T<xsl:value-of select="start"/>00</xsl:variable> 
     356              <xsl:variable name="meetingDuration" select="length"/> 
     357              <td> 
     358                <xsl:attribute name="class"> 
     359                  <xsl:choose> 
     360                    <xsl:when test="fbtype = '0'">busy</xsl:when> 
     361                    <xsl:when test="fbtype = '3'">tentative</xsl:when> 
     362                    <xsl:otherwise>free</xsl:otherwise> 
     363                  </xsl:choose> 
     364                </xsl:attribute> 
     365                <xsl:variable name="action"> 
     366                  <xsl:choose> 
     367                    <xsl:when test="$aggregation = 'true'"><xsl:value-of select="$updateEvent"/></xsl:when> 
     368                    <xsl:otherwise><xsl:value-of select="$initEvent"/></xsl:otherwise> 
     369                  </xsl:choose> 
     370                </xsl:variable> 
     371                <xsl:variable name="urlString"> 
     372                  <xsl:choose> 
     373                   <xsl:when test="$type='meeting'"><xsl:value-of select="$action"/>&amp;meetingStartdt=<xsl:value-of select="$startDate"/>&amp;meetingDuration=<xsl:value-of select="$meetingDuration"/>&amp;initDates=yes</xsl:when> 
     374                   <xsl:otherwise><xsl:value-of select="$action"/>&amp;startdate=<xsl:value-of select="$startDate"/>&amp;minutes=<xsl:value-of select="$meetingDuration"/></xsl:otherwise> 
     375                 </xsl:choose> 
     376                </xsl:variable> 
     377                <a href="{$urlString}"> 
     378                  <xsl:choose> 
     379                    <xsl:when test="((numBusy &gt; 0) and (numBusy &lt; 9)) or ((numTentative &gt; 0) and (numTentative &lt; 9)) and (number(numBusy) + number(numTentative) &lt; 9)"> 
     380                      <xsl:value-of select="number(numBusy) + number(numTentative)"/> 
     381                    </xsl:when> 
     382                    <xsl:otherwise><img src="{$resourcesRoot}/resources/spacer.gif" width="10" height="20" border="0" alt="f"/></xsl:otherwise> 
     383                  </xsl:choose> 
     384                  <span class="eventTip"> 
     385                    <xsl:value-of select="substring(../dateString,1,4)"/>-<xsl:value-of select="number(substring(../dateString,5,2))"/>-<xsl:value-of select="number(substring(../dateString,7,2))"/> 
     386                    <br/> 
     387                    <strong> 
     388                      <xsl:call-template name="timeFormatter"> 
     389                        <xsl:with-param name="timeString" select="$startTime"/> 
     390                      </xsl:call-template> 
     391                    </strong> 
     392                    <xsl:if test="numBusy &gt; 0"> 
     393                      <br/><xsl:value-of select="numBusy"/> busy 
     394                    </xsl:if> 
     395                    <xsl:if test="numTentative &gt; 0"> 
     396                      <br/><xsl:value-of select="numTentative"/> tentative 
     397                    </xsl:if> 
     398                    <xsl:if test="numBusy = 0 and numTentative = 0"> 
     399                      <br/><em>all free</em> 
     400                    </xsl:if> 
     401                  </span> 
     402                </a> 
     403              </td> 
     404            </xsl:for-each> 
     405          </tr> 
     406        </xsl:for-each> 
     407      </table> 
     408 
     409      <table id="freeBusyKey"> 
     410        <tr> 
     411          <td class="free">*</td> 
     412          <td>free</td> 
     413          <td>&#160;</td> 
     414          <td class="busy">*</td> 
     415          <td>busy</td> 
     416          <td>&#160;</td> 
     417          <td class="tentative">*</td> 
     418          <td>tentative</td> 
     419        </tr> 
     420      </table> 
     421  </xsl:template> 
     422 
     423 
     424 
     425 
     426 
     427 
     428 
     429 
     430 
     431 
     432  <!-- time formatter (should be extended as needed) --> 
     433  <xsl:template name="timeFormatter"> 
     434    <xsl:param name="timeString"/><!-- required --> 
     435    <xsl:param name="showMinutes">yes</xsl:param> 
     436    <xsl:param name="showAmPm">yes</xsl:param> 
     437    <xsl:param name="hour24">no</xsl:param> 
     438    <xsl:variable name="hour" select="number(substring($timeString,1,2))"/> 
     439    <xsl:variable name="minutes" select="substring($timeString,3,2)"/> 
     440    <xsl:variable name="AmPm"> 
     441      <xsl:choose> 
     442        <xsl:when test="$hour &lt; 12">AM</xsl:when> 
     443        <xsl:otherwise>PM</xsl:otherwise> 
     444      </xsl:choose> 
     445    </xsl:variable> 
     446    <xsl:choose> 
     447      <xsl:when test="hour24 = 'yes'"> 
     448        <xsl:value-of select="$hour"/><!-- 
     449     --><xsl:if test="$showMinutes = 'yes'">:<xsl:value-of select="$minutes"/></xsl:if> 
     450      </xsl:when> 
     451      <xsl:otherwise> 
     452        <xsl:choose> 
     453          <xsl:when test="$hour = 0">12</xsl:when> 
     454          <xsl:when test="$hour &lt; 13"><xsl:value-of select="$hour"/></xsl:when> 
     455          <xsl:otherwise><xsl:value-of select="$hour - 12"/></xsl:otherwise> 
     456        </xsl:choose><!-- 
     457     --><xsl:if test="$showMinutes = 'yes'">:<xsl:value-of select="$minutes"/></xsl:if> 
     458        <xsl:if test="$showAmPm = 'yes'"> 
     459          <xsl:text> </xsl:text> 
     460          <xsl:value-of select="$AmPm"/> 
     461        </xsl:if> 
     462      </xsl:otherwise> 
     463    </xsl:choose> 
     464  </xsl:template> 
     465 
     466</xsl:stylesheet>