Changeset 1481

Show
Ignore:
Timestamp:
07/31/07 15:54:58
Author:
johnsa
Message:

user client and admin client: allow conditional switching of the calendar selection widget (portal-friendly old-style widget or slicker dojo widget)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/deployment/webadmin/webapp/resources/default/default/default.xsl

    r1425 r1481  
    186186  <!-- Other generally useful global variables --> 
    187187  <xsl:variable name="publicCal">/cal</xsl:variable> 
     188   
     189  <!-- the following variable can be set to "true" or "false"; 
     190       to use dojo widgets and fancier UI features, set to false - these are 
     191       not guaranteed to work in portals --> 
     192  <xsl:variable name="portalFriendly">true</xsl:variable> 
    188193 
    189194  <!--==== MAIN TEMPLATE  ====--> 
     
    202207          <script type="text/javascript" src="/bedework-common/javascript/dojo/dojo.js">&#160;</script> 
    203208          <script type="text/javascript" src="{$resourcesRoot}/resources/bedeworkEventForm.js">&#160;</script> 
     209          <xsl:if test="$portalFriendly = 'true'"> 
     210            <script type="text/javascript" src="{$resourcesRoot}/resources/dynCalendarWidget.js">&#160;</script> 
     211            <link rel="stylesheet" href="{$resourcesRoot}/resources/dynCalendarWidget.css"/> 
     212          </xsl:if> 
    204213        </xsl:if> 
    205214        <xsl:if test="/bedeworkadmin/page='modCalendar'"> 
     
    928937              <div class="dateFields"> 
    929938                <span class="startDateLabel">Date </span> 
    930                 <span dojoType="dropdowndatepicker" formatLength="medium" value="today" saveFormat="yyyyMMdd" id="bwEventWidgetStartDate" iconURL="{$resourcesRoot}/resources/calIcon.gif"> 
    931                   <xsl:attribute name="value"><xsl:value-of select="form/start/rfc3339DateTime"/></xsl:attribute> 
    932                   <xsl:text> </xsl:text> 
    933                 </span> 
    934                 <input type="hidden" name="eventStartDate.year"> 
    935                   <xsl:attribute name="value"><xsl:value-of select="form/start/yearText/input/@value"/></xsl:attribute> 
    936                 </input> 
    937                 <input type="hidden" name="eventStartDate.month"> 
    938                   <xsl:attribute name="value"><xsl:value-of select="form/start/month/select/option[@selected = 'selected']/@value"/></xsl:attribute> 
    939                 </input> 
    940                 <input type="hidden" name="eventStartDate.day"> 
    941                   <xsl:attribute name="value"><xsl:value-of select="form/start/day/select/option[@selected = 'selected']/@value"/></xsl:attribute> 
    942                 </input> 
    943                 <!--<xsl:copy-of select="form/start/month/*"/> 
    944                 <xsl:copy-of select="form/start/day/*"/> 
    945939                <xsl:choose> 
    946                   <xsl:when test="/bedeworkadmin/creating = 'true'"> 
    947                     <xsl:copy-of select="form/start/year/*"/> 
     940                  <xsl:when test="$portalFriendly = 'true'"> 
     941                    <xsl:copy-of select="form/start/month/*"/> 
     942                    <xsl:copy-of select="form/start/day/*"/> 
     943                    <xsl:choose> 
     944                      <xsl:when test="/bedeworkadmin/creating = 'true'"> 
     945                        <xsl:copy-of select="form/start/year/*"/> 
     946                      </xsl:when> 
     947                      <xsl:otherwise> 
     948                        <xsl:copy-of select="form/start/yearText/*"/> 
     949                      </xsl:otherwise> 
     950                    </xsl:choose> 
     951                    <script language="JavaScript" type="text/javascript"> 
     952                      <xsl:comment> 
     953                      startDateDynCalWidget = new dynCalendar('startDateDynCalWidget', <xsl:value-of select="number(form/start/yearText/input/@value)"/>, <xsl:value-of select="number(form/start/month/select/option[@selected='selected']/@value)-1"/>, <xsl:value-of select="number(form/start/day/select/option[@selected='selected']/@value)"/>, 'startDateCalWidgetCallback',true,'<xsl:value-of select="$resourcesRoot"/>/resources/'); 
     954                      </xsl:comment> 
     955                    </script> 
    948956                  </xsl:when> 
    949957                  <xsl:otherwise> 
    950                     <xsl:copy-of select="form/start/yearText/*"/> 
     958                    <span dojoType="dropdowndatepicker" formatLength="medium" value="today" saveFormat="yyyyMMdd" id="bwEventWidgetStartDate" iconURL="{$resourcesRoot}/resources/calIcon.gif"> 
     959                      <xsl:attribute name="value"><xsl:value-of select="form/start/rfc3339DateTime"/></xsl:attribute> 
     960                      <xsl:text> </xsl:text> 
     961                    </span> 
     962                    <input type="hidden" name="eventStartDate.year"> 
     963                      <xsl:attribute name="value"><xsl:value-of select="form/start/yearText/input/@value"/></xsl:attribute> 
     964                    </input> 
     965                    <input type="hidden" name="eventStartDate.month"> 
     966                      <xsl:attribute name="value"><xsl:value-of select="form/start/month/select/option[@selected = 'selected']/@value"/></xsl:attribute> 
     967                    </input> 
     968                    <input type="hidden" name="eventStartDate.day"> 
     969                      <xsl:attribute name="value"><xsl:value-of select="form/start/day/select/option[@selected = 'selected']/@value"/></xsl:attribute> 
     970                    </input> 
    951971                  </xsl:otherwise> 
    952                 </xsl:choose>--> 
     972                </xsl:choose> 
    953973              </div> 
    954               <!-- 
    955               <script language="JavaScript" type="text/javascript"> 
    956                 <xsl:comment> 
    957                 startDateDynCalWidget = new dynCalendar('startDateDynCalWidget', <xsl:value-of select="number(form/start/yearText/input/@value)"/>, <xsl:value-of select="number(form/start/month/select/option[@selected='selected']/@value)-1"/>, <xsl:value-of select="number(form/start/day/select/option[@selected='selected']/@value)"/>, 'startDateCalWidgetCallback',true,'<xsl:value-of select="$resourcesRoot"/>/resources/'); 
    958                 </xsl:comment> 
    959               </script>--> 
    960974              <div class="{$timeFieldsClass}" id="startTimeFields"> 
    961975                <span id="calWidgetStartTimeHider" class="show"> 
     
    10021016              <div class="{$endDateTimeClass}" id="endDateTime"> 
    10031017                <div class="dateFields"> 
    1004                   <span dojoType="dropdowndatepicker" formatLength="medium" value="today" saveFormat="yyyyMMdd" id="bwEventWidgetEndDate" iconURL="{$resourcesRoot}/resources/calIcon.gif"> 
    1005                     <xsl:attribute name="value"><xsl:value-of select="form/end/rfc3339DateTime"/></xsl:attribute> 
    1006                     <xsl:text> </xsl:text> 
    1007                   </span> 
    1008                   <input type="hidden" name="eventEndDate.year"> 
    1009                     <xsl:attribute name="value"><xsl:value-of select="form/end/dateTime/yearText/input/@value"/></xsl:attribute> 
    1010                   </input> 
    1011                   <input type="hidden" name="eventEndDate.month"> 
    1012                     <xsl:attribute name="value"><xsl:value-of select="form/end/dateTime/month/select/option[@selected = 'selected']/@value"/></xsl:attribute> 
    1013                   </input> 
    1014                   <input type="hidden" name="eventEndDate.day"> 
    1015                     <xsl:attribute name="value"><xsl:value-of select="form/end/dateTime/day/select/option[@selected = 'selected']/@value"/></xsl:attribute> 
    1016                   </input> 
    1017                   <!--<xsl:copy-of select="form/end/dateTime/month/*"/> 
    1018                   <xsl:copy-of select="form/end/dateTime/day/*"/> 
    10191018                  <xsl:choose> 
    1020                     <xsl:when test="/bedeworkadmin/creating = 'true'"> 
    1021                       <xsl:copy-of select="form/end/dateTime/year/*"/> 
     1019                    <xsl:when test="$portalFriendly = 'true'"> 
     1020                      <xsl:copy-of select="form/end/dateTime/month/*"/> 
     1021                      <xsl:copy-of select="form/end/dateTime/day/*"/> 
     1022                      <xsl:choose> 
     1023                        <xsl:when test="/bedeworkadmin/creating = 'true'"> 
     1024                          <xsl:copy-of select="form/end/dateTime/year/*"/> 
     1025                        </xsl:when> 
     1026                        <xsl:otherwise> 
     1027                          <xsl:copy-of select="form/end/dateTime/yearText/*"/> 
     1028                        </xsl:otherwise> 
     1029                      </xsl:choose> 
     1030                      <script language="JavaScript" type="text/javascript"> 
     1031                        <xsl:comment> 
     1032                        endDateDynCalWidget = new dynCalendar('endDateDynCalWidget', <xsl:value-of select="number(form/start/yearText/input/@value)"/>, <xsl:value-of select="number(form/start/month/select/option[@selected='selected']/@value)-1"/>, <xsl:value-of select="number(form/start/day/select/option[@selected='selected']/@value)"/>, 'endDateCalWidgetCallback',true,'<xsl:value-of select="$resourcesRoot"/>/resources/'); 
     1033                      </xsl:comment> 
     1034                      </script> 
    10221035                    </xsl:when> 
    10231036                    <xsl:otherwise> 
    1024                       <xsl:copy-of select="form/end/dateTime/yearText/*"/> 
     1037                      <span dojoType="dropdowndatepicker" formatLength="medium" value="today" saveFormat="yyyyMMdd" id="bwEventWidgetEndDate" iconURL="{$resourcesRoot}/resources/calIcon.gif"> 
     1038                        <xsl:attribute name="value"><xsl:value-of select="form/end/rfc3339DateTime"/></xsl:attribute> 
     1039                        <xsl:text> </xsl:text> 
     1040                      </span> 
     1041                      <input type="hidden" name="eventEndDate.year"> 
     1042                        <xsl:attribute name="value"><xsl:value-of select="form/end/dateTime/yearText/input/@value"/></xsl:attribute> 
     1043                      </input> 
     1044                      <input type="hidden" name="eventEndDate.month"> 
     1045                        <xsl:attribute name="value"><xsl:value-of select="form/end/dateTime/month/select/option[@selected = 'selected']/@value"/></xsl:attribute> 
     1046                      </input> 
     1047                      <input type="hidden" name="eventEndDate.day"> 
     1048                        <xsl:attribute name="value"><xsl:value-of select="form/end/dateTime/day/select/option[@selected = 'selected']/@value"/></xsl:attribute> 
     1049                      </input> 
    10251050                    </xsl:otherwise> 
    1026                   </xsl:choose>--> 
     1051                  </xsl:choose> 
    10271052                </div> 
    1028                 <!--<script language="JavaScript" type="text/javascript"> 
    1029                   <xsl:comment> 
    1030                   endDateDynCalWidget = new dynCalendar('endDateDynCalWidget', <xsl:value-of select="number(form/start/yearText/input/@value)"/>, <xsl:value-of select="number(form/start/month/select/option[@selected='selected']/@value)-1"/>, <xsl:value-of select="number(form/start/day/select/option[@selected='selected']/@value)"/>, 'endDateCalWidgetCallback',true,'<xsl:value-of select="$resourcesRoot"/>/resources/'); 
    1031                 </xsl:comment> 
    1032                 </script>--> 
    10331053                <div class="{$timeFieldsClass}" id="endTimeFields"> 
    10341054                  <span id="calWidgetEndTimeHider" class="show"> 
  • trunk/deployment/webadmin/webapp/resources/resources/dynCalendarWidget.css

    r952 r1481  
    2121  height: 15px; 
    2222} 
    23 .dynCalendar_header a { 
     23.dynCalendar_header a:link, 
     24.dynCalendar_header a:active, 
     25.dynCalendar_header a:visited, 
     26.dynCalendar_header a:hover { 
    2427  background-color: #00a; 
    25   color: white;   
    26 
    27 .dynCalendar_header a { 
    28   background-color: #00a; 
    29   color: white; 
     28  color: white !important; 
     29  text-decoration: none !important;   
    3030} 
    3131.dynCalendar_dayname { 
  • trunk/deployment/webadmin/webapp/resources/resources/dynCalendarWidget.js

    r1157 r1481  
    236236  function dynCalendar_writeHTML() 
    237237  { 
    238     if (is_ie5up || is_nav6up || is_gecko) { 
    239       document.write('<a href="javascript: ' + this.objName + '.show()"><img src="' + this.imagesPath + 'calIcon.gif" border="0" width="16" height="15" /></a>'); 
    240       document.write('<div class="dynCalendar" id="' + this.layerID + '" onmouseover="' + this.objName + '._mouseover(true)" onmouseout="' + this.objName + '._mouseover(false)"></div>'); 
    241     } 
     238    document.write('<a href="javascript: ' + this.objName + '.show()"><img src="' + this.imagesPath + 'calIcon.gif" border="0" width="16" height="15" /></a>'); 
     239    document.write('<div class="dynCalendar" id="' + this.layerID + '" onmouseover="' + this.objName + '._mouseover(true)" onmouseout="' + this.objName + '._mouseover(false)"></div>'); 
    242240  } 
    243241 
     
    461459  document.onmousemove = function () 
    462460  { 
    463     if (is_ie5up || is_nav6up || is_gecko) { 
    464       if (arguments[0]) { 
    465         dynCalendar_mouseX = arguments[0].pageX; 
    466         dynCalendar_mouseY = arguments[0].pageY; 
    467       } else { 
    468         dynCalendar_mouseX = event.clientX + document.body.scrollLeft; 
    469         dynCalendar_mouseY = event.clientY + document.body.scrollTop; 
    470         arguments[0] = null; 
     461    if (arguments[0]) { 
     462      dynCalendar_mouseX = arguments[0].pageX; 
     463      dynCalendar_mouseY = arguments[0].pageY; 
     464    } else { 
     465      dynCalendar_mouseX = event.clientX + document.body.scrollLeft; 
     466      dynCalendar_mouseY = event.clientY + document.body.scrollTop; 
     467      arguments[0] = null; 
     468    } 
     469 
     470    dynCalendar_oldOnmousemove(); 
     471  } 
     472 
     473/** 
     474* Callbacks for document.onclick 
     475*/ 
     476  dynCalendar_oldOnclick = document.onclick ? document.onclick : new Function; 
     477 
     478  document.onclick = function () 
     479  { 
     480    if(!dynCalendar_mouseoverStatus){ 
     481      for(i=0; i<dynCalendar_layers.length; ++i){ 
     482        dynCalendar_layers[i]._hideLayer(); 
    471483      } 
    472  
    473       dynCalendar_oldOnmousemove(); 
    474     } 
    475   } 
    476  
    477 /** 
    478 * Callbacks for document.onclick 
    479 */ 
    480   dynCalendar_oldOnclick = document.onclick ? document.onclick : new Function; 
    481  
    482   document.onclick = function () 
    483   { 
    484     if (is_ie5up || is_nav6up || is_gecko) { 
    485       if(!dynCalendar_mouseoverStatus){ 
    486         for(i=0; i<dynCalendar_layers.length; ++i){ 
    487           dynCalendar_layers[i]._hideLayer(); 
    488         } 
    489       } 
    490  
    491       dynCalendar_oldOnclick(arguments[0] ? arguments[0] : null); 
    492     } 
    493   } 
     484    } 
     485 
     486    dynCalendar_oldOnclick(arguments[0] ? arguments[0] : null); 
     487  } 
     488   
     489  /** 
     490* Bedework specific callbacks 
     491*/ 
     492function startDateCalWidgetCallback(date, month, year) { 
     493  document.eventForm['eventStartDate.month'].value = month; 
     494  document.eventForm['eventStartDate.day'].value = date; 
     495  document.eventForm['eventStartDate.year'].value = year; 
     496
     497function endDateCalWidgetCallback(date, month, year) { 
     498  document.eventForm['eventEndDate.month'].value = month; 
     499  document.eventForm['eventEndDate.day'].value = date; 
     500  document.eventForm['eventEndDate.year'].value = year; 
     501
  • trunk/deployment/webuser/webapp/resources/demoskins/default/default/default.xsl

    r1480 r1481  
    171171       to use dojo widgets and fancier UI features, set to false - these are 
    172172       not guaranteed to work in portals --> 
    173   <xsl:variable name="portalFriendly">false</xsl:variable>  
     173  <xsl:variable name="portalFriendly">true</xsl:variable>  
    174174 
    175175 <!-- BEGIN MAIN TEMPLATE --> 
  • trunk/deployment/webuser/webapp/resources/demoskins/resources/dynCalendarWidget.js

    r1480 r1481  
    236236  function dynCalendar_writeHTML() 
    237237  { 
    238     //if (is_ie5up || is_ie6up || is_nav6up || is_gecko) { 
    239       document.write('<a href="javascript: ' + this.objName + '.show()"><img src="' + this.imagesPath + 'calIcon.gif" border="0" width="16" height="15" /></a>'); 
    240       document.write('<div class="dynCalendar" id="' + this.layerID + '" onmouseover="' + this.objName + '._mouseover(true)" onmouseout="' + this.objName + '._mouseover(false)"></div>'); 
    241     //} 
     238    document.write('<a href="javascript: ' + this.objName + '.show()"><img src="' + this.imagesPath + 'calIcon.gif" border="0" width="16" height="15" /></a>'); 
     239    document.write('<div class="dynCalendar" id="' + this.layerID + '" onmouseover="' + this.objName + '._mouseover(true)" onmouseout="' + this.objName + '._mouseover(false)"></div>'); 
    242240  } 
    243241 
     
    461459  document.onmousemove = function () 
    462460  { 
    463     //if (is_ie5up || is_nav6up || is_gecko) { 
    464       if (arguments[0]) { 
    465         dynCalendar_mouseX = arguments[0].pageX; 
    466         dynCalendar_mouseY = arguments[0].pageY; 
    467       } else { 
    468         dynCalendar_mouseX = event.clientX + document.body.scrollLeft; 
    469         dynCalendar_mouseY = event.clientY + document.body.scrollTop; 
    470         arguments[0] = null; 
     461    if (arguments[0]) { 
     462      dynCalendar_mouseX = arguments[0].pageX; 
     463      dynCalendar_mouseY = arguments[0].pageY; 
     464    } else { 
     465      dynCalendar_mouseX = event.clientX + document.body.scrollLeft; 
     466      dynCalendar_mouseY = event.clientY + document.body.scrollTop; 
     467      arguments[0] = null; 
     468    } 
     469 
     470    dynCalendar_oldOnmousemove(); 
     471  } 
     472 
     473/** 
     474* Callbacks for document.onclick 
     475*/ 
     476  dynCalendar_oldOnclick = document.onclick ? document.onclick : new Function; 
     477 
     478  document.onclick = function () 
     479  { 
     480    if(!dynCalendar_mouseoverStatus){ 
     481      for(i=0; i<dynCalendar_layers.length; ++i){ 
     482        dynCalendar_layers[i]._hideLayer(); 
    471483      } 
    472  
    473       dynCalendar_oldOnmousemove(); 
    474     //} 
    475   } 
    476  
    477 /** 
    478 * Callbacks for document.onclick 
    479 */ 
    480   dynCalendar_oldOnclick = document.onclick ? document.onclick : new Function; 
    481  
    482   document.onclick = function () 
    483   { 
    484     //if (is_ie5up || is_nav6up || is_gecko) { 
    485       if(!dynCalendar_mouseoverStatus){ 
    486         for(i=0; i<dynCalendar_layers.length; ++i){ 
    487           dynCalendar_layers[i]._hideLayer(); 
    488         } 
    489       } 
    490  
    491       dynCalendar_oldOnclick(arguments[0] ? arguments[0] : null); 
    492     //} 
     484    } 
     485 
     486    dynCalendar_oldOnclick(arguments[0] ? arguments[0] : null); 
    493487  } 
    494488   
     
    497491*/ 
    498492function startDateCalWidgetCallback(date, month, year) { 
    499   if (String(month).length == 1) { 
    500       month = '0' + month; 
    501   } 
    502   if (String(date).length == 1) { 
    503       date = '0' + date; 
    504   } 
    505493  document.eventForm['eventStartDate.month'].value = month; 
    506494  document.eventForm['eventStartDate.day'].value = date; 
     
    508496} 
    509497function endDateCalWidgetCallback(date, month, year) { 
    510   if (String(month).length == 1) { 
    511       month = '0' + month; 
    512   } 
    513   if (String(date).length == 1) { 
    514       date = '0' + date; 
    515   } 
    516498  document.eventForm['eventEndDate.month'].value = month; 
    517499  document.eventForm['eventEndDate.day'].value = date;