Additional whitespace fix for bug 262811

This commit is contained in:
mozilla%kewis.ch 2007-07-04 17:07:26 +00:00
Родитель ccd87c0527
Коммит ffafe6abff
1 изменённых файлов: 73 добавлений и 53 удалений

Просмотреть файл

@ -22,9 +22,9 @@
* Mike Potter <mikep@oeone.com> * Mike Potter <mikep@oeone.com>
* Chris Charabaruk <coldacid@meldstar.com> * Chris Charabaruk <coldacid@meldstar.com>
* Colin Phillips <colinp@oeone.com> * Colin Phillips <colinp@oeone.com>
* Karl Guertin <grayrest@grayrest.com> * Karl Guertin <grayrest@grayrest.com>
* Mike Norton <xor@ivwnet.com> * Mike Norton <xor@ivwnet.com>
* ArentJan Banck <ajbanck@planet.nl> * ArentJan Banck <ajbanck@planet.nl>
* Eric Belhaire <belhaire@ief.u-psud.fr> * Eric Belhaire <belhaire@ief.u-psud.fr>
* *
* Alternatively, the contents of this file may be used under the terms of * Alternatively, the contents of this file may be used under the terms of
@ -41,20 +41,21 @@
* *
* ***** END LICENSE BLOCK ***** */ * ***** END LICENSE BLOCK ***** */
/** Code which generates event and task (todo) preview tooltips/titletips /**
when the mouse hovers over either the event list, the task list, or * Code which generates event and task (todo) preview tooltips/titletips
an event or task box in one of the grid views. * when the mouse hovers over either the event list, the task list, or
* an event or task box in one of the grid views.
(Portions of this code were previously in calendar.js and unifinder.js, *
some of it duplicated.) * (Portions of this code were previously in calendar.js and unifinder.js,
**/ * some of it duplicated.)
*/
/** PUBLIC /** PUBLIC
* *
* This changes the mouseover preview based on the start and end dates * This changes the mouseover preview based on the start and end dates
* of an occurrence of a (one-time or recurring) calEvent or calToDo. * of an occurrence of a (one-time or recurring) calEvent or calToDo.
* Used by all grid views. * Used by all grid views.
*/ */
function onMouseOverItem( occurrenceBoxMouseEvent ) function onMouseOverItem( occurrenceBoxMouseEvent )
{ {
@ -106,22 +107,25 @@ function onMouseOverTaskTree( toolTip, mouseEvent )
return false; return false;
} }
/** Removes old content from tooltip, adds new content box to tooltip, /**
then resizes the tooltip to the size of the new content box. * Removes old content from tooltip, adds new content box to tooltip,
@param tooltip The tooltip to modify. * then resizes the tooltip to the size of the new content box.
@param holderBox The box element containing the new content. **/ *
* @param tooltip The tooltip to modify.
* @param holderBox The box element containing the new content.
*/
function setToolTipContent(toolTip, holderBox) function setToolTipContent(toolTip, holderBox)
{ {
while (toolTip.hasChildNodes()) { while (toolTip.hasChildNodes()) {
toolTip.removeChild( toolTip.firstChild ); toolTip.removeChild( toolTip.firstChild );
} }
toolTip.appendChild( holderBox ); toolTip.appendChild( holderBox );
var width = holderBox.boxObject.width; var width = holderBox.boxObject.width;
var height = holderBox.boxObject.height; var height = holderBox.boxObject.height;
// workaround bug 369225 (aspect: tooltip may not shrink height) // workaround bug 369225 (aspect: tooltip may not shrink height)
toolTip.sizeTo(0,0); toolTip.sizeTo(0,0);
// workaround bug 369225 (aspect: tooltip height too short) // workaround bug 369225 (aspect: tooltip height too short)
// Add top and bottom border and padding to workaround bug where bottom // Add top and bottom border and padding to workaround bug where bottom
// tooltip border disappears if wrapped description below header grid. // tooltip border disappears if wrapped description below header grid.
@ -131,8 +135,8 @@ function setToolTipContent(toolTip, holderBox)
} }
/** /**
* Called when a user hovers over a todo element and the text for the mouse over is changed. * Called when a user hovers over a todo element and the text for the mouse over is changed.
*/ */
function getPreviewForTask( toDoItem ) function getPreviewForTask( toDoItem )
{ {
@ -229,12 +233,12 @@ function getPreviewForTask( toDoItem )
} }
/** /**
* Called when mouse moves over a different, or * Called when mouse moves over a different, or
* when mouse moves over event in event list. * when mouse moves over event in event list.
* The instStartDate is date of instance displayed at event box * The instStartDate is date of instance displayed at event box
* (recurring or multiday events may be displayed by more than one event box * (recurring or multiday events may be displayed by more than one event box
* for different days), or null if should compute next instance from now. * for different days), or null if should compute next instance from now.
*/ */
function getPreviewForEvent( event, instStartDate, instEndDate ) function getPreviewForEvent( event, instStartDate, instEndDate )
{ {
const vbox = document.createElement( "vbox" ); const vbox = document.createElement( "vbox" );
@ -332,18 +336,23 @@ function getToDoStatusString(iCalToDo)
} }
} }
/** PRIVATE: Append a separator, a thin space between header and body. /**
@param vbox box to which to append separator. **/ * PRIVATE: Append a separator, a thin space between header and body.
*
* @param vbox box to which to append separator.
*/
function boxAppendBodySeparator(vbox) { function boxAppendBodySeparator(vbox) {
const separator = document.createElement("separator"); const separator = document.createElement("separator");
separator.setAttribute("class", "tooltipBodySeparator"); separator.setAttribute("class", "tooltipBodySeparator");
vbox.appendChild(separator); vbox.appendChild(separator);
} }
/** PRIVATE: Append description to box for body text. Text may contain /**
paragraphs; line indent and line breaks will be preserved by CSS. * PRIVATE: Append description to box for body text. Text may contain
@param box box to which to append body * paragraphs; line indent and line breaks will be preserved by CSS.
@param textString text of body **/ * @param box box to which to append body
* @param textString text of body
*/
function boxAppendBody(box, textString) function boxAppendBody(box, textString)
{ {
var textNode = document.createTextNode(textString); var textNode = document.createTextNode(textString);
@ -352,8 +361,11 @@ function boxAppendBody(box, textString)
xulDescription.appendChild(textNode); xulDescription.appendChild(textNode);
box.appendChild(xulDescription); box.appendChild(xulDescription);
} }
/** PRIVATE: Use dateFormatter to format date and time,
and to header grid append a row containing localized Label: date. **/ /**
* PRIVATE: Use dateFormatter to format date and time,
* and to header grid append a row containing localized Label: date.
*/
function boxAppendLabeledDateTime(box, labelProperty, date) function boxAppendLabeledDateTime(box, labelProperty, date)
{ {
var dateFormatter = Components.classes["@mozilla.org/calendar/datetime-formatter;1"] var dateFormatter = Components.classes["@mozilla.org/calendar/datetime-formatter;1"]
@ -362,12 +374,15 @@ function boxAppendLabeledDateTime(box, labelProperty, date)
var formattedDateTime = dateFormatter.formatDateTime(date); var formattedDateTime = dateFormatter.formatDateTime(date);
boxAppendLabeledText(box, labelProperty, formattedDateTime); boxAppendLabeledText(box, labelProperty, formattedDateTime);
} }
/** PRIVATE: Use dateFormatter to format date and time interval,
and to header grid append a row containing localized Label: interval. /**
@param box contains header grid. * PRIVATE: Use dateFormatter to format date and time interval,
@param labelProperty name of property for localized field label. * and to header grid append a row containing localized Label: interval.
@param start calDateTime of start of time interval. * @param box contains header grid.
@param end calDateTime of end of time interval. **/ * @param labelProperty name of property for localized field label.
* @param start calDateTime of start of time interval.
* @param end calDateTime of end of time interval.
*/
function boxAppendLabeledDateTimeInterval(box, labelProperty, start, end) function boxAppendLabeledDateTimeInterval(box, labelProperty, start, end)
{ {
var dateFormatter = Components.classes["@mozilla.org/calendar/datetime-formatter;1"] var dateFormatter = Components.classes["@mozilla.org/calendar/datetime-formatter;1"]
@ -384,8 +399,10 @@ function boxAppendLabeledDateTimeInterval(box, labelProperty, start, end)
} }
} }
/** PRIVATE: create empty 2-column grid for header fields, /**
and append it to box. **/ * PRIVATE: create empty 2-column grid for header fields,
* and append it to box.
*/
function boxInitializeHeaderGrid(box) function boxInitializeHeaderGrid(box)
{ {
var grid = document.createElement("grid"); var grid = document.createElement("grid");
@ -408,11 +425,13 @@ function boxInitializeHeaderGrid(box)
box.appendChild(grid); box.appendChild(grid);
} }
/** PRIVATE: To headers grid, append a row containing Label: value, /**
where label is localized text for labelProperty. * PRIVATE: To headers grid, append a row containing Label: value,
@param box containing headers grid * where label is localized text for labelProperty.
@param labelProperty name of property for localized name of header * @param box box containing headers grid
@param textString value of header field. **/ * @param labelProperty name of property for localized name of header
* @param textString value of header field.
*/
function boxAppendLabeledText(box, labelProperty, textString) function boxAppendLabeledText(box, labelProperty, textString)
{ {
var labelText = calGetString('calendar', labelProperty); var labelText = calGetString('calendar', labelProperty);
@ -445,9 +464,11 @@ function createTooltipHeaderDescription(text)
return label; return label;
} }
/** If now is during an occurrence, return the ocurrence. /**
Else if now is before an ocurrence, return the next ocurrence. * If now is during an occurrence, return the ocurrence.
Otherwise return the previous ocurrence. **/ * Else if now is before an ocurrence, return the next ocurrence.
* Otherwise return the previous ocurrence.
*/
function getCurrentNextOrPreviousRecurrence(calendarEvent) function getCurrentNextOrPreviousRecurrence(calendarEvent)
{ {
if (!calendarEvent.recurrenceInfo) { if (!calendarEvent.recurrenceInfo) {
@ -470,4 +491,3 @@ function getCurrentNextOrPreviousRecurrence(calendarEvent)
} }
return occ; return occ;
} }