Changeset 1157
- Timestamp:
- 12/14/06 03:33:44
- Files:
-
- trunk/deployment/webadmin/webapp/resources/default/default/default.css (modified) (5 diffs)
- trunk/deployment/webadmin/webapp/resources/default/default/default.xsl (modified) (9 diffs)
- trunk/deployment/webadmin/webapp/resources/resources/dynCalendarWidget.js (modified) (21 diffs)
- trunk/deployment/webadmin/webapp/resources/resources/includes.js (modified) (5 diffs)
- trunk/deployment/webuser/webapp/resources/demoskins/default/default/default.xsl (modified) (5 diffs)
- trunk/deployment/webuser/webapp/resources/demoskins/resources/dynCalendarWidget.js (modified) (23 diffs)
- trunk/deployment/webuser/webapp/resources/demoskins/resources/includes.js (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/deployment/webadmin/webapp/resources/default/default/default.css
r1124 r1157 260 260 font-size: 0.9em; 261 261 } 262 table.eventFormTable td.fieldName { 263 width: 7em; 264 } 262 265 table.eventFormTable th, 263 266 table.eventFormTable td.fieldName { … … 307 310 margin: 4px; 308 311 padding: 4px; 312 white-space: nowrap; 309 313 } 310 314 table.eventFormTable .dateStartEndBox strong { … … 314 318 margin-left: 26px; 315 319 } 320 table.eventFormTable select.timezones { 321 margin-left: 1em; 322 width: 160px; 323 } 316 324 table.eventFormTable .shown { 317 325 display: inline; … … 319 327 table.eventFormTable .invisible, 320 328 .invisible { 321 display: none ;329 display: none !important; 322 330 } 323 331 .hidden { … … 384 392 #clock { 385 393 position: relative; 394 } 395 396 #tztable { 397 margin-top: 1em; 398 } 399 #tztable td { 400 padding: 2px 4px; 401 } 402 #recurrenceFields #recurrenceTable strong { 403 display: inline; 404 } 405 #recurrenceFields #recurrenceTable td.recurrenceFrequency { 406 padding: 0.5em 1em 0 0; 407 } 408 #recurrenceFields #recurrenceTable td.recurrenceRules { 409 padding: 0.5em 0 0.5em 1em; 410 border-left: 1px solid #ddd; 411 } 412 #recurrenceFields #recurrenceTable td.recurrenceUntil { 413 width: 100%; 414 padding: 0.5em 0 0 1em; 415 border-top: 1px solid #ddd; 416 border-left: 1px solid #ddd; 417 } 418 #recurrenceFields #recurrenceTable td.recurrenceRules .rruleBlock { 419 margin: 0 0 0.5em 2em; 420 } 421 .chkBoxListItem { 422 display: block; 423 float: left; 424 width: 3em; 425 } 426 #recurrenceFields #recurrenceTable br { 427 clear: both; 428 } 429 #recurrenceFields #recurrenceTable p { 430 margin: 0 0 0.5em 0; 431 } 432 #recurrenceFields #recurrenceTable p.weekRecurLinks { 433 margin: 1em 0 1em 0; 434 } 435 #recurrenceFields #recurrenceTable .extraByMonthPosFields { 436 margin: 0 0 1em 2em; 437 padding: 0; 438 } 439 #recurrenceFields #monthRecurFields div, 440 #recurrenceFields #yearRecurFields div { 441 display: block; 442 margin: 0 0 0.5em 0; 443 } 444 #recurrenceFields #dayMonthCheckBoxList, 445 #recurrenceFields #monthDaysCheckBoxList, 446 #recurrenceFields #yearWeeksCheckBoxList, 447 #recurrenceFields #yearMonthCheckBoxList, 448 #recurrenceFields #yearMonthDaysCheckBoxList, 449 #recurrenceFields #yearDaysCheckBoxList { 450 margin: 0.5em 0 0.5em 2em; 451 display: block; 452 clear: both; 386 453 } 387 454 #contactEmailAlert { trunk/deployment/webadmin/webapp/resources/default/default/default.xsl
r1149 r1157 631 631 632 632 <xsl:variable name="modEventAction" select="/bedeworkadmin/formElements/form/@action"/> 633 <form name="peForm" method="post" action="{$modEventAction}" >633 <form name="peForm" method="post" action="{$modEventAction}" onsubmit="setRecurrence(this)"> 634 634 <table class="eventFormTable"> 635 635 <tr> … … 694 694 </xsl:otherwise> 695 695 </xsl:choose> 696 all day event<br/> 696 all day (anniversary) 697 698 <!-- floating event: no timezone (and not UTC) --> 699 <xsl:choose> 700 <xsl:when test="/bedeworkadmin/formElements/form/floating/input/@checked='checked'"> 701 <input type="checkbox" name="floatingFlag" id="floatingFlag" onclick="swapFloatingTime(this)" value="on" checked="checked"/> 702 <input type="hidden" name="eventStartDate.floating" value="on" id="startFloating"/> 703 <input type="hidden" name="eventEndDate.floating" value="on" id="endFloating"/> 704 </xsl:when> 705 <xsl:otherwise> 706 <input type="checkbox" name="floatingFlag" id="floatingFlag" onclick="swapFloatingTime(this)" value="off"/> 707 <input type="hidden" name="eventStartDate.floating" value="off" id="startFloating"/> 708 <input type="hidden" name="eventEndDate.floating" value="off" id="endFloating"/> 709 </xsl:otherwise> 710 </xsl:choose> 711 floating 712 713 <!-- store time as coordinated universal time (UTC) --> 714 <xsl:choose> 715 <xsl:when test="/bedeworkadmin/formElements/form/storeUTC/input/@checked='checked'"> 716 <input type="checkbox" name="storeUTCFlag" id="storeUTCFlag" onclick="swapStoreUTC(this)" value="on" checked="checked"/> 717 <input type="hidden" name="eventStartDate.storeUTC" value="on" id="startStoreUTC"/> 718 <input type="hidden" name="eventEndDate.storeUTC" value="on" id="endStoreUTC"/> 719 </xsl:when> 720 <xsl:otherwise> 721 <input type="checkbox" name="storeUTCFlag" id="storeUTCFlag" onclick="swapStoreUTC(this)" value="off"/> 722 <input type="hidden" name="eventStartDate.storeUTC" value="off" id="startStoreUTC"/> 723 <input type="hidden" name="eventEndDate.storeUTC" value="off" id="endStoreUTC"/> 724 </xsl:otherwise> 725 </xsl:choose> 726 store as UTC 727 728 <br/> 697 729 <div class="dateStartEndBox"> 698 730 <strong>Start:</strong> … … 712 744 <script language="JavaScript" type="text/javascript"> 713 745 <xsl:comment> 714 startDateDynCalWidget = new dynCalendar('startDateDynCalWidget', 'startDateCalWidgetCallback','<xsl:value-of select="$resourcesRoot"/>/resources/');715 </xsl:comment>746 startDateDynCalWidget = new dynCalendar('startDateDynCalWidget', <xsl:value-of select="number(/bedeworkadmin/formElements/form/start/yearText/input/@value)"/>, <xsl:value-of select="number(/bedeworkadmin/formElements/form/start/month/select/option[@selected='selected']/@value)-1"/>, <xsl:value-of select="number(/bedeworkadmin/formElements/form/start/day/select/option[@selected='selected']/@value)"/>, 'startDateCalWidgetCallback',true,'<xsl:value-of select="$resourcesRoot"/>/resources/'); 747 </xsl:comment> 716 748 </script> 717 749 <!--<img src="{$resourcesRoot}/resources/calIcon.gif" width="16" height="15" border="0"/>--> … … 724 756 </xsl:if> 725 757 <xsl:text> </xsl:text> 726 <a href="javascript:bwClockLaunch('eventStartDate');"> 727 <img src="{$resourcesRoot}/resources/clockIcon.gif" width="16" height="15" border="0"/> 728 </a> 758 <a href="javascript:bwClockLaunch('eventStartDate');"><img src="{$resourcesRoot}/resources/clockIcon.gif" width="16" height="15" border="0"/></a> 759 760 <select name="eventStartDate.tzid" id="startTzid" class="timezones"> 761 <xsl:if test="form/floating/input/@checked='checked'"><xsl:attribute name="disabled">true</xsl:attribute></xsl:if> 762 <option value="-1">select timezone...</option> 763 <xsl:for-each select="/bedeworkadmin/timezones/timezone"> 764 <option> 765 <xsl:attribute name="value"><xsl:value-of select="id"/></xsl:attribute> 766 <xsl:if test="/bedeworkadmin/formElements/form/start/tzid = id"><xsl:attribute name="selected">selected</xsl:attribute></xsl:if> 767 <xsl:value-of select="name"/> 768 </option> 769 </xsl:for-each> 770 </select> 729 771 </span> 730 772 </div> … … 762 804 <script language="JavaScript" type="text/javascript"> 763 805 <xsl:comment> 764 endDateDynCalWidget = new dynCalendar('endDateDynCalWidget', 'endDateCalWidgetCallback','<xsl:value-of select="$resourcesRoot"/>/resources/');806 endDateDynCalWidget = new dynCalendar('endDateDynCalWidget', <xsl:value-of select="number(/bedeworkadmin/formElements/form/start/yearText/input/@value)"/>, <xsl:value-of select="number(/bedeworkadmin/formElements/form/start/month/select/option[@selected='selected']/@value)-1"/>, <xsl:value-of select="number(/bedeworkadmin/formElements/form/start/day/select/option[@selected='selected']/@value)"/>, 'endDateCalWidgetCallback',true,'<xsl:value-of select="$resourcesRoot"/>/resources/'); 765 807 </xsl:comment> 766 808 </script> … … 774 816 </xsl:if> 775 817 <xsl:text> </xsl:text> 776 <a href="javascript:bwClockLaunch('eventEndDate');"> 777 <img src="{$resourcesRoot}/resources/clockIcon.gif" width="16" height="15" border="0"/> 778 </a> 818 <a href="javascript:bwClockLaunch('eventEndDate');"><img src="{$resourcesRoot}/resources/clockIcon.gif" width="16" height="15" border="0"/></a> 819 820 <select name="eventEndDate.tzid" id="endTzid" class="timezones"> 821 <xsl:if test="/bedeworkadmin/formElements/form/floating/input/@checked='checked'"><xsl:attribute name="disabled">true</xsl:attribute></xsl:if> 822 <option value="-1">select timezone...</option> 823 <xsl:for-each select="/bedeworkadmin/timezones/timezone"> 824 <option> 825 <xsl:attribute name="value"><xsl:value-of select="id"/></xsl:attribute> 826 <xsl:if test="/bedeworkadmin/formElements/form/end/dateTime/tzid = id"><xsl:attribute name="selected">selected</xsl:attribute></xsl:if> 827 <xsl:value-of select="name"/> 828 </option> 829 </xsl:for-each> 830 </select> 779 831 </span> 780 832 </div> … … 865 917 </div> 866 918 </div> 919 920 921 <!-- Recurrence fields --> 922 <!-- ================= --> 923 <xsl:if test="/bedeworkadmin/formElements/recurrenceId = ''"> 924 <!-- existing recurrence instances can not themselves recur, 925 so block this whole section if this event is an instance 926 (has a recurrenceId) --> 927 <input type="checkbox" name="recurrenceFlag" onclick="swapRecurrence(this)" value="on"/> 928 <xsl:if test="/bedeworkadmin/formElements/form/recurring='true'"><xsl:attribute name="checked">checked</xsl:attribute></xsl:if> 929 <xsl:choose> 930 <xsl:when test="/bedeworkadmin/creating = 'true'"> 931 recurring 932 </xsl:when> 933 <xsl:otherwise> 934 change recurrence 935 </xsl:otherwise> 936 </xsl:choose> 937 <span id="recurrenceUiSwitch" class="invisible"> 938 <input type="checkbox" name="recurrenceUiSwitch" value="simple" onchange="swapVisible(this,'advancedRecurrenceRules')"/>show advanced recurrence rules 939 </span> 940 941 <!-- set these dynamically when form is submitted --> 942 <input type="hidden" name="interval" value=""/> 943 <input type="hidden" name="count" value=""/> 944 <input type="hidden" name="until" value=""/> 945 <input type="hidden" name="byday" value=""/> 946 <input type="hidden" name="bymonthday" value=""/> 947 <input type="hidden" name="bymonth" value=""/> 948 <input type="hidden" name="byweekno" value=""/> 949 <input type="hidden" name="byyearday" value=""/> 950 <input type="hidden" name="wkst" value=""/> 951 952 <div id="recurrenceFields" class="invisible"> 953 <table id="recurrenceTable" cellspacing="0"> 954 <tr> 955 <td class="recurrenceFrequency" rowspan="2"> 956 <strong>Frequency:</strong><br/> 957 <!-- "freq" is used to determine if a recurrence should be created; test for "NONE" --> 958 <input type="radio" name="freq" value="NONE" onclick="showRecurrence(this.value)" checked="checked"/>none<br/> 959 <!--<input type="radio" name="freq" value="HOURLY" onclick="showRecurrence(this.value)"/>hourly<br/>--> 960 <input type="radio" name="freq" value="DAILY" onclick="showRecurrence(this.value)"/>daily<br/> 961 <input type="radio" name="freq" value="WEEKLY" onclick="showRecurrence(this.value)"/>weekly<br/> 962 <input type="radio" name="freq" value="MONTHLY" onclick="showRecurrence(this.value)"/>monthly<br/> 963 <input type="radio" name="freq" value="YEARLY" onclick="showRecurrence(this.value)"/>yearly 964 </td> 965 <td class="recurrenceRules"> 966 <!-- none --> 967 <div id="noneRecurrenceRules"> 968 <p>does not recur</p> 969 </div> 970 <span id="advancedRecurrenceRules" class="invisible"> 971 <!-- hourly --> 972 <div id="hourlyRecurrenceRules" class="invisible"> 973 <strong>Interval:</strong> 974 every <input type="text" name="hourlyInterval" size="2" value="1"/> hour(s) 975 </div> 976 <!-- daily --> 977 <div id="dailyRecurrenceRules" class="invisible"> 978 <p> 979 <strong>Interval:</strong> 980 every <input type="text" name="dailyInterval" size="2" value="1"/> day(s) 981 </p> 982 <p> 983 <input type="checkbox" name="swapDayMonthCheckBoxList" value="" onclick="swapVisible(this,'dayMonthCheckBoxList')"/> 984 in these months: 985 <div id="dayMonthCheckBoxList" class="invisible"> 986 <xsl:for-each select="/bedeworkadmin/monthlabels/val"> 987 <xsl:variable name="pos"><xsl:value-of select="position()"/></xsl:variable> 988 <span class="chkBoxListItem"> 989 <input type="checkbox" name="dayMonths"> 990 <xsl:attribute name="value"><xsl:value-of select="/bedeworkadmin/monthvalues/val[position() = $pos]"/></xsl:attribute> 991 </input> 992 <xsl:value-of select="."/> 993 </span> 994 <xsl:if test="$pos mod 6 = 0"><br/></xsl:if> 995 </xsl:for-each> 996 </div> 997 </p> 998 </div> 999 <!-- weekly --> 1000 <div id="weeklyRecurrenceRules" class="invisible"> 1001 <p> 1002 <strong>Interval:</strong> 1003 every <input type="text" name="weeklyInterval" size="2" value="1"/> week(s) on:<br/> 1004 </p> 1005 <p> 1006 <div id="weekRecurFields"> 1007 <xsl:call-template name="byDayChkBoxList"> 1008 <xsl:with-param name="name">byDayWeek</xsl:with-param> 1009 </xsl:call-template> 1010 </div> 1011 </p> 1012 <p class="weekRecurLinks"> 1013 <a href="javascript:recurSelectWeekdays('weekRecurFields')">select weekdays</a> | 1014 <a href="javascript:recurSelectWeekends('weekRecurFields')">select weekends</a> 1015 </p> 1016 <p> 1017 Week start: 1018 <select name="weekWkst"> 1019 <xsl:for-each select="/bedeworkadmin/shortdaynames/val"> 1020 <xsl:variable name="pos" select="position()"/> 1021 <option> 1022 <xsl:attribute name="value"><xsl:value-of select="/bedeworkadmin/recurdayvals/val[position() = $pos]"/></xsl:attribute> 1023 <xsl:value-of select="."/> 1024 </option> 1025 </xsl:for-each> 1026 </select> 1027 </p> 1028 </div> 1029 <!-- monthly --> 1030 <div id="monthlyRecurrenceRules" class="invisible"> 1031 <p> 1032 <strong>Interval:</strong> 1033 every <input type="text" name="monthlyInterval" size="2" value="1"/> month(s) 1034 </p> 1035 <div id="monthRecurFields"> 1036 <div id="monthRecurFields1"> 1037 on 1038 <select name="bymonthposPos1" width="7em" onchange="changeClass('monthRecurFields2','shown')"> 1039 <xsl:call-template name="recurrenceDayPosOptions"/> 1040 </select> 1041 <xsl:call-template name="byDayChkBoxList"/> 1042 </div> 1043 <xsl:call-template name="buildRecurFields"> 1044 <xsl:with-param name="current">2</xsl:with-param> 1045 <xsl:with-param name="total">10</xsl:with-param> 1046 <xsl:with-param name="name">month</xsl:with-param> 1047 </xsl:call-template> 1048 </div> 1049 <p> 1050 <input type="checkbox" name="swapMonthDaysCheckBoxList" value="" onclick="swapVisible(this,'monthDaysCheckBoxList')"/> 1051 on these days:<br/> 1052 <div id="monthDaysCheckBoxList" class="invisible"> 1053 <xsl:call-template name="buildCheckboxList"> 1054 <xsl:with-param name="current">1</xsl:with-param> 1055 <xsl:with-param name="end">31</xsl:with-param> 1056 <xsl:with-param name="name">monthDayBoxes</xsl:with-param> 1057 </xsl:call-template> 1058 </div> 1059 </p> 1060 </div> 1061 <!-- yearly --> 1062 <div id="yearlyRecurrenceRules" class="invisible"> 1063 <strong>Interval:</strong> 1064 every <input type="text" name="yearlyInterval" size="2" value="1"/> years(s)<br/> 1065 <div id="yearRecurFields"> 1066 <div id="yearRecurFields1"> 1067 on 1068 <select name="byyearposPos1" width="7em" onchange="changeClass('yearRecurFields2','shown')"> 1069 <xsl:call-template name="recurrenceDayPosOptions"/> 1070 </select> 1071 <xsl:call-template name="byDayChkBoxList"/> 1072 </div> 1073 <xsl:call-template name="buildRecurFields"> 1074 <xsl:with-param name="current">2</xsl:with-param> 1075 <xsl:with-param name="total">10</xsl:with-param> 1076 <xsl:with-param name="name">year</xsl:with-param> 1077 </xsl:call-template> 1078 </div> 1079 <p> 1080 <input type="checkbox" name="swapYearMonthCheckBoxList" value="" onclick="swapVisible(this,'yearMonthCheckBoxList')"/> 1081 in these months: 1082 <div id="yearMonthCheckBoxList" class="invisible"> 1083 <xsl:for-each select="/bedeworkadmin/monthlabels/val"> 1084 <xsl:variable name="pos"><xsl:value-of select="position()"/></xsl:variable> 1085 <span class="chkBoxListItem"> 1086 <input type="checkbox" name="yearMonths"> 1087 <xsl:attribute name="value"><xsl:value-of select="/bedeworkadmin/monthvalues/val[position() = $pos]"/></xsl:attribute> 1088 </input> 1089 <xsl:value-of select="."/> 1090 </span> 1091 <xsl:if test="$pos mod 6 = 0"><br/></xsl:if> 1092 </xsl:for-each> 1093 </div> 1094 </p> 1095 <p> 1096 <input type="checkbox" name="swapYearMonthDaysCheckBoxList" value="" onclick="swapVisible(this,'yearMonthDaysCheckBoxList')"/> 1097 on these days of the month:<br/> 1098 <div id="yearMonthDaysCheckBoxList" class="invisible"> 1099 <xsl:call-template name="buildCheckboxList"> 1100 <xsl:with-param name="current">1</xsl:with-param> 1101 <xsl:with-param name="end">31</xsl:with-param> 1102 <xsl:with-param name="name">yearMonthDayBoxes</xsl:with-param> 1103 </xsl:call-template> 1104 </div> 1105 </p> 1106 <p> 1107 <input type="checkbox" name="swapYearWeeksCheckBoxList" value="" onclick="swapVisible(this,'yearWeeksCheckBoxList')"/> 1108 in these weeks of the year:<br/> 1109 <div id="yearWeeksCheckBoxList" class="invisible"> 1110 <xsl:call-template name="buildCheckboxList"> 1111 <xsl:with-param name="current">1</xsl:with-param> 1112 <xsl:with-param name="end">53</xsl:with-param> 1113 <xsl:with-param name="name">yearWeekBoxes</xsl:with-param> 1114 </xsl:call-template> 1115 </div> 1116 </p> 1117 <p> 1118 <input type="checkbox" name="swapYearDaysCheckBoxList" value="" onclick="swapVisible(this,'yearDaysCheckBoxList')"/> 1119 on these days of the year:<br/> 1120 <div id="yearDaysCheckBoxList" class="invisible"> 1121 <xsl:call-template name="buildCheckboxList"> 1122 <xsl:with-param name="current">1</xsl:with-param> 1123 <xsl:with-param name="end">366</xsl:with-param> 1124 <xsl:with-param name="name">yearDayBoxes</xsl:with-param> 1125 </xsl:call-template> 1126 </div> 1127 </p> 1128 <p> 1129 Week start: 1130 <select name="yearWkst"> 1131 <xsl:for-each select="/bedeworkadmin/shortdaynames/val"> 1132 <xsl:variable name="pos" select="position()"/> 1133 <option> 1134 <xsl:attribute name="value"><xsl:value-of select="/bedeworkadmin/recurdayvals/val[position() = $pos]"/></xsl:attribute> 1135 <xsl:value-of select="."/> 1136 </option> 1137 </xsl:for-each> 1138 </select> 1139 </p> 1140 </div> 1141 </span> 1142 </td> 1143 </tr> 1144 <!-- recurrence count, until, forever --> 1145 <tr> 1146 <td class="recurrenceUntil"> 1147 <div id="recurrenceUntilRules" class="invisible"> 1148 <strong>Repeat:</strong> 1149 <p> 1150 <div class="dateFields"> 1151 <input type="radio" name="recurCountUntil" value="until" id="recurUntil"/> 1152 until 1153 <select name="untilMonth" onfocus="selectRecurCountUntil('recurUntil')"> 1154 <xsl:for-each select="/bedeworkadmin/formElements/form/start/month/select/option"> 1155 <xsl:copy-of select="."/> 1156 </xsl:for-each> 1157 </select> 1158 <select name="untilDay" onfocus="selectRecurCountUntil('recurUntil')"> 1159 <xsl:for-each select="/bedeworkadmin/formElements/form/start/day/select/option"> 1160 <xsl:copy-of select="."/> 1161 </xsl:for-each> 1162 </select> 1163 <xsl:choose> 1164 <xsl:when test="/bedeworkadmin/creating = 'true'"> 1165 <select name="untilYear" onfocus="selectRecurCountUntil('recurUntil')"> 1166 <xsl:for-each select="/bedeworkadmin/formElements/form/start/year/select/option"> 1167 <xsl:copy-of select="."/> 1168 </xsl:for-each> 1169 </select> 1170 </xsl:when> 1171 <xsl:otherwise> 1172 <input type="text" name="untilYear" size="4" onfocus="selectRecurCountUntil('recurUntil')"> 1173 <xsl:attribute name="value"><xsl:value-of select="/bedeworkadmin/formElements/form/start/yearText/input/@value"/></xsl:attribute> 1174 </input> 1175 </xsl:otherwise> 1176 </xsl:choose> 1177 </div> 1178 <script language="JavaScript" type="text/javascript"> 1179 <xsl:comment> 1180 untilDateDynCalWidget = new dynCalendar('untilDateDynCalWidget', <xsl:value-of select="number(/bedeworkadmin/formElements/form/start/yearText/input/@value)"/>, <xsl:value-of select="number(/bedeworkadmin/formElements/form/start/month/select/option[@selected='selected']/@value)-1"/>, <xsl:value-of select="number(/bedeworkadmin/formElements/form/start/day/select/option[@selected='selected']/@value)"/>, 'untilDateCalWidgetCallback',false,'<xsl:value-of select="$resourcesRoot"/>/resources/'); 1181 </xsl:comment> 1182 </script> 1183 </p> 1184 <p> 1185 <input type="radio" name="recurCountUntil" value="forever" checked="checked"/> 1186 forever 1187   1188 <input type="radio" name="recurCountUntil" value="count" id="recurCount"/> 1189 <input type="text" value="1" size="2" name="countHolder" onfocus="selectRecurCountUntil('recurCount')"/> times 1190 </p> 1191 </div> 1192 </td> 1193 </tr> 1194 </table> 1195 </div> 1196 </xsl:if> 867 1197 </td> 868 1198 </tr> … … 1176 1506 </table> 1177 1507 </form> 1508 </xsl:template> 1509 1510 <xsl:template name="byDayChkBoxList"> 1511 <xsl:param name="name"/> 1512 <xsl:for-each select="/bedeworkadmin/shortdaynames/val"> 1513 <xsl:variable name="pos" select="position()"/> 1514 <input type="checkbox"> 1515 <xsl:attribute name="value"><xsl:value-of select="/bedeworkadmin/recurdayvals/val[position() = $pos]"/></xsl:attribute> 1516 <xsl:attribute name="name"><xsl:value-of select="$name"/></xsl:attribute> 1517 </input> 1518 <xsl:value-of select="."/> 1519 </xsl:for-each> 1520 </xsl:template> 1521 1522 <xsl:template name="buildCheckboxList"> 1523 <xsl:param name="current"/> 1524 <xsl:param name="end"/> 1525 <xsl:param name="name"/> 1526 <xsl:param name="splitter">10</xsl:param> 1527 <span class="chkBoxListItem"> 1528 <input type="checkbox"> 1529 <xsl:attribute name="name"><xsl:value-of select="$name"/></xsl:attribute> 1530 <xsl:attribute name="value"><xsl:value-of select="$current"/></xsl:attribute> 1531 </input> 1532 <xsl:value-of select="$current"/> 1533 </span> 1534 <xsl:if test="$current mod $splitter = 0"><br/></xsl:if> 1535 <xsl:if test="$current = $end"><br/></xsl:if> 1536 <xsl:if test="$current < $end"> 1537 <xsl:call-template name="buildCheckboxList"> 1538 <xsl:with-param name="current"><xsl:value-of select="$current + 1"/></xsl:with-param> 1539 <xsl:with-param name="end"><xsl:value-of select="$end"/></xsl:with-param> 1540 <xsl:with-param name="name"><xsl:value-of select="$name"/></xsl:with-param> 1541 </xsl:call-template> 1542 </xsl:if> 1543 </xsl:template> 1544 1545 <xsl:template name="recurrenceDayPosOptions"> 1546 <option value="0">none</option> 1547 <option value="1">the first</option> 1548 <option value="2">the second</option> 1549 <option value="3">the third</option> 1550 <option value="4">the fourth</option> 1551 <option value="5">the fifth</option> 1552 <option value="-1">the last</option> 1553 <option value="">every</option> 1554 </xsl:template> 1555 1556 <xsl:template name="buildRecurFields"> 1557 <xsl:param name="current"/> 1558 <xsl:param name="total"/> 1559 <xsl:param name="name"/> 1560 <div class="invisible"> 1561 <xsl:attribute name="id"><xsl:value-of select="$name"/>RecurFields<xsl:value-of select="$current"/></xsl:attribute> 1562 and 1563 <select width="12em"> 1564 <xsl:attribute name="name">by<xsl:value-of select="$name"/>posPos<xsl:value-of select="$current"/></xsl:attribute> 1565 <xsl:if test="$current != $total"> 1566 <xsl:attribute name="onchange">changeClass('<xsl:value-of select="$name"/>RecurFields<xsl:value-of select="$current+1"/>','shown')</xsl:attribute> 1567 </xsl:if> 1568 <xsl:call-template name="recurrenceDayPosOptions"/> 1569 </select> 1570 <xsl:call-template name="byDayChkBoxList"/> 1571 </div> 1572 <xsl:if test="$current < $total"> 1573 <xsl:call-template name="buildRecurFields"> 1574 <xsl:with-param name="current"><xsl:value-of select="$current+1"/></xsl:with-param> 1575 <xsl:with-param name="total"><xsl:value-of select="$total"/></xsl:with-param> 1576 <xsl:with-param name="name"><xsl:value-of select="$name"/></xsl:with-param> 1577 </xsl:call-template> 1578 </xsl:if> 1178 1579 </xsl:template> 1179 1580 … … 2415 2816 <!--<form name="toggleCals" action="{$event-selectCalForEvent}"> 2416 2817 <xsl:choose> 2417 <xsl:when test="/bedework /appvar[key='showAllCalsForEvent']/value = 'true'">2818 <xsl:when test="/bedeworkadmin/appvar[key='showAllCalsForEvent']/value = 'true'"> 2418 2819 <input type="radio" name="setappvar" value="showAllCalsForEvent(false)" onclick="submit()"/> 2419 2820 show only writable calendars trunk/deployment/webadmin/webapp/resources/resources/dynCalendarWidget.js
r952 r1157 8 8 * 9 9 * Modifications for inclusion in Bedework calendar system 10 * by Arlen Johnson & Dave Brondsema 200610 * by Arlen Johnson 2006 & Dave Brondsema 2006 11 11 */ 12 12 … … 14 14 * Global variables 15 15 */ 16 dynCalendar_layers = new Array();17 dynCalendar_mouseoverStatus = false;18 dynCalendar_mouseX = 0;19 dynCalendar_mouseY = 0;16 dynCalendar_layers = new Array(); 17 dynCalendar_mouseoverStatus = false; 18 dynCalendar_mouseX = 0; 19 dynCalendar_mouseY = 0; 20 20 21 21 /** … … 24 24 * @access public 25 25 * @param string objName Name of the object that you create 26 * @param int yr Year value (e.g. 2006) 27 * @param int mth Month value (0-11) 28 * @param int dy Day (date) value (1-31) 26 29 * @param string callbackFunc Name of the callback function 30 * @param boolean hideBwFields Hide Bedework time fields when widget appears (true/false) 27 31 * @param string OPTIONAL Optional images root path 28 32 * @param string OPTIONAL Optional layer name 29 33 */ 30 function dynCalendar(objName, callbackFunc) 31 { 32 /** 33 * Properties 34 */ 35 // Todays date 36 this.today = new Date(); 37 this.date = this.today.getDate(); 38 this.month = this.today.getMonth(); 39 this.year = this.today.getFullYear(); 40 41 this.objName = objName; 42 this.callbackFunc = callbackFunc; 43 if (arguments[2]) { 44 this.imagesPath = arguments[2]; 45 } else { 46 this.imagesPath = '/caladminrsrc/resources/'; 47 } 48 this.layerID = arguments[3] ? arguments[3] : 'dynCalendar_layer_' + dynCalendar_layers.length; 49 50 this.offsetX = 5; 51 this.offsetY = 5; 52 53 this.useMonthCombo = false; 54 this.useYearCombo = false; 55 this.yearComboRange = 5; 56 57 this.currentMonth = this.month; 58 this.currentYear = this.year; 59 60 /** 34 function dynCalendar(objName, yr, mth, dy, callbackFunc, hideBwFields) 35 { 36 /** 37 * Properties 38 */ 39 // Todays date 40 // this.today = new Date(); 41 // this.date = this.today.getDate(); 42 // this.month = this.today.getMonth(); 43 // this.year = this.today.getFullYear(); 44 45 // In Bedework we will always pass the start date explicitly to the 46 // calendar widget. 47 this.year = yr; //this.today.getFullYear(); 48 this.month = mth; //this.today.getMonth(); 49 this.date = dy; //this.today.getDate(); 50 51 this.objName = objName; 52 this.callbackFunc = callbackFunc; 53 this.hideBwFields = hideBwFields; 54 55 if (arguments[6]) { 56 this.imagesPath = arguments[6]; 57 } else { 58 this.imagesPath = '/ucalrsrc/resources/'; 59 } 60 this.layerID = arguments[6] ? arguments[6] : 'dynCalendar_layer_' + dynCalendar_layers.length; 61 62 this.offsetX = 5; 63 this.offsetY = 5; 64 65 this.useMonthCombo = false; 66 this.useYearCombo = false; 67 this.yearComboRange = 5; 68 69 this.currentMonth = this.month; 70 this.currentYear = this.year; 71 72 /** 61 73 * Public Methods 62 74 */ 63 this.show = dynCalendar_show;64 this.writeHTML = dynCalendar_writeHTML;65 66 // Accessor methods67 this.setOffset = dynCalendar_setOffset;68 this.setOffsetX = dynCalendar_setOffsetX;69 this.setOffsetY = dynCalendar_setOffsetY;70 this.setImagesPath = dynCalendar_setImagesPath;71 this.setMonthCombo = dynCalendar_setMonthCombo;72 this.setYearCombo = dynCalendar_setYearCombo;73 this.setCurrentMonth = dynCalendar_setCurrentMonth;74 this.setCurrentYear = dynCalendar_setCurrentYear;75 this.setYearComboRange = dynCalendar_setYearComboRange;76 77 /**75 this.show = dynCalendar_show; 76 this.writeHTML = dynCalendar_writeHTML; 77 78 // Accessor methods 79 this.setOffset = dynCalendar_setOffset; 80 this.setOffsetX = dynCalendar_setOffsetX; 81 this.setOffsetY = dynCalendar_setOffsetY; 82 this.setImagesPath = dynCalendar_setImagesPath; 83 this.setMonthCombo = dynCalendar_setMonthCombo; 84 this.setYearCombo = dynCalendar_setYearCombo; 85 this.setCurrentMonth = dynCalendar_setCurrentMonth; 86 this.setCurrentYear = dynCalendar_setCurrentYear; 87 this.setYearComboRange = dynCalendar_setYearComboRange; 88 89 /** 78 90 * Private methods 79 91 */ 80 // Layer manipulation81 this._getLayer = dynCalendar_getLayer;82 this._hideLayer = dynCalendar_hideLayer;83 this._showLayer = dynCalendar_showLayer;84 this._setLayerPosition = dynCalendar_setLayerPosition;85 this._setHTML = dynCalendar_setHTML;86 87 // Miscellaneous88 this._getDaysInMonth = dynCalendar_getDaysInMonth;89 this._mouseover = dynCalendar_mouseover;90 91 /**92 // Layer manipulation 93 this._getLayer = dynCalendar_getLayer; 94 this._hideLayer = dynCalendar_hideLayer; 95 this._showLayer = dynCalendar_showLayer; 96 this._setLayerPosition = dynCalendar_setLayerPosition; 97 this._setHTML = dynCalendar_setHTML; 98 99 // Miscellaneous 100 this._getDaysInMonth = dynCalendar_getDaysInMonth; 101 this._mouseover = dynCalendar_mouseover; 102 103 /** 92 104 * Constructor type code 93 105 */ 94 dynCalendar_layers[dynCalendar_layers.length] = this;95 this.writeHTML();96 }106 dynCalendar_layers[dynCalendar_layers.length] = this; 107 this.writeHTML(); 108 } 97 109 98 110 /** … … 104 116 * @param integer year Optional year (YYYY format) 105 117 */ 106 function dynCalendar_show()107 {108 // Variable declarations to prevent globalisation109 var month, year, monthnames, numdays, thisMonth, firstOfMonth;110 var ret, row, i, cssClass, linkHTML, previousMonth, previousYear;111 var nextMonth, nextYear, prevImgHTML, prevLinkHTML, nextImgHTML, nextLinkHTML;112 var monthComboOptions, monthCombo, yearComboOptions, yearCombo, html;113 114 this.currentMonth = month = arguments[0] != null ? arguments[0] : this.currentMonth;115 this.currentYear = year = arguments[1] != null ? arguments[1] : this.currentYear;116 117 monthnames = new Array('January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December');118 numdays = this._getDaysInMonth(month, year);119 120 thisMonth = new Date(year, month, 1);121 firstOfMonth = thisMonth.getDay();122 123 // First few blanks up to first day124 ret = new Array(new Array());125 for(i=0; i<firstOfMonth; i++){126 ret[0][ret[0].length] = '<td> </td>';127 }128 129 // Main body of calendar130 row = 0;131 i = 1;132 while(i <= numdays){133 if(ret[row].length == 7){134 ret[++row] = new Array();135 }136 137 /**118 function dynCalendar_show() 119 { 120 // Variable declarations to prevent globalisation 121 var month, year, monthnames, numdays, thisMonth, firstOfMonth; 122 var ret, row, i, cssClass, linkHTML, previousMonth, previousYear; 123 var nextMonth, nextYear, prevImgHTML, prevLinkHTML, nextImgHTML, nextLinkHTML; 124 var monthComboOptions, monthCombo, yearComboOptions, yearCombo, html; 125 126 this.currentMonth = month = arguments[0] != null ? arguments[0] : this.currentMonth; 127 this.currentYear = year = arguments[1] != null ? arguments[1] : this.currentYear; 128 129 monthnames = new Array('January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'); 130 numdays = this._getDaysInMonth(month, year); 131 132 thisMonth = new Date(year, month, 1); 133 firstOfMonth = thisMonth.getDay(); 134 135 // First few blanks up to first day 136 ret = new Array(new Array()); 137 for(i=0; i<firstOfMonth; i++){ 138 ret[0][ret[0].length] = '<td> </td>'; 139 } 140 141 // Main body of calendar 142 row = 0; 143 i = 1; 144 while(i <= numdays){ 145 if(ret[row].length == 7){ 146 ret[++row] = new Array(); 147 } 148 149 /** 138 150 * Generate this cells' HTML 139 151 */ 140 cssClass = (i == this.date && month == this.month && year == this.year) ? 'dynCalendar_today' : 'dynCalendar_day';141 linkHTML = '<a href="javascript: ' + this.callbackFunc + '(' + i + ', ' + (Number(month) + 1) + ', ' + year + '); ' + this.objName + '._hideLayer()">' + (i++) + '</a>';142 ret[row][ret[row].length] = '<td align="center" class="' + cssClass + '">' + linkHTML + '</td>';143 }144 145 // Format the HTML146 for(i=0; i<ret.length; i++){147 ret[i] = ret[i].join('\n') + '\n';148 }149 150 previousYear = thisMonth.getFullYear();151 previousMonth = thisMonth.getMonth() - 1;152 if(previousMonth < 0){153 previousMonth = 11;154 previousYear--;155 }156 157 nextYear = thisMonth.getFullYear();158 nextMonth = thisMonth.getMonth() + 1;159 if(nextMonth > 11){160 nextMonth = 0;161 nextYear++;162 }163 164 //prevImgHTML = '<img src="' + this.imagesPath + '/prev.gif" alt="<<" border="0" />';152 cssClass = (i == this.date && month == this.month && year == this.year) ? 'dynCalendar_today' : 'dynCalendar_day'; 153 linkHTML = '<a href="javascript: ' + this.callbackFunc + '(' + i + ', ' + (Number(month) + 1) + ', ' + year + '); ' + this.objName + '._hideLayer()">' + (i++) + '</a>'; 154 ret[row][ret[row].length] = '<td align="center" class="' + cssClass + '">' + linkHTML + '</td>'; 155 } 156 157 // Format the HTML 158 for(i=0; i<ret.length; i++){ 159 ret[i] = ret[i].join('\n') + '\n'; 160 } 161 162 previousYear = thisMonth.getFullYear(); 163 previousMonth = thisMonth.getMonth() - 1; 164 if(previousMonth < 0){ 165 previousMonth = 11; 166 previousYear--; 167 } 168 169 nextYear = thisMonth.getFullYear(); 170 nextMonth = thisMonth.getMonth() + 1; 171 if(nextMonth > 11){ 172 nextMonth = 0; 173 nextYear++; 174 } 175 176 //prevImgHTML = '<img src="' + this.imagesPath + '/prev.gif" alt="<<" border="0" />'; 165 177 prevImgHTML = '<<'; 166 prevLinkHTML = '<a href="javascript: ' + this.objName + '.show(' + previousMonth + ', ' + previousYear + ')">' + prevImgHTML + '</a>';167 //nextImgHTML = '<img src="' + this.imagesPath + '/next.gif" alt="<<" border="0" />';178 prevLinkHTML = '<a href="javascript: ' + this.objName + '.show(' + previousMonth + ', ' + previousYear + ')">' + prevImgHTML + '</a>'; 179 //nextImgHTML = '<img src="' + this.imagesPath + '/next.gif" alt="<<" border="0" />'; 168 180 nextImgHTML = '>>'; 169 nextLinkHTML = '<a href="javascript: ' + this.objName + '.show(' + nextMonth + ', ' + nextYear + ')">' + nextImgHTML + '</a>';170 171 /**181 nextLinkHTML = '<a href="javascript: ' + this.objName + '.show(' + nextMonth + ', ' + nextYear + ')">' + nextImgHTML + '</a>'; 182 183 /** 172 184 * Build month combo 173 185 */ 174 if (this.useMonthCombo) {175 monthComboOptions = '';176 for (i=0; i<12; i++) {177 selected = (i == thisMonth.getMonth() ? 'selected="selected"' : '');178 monthComboOptions += '<option value="' + i + '" ' + selected + '>' + monthnames[i] + '</option>';179 }180 monthCombo = '<select name="months" onchange="' + this.objName + '.show(this.options[this.selectedIndex].value, ' + this.objName + '.currentYear)">' + monthComboOptions + '</select>';181 } else {182 monthCombo = monthnames[thisMonth.getMonth()];183 }184 185 /**186 if (this.useMonthCombo) { 187 monthComboOptions = ''; 188 for (i=0; i<12; i++) { 189 selected = (i == thisMonth.getMonth() ? 'selected="selected"' : ''); 190 monthComboOptions += '<option value="' + i + '" ' + selected + '>' + monthnames[i] + '</option>'; 191 } 192 monthCombo = '<select name="months" onchange="' + this.objName + '.show(this.options[this.selectedIndex].value, ' + this.objName + '.currentYear)">' + monthComboOptions + '</select>'; 193 } else { 194 monthCombo = monthnames[thisMonth.getMonth()]; 195 } 196 197 /** 186 198 * Build year combo 187 199 */ 188 if (this.useYearCombo) {189 yearComboOptions = '';190 for (i = thisMonth.getFullYear() - this.yearComboRange; i <= (thisMonth.getFullYear() + this.yearComboRange); i++) {191 selected = (i == thisMonth.getFullYear() ? 'selected="selected"' : '');192 yearComboOptions += '<option value="' + i + '" ' + selected + '>' + i + '</option>';193 }194 yearCombo = '<select style="border: 1px groove" name="years" onchange="' + this.objName + '.show(' + this.objName + '.currentMonth, this.options[this.selectedIndex].value)">' + yearComboOptions + '</select>';195 } else {196 yearCombo = thisMonth.getFullYear();197 }198 199 html = '<table class="dynCalendar_table" cellspacing="0">';200 html += '<tr><td class="dynCalendar_header">' + prevLinkHTML + '</td><td colspan="5" align="center" class="dynCalendar_header">' + monthCombo + ' ' + yearCombo + '</td><td align="right" class="dynCalendar_header">' + nextLinkHTML + '</td></tr>';201 html += '<tr>';202 html += '<td class="dynCalendar_dayname">Su</td>';203 html += '<td class="dynCalendar_dayname">Mo</td>';204 html += '<td class="dynCalendar_dayname">Tu</td>';205 html += '<td class="dynCalendar_dayname">We</td>';206 html += '<td class="dynCalendar_dayname">Th</td>';207 html += '<td class="dynCalendar_dayname">Fr</td>';208 html += '<td class="dynCalendar_dayname">Sa</td></tr>';209 html += '<tr>' + ret.join('</tr>\n<tr>') + '</tr>';210 html += '</table>';211 212 this._setHTML(html);213 if (!arguments[0] && !arguments[1]) {214 this._showLayer();215 this._setLayerPosition();216 }217 }200 if (this.useYearCombo) { 201 yearComboOptions = ''; 202 for (i = thisMonth.getFullYear() - this.yearComboRange; i <= (thisMonth.getFullYear() + this.yearComboRange); i++) { 203 selected = (i == thisMonth.getFullYear() ? 'selected="selected"' : ''); 204 yearComboOptions += '<option value="' + i + '" ' + selected + '>' + i + '</option>'; 205 } 206 yearCombo = '<select style="border: 1px groove" name="years" onchange="' + this.objName + '.show(' + this.objName + '.currentMonth, this.options[this.selectedIndex].value)">' + yearComboOptions + '</select>'; 207 } else { 208 yearCombo = thisMonth.getFullYear(); 209 } 210 211 html = '<table class="dynCalendar_table" cellspacing="0">'; 212 html += '<tr><td class="dynCalendar_header">' + prevLinkHTML + '</td><td colspan="5" align="center" class="dynCalendar_header">' + monthCombo + ' ' + yearCombo + '</td><td align="right" class="dynCalendar_header">' + nextLinkHTML + '</td></tr>'; 213 html += '<tr>'; 214 html += '<td class="dynCalendar_dayname">Su</td>'; 215 html += '<td class="dynCalendar_dayname">Mo</td>'; 216 html += '<td class="dynCalendar_dayname">Tu</td>'; 217 html += '<td class="dynCalendar_dayname">We</td>'; 218 html += '<td class="dynCalendar_dayname">Th</td>'; 219 html += '<td class="dynCalendar_dayname">Fr</td>'; 220 html += '<td class="dynCalendar_dayname">Sa</td></tr>'; 221 html += '<tr>' + ret.join('</tr>\n<tr>') + '</tr>'; 222 html += '</table>'; 223 224 this._setHTML(html); 225 if (!arguments[0] && !arguments[1]) { 226 this._showLayer(); 227 this._setLayerPosition(); 228 } 229 } 218 230 219 231 /** … … 222 234 * @access public 223 235 */ 224 function dynCalendar_writeHTML()225 {226 if (is_ie5up || is_nav6up || is_gecko) {227 document.write('<a href="javascript: ' + this.objName + '.show()"><img src="' + this.imagesPath + 'calIcon.gif" border="0" width="16" height="15" /></a>');228 document.write('<div class="dynCalendar" id="' + this.layerID + '" onmouseover="' + this.objName + '._mouseover(true)" onmouseout="' + this.objName + '._mouseover(false)"></div>');229 }230 }236 function dynCalendar_writeHTML() 237 { 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 } 242 } 231 243 232 244 /** … … 240 252 * offset from mouse position 241 253 */ 242 function dynCalendar_setOffset(Xoffset, Yoffset)243 {244 this.setOffsetX(Xoffset);245 this.setOffsetY(Yoffset);246 }254 function dynCalendar_setOffset(Xoffset, Yoffset) 255 { 256 this.setOffsetX(Xoffset); 257 this.setOffsetY(Yoffset); 258 } 247 259 248 260 /** … … 254 266 * offset from mouse position 255 267 */ 256 function dynCalendar_setOffsetX(Xoffset)257 {258 this.offsetX = Xoffset;259 }268 function dynCalendar_setOffsetX(Xoffset) 269 { 270 this.offsetX = Xoffset; 271 } 260 272 261 273 /** … … 267 279 * offset from mouse position 268 280 */ 269 function dynCalendar_setOffsetY(Yoffset)270 {271 this.offsetY = Yoffset;272 }281 function dynCalendar_setOffsetY(Yoffset) 282 { 283 this.offsetY = Yoffset; 284 } 273 285 274 286 /** … … 278 290 * @param string path Path to use for images 279 291 */ 280 function dynCalendar_setImagesPath(path)281 {282 this.imagesPath = path;283 }292 function dynCalendar_setImagesPath(path) 293 { 294 this.imagesPath = path; 295 } 284 296 285 297 /** … … 289 301 * @param boolean useMonthCombo Whether to use month dropdown or not 290 302 */ 291 function dynCalendar_setMonthCombo(useMonthCombo)292 {293 this.useMonthCombo = useMonthCombo;294 }303 function dynCalendar_setMonthCombo(useMonthCombo) 304 { 305 this.useMonthCombo = useMonthCombo; 306 } 295 307 296 308 /** … … 300 312 * @param boolean useYearCombo Whether to use year dropdown or not 301 313 */ 302 function dynCalendar_setYearCombo(useYearCombo)303 {304 this.useYearCombo = useYearCombo;305 }314 function dynCalendar_setYearCombo(useYearCombo) 315 { 316 this.useYearCombo = useYearCombo; 317 } 306 318 307 319 /** … … 311 323 * @param boolean month The month to set the current month to 312 324 */ 313 function dynCalendar_setCurrentMonth(month)314 {315 this.currentMonth = month;316 }325 function dynCalendar_setCurrentMonth(month) 326 { 327 this.currentMonth = month; 328 } 317 329 318 330 /** … … 322 334 * @param boolean year The year to set the current year to 323 335 */ 324 function dynCalendar_setCurrentYear(year)325 {326 this.currentYear = year;327 }336 function dynCalendar_setCurrentYear(year) 337 { 338 this.currentYear = year; 339 } 328 340 329 341 /** … … 334 346 * @param integer range The range to set 335 347 */ 336 function dynCalendar_setYearComboRange(range)337 {338 this.yearComboRange = range;339 }348 function dynCalendar_setYearComboRange(range) 349 { 350 this.yearComboRange = range; 351 } 340 352 341 353 /** … … 344 356 * @access private 345 357 */ 346 function dynCalendar_getLayer()347 {348 var layerID = this.layerID;349 350 if (document.getElementById(layerID)) {351 352 return document.getElementById(layerID);353 354 } else if (document.all(layerID)) {355 return document.all(layerID);356 }357 }358 function dynCalendar_getLayer() 359 { 360 var layerID = this.layerID; 361 362 if (document.getElementById(layerID)) { 363 364 return document.getElementById(layerID); 365 366 } else if (document.all(layerID)) { 367 return document.all(layerID); 368 } 369 } 358 370 359 371 /** … … 362 374 * @access private 363 375 */ 364 function dynCalendar_hideLayer()365 {366 this._getLayer().style.visibility = 'hidden';376 function dynCalendar_hideLayer() 377 { 378 this._getLayer().style.visibility = 'hidden'; 367 379 368 380 // for Bedework event editing; reveal time fields when cal widget is hidden 369 changeClass('calWidgetStartTimeHider','shown'); 370 changeClass('calWidgetEndTimeHider','shown'); 371 } 381 if (this.hideBwFields) { 382 changeClass('calWidgetStartTimeHider','shown'); 383 changeClass('calWidgetEndTimeHider','shown'); 384 } 385 } 372 386 373 387 /** … … 376 390 * @access private 377 391 */ 378 function dynCalendar_showLayer()379 {380 this._getLayer().style.visibility = 'visible';392 function dynCalendar_showLayer() 393 { 394 this._getLayer().style.visibility = 'visible'; 381 395 382 396 // for Bedework event editing; hide time fields when cal widget is visible 383 397 // to avoid IE rendering oddities (IE always displays the "windowed" layer 384 398 // above everything else -- that includes select boxes. 385 changeClass('calWidgetStartTimeHider','invisible'); 386 changeClass('calWidgetEndTimeHider','invisible'); 387 } 399 if (this.hideBwFields) { 400 changeClass('calWidgetStartTimeHider','invisible'); 401 changeClass('calWidgetEndTimeHider','invisible'); 402 } 403 } 388 404 389 405 /** … … 392 408 * @access private 393 409 */ 394 function dynCalendar_setLayerPosition()395 {396 this._getLayer().style.top = (dynCalendar_mouseY + this.offsetY) + 'px';397 this._getLayer().style.left = (dynCalendar_mouseX + this.offsetX) + 'px';398 }410 function dynCalendar_setLayerPosition() 411 { 412 this._getLayer().style.top = (dynCalendar_mouseY + this.offsetY) + 'px'; 413 this._getLayer().style.left = (dynCalendar_mouseX + this.offsetX) + 'px'; 414 } 399 415 400 416 /** … … 403 419 * @access private 404 420 */ 405 function dynCalendar_setHTML(html)406 {407 this._getLayer().innerHTML = html;408 }421 function dynCalendar_setHTML(html) 422 { 423 this._getLayer().innerHTML = html; 424 } 409 425 410 426 /** … … 415 431 * @param integer year The year of the month in question 416 432 */ 417 function dynCalendar_getDaysInMonth(month, year)418 {419 monthdays = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];420 if (month != 1) {421 return monthdays[month];422 } else {423 return ((year % 4 == 0 && year % 100 != 0) || year % 400 == 0 ? 29 : 28);424 }425 }433 function dynCalendar_getDaysInMonth(month, year) 434 { 435 monthdays = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]; 436 if (month != 1) { 437 return monthdays[month]; 438 } else { 439 return ((year % 4 == 0 && year % 100 != 0) || year % 400 == 0 ? 29 : 28); 440 } 441 } 426 442 427 443 /** … … 432 448 * calendar or not 433 449 */ 434 function dynCalendar_mouseover(status)435 {436 dynCalendar_mouseoverStatus = status;437 return true;438 }450 function dynCalendar_mouseover(status) 451 { 452 dynCalendar_mouseoverStatus = status; 453 return true; 454 } 439 455 440 456 /** 441 457 * onMouseMove event handler 442 458 */ 443 dynCalendar_oldOnmousemove = document.onmousemove ? document.onmousemove : new Function;444 445 document.onmousemove = function ()446 {447 if (is_ie5up || is_nav6up || is_gecko) {448 if (arguments[0]) {449 dynCalendar_mouseX = arguments[0].pageX;450 dynCalendar_mouseY = arguments[0].pageY;451 } else {452 dynCalendar_mouseX = event.clientX + document.body.scrollLeft;453 dynCalendar_mouseY = event.clientY + document.body.scrollTop;454 arguments[0] = null;455 }456 457 dynCalendar_oldOnmousemove();458 }459 }459 dynCalendar_oldOnmousemove = document.onmousemove ? document.onmousemove : new Function; 460 461 document.onmousemove = function () 462 { 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; 471 } 472 473 dynCalendar_oldOnmousemove(); 474 } 475 } 460 476 461 477 /** 462 478 * Callbacks for document.onclick 463 479 */ 464 dynCalendar_oldOnclick = document.onclick ? document.onclick : new Function;465 466 document.onclick = function ()467 {468 if (is_ie5up || is_nav6up || is_gecko) {469 if(!dynCalendar_mouseoverStatus){470 for(i=0; i<dynCalendar_layers.length; ++i){471 dynCalendar_layers[i]._hideLayer();472 }473 }474 475 dynCalendar_oldOnclick(arguments[0] ? arguments[0] : null);476 }477 }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 } trunk/deployment/webadmin/webapp/resources/resources/includes.js
r1052 r1157 1 var debug = false; // very basic debugging for now 2 1 3 function changeClass(id, newClass) { 2 4 identity = document.getElementById(id); 3 5 identity.className=newClass; 6 } 7 // show hide items using a checkbox 8 function swapVisible(obj,id) { 9 if (obj.checked) { 10 changeClass(id,'shown'); 11 } else { 12 changeClass(id,'invisible'); 13 } 4 14 } 5 15 function swapAllDayEvent(obj) { … … 19 29 allDayStartDateField.value = "off"; 20 30 allDayEndDateField.value = "off"; 31 } 32 } 33 function swapFloatingTime(obj) { 34 startTimezone = document.getElementById("startTzid"); 35 endTimezone = document.getElementById("endTzid"); 36 startFloating = document.getElementById("startFloating"); 37 endFloating = document.getElementById("endFloating"); 38 if (obj.checked) { 39 document.getElementById("storeUTCFlag").checked = false; 40 startTimezone.disabled = true; 41 endTimezone.disabled = true; 42 startFloating.value = "on"; 43 endFloating.value = "on"; 44 } else { 45 startTimezone.disabled = false; 46 endTimezone.disabled = false; 47 startFloating.value = "off"; 48 endFloating.value = "off"; 49 } 50 } 51 function swapStoreUTC(obj) { 52 startTimezone = document.getElementById("startTzid"); 53 endTimezone = document.getElementById("endTzid"); 54 startStoreUTC = document.getElementById("startStoreUTC"); 55 endStoreUTC = document.getElementById("endStoreUTC"); 56 if (obj.checked) { 57 document.getElementById("floatingFlag").checked = false; 58 startTimezone.disabled = false; 59 endTimezone.disabled = false; 60 startStoreUTC.value = "on"; 61 endStoreUTC.value = "on"; 62 } else { 63 startStoreUTC.value = "off"; 64 endStoreUTC.value = "off"; 21 65 } 22 66 } … … 41 85 } 42 86 } 43 87 function swapRecurrence(obj) { 88 if (obj.checked) { 89 changeClass('recurrenceFields','dateStartEndBox'); 90 changeClass('recurrenceUiSwitch','shown'); 91 } else { 92 changeClass('recurrenceFields','invisible'); 93 changeClass('recurrenceUiSwitch','invisible'); 94 } 95 } 96 // reveal and hide recurrence fields 97 function showRecurrence(freq) { 98 changeClass('recurrenceUntilRules','shown'); 99 100 if (freq == 'NONE') { 101 changeClass('noneRecurrenceRules','shown'); 102 changeClass('recurrenceUntilRules','invisible'); 103 } else { 104 changeClass('noneRecurrenceRules','invisible'); 105 } 106 if (freq == 'HOURLY') { 107 changeClass('hourlyRecurrenceRules','shown'); 108 } else { 109 changeClass('hourlyRecurrenceRules','invisible'); 110 } 111 if (freq == 'DAILY') { 112 changeClass('dailyRecurrenceRules','shown'); 113 } else { 114 changeClass('dailyRecurrenceRules','invisible'); 115 } 116 if (freq == 'WEEKLY') { 117 changeClass('weeklyRecurrenceRules','shown'); 118 } else { 119 changeClass('weeklyRecurrenceRules','invisible'); 120 } 121 if (freq == 'MONTHLY') { 122 changeClass('monthlyRecurrenceRules','shown'); 123 } else { 124 changeClass('monthlyRecurrenceRules','invisible'); 125 } 126 if (freq == 'YEARLY') { 127 changeClass('yearlyRecurrenceRules','shown'); 128 } else { 129 changeClass('yearlyRecurrenceRules','invisible'); 130 } 131 } 132 function recurSelectWeekends(id) { 133 chkBoxCollection = document.getElementById(id).getElementsByTagName('input'); 134 if (chkBoxCollection) { 135 if (typeof chkBoxCollection.length != 'undefined') { 136 for (i = 0; i < chkBoxCollection.length; i++) { 137 if (chkBoxCollection[i].value == 'SU' || chkBoxCollection[i].value == 'SA') { 138 chkBoxCollection[i].checked = true; 139 } else { 140 chkBoxCollection[i].checked = false; 141 } 142 } 143 } 144 } 145 } 146 function recurSelectWeekdays(id) { 147 chkBoxCollection = document.getElementById(id).getElementsByTagName('input'); 148 if (chkBoxCollection) { 149 if (typeof chkBoxCollection.length != 'undefined') { 150 for (i = 0; i < chkBoxCollection.length; i++) { 151 if (chkBoxCollection[i].value == 'SU' || chkBoxCollection[i].value == 'SA') { 152 chkBoxCollection[i].checked = false; 153 } else { 154 chkBoxCollection[i].checked = true; 155 } 156 } 157 } 158 } 159 } 160 function selectRecurCountUntil(id) { 161 document.getElementById(id).checked = true; 162 } 163 // Assemble the recurrence rules if recurrence is specified. 164 // Request params to set ('freq' is always set): 165 // interval, count, until (count OR until, not both) 166 // possibly: byday, bymonthday, bymonth, byyearday 167 function setRecurrence(formObj) { 168 if (formObj.recurrenceFlag.checked) { 169 var freq = getSelectedRadioButtonVal(formObj.freq); 170 if (freq != 'NONE') { 171 // build up recurrence rules 172 switch (freq) { 173 case "DAILY": 174 var bymonth = new Array(); 175 // get the bymonth values 176 bymonth = collectRecurChkBoxVals(bymonth,document.getElementById('dayMonthCheckBoxList').getElementsByTagName('input'),false); 177 // set the form values 178 formObj.bymonth.value = bymonth.join(','); 179 formObj.interval.value = formObj.dailyInterval.value; 180 break; 181 case "WEEKLY": 182 var byday = new Array(); 183 byday = collectRecurChkBoxVals(byday, document.getElementById('weekRecurFields').getElementsByTagName('input'),false); 184 formObj.byday.value = byday.join(','); 185 if (formObj.weekWkst.selectedIndex != -1) { 186 formObj.wkst.value = formObj.weekWkst[formObj.weekWkst.selectedIndex].value; 187 } 188 formObj.interval.value = formObj.weeklyInterval.value; 189 break; 190 case "MONTHLY": 191 var i = 1; 192 var monthByDayId = 'monthRecurFields' + i; 193 var byday = new Array(); 194 var bymonthday = new Array(); 195 var byyearday = new Array(); 196 // get the byday values 197 while (document.getElementById(monthByDayId)) { 198 var monthFields = document.getElementById(monthByDayId); 199 var dayPosSelect = monthFields.getElementsByTagName('select'); 200 var dayPos = dayPosSelect[0][dayPosSelect[0].selectedIndex].value; 201 if (dayPos) { 202 byday = collectRecurChkBoxVals(byday,monthFields.getElementsByTagName('input'),dayPos); 203 } 204 monthByDayId = monthByDayId.substring(0,monthByDayId.length-1) + ++i; 205 } 206 // get the bymonthday values 207 bymonthday = collectRecurChkBoxVals(bymonthday,document.getElementById('monthDaysCheckBoxList').getElementsByTagName('input'),false); 208 // set the form values 209 formObj.byday.value = byday.join(','); 210 formObj.bymonthday.value = bymonthday.join(','); 211 formObj.interval.value = formObj.monthlyInterval.value; 212 break; 213 case "YEARLY": 214 var i = 1; 215 var yearByDayId = 'yearRecurFields' + i; 216 var byday = new Array(); 217 var bymonthday = new Array(); 218 var bymonth = new Array(); 219 var byweekno = new Array(); 220 var byyearday = new Array(); 221 // get the byday values 222 while (document.getElementById(yearByDayId)) { 223 var yearFields = document.getElementById(yearByDayId); 224 var dayPosSelect = yearFields.getElementsByTagName('select'); 225 var dayPos = dayPosSelect[0][dayPosSelect[0].selectedIndex].value; 226 if (dayPos) { 227 byday = collectRecurChkBoxVals(byday,yearFields.getElementsByTagName('input'),dayPos); 228 } 229 yearByDayId = yearByDayId.substring(0,yearByDayId.length-1) + ++i; 230 } 231 // get the bymonth values 232 bymonth = collectRecurChkBoxVals(bymonth,document.getElementById('yearMonthCheckBoxList').getElementsByTagName('input'),false); 233 // get the bymonthday values 234 bymonthday = collectRecurChkBoxVals(bymonthday,document.getElementById('yearMonthDaysCheckBoxList').getElementsByTagName('input'),false); 235 // get the byweekno values 236 byweekno = collectRecurChkBoxVals(byweekno,document.getElementById('yearWeeksCheckBoxList').getElementsByTagName('input'),false); 237 // get the byyearday values 238 byyearday = collectRecurChkBoxVals(byyearday,document.getElementById('yearDaysCheckBoxList').getElementsByTagName('input'),false); 239 240 // set the form values 241 formObj.byday.value = byday.join(','); 242 formObj.bymonth.value = bymonth.join(','); 243 formObj.bymonthday.value = bymonthday.join(','); 244 formObj.byweekno.value = byweekno.join(','); 245 formObj.byyearday.value = byyearday.join(','); 246 if (formObj.yearWkst.selectedIndex != -1) { 247 formObj.wkst.value = formObj.yearWkst[formObj.yearWkst.selectedIndex].value; 248 } 249 formObj.interval.value = formObj.yearlyInterval.value; 250 break; 251 } 252 // build up count or until values 253 var recur = getSelectedRadioButtonVal(formObj.recurCountUntil); 254 switch (recur) { 255 case "forever": 256 // do nothing 257 break; 258 case "count": 259 formObj.count.value = formObj.countHolder.value; 260 break; 261 case "until": 262 // pad the month and day with zeros if only a single digit 263 var paddedMonth = (formObj.untilMonth.value < 10) ? '0'+formObj.untilMonth.value : formObj.untilMonth.value; 264 var paddedDay = (formObj.untilDay.value < 10) ? '0'+formObj.untilDay.value : formObj.untilDay.value; 265 formObj.until.value = formObj.untilYear.value + paddedMonth + paddedDay; 266 break; 267 } 268 } 269 } 270 if (debug) { 271 alert("frequency: " + freq + "\ninterval: " + formObj.interval.value + "\ncount: " + formObj.count.value + "\nuntil: " + formObj.until.value + "\nbyday: " + formObj.byday.value + "\nbymonthday: " + formObj.bymonthday.value + "\nbymonth: " + formObj.bymonth.value + "\nbyyearday: " + formObj.byyearday.value + "\nwkst: " + formObj.wkst.value); 272 } 273 return true; 274 } 275 function getSelectedRadioButtonVal(radioCollection) { 276 for(var i = 0; i < radioCollection.length; i++) { 277 if(radioCollection[i].checked == true) { 278 return radioCollection[i].value; 279 } 280 } 281 } 282 // returns an array of collected checkbox values 283 function collectRecurChkBoxVals(valArray,chkBoxes,dayPos) { 284 if (chkBoxes) { 285 if (typeof chkBoxes.length != 'undefined') { 286 for (i = 0; i < chkBoxes.length; i++) { 287 if (chkBoxes[i].checked == true) { 288 if (dayPos) { 289 valArray.push(dayPos + chkBoxes[i].value); 290 } else { 291 valArray.push(chkBoxes[i].value); 292 } 293 } 294 } 295 } 296 } 297 return valArray; 298 } 44 299 // launch a simple window for displaying information; no header or status bar 45 300 function launchSimpleWindow(URL) { … … 48 303 } 49 304 305 // launch a size parameterized window for displaying information; no header or status bar 306 function launchSizedWindow(URL,width,height) { 307 paramStr = "width=" + width + ",height=" + height + ",scrollbars=yes,resizable=yes,alwaysRaised=yes,menubar=no,toolbar=no"; 308 sizedWindow = window.open(URL, "sizedWindow", paramStr); 309 window.sizedWindow.focus(); 310 } 311 312 // launches new browser window with print-friendly version of page when 313 // print icon is clicked 314 function launchPrintWindow(URL) { 315 printWindow = window.open(URL, "printWindow", "width=640,height=500,scrollbars=yes,resizable=yes,alwaysRaised=yes,menubar=yes,toolbar=yes"); 316 window.printWindow.focus(); 317 } 318 50 319 function startDateCalWidgetCallback(date, month, year) { 51 if (String(month).length == 1) {52 month = '0' + month;53 }54 if (String(date).length == 1) {55 date = '0' + date;56 }57 320 today = new Date(); 58 321 if (year < today.getFullYear()) { 59 alert("You may not create an event in a previous year.");322 alert("You may not use this widget to \n create an event in a previous year."); 60 323 } else { 61 324 document.peForm['eventStartDate.month'].value = month; … … 65 328 } 66 329 function endDateCalWidgetCallback(date, month, year) { 67 if (String(month).length == 1) {68 month = '0' + month;69 }70 if (String(date).length == 1) {71 date = '0' + date;72 }73 330 today = new Date(); 74 331 if (year < today.getFullYear()) { 75 alert("You may not create an event in a previous year.");332 alert("You may not use this widget to \n create an event in a previous year."); 76 333 } else { 77 334 document.peForm['eventEndDate.month'].value = month; 78 335 document.peForm['eventEndDate.day'].value = date; 79 336 document.peForm['eventEndDate.year'].value = year; 337 } 338 } 339 function untilDateCalWidgetCallback(date, month, year) { 340 if (year < today.getFullYear()) { 341 alert("You may not use this widget to \n create an event in a previous year."); 342 } else { 343 document.peForm['untilMonth'].value = month; 344 document.peForm['untilDay'].value = date; 345 document.peForm['untilYear'].value = year; 346 selectRecurCountUntil('recurUntil'); 80 347 } 81 348 } trunk/deployment/webuser/webapp/resources/demoskins/default/default/default.xsl
r1156 r1157 2290 2290 <xsl:variable name="pos" select="position()"/> 2291 2291 <option> 2292 <xsl:attribute name="value"><xsl:value-of select="/bedework/recurday names/val[position() = $pos]"/></xsl:attribute>2292 <xsl:attribute name="value"><xsl:value-of select="/bedework/recurdayvals/val[position() = $pos]"/></xsl:attribute> 2293 2293 <xsl:value-of select="."/> 2294 2294 </option> … … 2402 2402 <xsl:variable name="pos" select="position()"/> 2403 2403 <option> 2404 <xsl:attribute name="value"><xsl:value-of select="/bedework/recurday names/val[position() = $pos]"/></xsl:attribute>2404 <xsl:attribute name="value"><xsl:value-of select="/bedework/recurdayvals/val[position() = $pos]"/></xsl:attribute> 2405 2405 <xsl:value-of select="."/> 2406 2406 </option> … … 2432 2432 </select> 2433 2433 <xsl:choose> 2434 <xsl:when test="/bedework/creating = 'true'">2434 <xsl:when test="/bedework/creating = 'true'"> 2435 2435 <select name="untilYear" onfocus="selectRecurCountUntil('recurUntil')"> 2436 2436 <xsl:for-each select="form/start/year/select/option"> … … 2438 2438 </xsl:for-each> 2439 2439 </select> 2440 </xsl:when> 2441 <xsl:otherwise> 2442 <input type="text" name="untilYear" size="4" onfocus="selectRecurCountUntil('recurUntil')"/> 2443 <xsl:attribute name="value"><xsl:value-of select="form/start/yearText/input/@value"/></xsl:attribute> 2444 </xsl:otherwise> 2440 </xsl:when> 2441 <xsl:otherwise> 2442 <input type="text" name="untilYear" size="4" onfocus="selectRecurCountUntil('recurUntil')"> 2443 <xsl:attribute name="value"><xsl:value-of select="form/start/yearText/input/@value"/></xsl:attribute> 2444 </input> 2445 </xsl:otherwise> 2445 2446 </xsl:choose> 2446 2447 </div> … … 2631 2632 <xsl:variable name="pos" select="position()"/> 2632 2633 <input type="checkbox"> 2633 <xsl:attribute name="value"><xsl:value-of select="/bedework/recurday names/val[position() = $pos]"/></xsl:attribute>2634 <xsl:attribute name="value"><xsl:value-of select="/bedework/recurdayvals/val[position() = $pos]"/></xsl:attribute> 2634 2635 <xsl:attribute name="name"><xsl:value-of select="$name"/></xsl:attribute> 2635 2636 </input> trunk/deployment/webuser/webapp/resources/demoskins/resources/dynCalendarWidget.js
r1147 r1157 8 8 * 9 9 * Modifications for inclusion in Bedework calendar system 10 * by Arlen Johnson 2006 10 * by Arlen Johnson 2006 & Dave Brondsema 2006 11 11 */ 12 12 … … 14 14 * Global variables 15 15 */ 16 dynCalendar_layers = new Array();17 dynCalendar_mouseoverStatus = false;18 dynCalendar_mouseX = 0;19 dynCalendar_mouseY = 0;16 dynCalendar_layers = new Array(); 17 dynCalendar_mouseoverStatus = false; 18 dynCalendar_mouseX = 0; 19 dynCalendar_mouseY = 0; 20 20 21 21 /** … … 32 32 * @param string OPTIONAL Optional layer name 33 33 */ 34 function dynCalendar(objName, yr, mth, dy, callbackFunc, hideBwFields)35 {34 function dynCalendar(objName, yr, mth, dy, callbackFunc, hideBwFields) 35 { 36 36 /** 37 37 * Properties 38 38 */ 39 // Todays date40 // this.today = new Date();39 // Todays date 40 // this.today = new Date(); 41 41 // this.date = this.today.getDate(); 42 // this.month = this.today.getMonth();43 // this.year = this.today.getFullYear();42 // this.month = this.today.getMonth(); 43 // this.year = this.today.getFullYear(); 44 44 45 45 // In Bedework we will always pass the start date explicitly to the 46 46 // calendar widget. 47 this.year = yr; //this.today.getFullYear();48 this.month = mth; //this.today.getMonth();49 this.date = dy; //this.today.getDate();50 51 this.objName = objName;52 this.callbackFunc = callbackFunc;47 this.year = yr; //this.today.getFullYear(); 48 this.month = mth; //this.today.getMonth(); 49 this.date = dy; //this.today.getDate(); 50 51 this.objName = objName; 52 this.callbackFunc = callbackFunc; 53 53 this.hideBwFields = hideBwFields; 54 54 55 55 if (arguments[6]) { 56 this.imagesPath = arguments[6];57 } else {58 this.imagesPath = '/ucalrsrc/resources/';59 }60 this.layerID = arguments[6] ? arguments[6] : 'dynCalendar_layer_' + dynCalendar_layers.length;61 62 this.offsetX = 5;63 this.offsetY = 5;64 65 this.useMonthCombo = false;66 this.useYearCombo = false;67 this.yearComboRange = 5;68 69 this.currentMonth = this.month;70 this.currentYear = this.year;71 72 /**56 this.imagesPath = arguments[6]; 57 } else { 58 this.imagesPath = '/ucalrsrc/resources/'; 59 } 60 this.layerID = arguments[6] ? arguments[6] : 'dynCalendar_layer_' + dynCalendar_layers.length; 61 62 this.offsetX = 5; 63 this.offsetY = 5; 64 65 this.useMonthCombo = false; 66 this.useYearCombo = false; 67 this.yearComboRange = 5; 68 69 this.currentMonth = this.month; 70 this.currentYear = this.year; 71 72 /** 73 73 * Public Methods 74 74 */ 75 this.show = dynCalendar_show;76 this.writeHTML = dynCalendar_writeHTML;77 78 // Accessor methods79 this.setOffset = dynCalendar_setOffset;80 this.setOffsetX = dynCalendar_setOffsetX;81 this.setOffsetY = dynCalendar_setOffsetY;82 this.setImagesPath = dynCalendar_setImagesPath;83 this.setMonthCombo = dynCalendar_setMonthCombo;84 this.setYearCombo = dynCalendar_setYearCombo;85 this.setCurrentMonth = dynCalendar_setCurrentMonth;86 this.setCurrentYear = dynCalendar_setCurrentYear;87 this.setYearComboRange = dynCalendar_setYearComboRange;88 89 /**75 this.show = dynCalendar_show; 76 this.writeHTML = dynCalendar_writeHTML; 77 78 // Accessor methods 79 this.setOffset = dynCalendar_setOffset; 80 this.setOffsetX = dynCalendar_setOffsetX; 81 this.setOffsetY = dynCalendar_setOffsetY; 82 this.setImagesPath = dynCalendar_setImagesPath; 83 this.setMonthCombo = dynCalendar_setMonthCombo; 84 this.setYearCombo = dynCalendar_setYearCombo; 85 this.setCurrentMonth = dynCalendar_setCurrentMonth; 86 this.setCurrentYear = dynCalendar_setCurrentYear; 87 this.setYearComboRange = dynCalendar_setYearComboRange; 88 89 /** 90 90 * Private methods 91 91 */ 92 // Layer manipulation93 this._getLayer = dynCalendar_getLayer;94 this._hideLayer = dynCalendar_hideLayer;95 this._showLayer = dynCalendar_showLayer;96 this._setLayerPosition = dynCalendar_setLayerPosition;97 this._setHTML = dynCalendar_setHTML;98 99 // Miscellaneous100 this._getDaysInMonth = dynCalendar_getDaysInMonth;101 this._mouseover = dynCalendar_mouseover;102 103 /**92 // Layer manipulation 93 this._getLayer = dynCalendar_getLayer; 94 this._hideLayer = dynCalendar_hideLayer; 95 this._showLayer = dynCalendar_showLayer; 96 this._setLayerPosition = dynCalendar_setLayerPosition; 97 this._setHTML = dynCalendar_setHTML; 98 99 // Miscellaneous 100 this._getDaysInMonth = dynCalendar_getDaysInMonth; 101 this._mouseover = dynCalendar_mouseover; 102 103 /** 104 104 * Constructor type code 105 105 */ 106 dynCalendar_layers[dynCalendar_layers.length] = this;107 this.writeHTML();108 }106 dynCalendar_layers[dynCalendar_layers.length] = this; 107 this.writeHTML(); 108 } 109 109 110 110 /** … … 116 116 * @param integer year Optional year (YYYY format) 117 117 */ 118 function dynCalendar_show()119 {120 // Variable declarations to prevent globalisation121 var month, year, monthnames, numdays, thisMonth, firstOfMonth;122 var ret, row, i, cssClass, linkHTML, previousMonth, previousYear;123 var nextMonth, nextYear, prevImgHTML, prevLinkHTML, nextImgHTML, nextLinkHTML;124 var monthComboOptions, monthCombo, yearComboOptions, yearCombo, html;125 126 this.currentMonth = month = arguments[0] != null ? arguments[0] : this.currentMonth;127 this.currentYear = year = arguments[1] != null ? arguments[1] : this.currentYear;128 129 monthnames = new Array('January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December');130 numdays = this._getDaysInMonth(month, year);131 132 thisMonth = new Date(year, month, 1);133 firstOfMonth = thisMonth.getDay();134 135 // First few blanks up to first day136 ret = new Array(new Array());137 for(i=0; i<firstOfMonth; i++){138 ret[0][ret[0].length] = '<td> </td>';139 }140 141 // Main body of calendar142 row = 0;143 i = 1;144 while(i <= numdays){145 if(ret[row].length == 7){146 ret[++row] = new Array();147 }148 149 /**118 function dynCalendar_show() 119 { 120 // Variable declarations to prevent globalisation 121 var month, year, monthnames, numdays, thisMonth, firstOfMonth; 122 var ret, row, i, cssClass, linkHTML, previousMonth, previousYear; 123 var nextMonth, nextYear, prevImgHTML, prevLinkHTML, nextImgHTML, nextLinkHTML; 124 var monthComboOptions, monthCombo, yearComboOptions, yearCombo, html; 125 126 this.currentMonth = month = arguments[0] != null ? arguments[0] : this.currentMonth; 127 this.currentYear = year = arguments[1] != null ? arguments[1] : this.currentYear; 128 129 monthnames = new Array('January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'); 130 numdays = this._getDaysInMonth(month, year); 131 132 thisMonth = new Date(year, month, 1); 133 firstOfMonth = thisMonth.getDay(); 134 135 // First few blanks up to first day 136 ret = new Array(new Array()); 137 for(i=0; i<firstOfMonth; i++){ 138 ret[0][ret[0].length] = '<td> </td>'; 139 } 140 141 // Main body of calendar 142 row = 0; 143 i = 1; 144 while(i <= numdays){ 145 if(ret[row].length == 7){ 146 ret[++row] = new Array(); 147 } 148 149 /** 150 150 * Generate this cells' HTML 151 151 */ 152 cssClass = (i == this.date && month == this.month && year == this.year) ? 'dynCalendar_today' : 'dynCalendar_day';153 linkHTML = '<a href="javascript: ' + this.callbackFunc + '(' + i + ', ' + (Number(month) + 1) + ', ' + year + '); ' + this.objName + '._hideLayer()">' + (i++) + '</a>';154 ret[row][ret[row].length] = '<td align="center" class="' + cssClass + '">' + linkHTML + '</td>';155 }156 157 // Format the HTML158 for(i=0; i<ret.length; i++){159 ret[i] = ret[i].join('\n') + '\n';160 }161 162 previousYear = thisMonth.getFullYear();163 previousMonth = thisMonth.getMonth() - 1;164 if(previousMonth < 0){165 previousMonth = 11;166 previousYear--;167 }168 169 nextYear = thisMonth.getFullYear();170 nextMonth = thisMonth.getMonth() + 1;171 if(nextMonth > 11){172 nextMonth = 0;173 nextYear++;174 }175 176 //prevImgHTML = '<img src="' + this.imagesPath + '/prev.gif" alt="<<" border="0" />';152 cssClass = (i == this.date && month == this.month && year == this.year) ? 'dynCalendar_today' : 'dynCalendar_day'; 153 linkHTML = '<a href="javascript: ' + this.callbackFunc + '(' + i + ', ' + (Number(month) + 1) + ', ' + year + '); ' + this.objName + '._hideLayer()">' + (i++) + '</a>'; 154 ret[row][ret[row].length] = '<td align="center" class="' + cssClass + '">' + linkHTML + '</td>'; 155 } 156 157 // Format the HTML 158 for(i=0; i<ret.length; i++){ 159 ret[i] = ret[i].join('\n') + '\n'; 160 } 161 162 previousYear = thisMonth.getFullYear(); 163 previousMonth = thisMonth.getMonth() - 1; 164 if(previousMonth < 0){ 165 previousMonth = 11; 166 previousYear--; 167 } 168 169 nextYear = thisMonth.getFullYear(); 170 nextMonth = thisMonth.getMonth() + 1; 171 if(nextMonth > 11){ 172 nextMonth = 0; 173 nextYear++; 174 } 175 176 //prevImgHTML = '<img src="' + this.imagesPath + '/prev.gif" alt="<<" border="0" />'; 177 177 prevImgHTML = '<<'; 178 prevLinkHTML = '<a href="javascript: ' + this.objName + '.show(' + previousMonth + ', ' + previousYear + ')">' + prevImgHTML + '</a>';179 //nextImgHTML = '<img src="' + this.imagesPath + '/next.gif" alt="<<" border="0" />';178 prevLinkHTML = '<a href="javascript: ' + this.objName + '.show(' + previousMonth + ', ' + previousYear + ')">' + prevImgHTML + '</a>'; 179 //nextImgHTML = '<img src="' + this.imagesPath + '/next.gif" alt="<<" border="0" />'; 180 180 nextImgHTML = '>>'; 181 nextLinkHTML = '<a href="javascript: ' + this.objName + '.show(' + nextMonth + ', ' + nextYear + ')">' + nextImgHTML + '</a>';182 183 /**181 nextLinkHTML = '<a href="javascript: ' + this.objName + '.show(' + nextMonth + ', ' + nextYear + ')">' + nextImgHTML + '</a>'; 182 183 /** 184 184 * Build month combo 185 185 */ 186 if (this.useMonthCombo) {187 monthComboOptions = '';188 for (i=0; i<12; i++) {189 selected = (i == thisMonth.getMonth() ? 'selected="selected"' : '');190 monthComboOptions += '<option value="' + i + '" ' + selected + '>' + monthnames[i] + '</option>';191 }192 monthCombo = '<select name="months" onchange="' + this.objName + '.show(this.options[this.selectedIndex].value, ' + this.objName + '.currentYear)">' + monthComboOptions + '</select>';193 } else {194 monthCombo = monthnames[thisMonth.getMonth()];195 }196 197 /**186 if (this.useMonthCombo) { 187 monthComboOptions = ''; 188 for (i=0; i<12; i++) { 189 selected = (i == thisMonth.getMonth() ? 'selected="selected"' : ''); 190 monthComboOptions += '<option value="' + i + '" ' + selected + '>' + monthnames[i] + '</option>'; 191 } 192 monthCombo = '<select name="months" onchange="' + this.objName + '.show(this.options[this.selectedIndex].value, ' + this.objName + '.currentYear)">' + monthComboOptions + '</select>'; 193 } else { 194 monthCombo = monthnames[thisMonth.getMonth()]; 195 } 196 197 /** 198 198 * Build year combo 199 199 */ 200 if (this.useYearCombo) {201 yearComboOptions = '';202 for (i = thisMonth.getFullYear() - this.yearComboRange; i <= (thisMonth.getFullYear() + this.yearComboRange); i++) {203 selected = (i == thisMonth.getFullYear() ? 'selected="selected"' : '');204 yearComboOptions += '<option value="' + i + '" ' + selected + '>' + i + '</option>';205 }206 yearCombo = '<select style="border: 1px groove" name="years" onchange="' + this.objName + '.show(' + this.objName + '.currentMonth, this.options[this.selectedIndex].value)">' + yearComboOptions + '</select>';207 } else {208 yearCombo = thisMonth.getFullYear();209 }210 211 html = '<table class="dynCalendar_table" cellspacing="0">';212 html += '<tr><td class="dynCalendar_header">' + prevLinkHTML + '</td><td colspan="5" align="center" class="dynCalendar_header">' + monthCombo + ' ' + yearCombo + '</td><td align="right" class="dynCalendar_header">' + nextLinkHTML + '</td></tr>';213 html += '<tr>';214 html += '<td class="dynCalendar_dayname">Su</td>';215 html += '<td class="dynCalendar_dayname">Mo</td>';216 html += '<td class="dynCalendar_dayname">Tu</td>';217 html += '<td class="dynCalendar_dayname">We</td>';218 html += '<td class="dynCalendar_dayname">Th</td>';219 html += '<td class="dynCalendar_dayname">Fr</td>';220 html += '<td class="dynCalendar_dayname">Sa</td></tr>';221 html += '<tr>' + ret.join('</tr>\n<tr>') + '</tr>';222 html += '</table>';223 224 this._setHTML(html);225 if (!arguments[0] && !arguments[1]) {226 this._showLayer();227 this._setLayerPosition();228 }229 }200 if (this.useYearCombo) { 201 yearComboOptions = ''; 202 for (i = thisMonth.getFullYear() - this.yearComboRange; i <= (thisMonth.getFullYear() + this.yearComboRange); i++) { 203 selected = (i == thisMonth.getFullYear() ? 'selected="selected"' : ''); 204 yearComboOptions += '<option value="' + i + '" ' + selected + '>' + i + '</option>'; 205 } 206 yearCombo = '<select style="border: 1px groove" name="years" onchange="' + this.objName + '.show(' + this.objName + '.currentMonth, this.options[this.selectedIndex].value)">' + yearComboOptions + '</select>'; 207 } else { 208 yearCombo = thisMonth.getFullYear(); 209 } 210 211 html = '<table class="dynCalendar_table" cellspacing="0">'; 212 html += '<tr><td class="dynCalendar_header">' + prevLinkHTML + '</td><td colspan="5" align="center" class="dynCalendar_header">' + monthCombo + ' ' + yearCombo + '</td><td align="right" class="dynCalendar_header">' + nextLinkHTML + '</td></tr>'; 213 html += '<tr>'; 214 html += '<td class="dynCalendar_dayname">Su</td>'; 215 html += '<td class="dynCalendar_dayname">Mo</td>'; 216 html += '<td class="dynCalendar_dayname">Tu</td>'; 217 html += '<td class="dynCalendar_dayname">We</td>'; 218 html += '<td class="dynCalendar_dayname">Th</td>'; 219 html += '<td class="dynCalendar_dayname">Fr</td>'; 220 html += '<td class="dynCalendar_dayname">Sa</td></tr>'; 221 html += '<tr>' + ret.join('</tr>\n<tr>') + '</tr>'; 222 html += '</table>'; 223 224 this._setHTML(html); 225 if (!arguments[0] && !arguments[1]) { 226 this._showLayer(); 227 this._setLayerPosition(); 228 } 229 } 230 230 231 231 /** … … 234 234 * @access public 235 235 */ 236 function dynCalendar_writeHTML()237 {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 }242 }236 function dynCalendar_writeHTML() 237 { 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 } 242 } 243 243 244 244 /** … … 252 252 * offset from mouse position 253 253 */ 254 function dynCalendar_setOffset(Xoffset, Yoffset)255 {256 this.setOffsetX(Xoffset);257 this.setOffsetY(Yoffset);258 }254 function dynCalendar_setOffset(Xoffset, Yoffset) 255 { 256 this.setOffsetX(Xoffset); 257 this.setOffsetY(Yoffset); 258 } 259 259 260 260 /** … … 266 266 * offset from mouse position 267 267 */ 268 function dynCalendar_setOffsetX(Xoffset)269 {270 this.offsetX = Xoffset;271 }268 function dynCalendar_setOffsetX(Xoffset) 269 { 270 this.offsetX = Xoffset; 271 } 272 272 273 273 /** … … 279 279 * offset from mouse position 280 280 */ 281 function dynCalendar_setOffsetY(Yoffset)282 {283 this.offsetY = Yoffset;284 }281 function dynCalendar_setOffsetY(Yoffset) 282 { 283 this.offsetY = Yoffset; 284 } 285 285 286 286 /** … … 290 290 * @param string path Path to use for images 291 291 */ 292 function dynCalendar_setImagesPath(path)293 {294 this.imagesPath = path;295 }292 function dynCalendar_setImagesPath(path) 293 { 294 this.imagesPath = path; 295 } 296 296 297 297 /** … … 301 301 * @param boolean useMonthCombo Whether to use month dropdown or not 302 302 */ 303 function dynCalendar_setMonthCombo(useMonthCombo)304 {305 this.useMonthCombo = useMonthCombo;306 }303 function dynCalendar_setMonthCombo(useMonthCombo) 304 { 305 this.useMonthCombo = useMonthCombo; 306 } 307 307 308 308 /** … … 312 312 * @param boolean useYearCombo Whether to use year dropdown or not 313 313 */ 314 function dynCalendar_setYearCombo(useYearCombo)315 {316 this.useYearCombo = useYearCombo;317 }314 function dynCalendar_setYearCombo(useYearCombo) 315 { 316 this.useYearCombo = useYearCombo; 317 } 318 318 319 319 /** … … 323 323 * @param boolean month The month to set the current month to 324 324 */ 325 function dynCalendar_setCurrentMonth(month)326 {327 this.currentMonth = month;328 }325 function dynCalendar_setCurrentMonth(month) 326 { 327 this.currentMonth = month; 328 } 329 329 330 330 /** … … 334 334 * @param boolean year The year to set the current year to 335 335 */ 336 function dynCalendar_setCurrentYear(year)337 {338 this.currentYear = year;339 }336 function dynCalendar_setCurrentYear(year) 337 { 338 this.currentYear = year; 339 } 340 340 341 341 /** … … 346 346 * @param integer range The range to set 347 347 */ 348 function dynCalendar_setYearComboRange(range)349 {350 this.yearComboRange = range;351 }348 function dynCalendar_setYearComboRange(range) 349 { 350 this.yearComboRange = range; 351 } 352 352 353 353 /** … … 356 356 * @access private 357 357 */ 358 function dynCalendar_getLayer()359 {360 var layerID = this.layerID;361 362 if (document.getElementById(layerID)) {363 364 return document.getElementById(layerID);365 366 } else if (document.all(layerID)) {367 return document.all(layerID);368 }369 }358 function dynCalendar_getLayer() 359 { 360 var layerID = this.layerID; 361 362 if (document.getElementById(layerID)) { 363 364 return document.getElementById(layerID); 365 366 } else if (document.all(layerID)) { 367 return document.all(layerID); 368 } 369 } 370 370 371 371 /** … … 374 374 * @access private 375 375 */ 376 function dynCalendar_hideLayer()377 {378 this._getLayer().style.visibility = 'hidden';376 function dynCalendar_hideLayer() 377 { 378 this._getLayer().style.visibility = 'hidden'; 379 379 380 380 // for Bedework event editing; reveal time fields when cal widget is hidden … … 383 383 changeClass('calWidgetEndTimeHider','shown'); 384 384 } 385 }385 } 386 386 387 387 /** … … 390 390 * @access private 391 391 */ 392 function dynCalendar_showLayer()393 {394 this._getLayer().style.visibility = 'visible';392 function dynCalendar_showLayer() 393 { 394 this._getLayer().style.visibility = 'visible'; 395 395 396 396 // for Bedework event editing; hide time fields when cal widget is visible … … 401 401 changeClass('calWidgetEndTimeHider','invisible'); 402 402 } 403 }403 } 404 404 405 405 /** … … 408 408 * @access private 409 409 */ 410 function dynCalendar_setLayerPosition()411 {412 this._getLayer().style.top = (dynCalendar_mouseY + this.offsetY) + 'px';413 this._getLayer().style.left = (dynCalendar_mouseX + this.offsetX) + 'px';414 }410 function dynCalendar_setLayerPosition() 411 { 412 this._getLayer().style.top = (dynCalendar_mouseY + this.offsetY) + 'px'; 413 this._getLayer().style.left = (dynCalendar_mouseX + this.offsetX) + 'px'; 414 } 415 415 416 416 /** … … 419 419 * @access private 420 420 */ 421 function dynCalendar_setHTML(html)422 {423 this._getLayer().innerHTML = html;424 }421 function dynCalendar_setHTML(html) 422 { 423 this._getLayer().innerHTML = html; 424 } 425 425 426 426 /** … … 431 431 * @param integer year The year of the month in question 432 432 */ 433 function dynCalendar_getDaysInMonth(month, year)434 {435 monthdays = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];436 if (month != 1) {437 return monthdays[month];438 } else {439 return ((year % 4 == 0 && year % 100 != 0) || year % 400 == 0 ? 29 : 28);440 }441 }433 function dynCalendar_getDaysInMonth(month, year) 434 { 435 monthdays = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]; 436 if (month != 1) { 437 return monthdays[month]; 438 } else { 439 return ((year % 4 == 0 && year % 100 != 0) || year % 400 == 0 ? 29 : 28); 440 } 441 } 442 442 443 443 /** … … 448 448 * calendar or not 449 449 */ 450 function dynCalendar_mouseover(status)451 {452 dynCalendar_mouseoverStatus = status;453 return true;454 }450 function dynCalendar_mouseover(status) 451 { 452 dynCalendar_mouseoverStatus = status; 453 return true; 454 } 455 455 456 456 /** 457 457 * onMouseMove event handler 458 458 */ 459 dynCalendar_oldOnmousemove = document.onmousemove ? document.onmousemove : new Function;460 461 document.onmousemove = function ()462 {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;471 }472 473 dynCalendar_oldOnmousemove();474 }475 }459 dynCalendar_oldOnmousemove = document.onmousemove ? document.onmousemove : new Function; 460 461 document.onmousemove = function () 462 { 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; 471 } 472 473 dynCalendar_oldOnmousemove(); 474 } 475 } 476 476 477 477 /** 478 478 * Callbacks for document.onclick 479 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 }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 } trunk/deployment/webuser/webapp/resources/demoskins/resources/includes.js
r1156 r1157 1 var debug = false; // very basic debugging for now 2 1 3 function changeClass(id, newClass) { 2 4 identity = document.getElementById(id); … … 181 183 byday = collectRecurChkBoxVals(byday, document.getElementById('weekRecurFields').getElementsByTagName('input'),false); 182 184 formObj.byday.value = byday.join(','); 183 formObj.wkst.value = formObj.weekWkst[formObj.weekWkst.selectedIndex].value; 185 if (formObj.weekWkst.selectedIndex != -1) { 186 formObj.wkst.value = formObj.weekWkst[formObj.weekWkst.selectedIndex].value; 187 } 184 188 formObj.interval.value = formObj.weeklyInterval.value; 185 189 break; … … 240 244 formObj.byweekno.value = byweekno.join(','); 241 245 formObj.byyearday.value = byyearday.join(','); 242 formObj.wkst.value = formObj.yearWkst[formObj.yearWkst.selectedIndex].value; 246 if (formObj.yearWkst.selectedIndex != -1) { 247 formObj.wkst.value = formObj.yearWkst[formObj.yearWkst.selectedIndex].value; 248 } 243 249 formObj.interval.value = formObj.yearlyInterval.value; 244 250 break; … … 262 268 } 263 269 } 264 //alert("frequency: " + freq + "\ninterval: " + formObj.interval.value + "\ncount: " + formObj.count.value + "\nuntil: " + formObj.until.value + "\nbyday: " + formObj.byday.value + "\nbymonthday: " + formObj.bymonthday.value + "\nbymonth: " + formObj.bymonth.value + "\nbyyearday: " + formObj.byyearday.value + "\nwkst: " + formObj.wkst.value); 270 271 if (debug) { 272 alert("frequency: " + freq + "\ninterval: " + formObj.interval.value + "\ncount: " + formObj.count.value + "\nuntil: " + formObj.until.value + "\nbyday: " + formObj.byday.value + "\nbymonthday: " + formObj.bymonthday.value + "\nbymonth: " + formObj.bymonth.value + "\nbyyearday: " + formObj.byyearday.value + "\nwkst: " + formObj.wkst.value); 273 } 265 274 return true; 266 275 } … … 310 319 311 320 function startDateCalWidgetCallback(date, month, year) { 312 /*if (String(month).length == 1) { 313 month = '0' + month; 314 } 315 if (String(date).length == 1) { 316 date = '0' + date; 317 }*/ 318 document.eventForm['eventStartDate.month'].value = month; 319 document.eventForm['eventStartDate.day'].value = date; 320 document.eventForm['eventStartDate.year'].value = year; 321 today = new Date(); 322 if (year < today.getFullYear()) { 323 alert("You may not use this widget to \n create an event in a previous year."); 324 } else { 325 document.eventForm['eventStartDate.month'].value = month; 326 document.eventForm['eventStartDate.day'].value = date; 327 document.eventForm['eventStartDate.year'].value = year; 328 } 321 329 } 322 330 function endDateCalWidgetCallback(date, month, year) { 323 /*if (String(month).length == 1) { 324 month = '0' + month; 325 } 326 if (String(date).length == 1) { 327 date = '0' + date; 328 }*/ 329 330 document.eventForm['eventEndDate.month'].value = month; 331 document.eventForm['eventEndDate.day'].value = date; 332 document.eventForm['eventEndDate.year'].value = year; 331 today = new Date(); 332 if (year < today.getFullYear()) { 333 alert("You may not use this widget to \n create an event in a previous year."); 334 } else { 335 document.eventForm['eventEndDate.month'].value = month; 336 document.eventForm['eventEndDate.day'].value = date; 337 document.eventForm['eventEndDate.year'].value = year; 338 } 333 339 } 334 340 function untilDateCalWidgetCallback(date, month, year) { 335 /*if (String(month).length == 1) { 336 month = '0' + month; 337 } 338 if (String(date).length == 1) { 339 date = '0' + date; 340 }*/ 341 342 document.eventForm['untilMonth'].value = month; 343 document.eventForm['untilDay'].value = date; 344 document.eventForm['untilYear'].value = year; 345 selectRecurCountUntil('recurUntil'); 341 today = new Date(); 342 if (year < today.getFullYear()) { 343 alert("You may not use this widget to \n create an event in a previous year."); 344 } else { 345 document.eventForm['untilMonth'].value = month; 346 document.eventForm['untilDay'].value = date; 347 document.eventForm['untilYear'].value = year; 348 selectRecurCountUntil('recurUntil'); 349 } 346 350 } 347 351
