Changeset 1154

Show
Ignore:
Timestamp:
12/13/06 14:06:27
Author:
johnsa
Message:

personal client: continued interface work on recurrence form elements -- monthly recurrences in place

Files:

Legend:

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

    r1152 r1154  
    21922192          <!-- ================= --> 
    21932193          <input type="checkbox" name="recurrenceFlag" onclick="swapRecurrence(this)" value="on"/> 
     2194          <xsl:if test="form/recurring='true'"><xsl:attribute name="checked">checked</xsl:attribute></xsl:if> 
     2195          recurring 
     2196          <span id="recurrenceUiSwitch" class="invisible"> 
     2197            <input type="radio" name="recurrenceUiSwitch" value="simple"/>simple 
     2198            <input type="radio" name="recurrenceUiSwitch" value="advanced" checked="checked"/>advanced 
     2199          </span> 
     2200 
    21942201          <!-- set these dynamically when form is submitted --> 
    21952202          <input type="hidden" name="interval" value=""/> 
     
    22012208          <input type="hidden" name="byyearday" value=""/> 
    22022209 
    2203           <xsl:if test="form/recurring='true'"><xsl:attribute name="checked">checked</xsl:attribute></xsl:if> 
    2204           recurring 
    22052210          <div id="recurrenceFields" class="invisible"> 
    22062211            <table id="recurrenceTable" cellspacing="0"> 
     
    22862291                  <div id="yearlyRecurrenceRules" class="invisible"> 
    22872292                    <strong>Interval:</strong> 
    2288                     every <input type="text" name="monthlyInterval" size="2" value="1"/> years(s)<br/> 
     2293                    every <input type="text" name="yearlyInterval" size="2" value="1"/> years(s)<br/> 
    22892294                    <div id="yearRecurFields"> 
    22902295                      <div id="yearRecurFields1"> 
     
    25662571    <xsl:param name="splitter">10</xsl:param> 
    25672572    <span class="chkBoxListItem"> 
    2568       <input type="checkbox"/> 
    2569       <xsl:attribute name="name"><xsl:value-of select="$name"/></xsl:attribute> 
    2570       <xsl:attribute name="value"><xsl:value-of select="$current"/></xsl:attribute> 
     2573      <input type="checkbox"> 
     2574        <xsl:attribute name="name"><xsl:value-of select="$name"/></xsl:attribute> 
     2575        <xsl:attribute name="value"><xsl:value-of select="$current"/></xsl:attribute> 
     2576      </input> 
    25712577      <xsl:value-of select="$current"/> 
    25722578    </span> 
  • trunk/deployment/webuser/webapp/resources/demoskins/resources/includes.js

    r1152 r1154  
    8686  if (obj.checked) { 
    8787    changeClass('recurrenceFields','dateStartEndBox'); 
     88    changeClass('recurrenceUiSwitch','shown'); 
    8889  } else { 
    8990    changeClass('recurrenceFields','invisible'); 
     91    changeClass('recurrenceUiSwitch','invisible'); 
    9092  } 
    9193} 
     
    171173          break; 
    172174        case "WEEKLY": 
     175          var byday = new Array(); 
     176          byday = collectRecurChkBoxVals(byday, document.getElementById('weekRecurFields').getElementsByTagName('input'),false); 
     177          formObj.byday.value = byday.join(','); 
    173178          formObj.interval.value = formObj.weeklyInterval.value; 
    174           weekByDayChkBoxes = document.getElementById('weekRecurFields').getElementsByTagName('input'); 
    175           formObj.byday.value = collectRecurChkBoxVals(weekByDayChkBoxes); 
    176179          break; 
    177180        case "MONTHLY": 
     181          var i = 1; 
     182          var monthByDayId = 'monthRecurFields' + i; 
     183          var byday = new Array(); 
     184          var bymonthday = new Array; 
     185          // get the byday values 
     186          while (document.getElementById(monthByDayId)) { 
     187            var monthFields = document.getElementById(monthByDayId); 
     188            var monthPosSelect = monthFields.getElementsByTagName('select'); 
     189            var monthPos = monthPosSelect[0][monthPosSelect[0].selectedIndex].value; 
     190            if (monthPos) { 
     191              byday = collectRecurChkBoxVals(byday,monthFields.getElementsByTagName('input'),monthPos); 
     192            } 
     193            monthByDayId = monthByDayId.substring(0,monthByDayId.length-1) + ++i; 
     194          } 
     195          // get the bymonthdayvalues 
     196          bymonthday = collectRecurChkBoxVals(bymonthday,document.getElementById('monthDaysCheckBoxList').getElementsByTagName('input'),false); 
     197          // set the form values 
     198          formObj.bymonthday.value = bymonthday.join(','); 
     199          formObj.byday.value = byday.join(','); 
     200          alert(formObj.monthlyInterval); 
    178201          formObj.interval.value = formObj.monthlyInterval.value; 
    179202          break; 
     
    210233  } 
    211234} 
    212 function collectRecurChkBoxVals(chkBoxes) { 
    213   var collectedVals = ""; 
     235// returns an array of collected checkbox values 
     236function collectRecurChkBoxVals(valArray,chkBoxes,monthPos) { 
    214237  if (chkBoxes) { 
    215238    if (typeof chkBoxes.length != 'undefined') { 
    216239      for (i = 0; i < chkBoxes.length; i++) { 
    217240        if (chkBoxes[i].checked == true) { 
    218            collectedVals += chkBoxes[i].value + ','; 
     241          if (monthPos) { 
     242            valArray.push(monthPos + chkBoxes[i].value); 
     243          } else { 
     244            valArray.push(chkBoxes[i].value); 
     245          } 
    219246        } 
    220247      } 
    221248    } 
    222249  } 
    223   return collectedVals
     250  return valArray
    224251} 
    225252// launch a simple window for displaying information; no header or status bar