Changeset 1150
- Timestamp:
- 12/12/06 18:20:25
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/deployment/webuser/webapp/resources/demoskins/default/default/default.xsl
r1147 r1150 1746 1746 <!-- The name "eventForm" is referenced by several javascript functions. Do not 1747 1747 change it without modifying includes.js --> 1748 <form name="eventForm" method="post" action="{$addEvent}" id="standardForm" >1748 <form name="eventForm" method="post" action="{$addEvent}" id="standardForm" onsubmit="setRecurrence(this)"> 1749 1749 <h2> 1750 1750 <span class="formButtons"> … … 1767 1767 <!-- The name "eventForm" is referenced by several javascript functions. Do not 1768 1768 change it without modifying includes.js --> 1769 <form name="eventForm" method="post" action="{$updateEvent}" id="standardForm" >1769 <form name="eventForm" method="post" action="{$updateEvent}" id="standardForm" onsubmit="setRecurrence(this)"> 1770 1770 <h2> 1771 1771 <span class="formButtons"> … … 2211 2211 <!-- ================= --> 2212 2212 <input type="checkbox" name="recurrenceFlag" onclick="swapRecurrence(this)" value="on"/> 2213 <!-- set these dynamically --> 2214 <input type="hidden" name="interval" value=""/> 2215 <input type="hidden" name="count" value=""/> 2216 <input type="hidden" name="until" value=""/> 2217 <input type="hidden" name="byday" value=""/> 2218 <input type="hidden" name="bymonthday" value=""/> 2219 <input type="hidden" name="bymonth" value=""/> 2220 <input type="hidden" name="byyearday" value=""/> 2221 2213 2222 <xsl:if test="form/recurring='true'"><xsl:attribute name="checked">checked</xsl:attribute></xsl:if> 2214 2223 recurring … … 2218 2227 <td class="recurrenceFrequency" rowspan="2"> 2219 2228 <strong>Frequency:</strong><br/> 2220 <input type="radio" name="freq" value="NONE" onclick="showRecurrence(this.value)" checked="checked"/>once<br/> 2221 <input type="radio" name="freq" value="HOURLY" onclick="showRecurrence(this.value)"/>hourly<br/> 2229 <!-- "freq" is used to determine if a recurrence should be created; test for "none" --> 2230 <input type="radio" name="freq" value="NONE" onclick="showRecurrence(this.value)" checked="checked"/>none<br/> 2231 <!--<input type="radio" name="freq" value="HOURLY" onclick="showRecurrence(this.value)"/>hourly<br/>--> 2222 2232 <input type="radio" name="freq" value="DAILY" onclick="showRecurrence(this.value)"/>daily<br/> 2223 2233 <input type="radio" name="freq" value="WEEKLY" onclick="showRecurrence(this.value)"/>weekly<br/> … … 2226 2236 </td> 2227 2237 <td class="recurrenceRules"> 2238 <!-- none --> 2228 2239 <div id="noneRecurrenceRules"> 2229 2240 <p>does not recur</p> 2230 2241 </div> 2242 <!-- hourly --> 2231 2243 <div id="hourlyRecurrenceRules" class="invisible"> 2232 2244 <strong>Interval:</strong> 2233 2245 every <input type="text" name="hourlyInterval" size="2" value="1"/> hour(s) 2234 2246 </div> 2247 <!-- daily --> 2235 2248 <div id="dailyRecurrenceRules" class="invisible"> 2236 2249 <p> … … 2239 2252 </p> 2240 2253 </div> 2254 <!-- weekly --> 2241 2255 <div id="weeklyRecurrenceRules" class="invisible"> 2242 2256 <p> … … 2245 2259 </p> 2246 2260 <p> 2247 <input type="radio" name="weekrrule" value="byday" checked="checked"/> 2248 <xsl:call-template name="byDayChkBoxList"/> 2261 <div id="byDayWeek"> 2262 <xsl:call-template name="byDayChkBoxList"> 2263 <xsl:with-param name="name">byDayWeek</xsl:with-param> 2264 </xsl:call-template> 2265 </div> 2249 2266 </p> 2250 <p> 2251 <input type="radio" name="weekrrule" value="weekdays"/>weekdays 2252 </p> 2253 <p> 2254 <input type="radio" name="weekrrule" value="weekends"/>weekends 2267 <p align="right"> 2268 <a href="javascript:recurSelectWeekdays('byDayWeek')">select weekdays</a> | 2269 <a href="javascript:recurSelectWeekends('byDayWeek')">select weekends</a> 2255 2270 </p> 2256 2271 </div> 2272 <!-- monthly --> 2257 2273 <div id="monthlyRecurrenceRules" class="invisible"> 2258 2274 <p> … … 2261 2277 </p> 2262 2278 <p> 2263 <input type="radio" name="monthrrule" value="bymonthpos" checked="checked"/> 2264 on the 2279  on 2265 2280 <select name="bymonthposPos1" width="7em"> 2266 <option value="first">first</option> 2267 <option value="second">second</option> 2268 <option value="third">third</option> 2269 <option value="fourth">fourth</option> 2270 <option value="last">last</option> 2281 <xsl:call-template name="recurrenceDayPosOptions"/> 2271 2282 </select> 2272 <select name="bymonthposDay1" width="7em"> 2273 <xsl:for-each select="/bedework/daynames/val"> 2274 <option> 2275 <xsl:attribute name="value"><xsl:value-of select="."/></xsl:attribute> 2276 <xsl:value-of select="."/> 2277 </option> 2278 </xsl:for-each> 2283 <xsl:call-template name="byDayChkBoxList"/><br/> 2284 and 2285 <select name="bymonthposPos2" width="7em"> 2286 <xsl:call-template name="recurrenceDayPosOptions"/> 2279 2287 </select> 2280 <div class="extraByMonthPosFields"> 2281 and the 2282 <select name="bymonthposPos2" width="7em"> 2283 <option value="none">none</option> 2284 <option value="first">first</option> 2285 <option value="second">second</option> 2286 <option value="third">third</option> 2287 <option value="fourth">fourth</option> 2288 <option value="last">last</option> 2289 </select> 2290 <select name="bymonthposDay2" width="7em"> 2291 <option value="none">none</option> 2292 <xsl:for-each select="/bedework/daynames/val"> 2293 <option> 2294 <xsl:attribute name="value"><xsl:value-of select="."/></xsl:attribute> 2295 <xsl:value-of select="."/> 2296 </option> 2297 </xsl:for-each> 2298 </select><br/> 2299 and the 2300 <select name="bymonthposPos3" width="7em"> 2301 <option value="none">none</option> 2302 <option value="first">first</option> 2303 <option value="second">second</option> 2304 <option value="third">third</option> 2305 <option value="fourth">fourth</option> 2306 <option value="last">last</option> 2307 </select> 2308 <select name="bymonthposDay3" width="7em"> 2309 <option value="none">none</option> 2310 <xsl:for-each select="/bedework/daynames/val"> 2311 <option> 2312 <xsl:attribute name="value"><xsl:value-of select="."/></xsl:attribute> 2313 <xsl:value-of select="."/> 2314 </option> 2315 </xsl:for-each> 2316 </select><br/> 2317 and the 2318 <select name="bymonthposPos4" width="7em"> 2319 <option value="none">none</option> 2320 <option value="first">first</option> 2321 <option value="second">second</option> 2322 <option value="third">third</option> 2323 <option value="fourth">fourth</option> 2324 <option value="last">last</option> 2325 </select> 2326 <select name="bymonthposDay4" width="7em"> 2327 <option value="none">none</option> 2328 <xsl:for-each select="/bedework/daynames/val"> 2329 <option> 2330 <xsl:attribute name="value"><xsl:value-of select="."/></xsl:attribute> 2331 <xsl:value-of select="."/> 2332 </option> 2333 </xsl:for-each> 2334 </select> 2335 </div> 2288 <xsl:call-template name="byDayChkBoxList"/><br/> 2289 and 2290 <select name="bymonthposPos3" width="7em"> 2291 <xsl:call-template name="recurrenceDayPosOptions"/> 2292 </select> 2293 <xsl:call-template name="byDayChkBoxList"/><br/> 2294 and 2295 <select name="bymonthposPos4" width="7em"> 2296 <xsl:call-template name="recurrenceDayPosOptions"/> 2297 </select> 2298 <xsl:call-template name="byDayChkBoxList"/> 2336 2299 </p> 2337 2300 <p> 2338 <input type="radio" name="monthrrule" value="bymonthday"/>day(s):<br/> 2339 <xsl:call-template name="buildCheckboxList"> 2340 <xsl:with-param name="current">1</xsl:with-param> 2341 <xsl:with-param name="end">31</xsl:with-param> 2342 <xsl:with-param name="name">bymonthday</xsl:with-param> 2343 </xsl:call-template> 2301 <input type="checkbox" name="swapMonthCheckBoxList" value="" onclick="swapVisible(this,'monthCheckBoxList')"/> 2302 on these days:<br/> 2303 <div id="monthCheckBoxList" class="invisible"> 2304 <xsl:call-template name="buildCheckboxList"> 2305 <xsl:with-param name="current">1</xsl:with-param> 2306 <xsl:with-param name="end">31</xsl:with-param> 2307 <xsl:with-param name="name">bymonthdayBoxes</xsl:with-param> 2308 </xsl:call-template> 2309 </div> 2344 2310 </p> 2345 2311 </div> … … 2349 2315 <p> 2350 2316 <input type="radio" name="yearrrule" value="bymonthpos" onclick="swapYearCheckBoxList(this)" checked="checked"/> 2351 on the2317 on 2352 2318 <select name="bymonthposPos1" width="7em"> 2353 <option value="first">first</option> 2354 <option value="second">second</option> 2355 <option value="third">third</option> 2356 <option value="fourth">fourth</option> 2357 <option value="last">last</option> 2319 <xsl:call-template name="recurrenceDayPosOptions"/> 2358 2320 </select> 2359 2321 <select name="bymonthposDay1" width="7em"> … … 2375 2337 </select> 2376 2338 <div class="extraByMonthPosFields"> 2377 and the2339 and 2378 2340 <select name="bymonthposPos2" width="7em"> 2379 <option value="none">none</option> 2380 <option value="first">first</option> 2381 <option value="second">second</option> 2382 <option value="third">third</option> 2383 <option value="fourth">fourth</option> 2384 <option value="last">last</option> 2341 <xsl:call-template name="recurrenceDayPosOptions"/> 2385 2342 </select> 2386 2343 <select name="bymonthposDay2" width="7em"> 2387 <option value="none">none</option>2388 2344 <xsl:for-each select="/bedework/daynames/val"> 2389 2345 <option> … … 2394 2350 </select> of 2395 2351 <select name="bymonthposMonth2" width="7em"> 2396 <option value="none">none</option>2397 2352 <xsl:for-each select="/bedework/monthvalues/val"> 2398 2353 <option> … … 2403 2358 </xsl:for-each> 2404 2359 </select><br/> 2405 and the2360 and 2406 2361 <select name="bymonthposPos3" width="7em"> 2407 <option value="none">none</option> 2408 <option value="first">first</option> 2409 <option value="second">second</option> 2410 <option value="third">third</option> 2411 <option value="fourth">fourth</option> 2412 <option value="last">last</option> 2362 <xsl:call-template name="recurrenceDayPosOptions"/> 2413 2363 </select> 2414 2364 <select name="bymonthposDay3" width="7em"> … … 2422 2372 </select> of 2423 2373 <select name="bymonthposMonth3" width="7em"> 2424 <option value="none">none</option>2425 2374 <xsl:for-each select="/bedework/monthvalues/val"> 2426 2375 <option> … … 2431 2380 </xsl:for-each> 2432 2381 </select><br/> 2433 and the2382 and 2434 2383 <select name="bymonthposPos4" width="7em"> 2435 <option value="none">none</option> 2436 <option value="first">first</option> 2437 <option value="second">second</option> 2438 <option value="third">third</option> 2439 <option value="fourth">fourth</option> 2440 <option value="last">last</option> 2384 <xsl:call-template name="recurrenceDayPosOptions"/> 2441 2385 </select> 2442 2386 <select name="bymonthposDay4" width="7em"> 2443 <option value="none">none</option>2444 2387 <xsl:for-each select="/bedework/daynames/val"> 2445 2388 <option> … … 2450 2393 </select> of 2451 2394 <select name="bymonthposMonth4" width="7em"> 2452 <option value="none">none</option>2453 2395 <xsl:for-each select="/bedework/monthvalues/val"> 2454 2396 <option> … … 2462 2404 </p> 2463 2405 <p> 2464 <input type=" radio" name="yearrrule" value="byyearday" onclick="swapYearCheckBoxList(this)"/>day(s):<br/>2406 <input type="checkbox" name="swapYearCheckBoxList" value="" onclick="swapVisible(this,'yearCheckBoxList')"/>on these days of the year:<br/> 2465 2407 <div id="yearCheckBoxList" class="invisible"> 2466 2408 <xsl:call-template name="buildCheckboxList"> 2467 2409 <xsl:with-param name="current">1</xsl:with-param> 2468 2410 <xsl:with-param name="end">366</xsl:with-param> 2469 <xsl:with-param name="name">byyearday </xsl:with-param>2411 <xsl:with-param name="name">byyeardayBoxes</xsl:with-param> 2470 2412 </xsl:call-template> 2471 2413 </div> … … 2478 2420 <div id="recurrenceUntilRules" class="invisible"> 2479 2421 <strong>Repeat:</strong> 2480   2481 <input type="radio" name="rCountUntil" value="count" checked="checked"/> 2482 until 2483 <div class="dateFields"> 2484 <select name="untilMonth"> 2485 <xsl:for-each select="form/start/month/select/option"> 2486 <xsl:copy-of select="."/> 2487 </xsl:for-each> 2488 </select> 2489 <select name="untilDay"> 2490 <xsl:for-each select="form/start/day/select/option"> 2491 <xsl:copy-of select="."/> 2492 </xsl:for-each> 2493 </select> 2494 <xsl:choose> 2495 <xsl:when test="/bedework/creating = 'true'"> 2496 <select name="untilYear"> 2497 <xsl:for-each select="form/start/year/select/option"> 2498 <xsl:copy-of select="."/> 2499 </xsl:for-each> 2500 </select> 2501 </xsl:when> 2502 <xsl:otherwise> 2503 <input type="text" name="untilYear" size="4"/> 2504 <xsl:attribute name="value"><xsl:value-of select="form/start/yearText/input/@value"/></xsl:attribute> 2505 </xsl:otherwise> 2506 </xsl:choose> 2507 </div> 2508 <script language="JavaScript" type="text/javascript"> 2509 <xsl:comment> 2510 untilDateDynCalWidget = new dynCalendar('untilDateDynCalWidget', <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)"/>, 'untilDateCalWidgetCallback',false,'<xsl:value-of select="$resourcesRoot"/>/resources/'); 2511 </xsl:comment> 2512 </script> 2513   2514 <input type="radio" name="rCountUntil" value="count"/> 2515 <input type="text" value="1" size="2" name="count"/> times 2422 <p> 2423 <div class="dateFields"> 2424 <input type="radio" name="rCountUntil" value="until"/> 2425 until 2426 <select name="untilMonth"> 2427 <xsl:for-each select="form/start/month/select/option"> 2428 <xsl:copy-of select="."/> 2429 </xsl:for-each> 2430 </select> 2431 <select name="untilDay"> 2432 <xsl:for-each select="form/start/day/select/option"> 2433 <xsl:copy-of select="."/> 2434 </xsl:for-each> 2435 </select> 2436 <xsl:choose> 2437 <xsl:when test="/bedework/creating = 'true'"> 2438 <select name="untilYear"> 2439 <xsl:for-each select="form/start/year/select/option"> 2440 <xsl:copy-of select="."/> 2441 </xsl:for-each> 2442 </select> 2443 </xsl:when> 2444 <xsl:otherwise> 2445 <input type="text" name="untilYear" size="4"/> 2446 <xsl:attribute name="value"><xsl:value-of select="form/start/yearText/input/@value"/></xsl:attribute> 2447 </xsl:otherwise> 2448 </xsl:choose> 2449 </div> 2450 <script language="JavaScript" type="text/javascript"> 2451 <xsl:comment> 2452 untilDateDynCalWidget = new dynCalendar('untilDateDynCalWidget', <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)"/>, 'untilDateCalWidgetCallback',false,'<xsl:value-of select="$resourcesRoot"/>/resources/'); 2453 </xsl:comment> 2454 </script> 2455 </p> 2456 <p> 2457 <input type="radio" name="rCountUntil" value="forever" checked="checked"/> 2458 forever 2459   2460 <input type="radio" name="rCountUntil" value="count"/> 2461 <input type="text" value="1" size="2" name="count"/> times 2462 </p> 2516 2463 </div> 2517 2464 </td> … … 2675 2622 2676 2623 <xsl:template name="byDayChkBoxList"> 2677 <input type="checkbox" name="byday"/> 2678 <xsl:attribute name="value"><xsl:value-of select="/bedework/shortdaynames/val[position()=1]"/></xsl:attribute> 2679 <xsl:value-of select="/bedework/shortdaynames/val[position()=1]"/> 2680 <input type="checkbox" name="byday"/> 2681 <xsl:attribute name="value"><xsl:value-of select="/bedework/shortdaynames/val[position()=2]"/></xsl:attribute> 2682 <xsl:value-of select="/bedework/shortdaynames/val[position()=2]"/> 2683 <input type="checkbox" name="byday"/> 2684 <xsl:attribute name="value"><xsl:value-of select="/bedework/shortdaynames/val[position()=3]"/></xsl:attribute> 2685 <xsl:value-of select="/bedework/shortdaynames/val[position()=3]"/> 2686 <input type="checkbox" name="byday"/> 2687 <xsl:attribute name="value"><xsl:value-of select="/bedework/shortdaynames/val[position()=4]"/></xsl:attribute> 2688 <xsl:value-of select="/bedework/shortdaynames/val[position()=4]"/> 2689 <input type="checkbox" name="byday"/> 2690 <xsl:attribute name="value"><xsl:value-of select="/bedework/shortdaynames/val[position()=5]"/></xsl:attribute> 2691 <xsl:value-of select="/bedework/shortdaynames/val[position()=5]"/> 2692 <input type="checkbox" name="byday"/> 2693 <xsl:attribute name="value"><xsl:value-of select="/bedework/shortdaynames/val[position()=6]"/></xsl:attribute> 2694 <xsl:value-of select="/bedework/shortdaynames/val[position()=6]"/> 2695 <input type="checkbox" name="byday"/> 2696 <xsl:attribute name="value"><xsl:value-of select="/bedework/shortdaynames/val[position()=7]"/></xsl:attribute> 2697 <xsl:value-of select="/bedework/shortdaynames/val[position()=7]"/> 2624 <xsl:param name="name"/> 2625 <xsl:for-each select="/bedework/shortdaynames/val"> 2626 <xsl:variable name="pos" select="position()"/> 2627 <input type="checkbox"> 2628 <xsl:attribute name="value"><xsl:value-of select="/bedework/recurdaynames/val[position() = $pos]"/></xsl:attribute> 2629 <xsl:attribute name="name"><xsl:value-of select="$name"/></xsl:attribute> 2630 </input> 2631 <xsl:value-of select="."/> 2632 </xsl:for-each> 2698 2633 </xsl:template> 2699 2634 … … 2717 2652 </xsl:call-template> 2718 2653 </xsl:if> 2654 </xsl:template> 2655 2656 <xsl:template name="recurrenceDayPosOptions"> 2657 <option value="0">none</option> 2658 <option value="1">the first</option> 2659 <option value="2">the second</option> 2660 <option value="3">the third</option> 2661 <option value="4">the fourth</option> 2662 <option value="5">the fifth</option> 2663 <option value="-1">the last</option> 2664 <option value="">every</option> 2719 2665 </xsl:template> 2720 2666 trunk/deployment/webuser/webapp/resources/demoskins/resources/includes.js
r1147 r1150 2 2 identity = document.getElementById(id); 3 3 identity.className=newClass; 4 } 5 // show hide items using a checkbox 6 function swapVisible(obj,id) { 7 if (obj.checked) { 8 changeClass(id,'shown'); 9 } else { 10 changeClass(id,'invisible'); 11 } 4 12 } 5 13 function swapAllDayEvent(obj) { … … 82 90 } 83 91 } 92 // reveal and hide recurrence fields 84 93 function showRecurrence(freq) { 85 86 94 changeClass('recurrenceUntilRules','shown'); 87 95 … … 118 126 } 119 127 } 120 function swapYearCheckBoxList(obj) { 121 if (obj.value == "byyearday") { 122 changeClass('yearCheckBoxList','shown'); 123 } else { 124 changeClass('yearCheckBoxList','invisible'); 128 function recurSelectWeekends(id) { 129 chkBoxCollection = document.getElementById(id).getElementsByTagName('input'); 130 if (chkBoxCollection) { 131 if (typeof chkBoxCollection.length != 'undefined') { 132 for (i = 0; i < chkBoxCollection.length; i++) { 133 if (chkBoxCollection[i].value == 'SU' || chkBoxCollection[i].value == 'SA') { 134 chkBoxCollection[i].checked = true; 135 } else { 136 chkBoxCollection[i].checked = false; 137 } 138 } 139 } 140 } 141 } 142 function recurSelectWeekdays(id) { 143 chkBoxCollection = document.getElementById(id).getElementsByTagName('input'); 144 if (chkBoxCollection) { 145 if (typeof chkBoxCollection.length != 'undefined') { 146 for (i = 0; i < chkBoxCollection.length; i++) { 147 if (chkBoxCollection[i].value == 'SU' || chkBoxCollection[i].value == 'SA') { 148 chkBoxCollection[i].checked = false; 149 } else { 150 chkBoxCollection[i].checked = true; 151 } 152 } 153 } 154 } 155 } 156 // assemble the recurrence rules if recurrence is specified 157 function setRecurrence(form) { 158 if (form.recurrenceFlag.checked) { 159 125 160 } 126 161 }
