From fe3bac2bb6e86c577fca5d36b2cac7ab510592f8 Mon Sep 17 00:00:00 2001 From: "mattwillis%gmail.com" Date: Thu, 23 Dec 2004 02:04:24 +0000 Subject: [PATCH] bug 243494 long event titles/locations/descriptions should break into multiple lines rather than crop r=pavlov@pavlov.net git-svn-id: svn://10.0.0.236/trunk@166974 18797224-902f-48f8-a5cc-f745e15eee43 --- .../calendar/resources/content/weekView.js | 37 ++++++++----------- .../resources/skin/classic/calendar.css | 11 +++++- .../themes/pinstripe/sunbird/calendar.css | 11 +++++- .../themes/winstripe/sunbird/calendar.css | 11 +++++- 4 files changed, 42 insertions(+), 28 deletions(-) diff --git a/mozilla/calendar/resources/content/weekView.js b/mozilla/calendar/resources/content/weekView.js index 025c2548079..f83a0091f83 100644 --- a/mozilla/calendar/resources/content/weekView.js +++ b/mozilla/calendar/resources/content/weekView.js @@ -365,9 +365,6 @@ WeekView.prototype.createEventBox = function ( itemOccurrence ) dump("duration: " + eventDuration + "\n"); - var eventText = calEvent.title; - - var eventBox = document.createElement("vbox"); // XXX Consider changing this to only store the ID @@ -416,25 +413,21 @@ WeekView.prototype.createEventBox = function ( itemOccurrence ) eventBox.setAttribute("onmouseover", "gCalendarWindow.changeMouseOverInfo( null, calEvent )"); eventBox.setAttribute("tooltip", "eventTooltip"); - // The event description. This doesn't go multi line, but does crop properly. - var eventDescriptionElement = document.createElement("label"); - - //eventDescriptionElement.calendarEventDisplay = calendarEventDisplay; - eventDescriptionElement.setAttribute("class", "week-view-event-label-class" ); - eventDescriptionElement.setAttribute("value", eventText ); - eventDescriptionElement.setAttribute("flex", "1" ); - - var DescriptionText = document.createTextNode(" "); - eventDescriptionElement.appendChild(DescriptionText); - - eventDescriptionElement.setAttribute("height", Height); - eventDescriptionElement.setAttribute("crop", "end"); - eventDescriptionElement.setAttribute("ondraggesture", "nsDragAndDrop.startDrag(event,calendarViewDNDObserver);"); - eventDescriptionElement.setAttribute("ondragover", "nsDragAndDrop.dragOver(event,calendarViewDNDObserver)"); - eventDescriptionElement.setAttribute("ondragdrop", "nsDragAndDrop.drop(event,calendarViewDNDObserver)"); - - eventBox.appendChild(eventDescriptionElement); - + // Event box text (title, location and description) + if (calEvent.title || calEvent.getProperty("location")) { + var titleText = ( (calEvent.title || "") + + (calEvent.getProperty("location") ? " ("+calEvent.getProperty("location")+")" : "") ); + var titleElement = document.createElement( "label" ); + titleElement.setAttribute( "class", "week-view-event-title-label-class" ); + titleElement.appendChild( document.createTextNode( titleText )); + eventBox.appendChild( titleElement ); + } + if (calEvent.getProperty("description")) { + var descriptionElement = document.createElement( "description" ); + descriptionElement.setAttribute( "class", "week-view-event-description-class" ); + descriptionElement.appendChild( document.createTextNode( calEvent.getProperty("description") )); + eventBox.appendChild( descriptionElement ); + } return eventBox; } diff --git a/mozilla/calendar/resources/skin/classic/calendar.css b/mozilla/calendar/resources/skin/classic/calendar.css index e13eff3de22..646279b1ce0 100644 --- a/mozilla/calendar/resources/skin/classic/calendar.css +++ b/mozilla/calendar/resources/skin/classic/calendar.css @@ -1235,6 +1235,7 @@ then observed (ERic 20/06/03) margin-bottom : 1px; margin-top : 1px; border : 1px solid #1D7AB5; + overflow : hidden; background-color : #F9F4FF; min-width : 20px; -moz-user-focus : normal; @@ -1256,13 +1257,19 @@ then observed (ERic 20/06/03) * Class for text of events *-------------------------------------------------------------------*/ -.week-view-event-text-class +.week-view-event-title-label-class { + cursor : pointer; font-size : 10pt; font-family : Arial, Helvetica; - color : #000000; } +.week-view-event-description-class +{ + cursor : pointer; + font-size : 8pt; + font-family : Arial, Helvetica; +} .week-time-class-text { diff --git a/mozilla/calendar/sunbird/themes/pinstripe/sunbird/calendar.css b/mozilla/calendar/sunbird/themes/pinstripe/sunbird/calendar.css index ab72e0a8514..c9bb624bc9c 100644 --- a/mozilla/calendar/sunbird/themes/pinstripe/sunbird/calendar.css +++ b/mozilla/calendar/sunbird/themes/pinstripe/sunbird/calendar.css @@ -1540,6 +1540,7 @@ then observed (ERic 20/06/03) margin-bottom : 1px; margin-top : 1px; border : 1px solid #1D7AB5; + overflow : hidden; background-color : #F9F4FF; min-width : 20px; -moz-user-focus : normal; @@ -1561,13 +1562,19 @@ then observed (ERic 20/06/03) * Class for text of events *-------------------------------------------------------------------*/ -.week-view-event-text-class +.week-view-event-title-label-class { + cursor : pointer; font-size : 10pt; font-family : Arial, Helvetica; - color : #000000; } +.week-view-event-description-class +{ + cursor : pointer; + font-size : 8pt; + font-family : Arial, Helvetica; +} .week-time-class-text { diff --git a/mozilla/calendar/sunbird/themes/winstripe/sunbird/calendar.css b/mozilla/calendar/sunbird/themes/winstripe/sunbird/calendar.css index bb5ced2ffc6..948a005e797 100644 --- a/mozilla/calendar/sunbird/themes/winstripe/sunbird/calendar.css +++ b/mozilla/calendar/sunbird/themes/winstripe/sunbird/calendar.css @@ -1750,6 +1750,7 @@ then observed (ERic 20/06/03) margin-bottom : 1px; margin-top : 1px; border : 1px solid #1D7AB5; + overflow : hidden; background-color : #F9F4FF; min-width : 20px; -moz-user-focus : normal; @@ -1771,13 +1772,19 @@ then observed (ERic 20/06/03) * Class for text of events *-------------------------------------------------------------------*/ -.week-view-event-text-class +.week-view-event-title-label-class { + cursor : pointer; font-size : 10pt; font-family : Arial, Helvetica; - color : #000000; } +.week-view-event-description-class +{ + cursor : pointer; + font-size : 8pt; + font-family : Arial, Helvetica; +} .week-time-class-text {