rem:  var HolderBox = document.createElement( "vbox" );  if( toDoItem ) { showTooltip = true;  if (toDoItem.title) { var TitleHtml = document.createElement( "description" ); var TitleText = document.createTextNode( "Title: "+toDoItem.title ); TitleHtml.appendChild( TitleText ); HolderBox.appendChild( TitleHtml ); }  var DateHtml = document.createElement( "description" ); var startDate = new Date( toDoItem.start.getTime() ); var DateText = document.createTextNode( "Start Date: "+gCalendarWindow.dateFormater.getFormatedDate( startDate ) ); DateHtml.appendChild( DateText ); HolderBox.appendChild( DateHtml );  DateHtml = document.createElement( "description" ); var dueDate = new Date( toDoItem.due.getTime() ); DateText = document.createTextNode( "Due Date: "+gCalendarWindow.dateFormater.getFormatedDate( dueDate ) ); DateHtml.appendChild( DateText ); HolderBox.appendChild( DateHtml );  if (toDoItem.description) { var text = "Description: "+toDoItem.description ; var lines = text.split("\n"); var nbmaxlines = 5 ; var nblines = lines.length ; if( nblines > nbmaxlines ) { var nblines = nbmaxlines ; lines[ nblines - 1 ] = "..." ; } for (var i = 0; i < nblines; i++) { var DescriptionHtml = document.createElement("description"); var DescriptionText = document.createTextNode(lines[i]); DescriptionHtml.appendChild(DescriptionText); HolderBox.appendChild(DescriptionHtml); } }  Html.appendChild( HolderBox ); } else { showTooltip = false; } 
add: var HolderBox = getPreviewTextForTask( toDoItem ) ; if( HolderBox ) Html.appendChild( HolderBox ) ; 
context: function changeToolTipTextForToDo( event ){   var toDoItem = getToDoFromEvent( event );   var Html = document.getElementById( "taskTooltip" );   while( Html.hasChildNodes() )   {      Html.removeChild( Html.firstChild );    }      var HolderBox = document.createElement( "vbox" );   if( toDoItem )   {      showTooltip = true; //needed to show the tooltip.               if (toDoItem.title)      {         var TitleHtml = document.createElement( "description" );         var TitleText = document.createTextNode( "Title: "+toDoItem.title );         TitleHtml.appendChild( TitleText );         HolderBox.appendChild( TitleHtml );      }         var DateHtml = document.createElement( "description" );      var startDate = new Date( toDoItem.start.getTime() );      var DateText = document.createTextNode( "Start Date: "+gCalendarWindow.dateFormater.getFormatedDate( startDate ) );      DateHtml.appendChild( DateText );      HolderBox.appendChild( DateHtml );         DateHtml = document.createElement( "description" );      var dueDate = new Date( toDoItem.due.getTime() );      DateText = document.createTextNode( "Due Date: "+gCalendarWindow.dateFormater.getFormatedDate( dueDate ) );      DateHtml.appendChild( DateText );      HolderBox.appendChild( DateHtml );         if (toDoItem.description)      {	var text = "Description: "+toDoItem.description ;	var lines = text.split("\n");	var nbmaxlines = 5 ;	var nblines = lines.length ;	if( nblines > nbmaxlines ) {	  var nblines = nbmaxlines ;	  lines[ nblines - 1 ] = "..." ;	}	for (var i = 0; i < nblines; i++) {	  var DescriptionHtml = document.createElement("description");	  var DescriptionText = document.createTextNode(lines[i]);	  DescriptionHtml.appendChild(DescriptionText);	  HolderBox.appendChild(DescriptionHtml);	}      }            Html.appendChild( HolderBox );   }    else   {      showTooltip = false; //Don't show the tooltip   }}
meta: 9421	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/9421/fd6cbdd83f28ebcb811a684385dd5c52936bfe16/unifinderToDo.js/buggy/calendar/resources/content/unifinderToDo.js