rem: var componentMenu = document.getElementById("component-type"); if( componentMenu.selectedItem) { dump("processComponentType: "+componentMenu.selectedItem.value+"\n"); var args = window.arguments[0]; switch( componentMenu.selectedItem.value ) { case "ICAL_COMPONENT_EVENT":  hideElement("task-cancelled-label"); hideElement("cancelled-checkbox"); hideElement("task-start-datetime-label"); hideElement("start-checkbox"); hideElement("due-checkbox"); hideElement("due-datetime"); hideElement("task-due-datetime-label"); hideElement("task-completed-label"); hideElement("completed-checkbox"); hideElement("completed-date-picker"); hideElement("percent-complete-menulist"); hideElement("percent-complete-label"); hideElement("task-priority-label"); hideElement("priority-levels"); showElement("end-datetime"); showElement("event-start-datetime-label"); showElement("event-end-datetime-label"); showElement("event-status-label"); showElement("event-status-field"); showElement("all-day-event-checkbox");  if( "new" == args.mode ) titleDataItem = document.getElementById( "data-event-title-new" ); else titleDataItem = document.getElementById( "data-event-title-edit" ); document.getElementById("calendar-new-component-window").setAttribute("title", titleDataItem.getAttribute( "value" )); break; case "ICAL_COMPONENT_TODO":  hideElement("end-datetime"); hideElement("event-start-datetime-label"); hideElement("event-end-datetime-label"); hideElement("event-status-label"); hideElement("event-status-field"); hideElement("all-day-event-checkbox"); showElement("task-cancelled-label"); showElement("cancelled-checkbox"); showElement("task-start-datetime-label"); showElement("start-checkbox"); showElement("due-checkbox"); showElement("due-datetime"); showElement("task-due-datetime-label"); showElement("task-completed-label"); showElement("completed-checkbox"); showElement("completed-date-picker"); showElement("percent-complete-menulist"); showElement("percent-complete-label"); showElement("task-priority-label"); showElement("priority-levels");   if( "new" == args.mode ) titleDataItem = document.getElementById( "data-event-title-new" ); else titleDataItem = document.getElementById( "data-event-title-edit" ); document.getElementById("calendar-new-component-window").setAttribute("title", titleDataItem.getAttribute( "value" )); break;  }  window.sizeToContent(); } else dump("processComponentType: no componentMenu.selectedItem!\n"); 
add: var componentMenu = document.getElementById("component-type"); if( componentMenu.selectedItem) { debug("processComponentType: " + componentMenu.selectedItem.value ); var args = window.arguments[0]; switch( componentMenu.selectedItem.value ) { case "ICAL_COMPONENT_EVENT":  hideElement("todo-cancelled-label"); hideElement("todo-cancelled-checkbox"); hideElement("task-start-datetime-label"); hideElement("start-checkbox"); hideElement("due-checkbox"); hideElement("due-datetime"); hideElement("task-due-datetime-label"); hideElement("task-completed-label"); hideElement("completed-checkbox"); hideElement("completed-date-picker"); hideElement("percent-complete-menulist"); hideElement("percent-complete-label"); hideElement("task-priority-label"); hideElement("priority-levels"); showElement("start-datetime"); showElement("end-datetime"); showElement("event-start-datetime-label"); showElement("event-end-datetime-label"); showElement("event-status-label"); showElement("event-status-field"); showElement("all-day-event-checkbox");   document.getElementById("start-datetime").setAttribute( "disabled", "false" ); enableElement("start-datetime"); enableElement("end-datetime");   if( "new" == args.mode ) title = document.getElementById( "data-event-title-new" ); else title = document.getElementById( "data-event-title-edit" );  document.getElementById("calendar-new-component-window").setAttribute("title", title); break;  case "ICAL_COMPONENT_TODO":  hideElement("end-datetime"); hideElement("event-start-datetime-label"); hideElement("event-end-datetime-label"); hideElement("event-status-label"); hideElement("event-status-field"); hideElement("all-day-event-checkbox"); showElement("todo-cancelled-label"); showElement("todo-cancelled-checkbox"); showElement("task-start-datetime-label"); showElement("start-checkbox"); showElement("due-checkbox"); showElement("due-datetime"); showElement("task-due-datetime-label"); showElement("task-completed-label"); showElement("completed-checkbox"); showElement("completed-date-picker"); showElement("percent-complete-menulist"); showElement("percent-complete-label"); showElement("task-priority-label"); showElement("priority-levels");  onDateTimeCheckbox("start-checkbox", "start-datetime") onDateTimeCheckbox("due-checkbox", "due-datetime") updateCompletedItemEnabled()   if( "new" == args.mode ) title = document.getElementById( "data-todo-title-new" ); else title = document.getElementById( "data-todo-title-edit" );  document.getElementById("calendar-new-component-window").setAttribute("title", title); break;   }  window.sizeToContent(); } else dump("processComponentType: no componentMenu.selectedItem!\n"); 
context: function processComponentType(){  var componentMenu = document.getElementById("component-type");  if( componentMenu.selectedItem) {    dump("processComponentType: "+componentMenu.selectedItem.value+"\n");    var args = window.arguments[0];    switch( componentMenu.selectedItem.value )    {      case "ICAL_COMPONENT_EVENT":        // Hide and show the appropriate fields and widgets        hideElement("task-cancelled-label");        hideElement("cancelled-checkbox");        hideElement("task-start-datetime-label");        hideElement("start-checkbox");        hideElement("due-checkbox");        hideElement("due-datetime");        hideElement("task-due-datetime-label");        hideElement("task-completed-label");        hideElement("completed-checkbox");        hideElement("completed-date-picker");        hideElement("percent-complete-menulist");        hideElement("percent-complete-label");        hideElement("task-priority-label");        hideElement("priority-levels");        showElement("end-datetime");        showElement("event-start-datetime-label");        showElement("event-end-datetime-label");        showElement("event-status-label");        showElement("event-status-field");        showElement("all-day-event-checkbox");        // Set menubar title correctly - New vs. Edit        if( "new" == args.mode )          titleDataItem = document.getElementById( "data-event-title-new" );        else          titleDataItem = document.getElementById( "data-event-title-edit" );        document.getElementById("calendar-new-component-window").setAttribute("title", titleDataItem.getAttribute( "value" ));        break;      case "ICAL_COMPONENT_TODO":        // Hide and show the appropriate fields and widgets        hideElement("end-datetime");        hideElement("event-start-datetime-label");        hideElement("event-end-datetime-label");        hideElement("event-status-label");        hideElement("event-status-field");        hideElement("all-day-event-checkbox");        showElement("task-cancelled-label");        showElement("cancelled-checkbox");        showElement("task-start-datetime-label");        showElement("start-checkbox");        showElement("due-checkbox");        showElement("due-datetime");        showElement("task-due-datetime-label");        showElement("task-completed-label");        showElement("completed-checkbox");        showElement("completed-date-picker");        showElement("percent-complete-menulist");        showElement("percent-complete-label");        showElement("task-priority-label");        showElement("priority-levels");                // Set menubar title correctly - New vs. Edit        if( "new" == args.mode )          titleDataItem = document.getElementById( "data-event-title-new" );        else          titleDataItem = document.getElementById( "data-event-title-edit" );        document.getElementById("calendar-new-component-window").setAttribute("title", titleDataItem.getAttribute( "value" ));        break;      //case "ICAL_COMPONENT_JOURNAL":    }    // Make the window big enough for all the fields and widgets    window.sizeToContent();  }  else    dump("processComponentType: no componentMenu.selectedItem!\n");}
meta: 10234	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/10234/7cf8f4a5a133269c8abdbc4d7ed791799ba534d2/eventDialog.js/clean/calendar/resources/content/eventDialog.js