Renaming files for bug 183106

git-svn-id: svn://10.0.0.236/trunk@134685 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
mikep%oeone.com
2002-12-03 15:01:38 +00:00
parent 4c0d2dcfbc
commit c59abec732
27 changed files with 0 additions and 13376 deletions

View File

@@ -1,292 +0,0 @@
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is Mozilla Calendar code.
*
* The Initial Developer of the Original Code is
* ArentJan Banck <ajbanck@planet.nl>.
* Portions created by the Initial Developer are Copyright (C) 2002
* the Initial Developer. All Rights Reserved.
*
* Contributor(s): ArentJan Banck <ajbanck@planet.nl>
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
/***** calendarClipboard
*
* NOTES
* TODO items
* - Add a clipboard listener, to enable/disable menu-items depending if
* valid clipboard data is available.
*
******/
function getClipboard()
{
const kClipboardContractID = "@mozilla.org/widget/clipboard;1";
const kClipboardIID = Components.interfaces.nsIClipboard;
return Components.classes[kClipboardContractID].getService(kClipboardIID);
}
function createTransferable()
{
const kTransferableContractID = "@mozilla.org/widget/transferable;1";
const kTransferableIID = Components.interfaces.nsITransferable
return Components.classes[kTransferableContractID].createInstance(kTransferableIID);
}
function createSupportsArray()
{
const kSuppArrayContractID = "@mozilla.org/supports-array;1";
const kSuppArrayIID = Components.interfaces.nsISupportsArray;
return Components.classes[kSuppArrayContractID].createInstance(kSuppArrayIID);
}
// Should we use (wide)String only, or no (wide)Strings for compatibility?
function createSupportsCString()
{
const kSuppStringContractID = "@mozilla.org/supports-cstring;1";
const kSuppStringIID = Components.interfaces.nsISupportsCString;
return Components.classes[kSuppStringContractID].createInstance(kSuppStringIID);
}
function createSupportsString()
{
const kSuppStringContractID = "@mozilla.org/supports-string;1";
const kSuppStringIID = Components.interfaces.nsISupportsString;
return Components.classes[kSuppStringContractID].createInstance(kSuppStringIID);
}
function createSupportsWString()
{
const kSuppStringContractID = "@mozilla.org/supports-wstring;1";
const kSuppStringIID = Components.interfaces.nsISupportsWString;
return Components.classes[kSuppStringContractID].createInstance(kSuppStringIID);
}
/**
* Test if the clipboard has items that can be pasted into Calendar.
* This must be of type "text/calendar" or "text/unicode"
*/
function canPaste()
{
const kClipboardIID = Components.interfaces.nsIClipboard;
var clipboard = getClipboard();
var flavourArray = createSupportsArray();
var flavours = ["text/calendar", "text/unicode"];
for (var i = 0; i < flavours.length; ++i)
{
const kSuppString = createSupportsCString();
kSuppString.data = flavours[i];
flavourArray.AppendElement(kSuppString);
}
return clipboard.hasDataMatchingFlavors(flavourArray, kClipboardIID.kGlobalClipboard);
}
/**
* Copy iCalendar data to the Clipboard, and delete the selected events.
* Does not use eventarray parameter, because DeletCcommand delete selected events.
*/
function cutToClipboard( /* calendarEventArray */)
{
// if( !calendarEventArray)
var calendarEventArray = gCalendarWindow.EventSelection.selectedEvents;
if( copyToClipboard( calendarEventArray ) )
{
deleteEventCommand( true ); // deletes all selected events without prompting.
}
}
/**
* Copy iCalendar data to the Clipboard. The data is copied to three types:
* 1) text/calendar. Found that name somewhere in mail code. not used outside
* Calendar as far as I know, so this can be customized for internal use.
* 2) text/unicode. Plaintext iCalendar data, tested on Windows for Outlook 2000
* and Lotus Organizer.
* 3) text/html. Not for parsing, only pretty looking calendar data.
*
**/
function copyToClipboard( calendarEventArray )
{
if( !calendarEventArray)
{
var calendarEventArray = new Array( 0 );
calendarEventArray = gCalendarWindow.EventSelection.selectedEvents;
}
if(calendarEventArray.length == 0)
alert("No events selected");
var calendarEvent;
var sTextiCalendar = eventArrayToICalString( calendarEventArray );
var sTextiCalendarExport = eventArrayToICalString( calendarEventArray, true );
var sTextHTML = eventArrayToHTML( calendarEventArray );
// 1. get the clipboard service
var clipboard = getClipboard();
// 2. create the transferable
var trans = createTransferable();
if ( trans && clipboard) {
// 3. register the data flavors
trans.addDataFlavor("text/calendar");
trans.addDataFlavor("text/unicode");
trans.addDataFlavor("text/html");
// 4. create the data objects
var icalWrapper = createSupportsString();
var textWrapper = createSupportsString();
var htmlWrapper = createSupportsString();
if ( icalWrapper && textWrapper && htmlWrapper ) {
// get the data
icalWrapper.data = sTextiCalendar; // plainTextRepresentation;
textWrapper.data = sTextiCalendarExport; // plainTextRepresentation;
htmlWrapper.data = sTextHTML; // htmlRepresentation;
// 5. add data objects to transferable
// Both Outlook 2000 client and Lotus Organizer use text/unicode when pasting iCalendar data
trans.setTransferData ( "text/calendar", icalWrapper, icalWrapper.data.length*2 ); // double byte data
trans.setTransferData ( "text/unicode", textWrapper, textWrapper.data.length*2 );
trans.setTransferData ( "text/html", htmlWrapper, htmlWrapper.data.length*2 );
clipboard.setData( trans, null, Components.interfaces.nsIClipboard.kGlobalClipboard );
return true;
}
}
return true;
}
/**
* Paste iCalendar events from the clipboard,
* or paste clipboard text into description of new event
*/
function pasteFromClipboard()
{
const kClipboardIID = Components.interfaces.nsIClipboard;
if( canPaste() ) {
// 1. get the clipboard service
var clipboard = getClipboard();
// 2. create the transferable
var trans = createTransferable();
if ( trans && clipboard) {
// 3. register the data flavors you want, highest fidelity first!
trans.addDataFlavor("text/calendar");
trans.addDataFlavor("text/unicode");
// 4. get transferable from clipboard
clipboard.getData ( trans, kClipboardIID.kGlobalClipboard);
// 5. ask transferable for the best flavor. Need to create new JS
// objects for the out params.
var flavour = { };
var data = { };
var length = { };
trans.getAnyTransferData(flavour, data, length);
data = data.value.QueryInterface(Components.interfaces.nsISupportsString).data;
//DEBUG alert("clipboard type: " + flavour.value);
var calendarEventArray;
var startDate;
var endDateTime;
var MinutesToAddOn;
switch (flavour.value) {
case "text/calendar":
calendarEventArray = parseIcalData( data );
//change the date of all the events to now
startDate = gCalendarWindow.currentView.getNewEventDate();
MinutesToAddOn = getIntPref(gCalendarWindow.calendarPreferences.calendarPref, "event.defaultlength", 60 );
endDateTime = startDate.getTime() + ( 1000 * 60 * MinutesToAddOn );
for( var i = 0; i < calendarEventArray.length; i++ )
{
calendarEventArray[i].start.setTime( startDate );
calendarEventArray[i].end.setTime( endDateTime );
}
addEventsToCalendar( calendarEventArray );
break;
case "text/unicode":
if ( data.indexOf("BEGIN:VEVENT") == -1 )
{
// no iCalendar data, paste clipboard text into description of new event
calendarEvent = createEvent();
initCalendarEvent( calendarEvent );
calendarEvent.description = data;
editNewEvent( calendarEvent );
}
else
{
calendarEventArray = parseIcalData( data );
//change the date of all the events to now
startDate = gCalendarWindow.currentView.getNewEventDate();
MinutesToAddOn = getIntPref(gCalendarWindow.calendarPreferences.calendarPref, "event.defaultlength", 60 );
endDateTime = startDate.getTime() + ( 1000 * 60 * MinutesToAddOn );
for( i = 0; i < calendarEventArray.length; i++ )
{
calendarEventArray[i].start.setTime( startDate );
calendarEventArray[i].end.setTime( endDateTime );
}
addEventsToCalendar( calendarEventArray );
}
break;
default:
alert("Unknown clipboard type: " + flavour.value);
}
}
}
else
alert( "No iCalendar or text on the clipboard." );
}

View File

@@ -1,607 +0,0 @@
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is OEone Calendar Code, released October 31st, 2001.
*
* The Initial Developer of the Original Code is
* OEone Corporation.
* Portions created by the Initial Developer are Copyright (C) 2001
* the Initial Developer. All Rights Reserved.
*
* Contributor(s): Garth Smedley <garths@oeone.com>
* Mike Potter <mikep@oeone.com>
* Colin Phillips <colinp@oeone.com>
* Karl Guertin <grayrest@grayrest.com>
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
/*-----------------------------------------------------------------
* DayView Class subclass of CalendarView
*
* Calendar day view class
*
* PROPERTIES
*
* NOTES
*
*
*/
// Make DayView inherit from CalendarView
DayView.prototype = new CalendarView();
DayView.prototype.constructor = DayView;
/**
* DayView Constructor.
*
* PARAMETERS
* calendarWindow - the owning instance of CalendarWindow.
*
*/
function DayView( calendarWindow )
{
// call super
this.superConstructor( calendarWindow );
//set the time on the left hand side labels
//need to do this in JavaScript to preserve formatting
for( var i = 0; i < 24; i++ )
{
/*
** FOR SOME REASON, THIS IS NOT WORKING FOR MIDNIGHT
*/
var TimeToFormat = new Date();
TimeToFormat.setHours( i );
TimeToFormat.setMinutes( "0" );
var FormattedTime = calendarWindow.dateFormater.getFormatedTime( TimeToFormat );
var Label = document.getElementById( "day-view-hour-"+i );
Label.setAttribute( "value", FormattedTime );
}
var dayViewEventSelectionObserver =
{
onSelectionChanged : function dv_EventSelectionObserver_OnSelectionChanged( EventSelectionArray )
{
for( i = 0; i < EventSelectionArray.length; i++ )
{
gCalendarWindow.dayView.selectBoxForEvent( EventSelectionArray[i] );
}
}
}
calendarWindow.EventSelection.addObserver( dayViewEventSelectionObserver );
}
/** PUBLIC
*
* Redraw the events for the current month
*
*/
DayView.prototype.refreshEvents = function dayview_refreshEvents( )
{
this.kungFooDeathGripOnEventBoxes = new Array();
// remove old event boxes
var eventBoxList = document.getElementsByAttribute( "eventbox", "dayview" );
for( var eventBoxIndex = 0; eventBoxIndex < eventBoxList.length; ++eventBoxIndex )
{
var eventBox = eventBoxList[ eventBoxIndex ];
eventBox.parentNode.removeChild( eventBox );
}
//get the all day box.
var AllDayBox = document.getElementById( "all-day-content-box" );
AllDayBox.setAttribute( "collapsed", "true" );
//remove all the text from the all day content box.
while( AllDayBox.hasChildNodes() )
{
AllDayBox.removeChild( AllDayBox.firstChild );
}
//shrink the day's content box.
document.getElementById( "day-view-content-box" ).removeAttribute( "allday" );
//make the text node that will contain the text for the all day box.
var calendarStringBundle = srGetStrBundle("chrome://calendar/locale/calendar.properties");
var HtmlNode = document.createElement( "description" );
HtmlNode.setAttribute( "class", "all-day-content-box-text-title" );
var TextNode = document.createTextNode( calendarStringBundle.GetStringFromName( "AllDayEvents" ) );
HtmlNode.appendChild( TextNode );
document.getElementById( "all-day-content-box" ).appendChild( HtmlNode );
// get the events for the day and loop through them
var dayEventList = this.calendarWindow.eventSource.getEventsForDay( this.calendarWindow.getSelectedDate() );
//refresh the array and the current spot.
var LowestStartHour = getIntPref( this.calendarWindow.calendarPreferences.calendarPref, "event.defaultstarthour", 8 );
var HighestEndHour = getIntPref( this.calendarWindow.calendarPreferences.calendarPref, "event.defaultendhour", 17 );;
for ( var i = 0; i < dayEventList.length; i++ )
{
dayEventList[i].OtherSpotArray = new Array('0');
dayEventList[i].CurrentSpot = 0;
dayEventList[i].NumberOfSameTimeEvents = 0;
if( dayEventList[i].event.allDay != true )
{
var ThisLowestStartHour = new Date( dayEventList[0].displayDate.getTime() );
if( ThisLowestStartHour.getHours() < LowestStartHour )
LowestStartHour = ThisLowestStartHour.getHours();
var EndDate = new Date( dayEventList[i].event.end.getTime() );
if( EndDate.getHours() > HighestEndHour )
HighestEndHour = EndDate;
}
}
for( i = 0; i < 24; i++ )
{
document.getElementById( "day-tree-item-"+i ).removeAttribute( "collapsed" );
}
//alert( "LowestStartHour is "+LowestStartHour );
for( i = 0; i < LowestStartHour; i++ )
{
document.getElementById( "day-tree-item-"+i ).setAttribute( "collapsed", "true" );
}
for( i = ( HighestEndHour + 1 ); i < 24; i++ )
{
document.getElementById( "day-tree-item-"+i ).setAttribute( "collapsed", "true" );
}
for ( i = 0; i < dayEventList.length; i++ )
{
var calendarEventDisplay = dayEventList[i];
//check to make sure that the event is not an all day event...
if ( calendarEventDisplay.event.allDay != true )
{
//see if there's another event at the same start time.
for ( j = 0; j < dayEventList.length; j++ )
{
thisCalendarEventDisplay = dayEventList[j];
//if this event overlaps with another event...
if ( ( ( thisCalendarEventDisplay.displayDate >= calendarEventDisplay.displayDate &&
thisCalendarEventDisplay.displayDate.getTime() < calendarEventDisplay.event.end.getTime() ) ||
( calendarEventDisplay.displayDate >= thisCalendarEventDisplay.displayDate &&
calendarEventDisplay.displayDate.getTime() < thisCalendarEventDisplay.event.end.getTime() ) ) &&
calendarEventDisplay.event.id != thisCalendarEventDisplay.event.id &&
thisCalendarEventDisplay.event.allDay != true )
{
//get the spot that this event will go in.
var ThisSpot = thisCalendarEventDisplay.CurrentSpot;
calendarEventDisplay.OtherSpotArray.push( ThisSpot );
ThisSpot++;
if ( ThisSpot > calendarEventDisplay.CurrentSpot )
{
calendarEventDisplay.CurrentSpot = ThisSpot;
}
}
}
SortedOtherSpotArray = new Array();
SortedOtherSpotArray = calendarEventDisplay.OtherSpotArray.sort( this.calendarWindow.compareNumbers );
LowestNumber = this.calendarWindow.getLowestElementNotInArray( SortedOtherSpotArray );
//this is the actual spot (0 -> n) that the event will go in on the day view.
calendarEventDisplay.CurrentSpot = LowestNumber;
calendarEventDisplay.NumberOfSameTimeEvents = SortedOtherSpotArray.length;
}
}
for ( var eventIndex = 0; eventIndex < dayEventList.length; ++eventIndex )
{
calendarEventDisplay = dayEventList[ eventIndex ];
//if its an all day event, don't show it in the hours stack.
if ( calendarEventDisplay.event.allDay == true )
{
// build up the text to show for this event
var eventText = calendarEventDisplay.event.title;
if( calendarEventDisplay.event.location )
{
eventText += " " + calendarEventDisplay.event.location;
}
if( calendarEventDisplay.event.description )
{
eventText += " " + calendarEventDisplay.event.description;
}
//show the all day box
AllDayBox.removeAttribute( "collapsed" );
//shrink the day's content box.
document.getElementById( "day-view-content-box" ).setAttribute( "allday", "true" );
//note the use of the AllDayText Attribute.
//This is used to remove the text when the day is changed.
newTextNode = document.createElement( "label" );
newTextNode.setAttribute( "value", eventText );
newTextNode.calendarEventDisplay = calendarEventDisplay;
newTextNode.setAttribute( "onmouseover", "gCalendarWindow.changeMouseOverInfo( calendarEventDisplay, event )" );
newTextNode.setAttribute( "onclick", "dayEventItemClick( this, event )" );
newTextNode.setAttribute( "ondblclick", "dayEventItemDoubleClick( this, event )" );
newTextNode.setAttribute( "tooltip", "eventTooltip" );
newTextNode.setAttribute( "AllDayText", "true" );
newImage = document.createElement("image");
newImage.setAttribute( "class", "all-day-event-class" );
newImage.calendarEventDisplay = calendarEventDisplay;
newImage.setAttribute( "onmouseover", "gCalendarWindow.changeMouseOverInfo( calendarEventDisplay, event )" );
newImage.setAttribute( "onclick", "dayEventItemClick( this, event )" );
newImage.setAttribute( "ondblclick", "dayEventItemDoubleClick( this, event )" );
newImage.setAttribute( "tooltip", "eventTooltip" );
//newImage.setAttribute( "AllDayText", "true" );
AllDayBox.appendChild( newImage );
AllDayBox.appendChild( newTextNode );
}
else
{
eventBox = this.createEventBox( calendarEventDisplay );
//add the box to the stack.
document.getElementById( "day-view-content-board" ).appendChild( eventBox );
}
// select the hour of the selected item, if there is an item whose date matches
// mark the box as selected, if the event is
if( this.calendarWindow.EventSelection.isSelectedEvent( calendarEventDisplay.event ) )
{
this.selectBoxForEvent( calendarEventDisplay.event );
}
}
}
/** PRIVATE
*
* This creates an event box for the day view
*/
DayView.prototype.createEventBox = function dayview_createEventBox( calendarEventDisplay )
{
var eventStartDate = calendarEventDisplay.displayDate;
var eventEndDate = calendarEventDisplay.displayEndDate;
var startHour = eventStartDate.getHours();
var startMinutes = eventStartDate.getMinutes();
var eventEndDateTime = new Date( 2000, 1, 1, eventEndDate.getHours(), eventEndDate.getMinutes(), 0 );
var eventStartDateTime = new Date( 2000, 1, 1, eventStartDate.getHours(), eventStartDate.getMinutes(), 0 );
var eventDuration = new Date( eventEndDateTime - eventStartDateTime );
var hourDuration = eventDuration / (3600000);
var eventBox = document.createElement( "vbox" );
var boxHeight = document.getElementById( "day-tree-item-"+startHour ).boxObject.height;
var topHeight = document.getElementById( "day-tree-item-"+startHour ).boxObject.y - document.getElementById( "day-tree-item-"+startHour ).parentNode.boxObject.y;
var boxWidth = document.getElementById( "day-tree-item-"+startHour ).boxObject.width;
topHeight = eval( topHeight + ( ( startMinutes/60 ) * boxHeight ) );
topHeight = Math.round( topHeight ) - 2;
eventBox.setAttribute( "top", topHeight );
eventBox.setAttribute( "height", Math.round( ( hourDuration*boxHeight ) + 1 ) );
var width = Math.round( ( boxWidth-kDayViewHourLeftStart ) / calendarEventDisplay.NumberOfSameTimeEvents );
eventBox.setAttribute( "width", width );
var left = eval( ( ( calendarEventDisplay.CurrentSpot - 1 ) * width ) + kDayViewHourLeftStart );
left = left - ( calendarEventDisplay.CurrentSpot - 1 );
eventBox.setAttribute( "left", Math.round( left ) );
//if you change this class, you have to change calendarViewDNDObserver in calendarDragDrop.js
eventBox.setAttribute( "class", "day-view-event-class" );
eventBox.setAttribute( "flex", "1" );
eventBox.setAttribute( "eventbox", "dayview" );
eventBox.setAttribute( "onclick", "dayEventItemClick( this, event )" );
eventBox.setAttribute( "ondblclick", "dayEventItemDoubleClick( this, event )" );
// dragdrop events
eventBox.setAttribute( "ondraggesture", "nsDragAndDrop.startDrag(event,calendarViewDNDObserver);" );
eventBox.setAttribute( "ondragover", "nsDragAndDrop.dragOver(event,calendarViewDNDObserver)" );
eventBox.setAttribute( "ondragdrop", "nsDragAndDrop.drop(event,calendarViewDNDObserver)" );
eventBox.setAttribute( "onmouseover", "gCalendarWindow.changeMouseOverInfo( calendarEventDisplay, event )" );
eventBox.setAttribute( "tooltip", "eventTooltip" );
eventBox.setAttribute( "name", "day-view-event-box-"+calendarEventDisplay.event.id );
if( calendarEventDisplay.event.categories && calendarEventDisplay.event.categories != "" )
{
eventBox.setAttribute( calendarEventDisplay.event.categories, "true" );
}
var eventHTMLElement = document.createElement( "label" );
eventHTMLElement.setAttribute( "value", calendarEventDisplay.event.title );
eventHTMLElement.setAttribute( "flex", "1" );
eventHTMLElement.setAttribute( "crop", "end" );
eventBox.appendChild( eventHTMLElement );
/*
if( calendarEventDisplay.event.description != "" )
{
var eventHTMLElement2 = document.createElement( "description" );
eventHTMLElement2.setAttribute( "value", calendarEventDisplay.event.description );
eventHTMLElement2.setAttribute( "flex", "1" );
eventHTMLElement2.setAttribute( "crop", "end" );
eventBox.appendChild( eventHTMLElement2 );
}
*/
// add a property to the event box that holds the calendarEvent that the
// box represents
eventBox.calendarEventDisplay = calendarEventDisplay;
this.kungFooDeathGripOnEventBoxes.push( eventBox );
return( eventBox );
}
/** PUBLIC
*
* Called when the user switches from a different view
*/
DayView.prototype.switchFrom = function dayview_switchFrom( )
{
}
/** PUBLIC
*
* Called when the user switches to the day view
*/
DayView.prototype.switchTo = function dayview_switchTo( )
{
// disable/enable view switching buttons
var weekViewButton = document.getElementById( "week_view_command" );
var monthViewButton = document.getElementById( "month_view_command" );
var dayViewButton = document.getElementById( "day_view_command" );
monthViewButton.removeAttribute( "disabled" );
weekViewButton.removeAttribute( "disabled" );
dayViewButton.setAttribute( "disabled", "true" );
// switch views in the deck
var calendarDeckItem = document.getElementById( "calendar-deck" );
calendarDeckItem.selectedIndex = 2;
}
/** PUBLIC
*
* Redraw the display, but not the events
*/
DayView.prototype.refreshDisplay = function dayview_refreshDisplay( )
{
// update the title
var dayNamePrev1;
var dayNamePrev2;
var dayName = this.calendarWindow.dateFormater.getDayName( this.calendarWindow.getSelectedDate().getDay() );
if (this.calendarWindow.getSelectedDate().getDay() < 2)
{
if (this.calendarWindow.getSelectedDate().getDay() == 0)
{
dayNamePrev1 = this.calendarWindow.dateFormater.getDayName( this.calendarWindow.getSelectedDate().getDay() + 6 );
dayNamePrev2 = this.calendarWindow.dateFormater.getDayName( this.calendarWindow.getSelectedDate().getDay() + 5 );
}
else
{
dayNamePrev1 = this.calendarWindow.dateFormater.getDayName( this.calendarWindow.getSelectedDate().getDay() - 1 );
dayNamePrev2 = this.calendarWindow.dateFormater.getDayName( this.calendarWindow.getSelectedDate().getDay() + 5 );
}
}
else
{
dayNamePrev1 = this.calendarWindow.dateFormater.getDayName( this.calendarWindow.getSelectedDate().getDay() - 1 );
dayNamePrev2 = this.calendarWindow.dateFormater.getDayName( this.calendarWindow.getSelectedDate().getDay() - 2 );
}
var dayNameNext1;
var dayNameNext2;
if (this.calendarWindow.getSelectedDate().getDay() > 4)
{
if (this.calendarWindow.getSelectedDate().getDay() == 6)
{
dayNameNext1 = this.calendarWindow.dateFormater.getDayName( this.calendarWindow.getSelectedDate().getDay() - 6);
dayNameNext2 = this.calendarWindow.dateFormater.getDayName( this.calendarWindow.getSelectedDate().getDay() - 5);
}
else
{
dayNameNext1 = this.calendarWindow.dateFormater.getDayName( this.calendarWindow.getSelectedDate().getDay() + 1);
dayNameNext2 = this.calendarWindow.dateFormater.getDayName( this.calendarWindow.getSelectedDate().getDay() - 5);
}
}
else
{
dayNameNext1 = this.calendarWindow.dateFormater.getDayName( this.calendarWindow.getSelectedDate().getDay() + 1);
dayNameNext2 = this.calendarWindow.dateFormater.getDayName( this.calendarWindow.getSelectedDate().getDay() + 2);
}
var monthName = this.calendarWindow.dateFormater.getMonthName( this.calendarWindow.getSelectedDate().getMonth() );
var dateString = monthName + " " + this.calendarWindow.getSelectedDate().getDate() + " " + this.calendarWindow.getSelectedDate().getFullYear();
var dayTextItemPrev2 = document.getElementById( "-2-day-title" );
var dayTextItemPrev1 = document.getElementById( "-1-day-title" );
var dayTextItem = document.getElementById( "0-day-title" );
var dayTextItemNext1 = document.getElementById( "1-day-title" );
var dayTextItemNext2 = document.getElementById( "2-day-title" );
var daySpecificTextItem = document.getElementById( "0-day-specific-title" );
dayTextItemPrev2.setAttribute( "value" , dayNamePrev2 );
dayTextItemPrev1.setAttribute( "value" , dayNamePrev1 );
dayTextItem.setAttribute( "value" , dayName );
dayTextItemNext1.setAttribute( "value" , dayNameNext1 );
dayTextItemNext2.setAttribute( "value" , dayNameNext2 );
daySpecificTextItem.setAttribute( "value" , dateString );
}
/** PUBLIC
*
* This is called when we are about the make a new event
* and we want to know what the default start date should be for the event.
*/
DayView.prototype.getNewEventDate = function dayview_getNewEventDate( )
{
var start = new Date( this.calendarWindow.getSelectedDate() );
start.setHours( start.getHours() );
start.setMinutes( Math.ceil( start.getMinutes() / 5 ) * 5 );
start.setSeconds( 0 );
return start;
}
/** PUBLIC
*
* Go to the next day.
*/
DayView.prototype.goToNext = function dayview_goToNext(goDays)
{
var nextDay;
if (goDays)
{
nextDay = new Date( this.calendarWindow.selectedDate.getFullYear(), this.calendarWindow.selectedDate.getMonth(), this.calendarWindow.selectedDate.getDate() + goDays );
this.goToDay( nextDay );
}
else
{
nextDay = new Date( this.calendarWindow.selectedDate.getFullYear(), this.calendarWindow.selectedDate.getMonth(), this.calendarWindow.selectedDate.getDate() + 1 );
this.goToDay( nextDay );
}
}
/** PUBLIC
*
* Go to the previous day.
*/
DayView.prototype.goToPrevious = function dayview_goToPrevious( goDays )
{
var prevDay;
if (goDays)
{
prevDay = new Date( this.calendarWindow.selectedDate.getFullYear(), this.calendarWindow.selectedDate.getMonth(), this.calendarWindow.selectedDate.getDate() - goDays );
this.goToDay( prevDay );
}
else
{
prevDay = new Date( this.calendarWindow.selectedDate.getFullYear(), this.calendarWindow.selectedDate.getMonth(), this.calendarWindow.selectedDate.getDate() - 1 );
this.goToDay( prevDay );
}
}
DayView.prototype.selectBoxForEvent = function dayview_selectBoxForEvent( calendarEvent )
{
var EventBoxes = document.getElementsByAttribute( "name", "day-view-event-box-"+calendarEvent.id );
for ( j = 0; j < EventBoxes.length; j++ )
{
EventBoxes[j].setAttribute( "eventselected", "true" );
}
}
/** PUBLIC
*
* clear the selected event by taking off the selected attribute.
*/
DayView.prototype.clearSelectedEvent = function dayview_clearSelectedEvent( )
{
var ArrayOfBoxes = document.getElementsByAttribute( "eventselected", "true" );
for( i = 0; i < ArrayOfBoxes.length; i++ )
{
ArrayOfBoxes[i].removeAttribute( "eventselected" );
}
}
DayView.prototype.clearSelectedDate = function dayview_clearSelectedDate( )
{
return;
}
DayView.prototype.getVisibleEvent = function dayview_getVisibleEvent( calendarEvent )
{
eventBox = document.getElementById( "day-view-event-box-"+calendarEvent.id );
if ( eventBox )
{
return eventBox;
}
else
return false;
}
/*
** This function is needed because it may be called after the end of each day.
*/
DayView.prototype.hiliteTodaysDate = function dayview_hiliteTodaysDate( )
{
return;
}

View File

@@ -1,269 +0,0 @@
<?xml version="1.0"?>
<!-- ***** BEGIN LICENSE BLOCK *****
- Version: MPL 1.1/GPL 2.0/LGPL 2.1
-
- The contents of this file are subject to the Mozilla Public License Version
- 1.1 (the "License"); you may not use this file except in compliance with
- the License. You may obtain a copy of the License at
- http://www.mozilla.org/MPL/
-
- Software distributed under the License is distributed on an "AS IS" basis,
- WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- for the specific language governing rights and limitations under the
- License.
-
- The Original Code is OEone Calendar Code, released October 31st, 2001.
-
- The Initial Developer of the Original Code is
- OEone Corporation.
- Portions created by the Initial Developer are Copyright (C) 2001
- the Initial Developer. All Rights Reserved.
-
- Contributor(s): Garth Smedley <garths@oeone.com>
- Mike Potter <mikep@oeone.com>
- Colin Phillips <colinp@oeone.com>
- Karl Guertin <grayrest@grayrest.com>
-
- Alternatively, the contents of this file may be used under the terms of
- either the GNU General Public License Version 2 or later (the "GPL"), or
- the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- in which case the provisions of the GPL or the LGPL are applicable instead
- of those above. If you wish to allow use of your version of this file only
- under the terms of either the GPL or the LGPL, and not to allow others to
- use your version of this file under the terms of the MPL, indicate your
- decision by deleting the provisions above and replace them with the notice
- and other provisions required by the LGPL or the GPL. If you do not delete
- the provisions above, a recipient may use your version of this file under
- the terms of any one of the MPL, the GPL or the LGPL.
-
- ***** END LICENSE BLOCK ***** -->
<!-- DTD File with all strings specific to the calendar -->
<!DOCTYPE overlay
[
<!ENTITY % dtd1 SYSTEM "chrome://calendar/locale/global.dtd" > %dtd1;
<!ENTITY % dtd2 SYSTEM "chrome://calendar/locale/calendar.dtd" > %dtd2;
]>
<!-- The Window -->
<overlay
xmlns:html="http://www.w3.org/1999/xhtml"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
>
<script type="application/x-javascript" src="chrome://calendar/content/calendarDayView.js"/>
<script src="chrome://global/content/nsDragAndDrop.js"/>
<script src="chrome://global/content/nsTransferable.js"/>
<script src="chrome://global/content/nsJSSupportsUtils.js"/>
<script src="chrome://global/content/nsJSComponentManager.js"/>
<vbox id="day-view-box" flex="1">
<!-- Day View: Controls-->
<hbox id="day-controls-box"> <!-- DO NOT SET FLEX, breaks resizing -->
<box class="day-previous-button-box">
<image id="day-previous-button" class="prevnextbuttons" onclick="gCalendarWindow.goToPrevious()"/>
</box>
<vbox id="day-title-container" flex="1">
<hbox id="day-title-box" flex="1">
<vbox class="day-title-label-box" flex="1">
<label id="-2-day-title" onclick="gCalendarWindow.goToPrevious( 2 )" value="" />
</vbox>
<vbox class="day-title-label-box" flex="1">
<label id="-1-day-title" onclick="gCalendarWindow.goToPrevious( 1 )" value="" />
</vbox>
<vbox class="day-title-label-box" flex="1">
<label id="0-day-title" value="" />
</vbox>
<vbox class="day-title-label-box" flex="1">
<label id="1-day-title" onclick="gCalendarWindow.goToNext( 1 )" value="" />
</vbox>
<vbox class="day-title-label-box" flex="1">
<label id="2-day-title" onclick="gCalendarWindow.goToNext( 2 )" value="" />
</vbox>
</hbox>
<hbox id="day-specific-title-box" flex="1">
<vbox class="day-title-label-box" flex="1">
<label id="0-day-specific-title" value="" />
</vbox>
</hbox>
</vbox>
<box id="day-next-button-box">
<image id="day-next-button" class="prevnextbuttons" onclick="gCalendarWindow.goToNext()"/>
</box>
</hbox>
<!-- Day View: -->
<vbox id="inner-day-view-box" flex="1">
<box id="all-day-content-box" align="center" collapsed="true" flex="1">
<label class="all-day-content-box-text-title" value="All Day Events"/>
</box>
<!-- This is an overlay being included from above -->
<box id="day-view-content-box" flex="1">
<!--
<vbox id="leftgradientbox" >
<image src="chrome://calendar/skin/day_left_gradient.png" left="1" top="1" width="30" height="1199"/>
</vbox>
-->
<stack id="day-view-content-board" flex="1">
<vbox id="day-hour-content-holder" flex="1">
<box top="0" left="31" class="day-view-hour-box-class" id="day-tree-item-0" hour="0" onclick="dayViewHourClick( event )" ondblclick="dayViewHourDoubleClick( event )" flex="1" ondraggesture="nsDragAndDrop.startDrag(event,calendarViewDNDObserver);" ondragover="nsDragAndDrop.dragOver(event,calendarViewDNDObserver)" ondragdrop="nsDragAndDrop.drop(event,calendarViewDNDObserver)" oncontextmenu="dayViewHourContextClick( event )">
<box class="day-time-class">
<label class="day-time-class-label" id="day-view-hour-0" value="&time.midnight; " />
</box>
</box>
<box top="50" left="31" class="day-view-hour-box-class" id="day-tree-item-1" hour="1" onclick="dayViewHourClick( event )" ondblclick="dayViewHourDoubleClick( event )" flex="1" ondraggesture="nsDragAndDrop.startDrag(event,calendarViewDNDObserver);" ondragover="nsDragAndDrop.dragOver(event,calendarViewDNDObserver)" ondragdrop="nsDragAndDrop.drop(event,calendarViewDNDObserver)" oncontextmenu="dayViewHourContextClick( event )">
<box class="day-time-class">
<label class="day-time-class-label" id="day-view-hour-1"/>
</box>
</box>
<box top="100" left="31" class="day-view-hour-box-class" id="day-tree-item-2" hour="2" onclick="dayViewHourClick( event )" ondblclick="dayViewHourDoubleClick( event )" flex="1" ondraggesture="nsDragAndDrop.startDrag(event,calendarViewDNDObserver);" ondragover="nsDragAndDrop.dragOver(event,calendarViewDNDObserver)" ondragdrop="nsDragAndDrop.drop(event,calendarViewDNDObserver)" oncontextmenu="dayViewHourContextClick( event )">
<box class="day-time-class">
<label class="day-time-class-label" id="day-view-hour-2"/>
</box>
</box>
<box top="150" left="31" class="day-view-hour-box-class" id="day-tree-item-3" hour="3" onclick="dayViewHourClick( event )" ondblclick="dayViewHourDoubleClick( event )" flex="1" ondraggesture="nsDragAndDrop.startDrag(event,calendarViewDNDObserver);" ondragover="nsDragAndDrop.dragOver(event,calendarViewDNDObserver)" ondragdrop="nsDragAndDrop.drop(event,calendarViewDNDObserver)" oncontextmenu="dayViewHourContextClick( event )">
<box class="day-time-class">
<label class="day-time-class-label" id="day-view-hour-3"/>
</box>
</box>
<box top="200" left="31" class="day-view-hour-box-class" id="day-tree-item-4" hour="4" onclick="dayViewHourClick( event )" ondblclick="dayViewHourDoubleClick( event )" flex="1" ondraggesture="nsDragAndDrop.startDrag(event,calendarViewDNDObserver);" ondragover="nsDragAndDrop.dragOver(event,calendarViewDNDObserver)" ondragdrop="nsDragAndDrop.drop(event,calendarViewDNDObserver)" oncontextmenu="dayViewHourContextClick( event )">
<box class="day-time-class">
<label class="day-time-class-label" id="day-view-hour-4"/>
</box>
</box>
<box top="250" left="31" class="day-view-hour-box-class" id="day-tree-item-5" hour="5" onclick="dayViewHourClick( event )" ondblclick="dayViewHourDoubleClick( event )" flex="1" ondraggesture="nsDragAndDrop.startDrag(event,calendarViewDNDObserver);" ondragover="nsDragAndDrop.dragOver(event,calendarViewDNDObserver)" ondragdrop="nsDragAndDrop.drop(event,calendarViewDNDObserver)" oncontextmenu="dayViewHourContextClick( event )">
<box class="day-time-class">
<label class="day-time-class-label" id="day-view-hour-5"/>
</box>
</box>
<box top="300" left="31" class="day-view-hour-box-class" id="day-tree-item-6" hour="6" onclick="dayViewHourClick( event )" ondblclick="dayViewHourDoubleClick( event )" flex="1" ondraggesture="nsDragAndDrop.startDrag(event,calendarViewDNDObserver);" ondragover="nsDragAndDrop.dragOver(event,calendarViewDNDObserver)" ondragdrop="nsDragAndDrop.drop(event,calendarViewDNDObserver)" oncontextmenu="dayViewHourContextClick( event )">
<box class="day-time-class">
<label class="day-time-class-label" id="day-view-hour-6"/>
</box>
</box>
<box top="350" left="31" class="day-view-hour-box-class" id="day-tree-item-7" hour="7" onclick="dayViewHourClick( event )" ondblclick="dayViewHourDoubleClick( event )" flex="1" ondraggesture="nsDragAndDrop.startDrag(event,calendarViewDNDObserver);" ondragover="nsDragAndDrop.dragOver(event,calendarViewDNDObserver)" ondragdrop="nsDragAndDrop.drop(event,calendarViewDNDObserver)" oncontextmenu="dayViewHourContextClick( event )">
<box class="day-time-class">
<label class="day-time-class-label" id="day-view-hour-7"/>
</box>
</box>
<box top="400" left="31" class="day-view-hour-box-class" id="day-tree-item-8" hour="8" onclick="dayViewHourClick( event )" ondblclick="dayViewHourDoubleClick( event )" flex="1" ondraggesture="nsDragAndDrop.startDrag(event,calendarViewDNDObserver);" ondragover="nsDragAndDrop.dragOver(event,calendarViewDNDObserver)" ondragdrop="nsDragAndDrop.drop(event,calendarViewDNDObserver)" oncontextmenu="dayViewHourContextClick( event )">
<box class="day-time-class">
<label class="day-time-class-label" id="day-view-hour-8"/>
</box>
</box>
<box top="450" left="31" class="day-view-hour-box-class" id="day-tree-item-9" hour="9" onclick="dayViewHourClick( event )" ondblclick="dayViewHourDoubleClick( event )" flex="1" ondraggesture="nsDragAndDrop.startDrag(event,calendarViewDNDObserver);" ondragover="nsDragAndDrop.dragOver(event,calendarViewDNDObserver)" ondragdrop="nsDragAndDrop.drop(event,calendarViewDNDObserver)" oncontextmenu="dayViewHourContextClick( event )">
<box class="day-time-class">
<label class="day-time-class-label" id="day-view-hour-9"/>
</box>
</box>
<box top="500" left="31" class="day-view-hour-box-class" id="day-tree-item-10" hour="10" onclick="dayViewHourClick( event )" ondblclick="dayViewHourDoubleClick( event )" flex="1" ondraggesture="nsDragAndDrop.startDrag(event,calendarViewDNDObserver);" ondragover="nsDragAndDrop.dragOver(event,calendarViewDNDObserver)" ondragdrop="nsDragAndDrop.drop(event,calendarViewDNDObserver)" oncontextmenu="dayViewHourContextClick( event )">
<box class="day-time-class">
<label class="day-time-class-label" id="day-view-hour-10"/>
</box>
</box>
<box top="550" left="31" class="day-view-hour-box-class" id="day-tree-item-11" hour="11" onclick="dayViewHourClick( event )" ondblclick="dayViewHourDoubleClick( event )" flex="1" ondraggesture="nsDragAndDrop.startDrag(event,calendarViewDNDObserver);" ondragover="nsDragAndDrop.dragOver(event,calendarViewDNDObserver)" ondragdrop="nsDragAndDrop.drop(event,calendarViewDNDObserver)" oncontextmenu="dayViewHourContextClick( event )">
<box class="day-time-class">
<label class="day-time-class-label" id="day-view-hour-11"/>
</box>
</box>
<box top="600" left="31" class="day-view-hour-box-class" id="day-tree-item-12" hour="12" onclick="dayViewHourClick( event )" ondblclick="dayViewHourDoubleClick( event )" flex="1" ondraggesture="nsDragAndDrop.startDrag(event,calendarViewDNDObserver);" ondragover="nsDragAndDrop.dragOver(event,calendarViewDNDObserver)" ondragdrop="nsDragAndDrop.drop(event,calendarViewDNDObserver)" oncontextmenu="dayViewHourContextClick( event )">
<box class="day-time-class">
<label class="day-time-class-label" id="day-view-hour-12"/>
</box>
</box>
<box top="650" left="31" class="day-view-hour-box-class" id="day-tree-item-13" hour="13" onclick="dayViewHourClick( event )" ondblclick="dayViewHourDoubleClick( event )" flex="1" ondraggesture="nsDragAndDrop.startDrag(event,calendarViewDNDObserver);" ondragover="nsDragAndDrop.dragOver(event,calendarViewDNDObserver)" ondragdrop="nsDragAndDrop.drop(event,calendarViewDNDObserver)" oncontextmenu="dayViewHourContextClick( event )">
<box class="day-time-class">
<label class="day-time-class-label" id="day-view-hour-13"/>
</box>
</box>
<box top="700" left="31" class="day-view-hour-box-class" id="day-tree-item-14" hour="14" onclick="dayViewHourClick( event )" ondblclick="dayViewHourDoubleClick( event )" flex="1" ondraggesture="nsDragAndDrop.startDrag(event,calendarViewDNDObserver);" ondragover="nsDragAndDrop.dragOver(event,calendarViewDNDObserver)" ondragdrop="nsDragAndDrop.drop(event,calendarViewDNDObserver)" oncontextmenu="dayViewHourContextClick( event )">
<box class="day-time-class">
<label class="day-time-class-label" id="day-view-hour-14"/>
</box>
</box>
<box top="750" left="31" class="day-view-hour-box-class" id="day-tree-item-15" hour="15" onclick="dayViewHourClick( event )" ondblclick="dayViewHourDoubleClick( event )" flex="1" ondraggesture="nsDragAndDrop.startDrag(event,calendarViewDNDObserver);" ondragover="nsDragAndDrop.dragOver(event,calendarViewDNDObserver)" ondragdrop="nsDragAndDrop.drop(event,calendarViewDNDObserver)" oncontextmenu="dayViewHourContextClick( event )">
<box class="day-time-class">
<label class="day-time-class-label" id="day-view-hour-15"/>
</box>
</box>
<box top="800" left="31" class="day-view-hour-box-class" id="day-tree-item-16" hour="16" onclick="dayViewHourClick( event )" ondblclick="dayViewHourDoubleClick( event )" flex="1" ondraggesture="nsDragAndDrop.startDrag(event,calendarViewDNDObserver);" ondragover="nsDragAndDrop.dragOver(event,calendarViewDNDObserver)" ondragdrop="nsDragAndDrop.drop(event,calendarViewDNDObserver)" oncontextmenu="dayViewHourContextClick( event )">
<box class="day-time-class">
<label class="day-time-class-label" id="day-view-hour-16"/>
</box>
</box>
<box top="850" left="31" class="day-view-hour-box-class" id="day-tree-item-17" hour="17" onclick="dayViewHourClick( event )" ondblclick="dayViewHourDoubleClick( event )" flex="1" ondraggesture="nsDragAndDrop.startDrag(event,calendarViewDNDObserver);" ondragover="nsDragAndDrop.dragOver(event,calendarViewDNDObserver)" ondragdrop="nsDragAndDrop.drop(event,calendarViewDNDObserver)" oncontextmenu="dayViewHourContextClick( event )">
<box class="day-time-class">
<label class="day-time-class-label" id="day-view-hour-17"/>
</box>
</box>
<box top="900" left="31" class="day-view-hour-box-class" id="day-tree-item-18" hour="18" onclick="dayViewHourClick( event )" ondblclick="dayViewHourDoubleClick( event )" flex="1" ondraggesture="nsDragAndDrop.startDrag(event,calendarViewDNDObserver);" ondragover="nsDragAndDrop.dragOver(event,calendarViewDNDObserver)" ondragdrop="nsDragAndDrop.drop(event,calendarViewDNDObserver)" oncontextmenu="dayViewHourContextClick( event )">
<box class="day-time-class">
<label class="day-time-class-label" id="day-view-hour-18"/>
</box>
</box>
<box top="950" left="31" class="day-view-hour-box-class" id="day-tree-item-19" hour="19" onclick="dayViewHourClick( event )" ondblclick="dayViewHourDoubleClick( event )" flex="1" ondraggesture="nsDragAndDrop.startDrag(event,calendarViewDNDObserver);" ondragover="nsDragAndDrop.dragOver(event,calendarViewDNDObserver)" ondragdrop="nsDragAndDrop.drop(event,calendarViewDNDObserver)" oncontextmenu="dayViewHourContextClick( event )">
<box class="day-time-class">
<label class="day-time-class-label" id="day-view-hour-19"/>
</box>
</box>
<box top="1000" left="31" class="day-view-hour-box-class" id="day-tree-item-20" hour="20" onclick="dayViewHourClick( event )" ondblclick="dayViewHourDoubleClick( event )" flex="1" ondraggesture="nsDragAndDrop.startDrag(event,calendarViewDNDObserver);" ondragover="nsDragAndDrop.dragOver(event,calendarViewDNDObserver)" ondragdrop="nsDragAndDrop.drop(event,calendarViewDNDObserver)" oncontextmenu="dayViewHourContextClick( event )">
<box class="day-time-class">
<label class="day-time-class-label" id="day-view-hour-20"/>
</box>
</box>
<box top="1050" left="31" class="day-view-hour-box-class" id="day-tree-item-21" hour="21" onclick="dayViewHourClick( event )" ondblclick="dayViewHourDoubleClick( event )" flex="1" ondraggesture="nsDragAndDrop.startDrag(event,calendarViewDNDObserver);" ondragover="nsDragAndDrop.dragOver(event,calendarViewDNDObserver)" ondragdrop="nsDragAndDrop.drop(event,calendarViewDNDObserver)" oncontextmenu="dayViewHourContextClick( event )">
<box class="day-time-class">
<label class="day-time-class-label" id="day-view-hour-21"/>
</box>
</box>
<box top="1100" left="31" class="day-view-hour-box-class" id="day-tree-item-22" hour="22" onclick="dayViewHourClick( event )" ondblclick="dayViewHourDoubleClick( event )" flex="1" ondraggesture="nsDragAndDrop.startDrag(event,calendarViewDNDObserver);" ondragover="nsDragAndDrop.dragOver(event,calendarViewDNDObserver)" ondragdrop="nsDragAndDrop.drop(event,calendarViewDNDObserver)" oncontextmenu="dayViewHourContextClick( event )">
<box class="day-time-class">
<label class="day-time-class-label" id="day-view-hour-22"/>
</box>
</box>
<box top="1150" left="31" class="day-view-hour-box-class" id="day-tree-item-23" hour="23" onclick="dayViewHourClick( event )" ondblclick="dayViewHourDoubleClick( event )" flex="1" ondraggesture="nsDragAndDrop.startDrag(event,calendarViewDNDObserver);" ondragover="nsDragAndDrop.dragOver(event,calendarViewDNDObserver)" ondragdrop="nsDragAndDrop.drop(event,calendarViewDNDObserver)" oncontextmenu="dayViewHourContextClick( event )">
<box class="day-time-class">
<label class="day-time-class-label" id="day-view-hour-23"/>
</box>
</box>
</vbox>
</stack>
</box> <!-- End: day-tree-content-box -->
</vbox>
</vbox> <!-- End: Calendar Day View -->
</overlay>

View File

@@ -1,328 +0,0 @@
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is Mozilla Calendar code.
*
* The Initial Developer of the Original Code is
* ArentJan Banck <ajbanck@planet.nl>.
* Portions created by the Initial Developer are Copyright (C) 2002
* the Initial Developer. All Rights Reserved.
*
* Contributor(s): ArentJan Banck <ajbanck@planet.nl>
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
// TODO move nsIDragService definition
//const nsIDragService = Components.interfaces.nsIDragService;
// function to select whatever what is clicked to start dragging, Mozilla doesn't do this
function calendarViewClick ( aEvent ) {
if(aEvent.target.className == "day-view-hour-box-class")
dayViewHourClick( aEvent );
if(aEvent.target.className == "day-view-event-class")
dayEventItemClick( aEvent.target, aEvent );
if (gCalendarWindow.currentView == gCalendarWindow.weekView)
;//weekViewHourClick( aEvent );
}
//var startDateIndex;
var calendarViewDNDObserver = {
getSupportedFlavours : function () {
var flavourSet = new FlavourSet();
flavourSet.appendFlavour("text/unicode");
flavourSet.appendFlavour("text/calendar");
flavourSet.appendFlavour("text/calendar-interval");
flavourSet.appendFlavour("text/x-moz-message-or-folder");
flavourSet.appendFlavour("application/x-moz-file", "nsIFile");
return flavourSet;
},
onDragStart: function (aEvent, aXferData, aDragAction){
// select clicked object, Mozilla doens't do this.
calendarViewClick( aEvent );
// aEvent.currentTarget;
if( aEvent.target.localName == "splitter" || aEvent.target.localName == "menu")
throw Components.results.NS_OK; // not a draggable item
if(aEvent.target.className == "day-view-event-class" ||
aEvent.target.className == "week-view-event-label-class")
{
// We are going to drag an event
var dragEvents = gCalendarWindow.EventSelection.selectedEvents;
aXferData.data= new TransferData();
aXferData.data.addDataForFlavour("text/calendar", eventArrayToICalString( dragEvents ) );
aXferData.data.addDataForFlavour("text/unicode", eventArrayToICalString( dragEvents, true ) );
//if (aEvent.ctrlKey) {
// action.action = nsIDragService.DRAGDROP_ACTION_COPY ;
//}
aEvent.preventBubble();
}
else
{
// Dragging on the calendar canvas to select an event period
// var newDate = gHeaderDateItemArray[dayIndex].getAttribute( "date" );
var gStartDate = new Date( gCalendarWindow.getSelectedDate() );
this.startDateIndex = aEvent.target.getAttribute( "day" );
gStartDate.setHours( aEvent.target.getAttribute( "hour" ) );
gStartDate.setMinutes( 0 );
gStartDate.setSeconds( 0 );
aXferData.data=new TransferData();
aXferData.data.addDataForFlavour("text/calendar-interval", gStartDate.getTime() );
// aDragAction.action = nsIDragService.DRAGDROP_ACTION_MOVE;
aEvent.preventBubble();
}
},
onDragOver: function calendarViewOnDragOver(aEvent, aFlavour, aDragSession)
{
if (aDragSession.isDataFlavorSupported("text/calendar-interval"))
{
// multiday events not supported. In week view, do not allow more than one day in selection
if (gCalendarWindow.currentView == gCalendarWindow.weekView )
{
if (aEvent.target.getAttribute( "day" ) != this.startDateIndex)
{
aDragSession.canDrop = false;
return false;
}
}
// if (aDragSession.isDataFlavorSupported("text/calendar-interval"))
aEvent.target.setAttribute( "draggedover", "true" );
}
return true;
},
onDrop: function (aEvent, aXferData, aDragSession)
{
var trans = Components.classes["@mozilla.org/widget/transferable;1"].createInstance(Components.interfaces.nsITransferable);
trans.addDataFlavor("text/calendar");
trans.addDataFlavor("text/calendar-interval");
trans.addDataFlavor("text/x-moz-message-or-folder");
trans.addDataFlavor("text/x-moz-url");
trans.addDataFlavor("application/x-moz-file");
trans.addDataFlavor("text/unicode");
aDragSession.getData (trans, i);
var dataObj = new Object();
var bestFlavor = new Object();
var len = new Object();
trans.getAnyTransferData(bestFlavor, dataObj, len);
switch (bestFlavor.value)
{
case "text/calendar": // A calendar object is dropped. ical text data.
if (dataObj)
// XXX For MOZILLA10 1.0 this is nsISupportWString
dataObj = dataObj.value.QueryInterface(Components.interfaces.nsISupportsString);
var dropEvent = createEvent();
var newEventId = dropEvent.id; // can be used when copying to new event
// XXX TODO: Check if there is a function in calendarImportExport to do this
icalStr = dataObj.data.substring(0, len.value);
i = icalStr.indexOf("BEGIN:VEVENT");
j = icalStr.indexOf("END:VEVENT") + 10;
eventData = icalStr.substring(i, j);
dropEvent.parseIcalString( eventData );
// calculate new start/end time for droplocation
// use the minutes from the event, and change the hour to the hour dropped in
var gDropzoneStartTime = new Date( dropEvent.start.getTime() );
gDropzoneStartTime.setHours( aEvent.target.getAttribute( "hour" ) );
var draggedTime = gDropzoneStartTime - dropEvent.start ;
var eventDuration = dropEvent.end.getTime() - dropEvent.start.getTime();
if(aDragSession.dragAction == nsIDragService.DRAGDROP_ACTION_MOVE)
{
var calendarEvent = gICalLib.fetchEvent( dropEvent.id );
if( calendarEvent != null )
{
calendarEvent.start.setTime(gDropzoneStartTime.getTime() );
calendarEvent.end.setTime ( calendarEvent.start.getTime() + eventDuration );
gICalLib.modifyEvent( calendarEvent );
}
else
alert(" Event with id: " + dropEvent.id + " not found");
}
else
{
// create a copy of the dragged event on the droplocation
dropEvent.id = newEventId;
// XXX TODO Check if stamp/DTSTAMP is correclty set to current time
dropEvent.start.setTime(gDropzoneStartTime.getTime() );
dropEvent.end.setTime ( dropEvent.start.getTime() + eventDuration );
editNewEvent( dropEvent );
}
break;
case "text/calendar-interval": // A start time is dragged as start of an event duration
// no copy for interval drag
// if (dragSession.dragAction == nsIDragService.DRAGDROP_ACTION_COPY)
// return false;
if (dataObj)
dataObj = dataObj.value.QueryInterface(Components.interfaces.nsISupportsString);
var dragTime = dataObj.data.substring(0, len.value);
gStartDate = new Date( );
gStartDate.setTime( dragTime );
gEndDate = new Date( gStartDate.getTime() );
gEndDate.setHours( aEvent.target.getAttribute( "hour" ) );
if( gEndDate.getTime() < gStartDate.getTime() )
{
var Temp = gEndDate;
gEndDate = gStartDate;
gStartDate = Temp;
}
newEvent( gStartDate, gEndDate );
break;
case "text/x-moz-url":
var url = transferUtils.retrieveURLFromData(aXferData.data, aXferData.flavour.contentType);
if (!url)
return;
alert(url);
break;
case "text/unicode": // text, create new event with text as description
if (dataObj)
dataObj = dataObj.value.QueryInterface(Components.interfaces.nsISupportsWString);
// calculate star and and time's for new event, default event lenght is 1 hour
var gStartDate = new Date( gCalendarWindow.getSelectedDate() );
gStartDate.setHours( aEvent.target.getAttribute( "hour" ) );
gStartDate.setMinutes( 0 );
gStartDate.setSeconds( 0 );
gEndDate = new Date( gStartDate.getTime() );
gEndDate.setHours(gStartDate.getHours() + 1);
newEvent = createEvent();
newEvent.start.setTime( gStartDate );
newEvent.end.setTime( gEndDate );
newEvent.description = dataObj.data.substring(0, len.value);
editNewEvent( newEvent );
break;
case "text/x-moz-message-or-folder": // Mozilla mail, work in progress
try {
if (dataObj)
dataObj = dataObj.value.QueryInterface(Components.interfaces.nsISupportsString);
// pull the URL out of the data object
// sourceDocument nul if from other app
var sourceUri = dataObj.data.substring(0, len.value);
if (! sourceUri)
break;
alert("import not implemented " + sourceUri);
/*
try
{
sourceResource = RDF.GetResource(sourceUri, true);
var folder = sourceResource.QueryInterface(Components.interfaces.nsIFolder);
if (folder)
dragFolder = true;
}
catch(ex)
{
sourceResource = null;
var isServer = GetFolderAttribute(folderTree, targetResource, "IsServer");
if (isServer == "true")
{
debugDump("***isServer == true\n");
return false;
}
// canFileMessages checks no select, and acl, for imap.
var canFileMessages = GetFolderAttribute(folderTree, targetResource, "CanFileMessages");
if (canFileMessages != "true")
{
debugDump("***canFileMessages == false\n");
return false;
}
var hdr = messenger.messageServiceFromURI(sourceUri).messageURIToMsgHdr(sourceUri);
alert(hdr);
if (hdr.folder == targetFolder)
return false;
break;
}
*/
}
catch(ex) {
alert(ex.message);
}
break;
case "application/x-moz-file": // file from OS, we expect it to be iCalendar data
try {
var fileObj = dataObj.value.QueryInterface(Components.interfaces.nsIFile);
var aDataStream = readDataFromFile( fileObj.path );
var calendarEventArray = parseIcalData( aDataStream );
// TODO Move to calendarImportExport to have the option to turn off dialogs
addEventsToCalendar( calendarEventArray );
}
catch(ex) {
alert(ex.message);
}
break;
}
// cleanup
var allDraggedElements = document.getElementsByAttribute( "draggedover", "true" );
for( var i = 0; i < allDraggedElements.length; i++ )
{
allDraggedElements[i].removeAttribute( "draggedover" );
}
},
onDragExit: function (aEvent, aDragSession)
{
// nothing, doesn't fire for cancel? needed for interval-drag cleanup
}
};

View File

@@ -1,360 +0,0 @@
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is OEone Calendar Code, released October 31st, 2001.
*
* The Initial Developer of the Original Code is
* OEone Corporation.
* Portions created by the Initial Developer are Copyright (C) 2001
* the Initial Developer. All Rights Reserved.
*
* Contributor(s): Garth Smedley <garths@oeone.com>
* Mike Potter <mikep@oeone.com>
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
var gAllEvents = new Array();
var CreateAlarmBox = true;
var gDateFormatter = new DateFormater( opener.gCalendarWindow ); // used to format dates and times
var kungFooDeathGripOnEventBoxes = new Array();
var gICalLib;
function onLoad()
{
var calendarEventService = opener.gEventSource;
gICalLib = calendarEventService.getICalLib();
var args = window.arguments[0];
if( args.calendarEvent )
{
onAlarmCall( args.calendarEvent );
}
if( "pendingEvents" in window )
{
//dump( "\n GETTING PENDING ___________________" );
for( var i in window.pendingEvents )
{
gAllEvents[ gAllEvents.length ] = window.pendingEvents[i];
}
buildEventBoxes();
}
doSetOKCancel( onOkButton, 0 );
}
function buildEventBoxes()
{
//remove all the old event boxes.
var EventContainer = document.getElementById( "event-container-rows" );
if( EventContainer )
{
var NumberOfChildElements = EventContainer.childNodes.length;
for( i = 0; i < NumberOfChildElements; i++ )
{
EventContainer.removeChild( EventContainer.lastChild );
}
//start at length - 10 or 0 if that is < 0
var Start = gAllEvents.length - 10;
if( Start < 0 )
Start = 0;
//build all event boxes again.
for( var i = Start; i < gAllEvents.length; i++ )
{
createAlarmBox( gAllEvents[i] );
}
//reset the text
if( gAllEvents.length > 10 )
{
var TooManyDesc = document.getElementById( "too-many-alarms-description" );
TooManyDesc.removeAttribute( "collapsed" );
TooManyDesc.setAttribute( "value", "You have "+ (gAllEvents.length )+" total alarms. We've shown you the last 10. Click Acknowledge All to clear them all." );
}
else
{
var TooManyDesc = document.getElementById( "too-many-alarms-description" );
TooManyDesc.setAttribute( "collapsed", "true" );
}
}
sizeToContent();
}
function onAlarmCall( Event )
{
var AddToArray = true;
//check and make sure that the event is not already in the array
for( i = 0; i < gAllEvents.length; i++ )
{
if( gAllEvents[i].id == Event.id )
AddToArray = false;
}
if( AddToArray )
gAllEvents[ gAllEvents.length ] = Event;
buildEventBoxes();
}
function createAlarmBox( Event )
{
var OuterBox = document.getElementsByAttribute( "name", "sample-row" )[0].cloneNode( true );
OuterBox.removeAttribute( "name" );
OuterBox.setAttribute( "id", Event.id );
OuterBox.setAttribute( "eventbox", "true" );
OuterBox.removeAttribute( "collapsed" );
OuterBox.getElementsByAttribute( "name", "AcknowledgeButton" )[0].event = Event;
OuterBox.getElementsByAttribute( "name", "AcknowledgeButton" )[0].setAttribute( "onclick", "acknowledgeAlarm( this.event );removeAlarmBox( this.event );" );
OuterBox.getElementsByAttribute( "name", "EditEvent" )[0].event = Event;
OuterBox.getElementsByAttribute( "name", "EditEvent" )[0].setAttribute( "onclick", "launchEditEvent( this.event );" );
kungFooDeathGripOnEventBoxes.push( OuterBox.getElementsByAttribute( "name", "AcknowledgeButton" )[0] );
OuterBox.getElementsByAttribute( "name", "SnoozeButton" )[0].event = Event;
OuterBox.getElementsByAttribute( "name", "SnoozeButton" )[0].setAttribute( "onclick", "snoozeAlarm( this.event );removeAlarmBox( this.event );" );
var prefService = Components.classes["@mozilla.org/preferences-service;1"]
.getService(Components.interfaces.nsIPrefService);
OuterBox.getElementsByAttribute( "name", "alarm-length-field" )[0].value = getIntPref(prefService.getBranch("calendar."), "event.defaultsnoozelength", 60 );
kungFooDeathGripOnEventBoxes.push( OuterBox.getElementsByAttribute( "name", "SnoozeButton" )[0] );
/*
** The first part of the box, the title and description
*/
var EventTitle = document.createTextNode( Event.title );
OuterBox.getElementsByAttribute( "name", "Title" )[0].appendChild( EventTitle );
var EventDescription = document.createTextNode( Event.description );
OuterBox.getElementsByAttribute( "name", "Description" )[0].appendChild( EventDescription );
var displayDate = new Date( Event.displayDate );
var EventDisplayDate = document.createTextNode( getFormatedDate( displayDate ) );
OuterBox.getElementsByAttribute( "name", "StartDate" )[0].appendChild( EventDisplayDate );
var EventDisplayTime = document.createTextNode( getFormatedTime( displayDate ) );
OuterBox.getElementsByAttribute( "name", "StartTime" )[0].appendChild( EventDisplayTime );
/*
** 3rd part of the row: the number of times that alarm went off (sometimes hidden)
*/
OuterBox.getElementsByAttribute( "name", "NumberOfTimes" )[0].setAttribute( "id", "description-"+Event.id );
//document.getElementById( "event-container-rows" ).insertBefore( OuterBox, document.getElementById( "event-container-rows" ).childNodes[1] );
document.getElementById( "event-container-rows" ).appendChild( OuterBox );
}
function removeAlarmBox( Event )
{
//get the box for the event
var EventAlarmBox = document.getElementById( Event.id );
if( EventAlarmBox )
{
//remove the box from the body
EventAlarmBox.parentNode.removeChild( EventAlarmBox );
}
//if there's no more events left, close the dialog
EventAlarmBoxes = document.getElementsByAttribute( "eventbox", "true" );
if( EventAlarmBoxes.length > 0 )
{
//there are still boxes left.
return( false );
}
else
{
//close the dialog
self.close();
}
}
function getArrayId( Event )
{
for( i = 0; i < gAllEvents.length; i++ )
{
if( gAllEvents[i].id == Event.id )
return( i );
}
return( false );
}
function onOkButton( )
{
//this would acknowledge all the alarms
for( i = 0; i < gAllEvents.length; i++ )
{
gAllEvents[i].lastAlarmAck = new Date();
}
for( i = 0; i < gAllEvents.length; i++ )
{
gICalLib.modifyEvent( gAllEvents[i] );
}
return( true );
}
function onCancelButton()
{
//just close the dialog
return( true );
}
function acknowledgeAlarm( Event )
{
Event.lastAlarmAck = new Date();
var calendarEventService = opener.gEventSource;
gICalLib = calendarEventService.getICalLib();
gICalLib.modifyEvent( Event );
var Id = getArrayId( Event )
gAllEvents.splice( Id, 1 );
buildEventBoxes();
}
function launchEditEvent( Event )
{
// set up a bunch of args to pass to the dialog
var args = new Object();
args.mode = "edit";
args.onOk = modifyEventDialogResponse;
args.calendarEvent = Event;
// open the dialog modally
window.setCursor( "wait" );
opener.openDialog("chrome://calendar/content/calendarEventDialog.xul", "caEditEvent", "chrome,modal", args );
}
function modifyEventDialogResponse( calendarEvent )
{
gICalLib.modifyEvent( calendarEvent );
}
function snoozeAlarm( Event )
{
var OuterBox = document.getElementById( Event.id );
var SnoozeInteger = OuterBox.getElementsByAttribute( "name", "alarm-length-field" )[0].value;
SnoozeInteger = parseInt( SnoozeInteger );
var SnoozeUnits = document.getElementsByAttribute( "name", "alarm-length-units" )[0].value;
var Now = new Date();
Now = Now.getTime();
var TimeToNextAlarm;
switch (SnoozeUnits )
{
case "minutes":
TimeToNextAlarm = 1000 * 60 * SnoozeInteger;
break;
case "hours":
TimeToNextAlarm = 1000 * 60 * 60 * SnoozeInteger;
break;
case "days":
TimeToNextAlarm = 1000 * 60 * 60 * 24 * SnoozeInteger;
break;
}
var MSOfNextAlarm = Now + TimeToNextAlarm; //10 seconds.
var DateObjOfNextAlarm = new Date( MSOfNextAlarm );
Event.setSnoozeTime( DateObjOfNextAlarm );
var calendarEventService = opener.gEventSource;
gICalLib = calendarEventService.getICalLib();
gICalLib.modifyEvent( Event );
var Id = getArrayId( Event )
gAllEvents.splice( Id, 1 );
buildEventBoxes();
}
function getFormatedDate( date )
{
return( opener.gCalendarWindow.dateFormater.getFormatedDate( date ) );
}
/**
* Take a Date object and return a displayable time string i.e.: 12:30 PM
*/
function getFormatedTime( date )
{
var timeString = opener.gCalendarWindow.dateFormater.getFormatedTime( date );
return timeString;
}
function getIntPref (prefObj, prefName, defaultValue)
{
try
{
return prefObj.getIntPref (prefName);
}
catch (e)
{
prefObj.setIntPref( prefName, defaultValue );
return defaultValue;
}
}

View File

@@ -1,134 +0,0 @@
<?xml version="1.0"?>
<!-- ***** BEGIN LICENSE BLOCK *****
- Version: MPL 1.1/GPL 2.0/LGPL 2.1
-
- The contents of this file are subject to the Mozilla Public License Version
- 1.1 (the "License"); you may not use this file except in compliance with
- the License. You may obtain a copy of the License at
- http://www.mozilla.org/MPL/
-
- Software distributed under the License is distributed on an "AS IS" basis,
- WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- for the specific language governing rights and limitations under the
- License.
-
- The Original Code is OEone Calendar Code, released October 31st, 2001.
-
- The Initial Developer of the Original Code is
- OEone Corporation.
- Portions created by the Initial Developer are Copyright (C) 2001
- the Initial Developer. All Rights Reserved.
-
- Contributor(s): Garth Smedley <garths@oeone.com>
- Mike Potter <mikep@oeone.com>
- Colin Phillips <colinp@oeone.com>
-
- Alternatively, the contents of this file may be used under the terms of
- either the GNU General Public License Version 2 or later (the "GPL"), or
- the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- in which case the provisions of the GPL or the LGPL are applicable instead
- of those above. If you wish to allow use of your version of this file only
- under the terms of either the GPL or the LGPL, and not to allow others to
- use your version of this file under the terms of the MPL, indicate your
- decision by deleting the provisions above and replace them with the notice
- and other provisions required by the LGPL or the GPL. If you do not delete
- the provisions above, a recipient may use your version of this file under
- the terms of any one of the MPL, the GPL or the LGPL.
-
- ***** END LICENSE BLOCK ***** -->
<?xml-stylesheet href="chrome://global/skin/global.css" type="text/css"?>
<?xul-overlay href="chrome://global/content/dialogOverlay.xul"?>
<?xul-overlay href="chrome://calendar/content/timepicker/timepicker-overlay.xul"?>
<!-- CSS File with all styles specific to the dialog -->
<?xml-stylesheet href="chrome://calendar/skin/calendarEventAlertDialog.css" ?>
<!-- DTD File with all strings specific to the calendar -->
<!DOCTYPE window
[
<!ENTITY % dtd1 SYSTEM "chrome://calendar/locale/global.dtd" > %dtd1;
<!ENTITY % dtd2 SYSTEM "chrome://calendar/locale/calendar.dtd" > %dtd2;
<!ENTITY % dtd3 SYSTEM "chrome://global/locale/brand.dtd" > %dtd3;
]>
<window
id="calendar-new-eventwindow"
title="&brandShortName; - Calendar Alarm - &event.title.alarm;"
onload="onLoad()"
windowtype="calendarAlarmWindow"
persist="screenX screenY"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<!-- Javascript includes -->
<script type="application/x-javascript" src="chrome://global/content/strres.js"/>
<script type="application/x-javascript" src="chrome://calendar/content/dateUtils.js"/>
<script type="application/x-javascript" src="chrome://calendar/content/calendarEventAlertDialog.js"/>
<script type="application/x-javascript" src="chrome://calendar/content/calendarEvent.js"/>
<!-- Picker popups -->
<popup id="oe-date-picker-popup" position="after_start" oncommand="onDatePick( this )" label=""/>
<popup id="oe-time-picker-popup" position="after_start" oncommand="onTimePick( this )" label=""/>
<!-- The dialog -->
<!-- dialog-box: from dialogOverlay.xul -->
<vbox id="dialog-box">
<!-- standard-dialog-content: from dialogOverlay.xul -->
<vbox id="standard-dialog-content">
<grid flex="1" id="event-container-box">
<columns>
<column flex="1"/>
<column flex="2" crop="right"/>
<column flex="1"/>
<column flex="1" id="last-column" collapsed="true"/>
</columns>
<rows id="event-container-rows"/>
<row class="ca-event-alert-row" name="sample-row" collapsed="true">
<!-- NOTE: ALL ITEMS USE name INSTEAD OF id BECAUSE THE BOX IS DUPLICATED FOR EACH EVENT -->
<vbox align="start" pack="center">
<button name="AcknowledgeButton" label="&calendar.alarm.acknowledge.label;" wrap="none" class="alarm-acknowledge-button-class"/>
<button name="EditEvent" label="&calendar.alarm.editevent.label;" wrap="none" class="alarm-acknowledge-button-class"/>
<box>
<button name="SnoozeButton" label="&calendar.alarm.snooze.label;" wrap="none" class="alarm-acknowledge-button-class"/>
<textbox name="alarm-length-field" class="alarm-length-field-class"/>
<menulist name="alarm-length-units" labelnumber="labelplural" crop="none">
<menupopup >
<menuitem label="&alarm.units.minutes;" labelplural="&alarm.units.minutes;" labelsingular="&alarm.units.minutes.singular;" value="minutes"/>
<menuitem label="&alarm.units.hours;" labelplural="&alarm.units.hours;" labelsingular="&alarm.units.hours.singular;" value="hours"/>
<menuitem label="&alarm.units.days;" labelplural="&alarm.units.days;" labelsingular="&alarm.units.days.singular;" value="days"/>
</menupopup>
</menulist>
</box>
</vbox>
<vbox>
<description name="Title"/>
<description name="Description"/>
</vbox>
<vbox>
<description name="StartDate"/>
<description name="StartTime"/>
</vbox>
<description name="NumberOfTimes" NumberOfTimes="1"/>
<separator class="thin"/>
</row>
</grid>
<label id="too-many-alarms-description" value="" collapsed="true"/>
<box>
<spacer flex="1"/>
<button id="dialog-btn-yes" label="&calendar.alarm.acknowledgeall.label;" default="true" oncommand="doOKButton();"/>
</box>
</vbox>
</vbox> <!-- dialog-box -->
</window>

File diff suppressed because it is too large Load Diff

View File

@@ -1,469 +0,0 @@
<?xml version="1.0"?>
<!-- ***** BEGIN LICENSE BLOCK *****
- Version: MPL 1.1/GPL 2.0/LGPL 2.1
-
- The contents of this file are subject to the Mozilla Public License Version
- 1.1 (the "License"); you may not use this file except in compliance with
- the License. You may obtain a copy of the License at
- http://www.mozilla.org/MPL/
-
- Software distributed under the License is distributed on an "AS IS" basis,
- WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- for the specific language governing rights and limitations under the
- License.
-
- The Original Code is OEone Calendar Code, released October 31st, 2001.
-
- The Initial Developer of the Original Code is
- OEone Corporation.
- Portions created by the Initial Developer are Copyright (C) 2001
- the Initial Developer. All Rights Reserved.
-
- Contributor(s): Garth Smedley <garths@oeone.com>
- Mike Potter <mikep@oeone.com>
- Colin Phillips <colinp@oeone.com>
- Chris Charabaruk <ccharabaruk@meldstar.com>
- ArentJan Banck <ajbanck@planet.nl>
-
- Alternatively, the contents of this file may be used under the terms of
- either the GNU General Public License Version 2 or later (the "GPL"), or
- the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- in which case the provisions of the GPL or the LGPL are applicable instead
- of those above. If you wish to allow use of your version of this file only
- under the terms of either the GPL or the LGPL, and not to allow others to
- use your version of this file under the terms of the MPL, indicate your
- decision by deleting the provisions above and replace them with the notice
- and other provisions required by the LGPL or the GPL. If you do not delete
- the provisions above, a recipient may use your version of this file under
- the terms of any one of the MPL, the GPL or the LGPL.
-
- ***** END LICENSE BLOCK ***** -->
<?xml-stylesheet href="chrome://global/skin/global.css" type="text/css"?>
<?xul-overlay href="chrome://global/content/dialogOverlay.xul"?>
<?xul-overlay href="chrome://calendar/content/timepicker/timepicker-overlay.xul"?>
<!-- CSS File with all styles specific to the dialog -->
<?xml-stylesheet href="chrome://calendar/skin/calendarEventDialog.css" ?>
<?xml-stylesheet href="chrome://calendar/skin/dialogOverlay.css" type="text/css"?>
<?xml-stylesheet href="chrome://calendar/context/datepicker/datepicker.css" ?>
<?xml-stylesheet href="chrome://calendar/context/datepicker/calendar.css" ?>
<!-- CSS for selecting contacts to invite to event -->
<?xml-stylesheet href="chrome://calendar/skin/contactsSelectAddressesDialog.css" ?>
<!-- DTD File with all strings specific to the calendar -->
<!DOCTYPE dialog
[
<!ENTITY % dtd1 SYSTEM "chrome://calendar/locale/global.dtd" > %dtd1;
<!ENTITY % dtd2 SYSTEM "chrome://calendar/locale/calendar.dtd" > %dtd2;
<!ENTITY % dtd3 SYSTEM "chrome://calendar/locale/contactsSelectAddressesDialog.dtd" > %dtd3;
]>
<dialog
id="calendar-new-eventwindow"
title="Calendar Event"
onload="loadCalendarEventDialog()"
buttons="accept,cancel"
ondialogaccept="return onOKCommand();"
ondialogcancel="return true;"
persist="screenX screenY"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
xmlns:nc="http://home.netscape.com/NC-rdf#">
<!-- Javascript DTD To Variable -->
<script type="application/x-javascript">
var neStartTimeErrorAlertMessage = "&newevent.starttimeerror.alertmessage;";
var neRecurErrorAlertMessage = "&newevent.recurendtimeerror.alertmessage;";
var DTD_noEmailMessage = "&ab-selectAddressesDialogNoEmailMessage.label;";
var DTD_toPrefix = "&ab-selectAddressesDialogPrefixTo.label;";
</script>
<!-- Select addresses commands -->
<commandset id="selectAddressesCommands">
<command id="addToInviteList" oncommand="addSelectedAddressesIntoInviteBucket( '', '' );" disabled="true" />
<command id="removeFromInviteList" oncommand="removeSelectedFromInviteBucket();" disabled="true" />
</commandset>
<!-- Javascript includes -->
<script type="application/x-javascript" src="chrome://global/content/strres.js"/>
<script type="application/x-javascript" src="chrome://calendar/content/dateUtils.js"/>
<script type="application/x-javascript" src="chrome://calendar/content/calendarEventDialog.js"/>
<script type="application/x-javascript" src="chrome://calendar/content/contactsSelectAddressesDialog.js"/>
<script type="application/x-javascript" src="chrome://calendar/content/calendarEventDialogAttachFile.js"/>
<!-- needed to get the default categories -->
<script type="application/x-javascript" src="chrome://calendar/content/pref/rootCalendarPref.js"/>
<!-- Data used in JS from dtd -->
<dataset>
<data id="data-event-title-new" value="&event.title.new;" />
<data id="data-event-title-edit" value="&event.title.edit;" />
<data id="neStartTimeErrorAlertMessage" value="&newevent.starttimeerror.alertmessage;" />
<data id="onthe-text" value="&onthe-text;" />
<data id="last-text" value="&last-text;" />
<data id="ofthemonth-text" value="&ofthemonth-text;" />
</dataset>
<!-- Picker popups -->
<popup id="oe-time-picker-popup" position="after_start" oncommand="onTimePick( this )" value=""/>
<vbox id="standard-dialog-content" flex="1">
<tabbox>
<tabs>
<tab label="&newevent.newevent.tab.label;"/>
<tab label="&newevent.recurrence.tab.label;"/>
<tab label="&newevent.contacts.tab.label;" collapsed="true"/>
<tab label="&newevent.files.tab.label;" collapsed="true"/>
</tabs>
<tabpanels>
<tabpanel>
<grid>
<columns>
<column />
<column flex="1"/>
</columns>
<rows>
<!-- Title -->
<row align="center">
<hbox class="field-label-box-class" pack="end">
<label for="title-field" value="&newevent.title.label;"/>
</hbox>
<textbox id="title-field"/>
</row>
<!-- Location -->
<row align="center">
<hbox class="field-label-box-class" pack="end">
<label for="location-field" value="&newevent.location.label;"/>
</hbox>
<textbox id="location-field"/>
</row>
<!-- Start Date -->
<row align="center">
<hbox class="field-label-box-class" pack="end">
<label value="&newevent.startdate.label;"/>
</hbox>
<hbox id="start-date-box" align="center">
<datepicker id="start-date-picker" value="" ondatepick="onDatePick( this );updateEndDate( this );"/>
<textbox id="start-time-text" readonly="true" value="" onmousedown="prepareTimePicker('start-time-text')" popup="oe-time-picker-popup" position="after_start"/>
<image id="start-time-button" class="event-time-button-class" onmousedown="prepareTimePicker('start-time-text')" popup="oe-time-picker-popup" position="after_start"/>
</hbox>
</row>
<!-- End Date -->
<row align="center">
<hbox class="field-label-box-class" pack="end">
<label value="&newevent.enddate.label;"/>
</hbox>
<hbox id="end-date-box" align="center">
<datepicker id="end-date-picker" value="" ondatepick="updateDateDifference( this )"/>
<textbox id="end-time-text" readonly="true" value="" onmousedown="prepareTimePicker('end-time-text')" popup="oe-time-picker-popup" position="after_start"/>
<image id="end-time-button" class="event-time-button-class" onmousedown="prepareTimePicker('end-time-text')" popup="oe-time-picker-popup" position="after_start"/>
</hbox>
</row>
<!-- All Day -->
<row align="center">
<spacer />
<label id="end-time-warning" class="warning-text-class" value="&newevent.endtime.warning;" collapsed="true"/>
</row>
<!-- All Day -->
<row align="center">
<spacer />
<checkbox id="all-day-event-checkbox" label="&newevent.alldayevent.label;" checked="false" oncommand="commandAllDay()"/>
</row>
<!-- Description -->
<row flex="1" align="start">
<hbox class="field-label-box-class" pack="end">
<label for="description-field" value="&newevent.description.label;"/>
</hbox>
<textbox id="description-field" onkeypress="event.stopPropagation()" multiline="true" rows="3" cols="30" />
</row>
<!-- URI/URL -->
<row align="center">
<hbox class="field-label-box-class" pack="end">
<label for="uri-field" value="&newevent.uri.label;"/>
</hbox>
<hbox>
<textbox id="uri-field" flex="1"/>
<button label="&newevent.uri.visit.label;" oncommand="launchBrowser()"/>
</hbox>
</row>
<!-- Private -->
<row align="center">
<spacer />
<checkbox id="private-checkbox" checked="false" label="&newevent.private.label;"/>
</row>
<!-- Alarm -->
<row align="center">
<spacer />
<vbox>
<hbox id="alarm-box" align="center">
<checkbox id="alarm-checkbox" class="proper-align" label="&newevent.alarm.label;" checked="false" oncommand="commandAlarm()"/>
<textbox id="alarm-length-field" oninput="alarmLengthKeyDown( this )"/>
<menulist id="alarm-length-units" crop="none" labelnumber="labelplural">
<menupopup>
<menuitem label="&alarm.units.minutes;" labelplural="&alarm.units.minutes;" labelsingular="&alarm.units.minutes.singular;" value="minutes"/>
<menuitem label="&alarm.units.hours;" labelplural="&alarm.units.hours;" labelsingular="&alarm.units.hours.singular;" value="hours" />
<menuitem label="&alarm.units.days;" labelplural="&alarm.units.days;" labelsingular="&alarm.units.days.singular;" value="days"/>
</menupopup>
</menulist>
<label id="alarm-length-text" for="alarm-length-field" value="&newevent.beforealarm.label;"/>
</hbox>
<hbox id="alarm-box-email" align="center">
<spacer width="15"/>
<checkbox id="alarm-email-checkbox" label="&newevent.email.label;" checked="false" oncommand="commandAlarmEmail()"/>
<textbox id="alarm-email-field" size="39" value="" />
</hbox>
</vbox>
</row>
<!-- Calendar Status -->
<row align="center">
<hbox class="field-label-box-class" pack="end">
<label value="Event Status"/>
</hbox>
<menulist id="status-field" label="&newevent.status.label;">
<menupopup id="status-menulist-menupopup">
<menuitem label="&newevent.status.tentative.label;" value="ICAL_STATUS_TENTATIVE"/>
<menuitem label="&newevent.status.confirmed.label;" value="ICAL_STATUS_CONFIRMED"/>
<menuitem label="&newevent.status.cancelled.label;" value="ICAL_STATUS_CANCELLED"/>
</menupopup>
</menulist>
</row>
<!-- Categories -->
<row align="center">
<hbox class="field-label-box-class" pack="end">
<label value="&newtodo.categories.label;"/>
</hbox>
<menulist id="categories-field" label="&newevent.category.label;">
<menupopup id="categories-menulist-menupopup">
<menuitem label="&priority.level.none;" value="0"/>
</menupopup>
</menulist>
</row>
<!-- Calendar Server -->
<row align="center">
<hbox class="field-label-box-class" pack="end">
<label id="server-field-label" value="&newevent.server.label;"/>
</hbox>
<menulist id="server-field">
<menupopup id="server-menulist-menupopup" datasources="rdf:null" ref="urn:calendarcontainer">
<template>
<rule>
<menuitem uri="rdf:*" value="rdf:http://home.netscape.com/NC-rdf#path" label="rdf:http://home.netscape.com/NC-rdf#name"/>
</rule>
</template>
</menupopup>
</menulist>
</row>
</rows>
</grid>
</tabpanel>
<tabpanel>
<!-- Repeat -->
<vbox>
<hbox id="repeat-box" align="center">
<checkbox id="repeat-checkbox" class="proper-align" label="&newevent.repeat.label;" checked="false" oncommand="commandRepeat()"/>
<textbox id="repeat-length-field" class="cursor-pointer" disable-controller="repeat" value="1" oninput="repeatLengthKeyDown( this )"/>
<menulist crop="none" oncommand="repeatUnitCommand( this )" labelnumber="labelplural" id="repeat-length-units" disable-controller="repeat">
<menupopup>
<menuitem label="&repeat.units.days;" labelplural="&repeat.units.days;" labelsingular="&repeat.units.days.singular;" id="repeat-length-days" value="days" />
<menuitem label="&repeat.units.weeks;" labelplural="&repeat.units.weeks;" labelsingular="&repeat.units.weeks.singular;" id="repeat-length-weeks" value="weeks"/>
<menuitem label="&repeat.units.months;" labelplural="&repeat.units.months;" labelsingular="&repeat.units.months.singular;" id="repeat-length-months" value="months"/>
<menuitem label="&repeat.units.years;" labelplural="&repeat.units.years;" labelsingular="&repeat.units.years.singular;" id="repeat-length-years" value="years" />
</menupopup>
</menulist>
</hbox>
<hbox id="repeat-extenstions-week" disabled="true" disable-controller="repeat" collapsed="false" align="center">
<checkbox disable-controller="repeat" class="repeat-day-class" label="Sun" id="advanced-repeat-week-0" value="0" checked="false" />
<checkbox disable-controller="repeat" class="repeat-day-class" label="Mon" id="advanced-repeat-week-1" value="1" checked="false" />
<checkbox disable-controller="repeat" class="repeat-day-class" label="Tue" id="advanced-repeat-week-2" value="2" checked="false" />
<checkbox disable-controller="repeat" class="repeat-day-class" label="Wed" id="advanced-repeat-week-3" value="3" checked="false" />
<checkbox disable-controller="repeat" class="repeat-day-class" label="Thu" id="advanced-repeat-week-4" value="4" checked="false" />
<checkbox disable-controller="repeat" class="repeat-day-class" label="Fri" id="advanced-repeat-week-5" value="5" checked="false" />
<checkbox disable-controller="repeat" class="repeat-day-class" label="Sat" id="advanced-repeat-week-6" value="6" checked="false" />
</hbox>
<hbox id="repeat-extenstions-month" diabled="true" collapsed="true" align="center">
<vbox align="center">
<radiogroup id="advanced-repeat-month" disable-controller="repeat">
<radio disable-controller="repeat" id="advanced-repeat-dayofmonth" label="On the xth day of the month" selected="true"/>
<radio disable-controller="repeat" id="advanced-repeat-dayofweek" label="4th Tuesday of the month"/>
<radio disable-controller="repeat" id="advanced-repeat-dayofweek-last" label="Last Tuesday of the month" disabled="true"/>
</radiogroup>
</vbox>
</hbox>
<spacer height="10" />
<hbox align="center">
<spacer class="repeat-left-spacer" />
<radiogroup id="repeat-until-group" disable-controller="repeat">
<radio id="repeat-forever-radio" disable-controller="repeat" label="&newevent.forever.label;" oncommand="commandUntil()"/>
<hbox id="repeat-end-box" align="center">
<vbox>
<hbox>
<radio id="repeat-until-radio" disable-controller="repeat" label="&newevent.until.label;" oncommand="commandUntil()"/>
<spacer id="until-spacer"/>
<datepicker id="repeat-end-date-picker" value=""/>
</hbox>
<label id="repeat-time-warning" class="warning-text-class" value="&newevent.recurend.warning;" collapsed="true"/>
</vbox>
</hbox>
</radiogroup>
</hbox>
<hbox align="center">
<spacer class="repeat-left-spacer" />
<groupbox>
<caption label="&newevent.exceptions.caption;"/>
<grid>
<columns>
<column flex="1"/>
<column/>
</columns>
<rows>
<row>
<hbox align="center">
<datepicker id="exceptions-date-picker" disable-controller="repeat" value=""/>
</hbox>
<button id="exception-add-button" label="&newevent.addexceptions.label;" disable-controller="repeat" oncommand="addException()"/>
</row>
<row>
<listbox id="exception-dates-listbox" disable-controller="repeat" rows="4"/>
<vbox>
<button label="&newevent.deleteexceptions.label;" disable-controller="repeat" oncommand="removeSelectedExceptionDate()"/>
</vbox>
</row>
</rows>
</grid>
</groupbox>
</hbox>
</vbox>
<!-- /Repeat -->
</tabpanel>
<!-- Contacts panel -->
<tabpanel orient="vertical" collapsed="true">
<!-- Invite -->
<vbox collapsed="true">
<hbox id="invite-box" align="center">
<checkbox id="invite-checkbox" label="&newevent.invite.label;" checked="false" oncommand="commandInvite()"/>
<textbox id="invite-email-field" size="39" disabled="true"/>
</hbox>
</vbox>
<vbox flex="1">
<hbox id="topBox" align="center">
<label value="&ab-selectAddressesDialogLookIn.label;" />
<!-- Address book chooser -->
<menulist id="addressBookList" oncommand="onChooseAddressBookEventDialog( this );">
<menupopup id="addressBookList-menupopup" ref="moz-abdirectory://" datasources="rdf:addressdirectory">
<template>
<rule nc:IsMailList="false">
<menuitem uri="..."
label="rdf:http://home.netscape.com/NC-rdf#DirName"
value="rdf:http://home.netscape.com/NC-rdf#DirUri"/>
</rule>
</template>
</menupopup>
</menulist>
</hbox>
<hbox flex="1">
<!-- Existing addresses -->
<vbox id="resultsBox" flex="4">
<label value=" " />
<tree id="abResultsTree" flex="1" persist="height" hidecolumnpicker="true" seltype="multiple" onclick="this.contactsTree.onClick( event );" ondblclick="this.contactsTree.onDblClick( event );">
<treecols id="recipientTreeCols">
<treecol id="GeneratedName" sort-field="GeneratedName" class="sortDirectionIndicator" list-view-sort-field="true"
persist="ordinal width" flex="1" label="&ab-selectAddressesDialogNameColumn.label;" primary="true"/>
<splitter class="tree-splitter"/>
<treecol id="PrimaryEmail" sort-field="PrimaryEmail" class="sortDirectionIndicator" list-view-sort-field="true"
persist="ordinal width" flex="1" label="&ab-selectAddressesDialogEmailColumn.label;"/>
</treecols>
<treechildren />
</tree>
</vbox>
<!-- Add and remove buttons -->
<vbox id="addToBucketButtonBox">
<spacer flex="1" />
<button id="toButton" label="&ab-selectAddressesDialogInvite.label;" command="addToInviteList" />
<spacer />
<button id="remove" label="&ab-selectAddressesDialogUninvite.label;" class="dialog" command="removeFromInviteList" />
<spacer flex="1" />
</vbox>
<!-- Recipient list -->
<vbox id="bucketBox" flex="1">
<label value="&ab-selectAddressesDialogInviteList.label;"/>
<tree id="addressBucket" flex="1" seltype="multiple" hidecolumnpicker="true" onclick="selectEventRecipient( this );">
<treecols>
<treecol id="addressCol" flex="1" hideheader="true"/>
</treecols>
<treechildren id="bucketBody" flex="1"/>
</tree>
</vbox>
</hbox>
</vbox>
</tabpanel>
<tabpanel>
<listbox id="attachmentBucket" flex="1" rows="8"
onkeypress="if (event.keyCode == 8 || event.keyCode == 46) RemoveSelectedAttachment();"
onclick="AttachmentBucketClicked(event);"
ondragover="nsDragAndDrop.dragOver(event, attachmentBucketObserver);"
ondragdrop="nsDragAndDrop.drop(event, attachmentBucketObserver);"
ondragexit="nsDragAndDrop.dragExit(event, attachmentBucketObserver);"/>
<vbox>
<button onclick="AttachFile()" label="Choose File"/>
<button onclick="removeSelectedAttachment()" label="Remove Selected File"/>
<spacer flex="1"/>
</vbox>
</tabpanel>
</tabpanels>
</tabbox>
</vbox> <!-- standard-dialog-content -->
</dialog>

View File

@@ -1,257 +0,0 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
* The contents of this file are subject to the Netscape Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is Mozilla Communicator client code, released
* March 31, 1998.
*
* The Initial Developer of the Original Code is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998-1999 Netscape Communications Corporation. All
* Rights Reserved.
*/
/**
* In order to distinguish clearly globals that are initialized once when js load (static globals) and those that need to be
* initialize every time a compose window open (globals), I (ducarroz) have decided to prefix by s... the static one and
* by g... the other one. Please try to continue and repect this rule in the future. Thanks.
*/
/**
* static globals, need to be initialized only once
*/
var sPrefs = null;
var sPrefBranchInternal = null;
const kComposeAttachDirPrefName = "mail.compose.attach.dir";
// First get the preferences service
try {
var prefService = Components.classes["@mozilla.org/preferences-service;1"]
.getService(Components.interfaces.nsIPrefService);
sPrefs = prefService.getBranch(null);
sPrefBranchInternal = sPrefs.QueryInterface(Components.interfaces.nsIPrefBranchInternal);
}
catch (ex) {
dump("failed to preferences services\n");
}
function GetLastAttachDirectory()
{
var lastDirectory;
try {
lastDirectory = sPrefs.getComplexValue(kComposeAttachDirPrefName, Components.interfaces.nsILocalFile);
}
catch (ex) {
// this will fail the first time we attach a file
// as we won't have a pref value.
lastDirectory = null;
}
return lastDirectory;
}
// attachedLocalFile must be a nsILocalFile
function SetLastAttachDirectory(attachedLocalFile)
{
try {
var file = attachedLocalFile.QueryInterface(Components.interfaces.nsIFile);
var parent = file.parent.QueryInterface(Components.interfaces.nsILocalFile);
sPrefs.setComplexValue(kComposeAttachDirPrefName, Components.interfaces.nsILocalFile, parent);
}
catch (ex) {
dump("error: SetLastAttachDirectory failed: " + ex + "\n");
}
}
function AttachFile()
{
var currentAttachment = "";
//Get file using nsIFilePicker and convert to URL
try {
var nsIFilePicker = Components.interfaces.nsIFilePicker;
var fp = Components.classes["@mozilla.org/filepicker;1"].createInstance(nsIFilePicker);
fp.init(window, "Attach File", nsIFilePicker.modeOpen);
var lastDirectory = GetLastAttachDirectory();
if (lastDirectory)
fp.displayDirectory = lastDirectory;
fp.appendFilters(nsIFilePicker.filterAll);
if (fp.show() == nsIFilePicker.returnOK) {
currentAttachment = fp.fileURL.spec;
SetLastAttachDirectory(fp.file)
}
}
catch (ex) {
dump("failed to get the local file to attach\n");
}
if (currentAttachment == "")
return;
if (DuplicateFileCheck(currentAttachment))
{
dump("Error, attaching the same item twice\n");
}
else
{
var attachment = Components.classes["@mozilla.org/messengercompose/attachment;1"]
.createInstance(Components.interfaces.nsIMsgAttachment);
attachment.url = currentAttachment;
AddAttachment(attachment);
}
}
function AddAttachment(attachment)
{
if (attachment && attachment.url)
{
var bucket = document.getElementById("attachmentBucket");
var item = document.createElement("listitem");
if (!attachment.name)
attachment.name = attachment.url;
item.setAttribute("label", attachment.name); //use for display only
item.attachment = attachment; //full attachment object stored here
try {
item.setAttribute("tooltiptext", unescape(attachment.url));
} catch(e) {
item.setAttribute("tooltiptext", attachment.url);
}
item.setAttribute("class", "listitem-iconic");
item.setAttribute("image", "moz-icon:" + attachment.url);
bucket.appendChild(item);
}
}
function DuplicateFileCheck(FileUrl)
{
var bucket = document.getElementById('attachmentBucket');
for (var index = 0; index < bucket.childNodes.length; index++)
{
var item = bucket.childNodes[index];
var attachment = item.attachment;
if (attachment)
{
if (FileUrl == attachment.url)
return true;
}
}
return false;
}
function RemoveSelectedAttachment()
{
var child;
var bucket = document.getElementById("attachmentBucket");
if (bucket.selectedItems.length > 0) {
for (var item = bucket.selectedItems.length - 1; item >= 0; item-- )
{
child = bucket.removeChild(bucket.selectedItems[item]) = null;
// Let's release the attachment object hold by the node else it won't go away until the window is destroyed
child.attachment = null;
}
}
}
function AttachmentBucketClicked(event)
{
if (event.button != 0)
return;
if (event.originalTarget.localName == "listboxbody")
{
AttachFile();
}
}
var attachmentBucketObserver = {
canHandleMultipleItems: true,
onDrop: function (aEvent, aData, aDragSession)
{
var dataList = aData.dataList;
var dataListLength = dataList.length;
var errorTitle;
var attachment;
var errorMsg;
for (var i = 0; i < dataListLength; i++)
{
var item = dataList[i].first;
var prettyName;
var rawData = item.data;
if (item.flavour.contentType == "text/x-moz-url" ||
item.flavour.contentType == "text/x-moz-message-or-folder" ||
item.flavour.contentType == "application/x-moz-file")
{
if (item.flavour.contentType == "application/x-moz-file")
{
var ioService = Components.classes["@mozilla.org/network/io-service;1"]
.getService(Components.interfaces.nsIIOService);
rawData = ioService.getURLSpecFromFile(rawData);
}
else
{
var separator = rawData.indexOf("\n");
if (separator != -1)
{
prettyName = rawData.substr(separator+1);
rawData = rawData.substr(0,separator);
}
}
if (DuplicateFileCheck(rawData))
{
dump("Error, attaching the same item twice\n");
}
else
{
attachment = Components.classes["@mozilla.org/messengercompose/attachment;1"]
.createInstance(Components.interfaces.nsIMsgAttachment);
attachment.url = rawData;
attachment.name = prettyName;
AddAttachment(attachment);
}
}
}
},
onDragOver: function (aEvent, aFlavour, aDragSession)
{
var attachmentBucket = document.getElementById("attachmentBucket");
attachmentBucket.setAttribute("dragover", "true");
},
onDragExit: function (aEvent, aDragSession)
{
var attachmentBucket = document.getElementById("attachmentBucket");
attachmentBucket.removeAttribute("dragover");
},
getSupportedFlavours: function ()
{
var flavourSet = new FlavourSet();
flavourSet.appendFlavour("text/x-moz-url");
flavourSet.appendFlavour("text/x-moz-message-or-folder");
flavourSet.appendFlavour("application/x-moz-file", "nsIFile");
return flavourSet;
}
};

File diff suppressed because it is too large Load Diff

View File

@@ -1,165 +0,0 @@
<?xml version="1.0"?>
<!-- ***** BEGIN LICENSE BLOCK *****
- Version: MPL 1.1/GPL 2.0/LGPL 2.1
-
- The contents of this file are subject to the Mozilla Public License Version
- 1.1 (the "License"); you may not use this file except in compliance with
- the License. You may obtain a copy of the License at
- http://www.mozilla.org/MPL/
-
- Software distributed under the License is distributed on an "AS IS" basis,
- WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- for the specific language governing rights and limitations under the
- License.
-
- The Original Code is OEone Calendar Code, released October 31st, 2001.
-
- The Initial Developer of the Original Code is
- OEone Corporation.
- Portions created by the Initial Developer are Copyright (C) 2001
- the Initial Developer. All Rights Reserved.
-
- Contributor(s): Colin Phillips <colinp@oeone.com>
- Dan Parent <danp@oeone.com>
-
- Alternatively, the contents of this file may be used under the terms of
- either the GNU General Public License Version 2 or later (the "GPL"), or
- the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- in which case the provisions of the GPL or the LGPL are applicable instead
- of those above. If you wish to allow use of your version of this file only
- under the terms of either the GPL or the LGPL, and not to allow others to
- use your version of this file under the terms of the MPL, indicate your
- decision by deleting the provisions above and replace them with the notice
- and other provisions required by the LGPL or the GPL. If you do not delete
- the provisions above, a recipient may use your version of this file under
- the terms of any one of the MPL, the GPL or the LGPL.
-
- ***** END LICENSE BLOCK ***** -->
<?xul-overlay href="chrome://global/content/globalOverlay.xul"?>
<?xul-overlay href="chrome://communicator/content/utilityOverlay.xul"?>
<?xul-overlay href="chrome://communicator/content/tasksOverlay.xul"?>
<?xul-overlay href="chrome://global/content/charsetOverlay.xul"?>
<!DOCTYPE overlay
[
<!ENTITY % navigatorDTD SYSTEM "chrome://navigator/locale/navigator.dtd" > %navigatorDTD;
<!ENTITY % calendarDTD SYSTEM "chrome://calendar/locale/calendar.dtd" > %calendarDTD;
<!ENTITY % calendarMenuOverlayDTD SYSTEM "chrome://calendar/locale/calendarMenuOverlay.dtd" > %calendarMenuOverlayDTD;
]>
<overlay id="calendarOverlay"
xmlns:html="http://www.w3.org/1999/xhtml"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<commandset id="commands">
<command id="cmd_quit"/>
<command id="cmd_close" oncommand="BrowserClose()"/>
<!-- Edit Menu -->
<command id="cmd_undo"/>
<command id="cmd_redo"/>
<command id="cmd_cut"/>
<command id="cmd_copy"/>
<command id="cmd_paste"/>
<command id="cmd_delete"/>
<command id="cmd_selectAll"/>
<!-- Search Menu -->
<command id="Browser:Find" oncommand="BrowserFind();" />
<command id="Browser:FindAgain" oncommand="BrowserFindAgain();" />
<commandset id="tasksCommands"/>
</commandset>
<!-- Keysets -->
<keyset id="navKeys">
<!-- File Menu -->
<key id="key_close"/>
<!-- Edit Menu -->
<key id="key_undo"/>
<key id="key_redo"/>
<key id="key_cut"/>
<key id="key_copy"/>
<key id="key_paste"/>
<key id="key_delete"/>
<key id="key_selectAll"/>
<!-- Search Menu -->
<key id="key_find" key="&findOnCmd.commandkey;" command="Browser:Find" modifiers="accel"/>
<key id="key_findAgain" key="&findAgainCmd.commandkey;" command="Browser:FindAgain" modifiers="accel"/>
</keyset>
<keyset id="tasksKeys">
<key id="key_quit"/>
</keyset>
<!-- Menu -->
<menubar id="main-menubar" class="chromeclass-menubar">
<menu id="menu_File">
<menupopup id="menu_FilePopup">
<menuitem id="calendar-new-event-menu" key="new_event_key" label="&event.new.event;" observes="new_command"/>
<menuitem id="calendar-new-todo-menu" key="new_todo_key" label="&event.new.todo;" observes="new_todo_command"/>
<menuitem id="calendar-new-calendar-menu" key="new_calendar_key" label="&calendar.context.newserver.label;" observes="new_server_command"/>
<menuitem id="unifinder-modify-menu" key="modify_event_key" label="&event.edit.event;" observes="modify_command"/>
<menuitem id="calendar-close" observes="close_calendar_command" label="&calendar.menu.options.close;"/>
<menuseparator/>
<menuitem id="calendar-mail-event" observes="send_event_command" label="&event.mail.event;"/>
<menuseparator/>
<menuitem id="calendar-print-menu" observes="print_command" label="&calendar.print.label;"/>
</menupopup>
</menu>
<menu id="menu_Edit">
<menupopup id="mppEdit">
<menuitem id="calendar-cut-menu" key="key_cut" label="&calendar.cut.label;" accesskey="&calendar.cut.accesskey;" observes="cut_command" />
<menuitem id="calendar-copy-menu" key="key_copy" label="&calendar.copy.label;" accesskey="&calendar.copy.accesskey;" observes="copy_command" />
<menuitem id="calendar-paste-menu" key="key_paste" label="&calendar.paste.label;" accesskey="&calendar.paste.accesskey;" observes="paste_command"/>
<menuitem id="unifinder-remove-menu" key="delete_key" label="&event.delete.event;" observes="delete_command" />
<menuseparator/>
<menuitem id="calendar-selectall-menu" key="key_selectAll" label="&calendar.selectall.label;" accesskey="&calendar.selectall.accesskey;" observes="select_all_command"/>
<menuseparator/>
<menuitem id="calendar-edit-preferences" label="&calendar.preferences.label;" accesskey="&calendar.preferences.accesskey;" oncommand="launchPreferences()"/>
</menupopup>
</menu>
<menu id="menu_View">
<menupopup id="mppView">
<menuitem id="calendar-view-menu-day" key="view_day_key" label="&calendar.flat.topbar.dayview;" accesskey="d" observes="day_view_command"/>
<menuitem id="calendar-view-menu-week" key="view_week_key" label="&calendar.flat.topbar.weekview;" accesskey="w" observes="week_view_command"/>
<menuitem id="calendar-view-menu-month" key="view_month_key" label="&calendar.flat.topbar.monthview;" accesskey="m" observes="month_view_command"/>
</menupopup>
</menu>
<menu id="menu_Go" label="&goMenu.label;" accesskey="&goMenu.accesskey;">
<menupopup id="mppView">
<menuitem id="calendar-view-menu-today" key="go_to_today_key" label="&goTodayCmd.label;" accesskey="&goTodayCmd.accesskey;" observes="go_today_command"/>
<menuitem id="calendar-view-menu-previous" key="go_backward_key" label="&goPreviousCmd.label;" accesskey="&goPreviousCmd.accesskey;" observes="previous_command"/>
<menuitem id="calendar-view-menu-next" key="go_forward_key" label="&goNextCmd.label;" accesskey="&goNextCmd.accesskey;" observes="next_command"/>
</menupopup>
</menu>
<menu id="tasksMenu">
<menupopup id="taskPopup">
<menuitem id="calendar-wizard-menu" key="wizard_key" label="Launch Wizard" observes="wizard_command"/>
<menuitem id="calendar-import-menu" key="import_key" label="&calendar.import.label;" accesskey="&calendar.import.accesskey;" observes="import_command"/>
<menuitem id="calendar-export-menu" key="export_key" label="&calendar.export.label;" accesskey="&calendar.export.accesskey;" observes="export_command"/>
<menuitem id="calendar-addserver-menu" label="&calendar.subscribe.label;" observes="new_server_command"/>
<menuitem id="calendar-publish-menu" label="&calendar.publish.label;" observes="publish_events_command"/>
<menuseparator/>
</menupopup>
</menu>
<menu id="windowMenu"/>
<menu accesskey="&helpMenuCmd.accesskey;" id="menu_Help">
<menupopup id="helpPopup">
<menuitem id="releaseUrl"/>
<menuseparator id="menu_HelpAboutSeparator"/>
<menuitem id="calendar-about-menu-item" label="&calendar.about.label;" accesskey="&calendar.about.accesskey;" oncommand="displayCalendarVersion()"/>
</menupopup>
</menu>
</menubar>
</overlay>

View File

@@ -1,934 +0,0 @@
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is OEone Calendar Code, released October 31st, 2001.
*
* The Initial Developer of the Original Code is
* OEone Corporation.
* Portions created by the Initial Developer are Copyright (C) 2001
* the Initial Developer. All Rights Reserved.
*
* Contributor(s): Garth Smedley <garths@oeone.com>
* Mike Potter <mikep@oeone.com>
* Karl Guertin <grayrest@grayrest.com>
* Colin Phillips <colinp@oeone.com>
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
/*-----------------------------------------------------------------
* MonthView Class subclass of CalendarView
*
* Calendar month view class
*
* PROPERTIES
* selectedEventBox - Events are displayed in dynamically created event boxes
* this is the selected box, or null
*
* showingLastDay - When the user changes to a new month we select
* the same day in the new month that was selected in the original month. If the
* new month does not have that day ( i.e. 31 was selected and the new month has
* only 30 days ) we move the selection to the last day. When this happens we turn on
* the 'showingLastDay' flag. Now we will always select the last day when the month
* is changed so that if they go back to the original month, 31 is selected again.
* 'showingLastDay' is turned off when the user selects a new day or changes the view.
*
*
* dayNumberItemArray - An array [ 0 to 41 ] of text boxes that hold the day numbers in the month view.
* We set the value attribute to the day number, or "" for boxes that are not in the month.
* In the XUL they have id's of the form month-week-<row_number>-day-<column_number>
* where row_number is 1 - 6 and column_number is 1 - 7.
*
* dayBoxItemArray - An array [ 0 to 41 ] of boxes, one for each day in the month view. These boxes
* are selected when a day is selected. They contain a dayNumberItem and event boxes.
* In the XUL they have id's of the form month-week-<row_number>-day-<column_number>-box
* where row_number is 1 - 6 and column_number is 1 - 7.
*
* dayBoxItemByDateArray - This array is reconstructed whenever the month changes ( and probably more
* often than that ) It contains day box items, just like the dayBoxItemArray above,
* except this array contains only those boxes that belong to the current month
* and is indexed by date. So for a 30 day month that starts on a Wednesday,
* dayBoxItemByDateArray[0] === dayBoxItemArray[3] and
* dayBoxItemByDateArray[29] === dayBoxItemArray[36]
*
* kungFooDeathGripOnEventBoxes - This is to keep the event box javascript objects around so when we get
* them back they still have the calendar event property on them.
*
*
* NOTES
*
* Events are displayed in dynamically created event boxes. these boxes have a property added to them
* called "calendarEvent" which contains the event represented by the box.
*
* There is one day box item for every day box in the month grid. These have an attribute
* called "empty" which is set to "true", like so:
*
* dayBoxItem.setAttribute( "empty" , "true" );
*
* when the day box is not in the month. This allows the display to be controlled from css.
*
* The day boxes also have a couple of properties added to them:
*
* dayBoxItem.dayNumber - null when day is not in month.
* - the date, 1 to 31, otherwise,
*
* dayBoxItem.numEvents - The number of events for the day, used to limit the number displayed
* since there is only room for 3.
*
*/
// Make MonthView inherit from CalendarView
MonthView.prototype = new CalendarView();
MonthView.prototype.constructor = MonthView;
/**
* MonthView Constructor.
*
* PARAMETERS
* calendarWindow - the owning instance of CalendarWindow.
*
*/
function MonthView( calendarWindow )
{
// call the super constructor
this.superConstructor( calendarWindow );
this.numberOfEventsToShow = false;
var monthViewEventSelectionObserver =
{
onSelectionChanged : function( EventSelectionArray )
{
dump( "\nIn Month view, on selection changed");
if( EventSelectionArray.length > 0 )
{
//if there are selected events.
//for some reason, this function causes the tree to go into a select / unselect loop
//putting it in a settimeout fixes this.
setTimeout( "gCalendarWindow.monthView.clearSelectedDate();", 1 );
gCalendarWindow.monthView.clearSelectedBoxes();
//dump( "\nIn Month view, eventSelectionArray.length is "+EventSelectionArray.length );
var i = 0;
for( i = 0; i < EventSelectionArray.length; i++ )
{
//dump( "\nin Month view, going to try and get the event boxes with name 'month-view-event-box-"+EventSelectionArray[i].id+"'" );
var EventBoxes = document.getElementsByAttribute( "name", "month-view-event-box-"+EventSelectionArray[i].id );
//dump( "\nIn Month view, found "+EventBoxes.length+" matches for the selected event." );
for ( j = 0; j < EventBoxes.length; j++ )
{
EventBoxes[j].setAttribute( "eventselected", "true" );
}
}
//dump( "\nAll Done in Selection for Month View" );
}
else
{
//select the proper day
gCalendarWindow.monthView.hiliteSelectedDate();
}
}
}
calendarWindow.EventSelection.addObserver( monthViewEventSelectionObserver );
this.showingLastDay = false;
// set up month day box's and day number text items, see notes above
this.dayNumberItemArray = new Array();
this.dayBoxItemArray = new Array();
this.kungFooDeathGripOnEventBoxes = new Array();
this.dayBoxItemByDateArray = new Array();
var dayItemIndex = 0;
for( var weekIndex = 1; weekIndex <= 6; ++weekIndex )
{
for( var dayIndex = 1; dayIndex <= 7; ++dayIndex )
{
// add the day text item to an array[0..41]
var dayNumberItem = document.getElementById( "month-week-" + weekIndex + "-day-" + dayIndex );
this.dayNumberItemArray[ dayItemIndex ] = dayNumberItem;
// add the day box to an array[0..41]
var dayBoxItem = document.getElementById( "month-week-" + weekIndex + "-day-" + dayIndex + "-box" );
this.dayBoxItemArray[ dayItemIndex ] = dayBoxItem;
// set on click of day boxes
dayBoxItem.setAttribute( "onclick", "gCalendarWindow.monthView.clickDay( event )" );
dayBoxItem.setAttribute( "oncontextmenu", "gCalendarWindow.monthView.contextClickDay( event )" );
//set the drop
dayBoxItem.setAttribute( "ondragdrop", "nsDragAndDrop.drop(event,monthViewEventDragAndDropObserver)" );
dayBoxItem.setAttribute( "ondragover", "nsDragAndDrop.dragOver(event,monthViewEventDragAndDropObserver)" );
//set the double click of day boxes
dayBoxItem.setAttribute( "ondblclick", "gCalendarWindow.monthView.doubleClickDay( event )" );
// array index
++dayItemIndex;
}
}
}
/** PUBLIC
*
* Redraw the events for the current month
*
* We create XUL boxes dynamically and insert them into the XUL.
* To refresh the display we remove all the old boxes and make new ones.
*/
MonthView.prototype.refreshEvents = function monthView_refreshEvents( )
{
// get this month's events and display them
var monthEventList = this.calendarWindow.eventSource.getEventsForMonth( this.calendarWindow.getSelectedDate() );
// remove old event boxes
var eventBoxList = document.getElementsByAttribute( "eventbox", "monthview" );
var eventBox = null;
for( var eventBoxIndex = 0; eventBoxIndex < eventBoxList.length; ++eventBoxIndex )
{
eventBox = eventBoxList[ eventBoxIndex ];
eventBox.parentNode.removeChild( eventBox );
}
// clear calendarEvent counts, we only display 3 events per day
// count them by adding a property to the dayItem, which is zeroed here
for( var dayItemIndex = 0; dayItemIndex < this.dayBoxItemArray.length; ++dayItemIndex )
{
var dayItem = this.dayBoxItemArray[ dayItemIndex ];
dayItem.numEvents = 0;
}
this.kungFooDeathGripOnEventBoxes = new Array();
// add each calendarEvent
for( var eventIndex = 0; eventIndex < monthEventList.length; ++eventIndex )
{
var calendarEventDisplay = monthEventList[ eventIndex ];
var eventDate = new Date( calendarEventDisplay.displayDate );
// get the day box for the calendarEvent's day
var eventDayInMonth = eventDate.getDate();
var dayBoxItem = this.dayBoxItemByDateArray[ eventDayInMonth ];
if( !dayBoxItem )
break;
// Display no more than three, show dots for the events > 3
dayBoxItem.numEvents += 1;
if( this.numberOfEventsToShow == false && dayBoxItem.numEvents > 1 )
{
this.setNumberOfEventsToShow();
}
if( dayBoxItem.numEvents == 1 || dayBoxItem.numEvents < this.numberOfEventsToShow )
{
// Make a box item to hold the event
eventBox = document.createElement( "box" );
eventBox.setAttribute( "id", "month-view-event-box-"+calendarEventDisplay.event.id );
eventBox.setAttribute( "name", "month-view-event-box-"+calendarEventDisplay.event.id );
eventBox.setAttribute( "event"+calendarEventDisplay.event.id, true );
eventBox.setAttribute( "class", "month-day-event-box-class" );
if( calendarEventDisplay.event.categories && calendarEventDisplay.event.categories != "" )
{
eventBox.setAttribute( calendarEventDisplay.event.categories, "true" );
}
eventBox.setAttribute( "eventbox", "monthview" );
eventBox.setAttribute( "onclick", "monthEventBoxClickEvent( this, event )" );
eventBox.setAttribute( "ondblclick", "monthEventBoxDoubleClickEvent( this, event )" );
eventBox.setAttribute( "onmouseover", "gCalendarWindow.changeMouseOverInfo( calendarEventDisplay, event )" );
eventBox.setAttribute( "tooltip", "eventTooltip" );
eventBox.setAttribute( "ondraggesture", "nsDragAndDrop.startDrag(event,monthViewEventDragAndDropObserver);" );
// add a property to the event box that holds the calendarEvent that the
// box represents
eventBox.calendarEventDisplay = calendarEventDisplay;
this.kungFooDeathGripOnEventBoxes.push( eventBox );
// Make a text item to show the event title
var eventBoxText = document.createElement( "label" );
eventBoxText.setAttribute( "crop", "end" );
eventBoxText.setAttribute( "class", "month-day-event-text-class" );
eventBoxText.setAttribute( "value", calendarEventDisplay.event.title );
//you need this flex in order for text to crop
eventBoxText.setAttribute( "flex", "1" );
eventBoxText.setAttribute( "ondraggesture", "nsDragAndDrop.startDrag(event,monthViewEventDragAndDropObserver);" );
// add the text to the event box and the event box to the day box
eventBox.appendChild( eventBoxText );
dayBoxItem.appendChild( eventBox );
}
else
{
//if there is not a box to hold the little dots for this day...
if ( !document.getElementById( "dotboxholder"+calendarEventDisplay.event.start.day ) )
{
//make one
dotBoxHolder = document.createElement( "hbox" );
dotBoxHolder.setAttribute( "id", "dotboxholder"+calendarEventDisplay.event.start.day );
dotBoxHolder.setAttribute( "eventbox", "monthview" );
//add the box to the day.
dayBoxItem.appendChild( dotBoxHolder );
}
else
{
//otherwise, get the box
dotBoxHolder = document.getElementById( "dotboxholder"+calendarEventDisplay.event.start.day );
}
if( dotBoxHolder.childNodes.length < kMAX_NUMBER_OF_DOTS_IN_MONTH_VIEW )
{
eventDotBox = document.createElement( "box" );
eventDotBox.setAttribute( "eventbox", "monthview" );
//show a dot representing an event.
//NOTE: This variable is named eventBox because it needs the same name as
// the regular boxes, for the next part of the function!
eventBox = document.createElement( "image" );
eventBox.setAttribute( "class", "month-view-event-dot-class" );
eventBox.setAttribute( "id", "month-view-event-box-"+calendarEventDisplay.event.id );
eventBox.setAttribute( "name", "month-view-event-box-"+calendarEventDisplay.event.id );
eventBox.calendarEventDisplay = calendarEventDisplay;
eventBox.setAttribute( "onmouseover", "gCalendarWindow.changeMouseOverInfo( calendarEventDisplay, event )" );
eventBox.setAttribute( "onclick", "monthEventBoxClickEvent( this, event )" );
eventBox.setAttribute( "ondblclick", "monthEventBoxDoubleClickEvent( this, event )" );
eventBox.setAttribute( "tooltip", "eventTimeViewTooltip" );
this.kungFooDeathGripOnEventBoxes.push( eventBox );
//add the dot to the extra box.
eventDotBox.appendChild( eventBox );
dotBoxHolder.appendChild( eventDotBox );
}
}
// mark the box as selected, if the event is
if( this.calendarWindow.EventSelection.isSelectedEvent( calendarEventDisplay.event ) )
{
this.selectBoxForEvent( calendarEventDisplay.event );
}
}
}
/** PUBLIC
*
* Called when the user switches to a different view
*/
MonthView.prototype.switchFrom = function monthView_switchFrom( )
{
}
/** PUBLIC
*
* Called when the user switches to the month view
*/
MonthView.prototype.switchTo = function monthView_switchTo( )
{
// see showingLastDay notes above
this.showingLastDay = false;
// disable/enable view switching buttons
var weekViewButton = document.getElementById( "week_view_command" );
var monthViewButton = document.getElementById( "month_view_command" );
var dayViewButton = document.getElementById( "day_view_command" );
monthViewButton.setAttribute( "disabled", "true" );
weekViewButton.removeAttribute( "disabled" );
dayViewButton.removeAttribute( "disabled" );
// switch views in the deck
var calendarDeckItem = document.getElementById( "calendar-deck" );
calendarDeckItem.selectedIndex = 0;
}
/** PUBLIC
*
* Redraw the display, but not the events
*/
MonthView.prototype.refreshDisplay = function monthView_refreshDisplay( )
{
// set the month/year in the header
var selectedDate = this.calendarWindow.getSelectedDate();
var newMonth = selectedDate.getMonth();
var newYear = selectedDate.getFullYear();
var titleMonthArray = new Array();
var titleYearArray = new Array();
var toDebug = "";
for (var i=-2; i < 3; i++){
titleMonthArray[i] = newMonth + i;
titleMonthArray[i] = (titleMonthArray[i] >= 0)? titleMonthArray[i] % 12 : titleMonthArray[i] + 12;
titleMonthArray[i] = this.calendarWindow.dateFormater.getMonthName( titleMonthArray[i] );
var idName = i + "-month-title";
document.getElementById( idName ).setAttribute( "value" , titleMonthArray[i] );
}
document.getElementById( "0-year-title" ).setAttribute( "value" , newYear );
var Offset = getIntPref(this.calendarWindow.calendarPreferences.calendarPref, "week.start", 0 );
var NewArrayOfDayNames = new Array();
for( i = 0; i < ArrayOfDayNames.length; i++ )
{
NewArrayOfDayNames[i] = ArrayOfDayNames[i];
}
for( i = 0; i < Offset; i++ )
{
var FirstElement = NewArrayOfDayNames.shift();
NewArrayOfDayNames.push( FirstElement );
}
//set the day names
for( i = 1; i <= 7; i++ )
{
document.getElementById( "month-view-header-day-"+i ).value = NewArrayOfDayNames[ (i-1) ];
}
// Write in all the day numbers and create the dayBoxItemByDateArray, see notes above
// figure out first and last days of the month
var firstDate = new Date( newYear, newMonth, 1 );
var firstDayOfWeek = firstDate.getDay() - Offset;
if( firstDayOfWeek < 0 )
firstDayOfWeek+=7;
var lastDayOfMonth = DateUtils.getLastDayOfMonth( newYear, newMonth );
// prepare the dayBoxItemByDateArray, we will be filling this in
this.dayBoxItemByDateArray = new Array();
// loop through all the day boxes
var dayNumber = 1;
for( var dayIndex = 0; dayIndex < this.dayNumberItemArray.length; ++dayIndex )
{
var dayNumberItem = this.dayNumberItemArray[ dayIndex ];
var dayBoxItem = this.dayBoxItemArray[ dayIndex ];
var thisDate;
if( dayIndex < firstDayOfWeek || dayNumber > lastDayOfMonth )
{
// this day box is NOT in the month,
dayBoxItem.dayNumber = null;
dayBoxItem.setAttribute( "empty" , "true" );
dayBoxItem.removeAttribute( "weekend" );
if( dayIndex < firstDayOfWeek )
{
thisDate = new Date( newYear, newMonth, 1-(firstDayOfWeek - dayIndex ) );
dayBoxItem.date = thisDate;
dayNumberItem.setAttribute( "value" , thisDate.getDate() );
}
else
{
thisDate = new Date( newYear, newMonth, lastDayOfMonth+( dayIndex - lastDayOfMonth - firstDayOfWeek + 1 ) );
dayBoxItem.date = thisDate;
dayBoxItem.setAttribute( "date", thisDate );
dayNumberItem.setAttribute( "value" , thisDate.getDate() );
}
}
else
{
dayNumberItem.setAttribute( "value" , dayNumber );
dayBoxItem.removeAttribute( "empty" );
thisDate = new Date( newYear, newMonth, dayNumber );
if( thisDate.getDay() == 0 | thisDate.getDay() == 6 )
{
dayBoxItem.setAttribute( "weekend", "true" );
}
else
dayBoxItem.removeAttribute( "weekend" );
dayBoxItem.dayNumber = dayNumber;
this.dayBoxItemByDateArray[ dayNumber ] = dayBoxItem;
++dayNumber;
}
}
// if we aren't showing an event, highlite the selected date.
if ( this.calendarWindow.EventSelection.selectedEvents.length < 1 )
{
this.hiliteSelectedDate( );
}
//always highlight today's date.
this.hiliteTodaysDate( );
}
/** PRIVATE
*
* Mark the selected date, also unmark the old selection if there was one
*/
MonthView.prototype.hiliteSelectedDate = function monthView_hiliteSelectedDate( )
{
// Clear the old selection if there was one
this.clearSelectedDate();
this.clearSelectedBoxes();
// Set the background for selection
var ThisBox = this.dayBoxItemByDateArray[ this.calendarWindow.getSelectedDate().getDate() ];
if( ThisBox )
ThisBox.setAttribute( "monthselected" , "true" );
}
/** PUBLIC
*
* Unmark the selected date if there is one.
*/
MonthView.prototype.clearSelectedDate = function monthView_clearSelectedDate( )
{
var SelectedBoxes = document.getElementsByAttribute( "monthselected", "true" );
for( var i = 0; i < SelectedBoxes.length; i++ )
{
SelectedBoxes[i].removeAttribute( "monthselected" );
}
}
/** PUBLIC
*
* Unmark the selected date if there is one.
*/
MonthView.prototype.clearSelectedBoxes = function monthView_clearSelectedBoxes( )
{
var SelectedBoxes = document.getElementsByAttribute( "eventselected", "true" );
for( var i = 0; i < SelectedBoxes.length; i++ )
{
SelectedBoxes[i].removeAttribute( "eventselected" );
}
}
/** PRIVATE
*
* Mark today as selected, also unmark the old today if there was one.
*/
MonthView.prototype.hiliteTodaysDate = function monthView_hiliteTodaysDate( )
{
var Month = this.calendarWindow.getSelectedDate().getMonth();
var Year = this.calendarWindow.getSelectedDate().getFullYear();
// Clear the old selection if there was one
var TodayBox = document.getElementsByAttribute( "today", "true" );
for( var i = 0; i < TodayBox.length; i++ )
{
TodayBox[i].removeAttribute( "today" );
}
//highlight today.
var Today = new Date( );
if ( Year == Today.getFullYear() && Month == Today.getMonth() )
{
var ThisBox = this.dayBoxItemByDateArray[ Today.getDate() ];
if( ThisBox )
ThisBox.setAttribute( "today", "true" );
}
}
/** PUBLIC
*
* This is called when we are about the make a new event
* and we want to know what the default start date should be for the event.
*/
MonthView.prototype.getNewEventDate = function monthView_getNewEventDate( )
{
// use the selected year, month and day
// and the current hours and minutes
var now = new Date();
var start = new Date( this.calendarWindow.getSelectedDate() );
start.setHours( now.getHours() );
start.setMinutes( Math.ceil( now.getMinutes() / 5 ) * 5 );
start.setSeconds( 0 );
return start;
}
/** PUBLIC
*
* Moves goMonths months in the future, goes to next month if no argument.
*/
MonthView.prototype.goToNext = function monthView_goToNext( goMonths )
{
var nextMonth;
if(goMonths){
nextMonth = new Date( this.calendarWindow.selectedDate.getFullYear(), this.calendarWindow.selectedDate.getMonth() + goMonths, 1 );
this.adjustNewMonth( nextMonth );
this.goToDay( nextMonth );
}else{
nextMonth = new Date( this.calendarWindow.selectedDate.getFullYear(), this.calendarWindow.selectedDate.getMonth() + 1, 1 );
this.adjustNewMonth( nextMonth );
this.goToDay( nextMonth );
}
}
/** PUBLIC
*
* Goes goMonths months into the past, goes to the previous month if no argument.
*/
MonthView.prototype.goToPrevious = function monthView_goToPrevious( goMonths )
{
var prevMonth;
if(goMonths){
prevMonth = new Date( this.calendarWindow.selectedDate.getFullYear(), this.calendarWindow.selectedDate.getMonth() - goMonths, 1 );
this.adjustNewMonth( prevMonth );
this.goToDay( prevMonth );
}else{
prevMonth = new Date( this.calendarWindow.selectedDate.getFullYear(), this.calendarWindow.selectedDate.getMonth() - 1, 1 );
this.adjustNewMonth( prevMonth );
this.goToDay( prevMonth );
}
}
/** PRIVATE
*
* Helper function for goToNext and goToPrevious
*
* When the user changes to a new month the new month may not have the selected day in it.
* ( i.e. 31 was selected and the new month has only 30 days ).
* In that case our addition, or subtraction, in goToNext or goToPrevious will cause the
* date to jump a month. ( Say the date starts at May 31, we add 1 to the month, Now the
* date would be June 31, but the Date object knows there is no June 31, so it sets itself
* to July 1. )
*
* In goToNext or goToPrevious we set the date to be 1, so the month will be correct. Here
* we set the date to be the selected date, making adjustments if the selected date is not in the month.
*/
MonthView.prototype.adjustNewMonth = function monthView_adjustNewMonth( newMonth )
{
// Don't let a date beyond the end of the month make us jump
// too many or too few months
var lastDayOfMonth = DateUtils.getLastDayOfMonth( newMonth.getFullYear(), newMonth.getMonth() );
if( this.calendarWindow.selectedDate.getDate() > lastDayOfMonth )
{
// The selected date is NOT in the month
// set it to the last day of the month and turn on showingLastDay, see notes in MonthView class
newMonth.setDate( lastDayOfMonth )
this.showingLastDay = true;
}
else if( this.showingLastDay )
{
// showingLastDay is on so select the last day of the month, see notes in MonthView class
newMonth.setDate( lastDayOfMonth )
}
else
{
// date is NOT beyond the last.
newMonth.setDate( this.calendarWindow.selectedDate.getDate() )
}
}
/** PUBLIC -- monthview only
*
* Called when a day box item is single clicked
*/
MonthView.prototype.clickDay = function monthView_clickDay( event )
{
if( event.button > 0 )
return;
var dayBoxItem = event.currentTarget;
if( dayBoxItem.dayNumber != null && event.detail == 1 )
{
// turn off showingLastDay - see notes in MonthView class
this.showingLastDay = false;
// change the selected date and redraw it
var newDate = this.calendarWindow.getSelectedDate();
newDate.setDate( dayBoxItem.dayNumber );
this.calendarWindow.setSelectedDate( newDate );
//changing the selection will redraw the day as selected (colored blue) in the month view.
//therefor, this has to happen after setSelectedDate
gCalendarWindow.EventSelection.emptySelection();
}
}
/** PUBLIC -- monthview only
*
* Called when a day box item is single clicked
*/
MonthView.prototype.contextClickDay = function monthView_contextClickDay( event )
{
var dayBoxItem = event.currentTarget;
if( dayBoxItem.dayNumber != null )
{
// turn off showingLastDay - see notes in MonthView class
this.showingLastDay = false;
// change the selected date and redraw it
gNewDateVariable = gCalendarWindow.getSelectedDate();
gNewDateVariable.setDate( dayBoxItem.dayNumber );
}
}
/*
** Don't forget that clickDay gets called before double click day gets called
*/
MonthView.prototype.doubleClickDay = function monthView_doubleClickDay( event )
{
if( event.button > 0 )
return;
if ( event.currentTarget.dayNumber != null )
{
// change the selected date and redraw it
var startDate = this.getNewEventDate();
newEvent( startDate, false );
}
else
{
newEvent( dayBoxItem.date, false );
}
}
MonthView.prototype.clearSelectedEvent = function monthView_clearSelectedEvent( )
{
var ArrayOfBoxes = document.getElementsByAttribute( "eventselected", "true" );
for( i = 0; i < ArrayOfBoxes.length; i++ )
{
ArrayOfBoxes[i].removeAttribute( "eventselected" );
}
}
MonthView.prototype.getVisibleEvent = function monthView_getVisibleEvent( calendarEvent )
{
var eventBox = document.getElementById( "month-view-event-box-"+calendarEvent.id );
if ( eventBox )
{
return eventBox;
}
else
return false;
}
MonthView.prototype.selectBoxForEvent = function monthView_selectBoxForEvent( calendarEvent )
{
var EventBoxes = document.getElementsByAttribute( "name", "month-view-event-box-"+calendarEvent.id );
for ( j = 0; j < EventBoxes.length; j++ )
{
EventBoxes[j].setAttribute( "eventselected", "true" );
}
}
/*Just calls setCalendarSize, it's here so it can be implemented on the other two views without difficulty.*/
MonthView.prototype.doResize = function monthView_doResize( )
{
this.setCalendarSize(this.getViewHeight());
this.setNumberOfEventsToShow();
}
/*Takes in a height, sets the calendar's container box to that height, the grid expands and contracts to fit it.*/
MonthView.prototype.setCalendarSize = function monthView_setCalendarSize( height )
{
var offset = document.defaultView.getComputedStyle(document.getElementById("month-controls-box"), "").getPropertyValue("height");
offset = parseInt( offset );
height = (height-offset)+"px";
document.getElementById( "month-content-box" ).setAttribute( "height", height );
}
/*returns the height of the current view in pixels*/
MonthView.prototype.getViewHeight = function monthView_getViewHeight( )
{
var toReturn = document.defaultView.getComputedStyle(document.getElementById("month-view-box"), "").getPropertyValue("height");
toReturn = parseInt( toReturn ); //strip off the px at the end
return toReturn;
}
MonthView.prototype.setNumberOfEventsToShow = function monthView_getNumberOfEventsToShow( )
{
//get the style height of the month view box.
var MonthViewBoxHeight = document.defaultView.getComputedStyle(document.getElementById("month-week-4-day-4-box"), "").getPropertyValue("height");
MonthViewBoxHeight = parseInt( MonthViewBoxHeight ); //strip off the px at the end
//get the height of an event box.
var Element = document.getElementsByAttribute( "eventbox", "monthview" )[0];
if( !Element )
return;
var EventBoxHeight = document.defaultView.getComputedStyle( Element, "" ).getPropertyValue( "height" );
EventBoxHeight = parseInt( EventBoxHeight ); //strip off the px at the end
//calculate the number of events to show.
dump( "\n\n"+( MonthViewBoxHeight - EventBoxHeight ) / EventBoxHeight );
dump( "\n"+MonthViewBoxHeight );
dump( "\n"+EventBoxHeight );
this.numberOfEventsToShow = parseInt( ( MonthViewBoxHeight - EventBoxHeight ) / EventBoxHeight );
}
/*
drag and drop stuff
*/
var gEventBeingDragged = false;
var gBoxBeingDroppedOn = false;
var monthViewEventDragAndDropObserver = {
onDragStart: function (evt, transferData, action){
if( evt.target.calendarEventDisplay )
gEventBeingDragged = evt.target.calendarEventDisplay.event;
else if( evt.target.parentNode.calendarEventDisplay )
gEventBeingDragged = evt.target.parentNode.calendarEventDisplay.event;
//dump( "\nEvent being dragged is "+gEventBeingDragged );
transferData.data=new TransferData();
transferData.data.addDataForFlavour("text/unicode",0);
},
getSupportedFlavours : function () {
var weekflavours = new FlavourSet();
weekflavours.appendFlavour("text/unicode");
return weekflavours;
},
onDragOver: function (evt,flavour,session){
//dump( "on dragged over "+evt.target.getAttribute( "id" )+"\n" );
gBoxBeingDroppedOn = document.getElementById( evt.target.getAttribute( "id" ) );
//dump( evt.target.getAttribute( "id" ) );
},
onDrop: function (evt,dropdata,session){
//get the date of the current event box.
//dump( "\n\nDROP EVNET->\n"+gEventBeingDragged.start );
var newDay = gBoxBeingDroppedOn.dayNumber;
if( newDay == null )
return;
var OldStartDate = new Date( gEventBeingDragged.start.getTime() );
var newStartDate = new Date( OldStartDate.getTime() );
newStartDate.setDate( newDay );
var Difference = newStartDate.getTime() - OldStartDate.getTime();
var oldEndDate = new Date( gEventBeingDragged.end.getTime() );
var newEndDate = oldEndDate.getTime() + Difference;
gEventBeingDragged.start.setTime( newStartDate.getTime() );
gEventBeingDragged.end.setTime( newEndDate );
//edit the event being dragged to change its start and end date
//don't change the start and end time though.
gICalLib.modifyEvent( gEventBeingDragged, gEventBeingDragged.parent.server );
//refresh the view
}
};

View File

@@ -1,339 +0,0 @@
<?xml version="1.0"?>
<!-- ***** BEGIN LICENSE BLOCK *****
- Version: MPL 1.1/GPL 2.0/LGPL 2.1
-
- The contents of this file are subject to the Mozilla Public License Version
- 1.1 (the "License"); you may not use this file except in compliance with
- the License. You may obtain a copy of the License at
- http://www.mozilla.org/MPL/
-
- Software distributed under the License is distributed on an "AS IS" basis,
- WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- for the specific language governing rights and limitations under the
- License.
-
- The Original Code is OEone Calendar Code, released October 31st, 2001.
-
- The Initial Developer of the Original Code is
- OEone Corporation.
- Portions created by the Initial Developer are Copyright (C) 2001
- the Initial Developer. All Rights Reserved.
-
- Contributor(s): Garth Smedley <garths@oeone.com>
- Mike Potter <mikep@oeone.com>
- Karl Guertin <grayrest@grayrest.com>
- Colin Phillips <colinp@oeone.com>
-
- Alternatively, the contents of this file may be used under the terms of
- either the GNU General Public License Version 2 or later (the "GPL"), or
- the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- in which case the provisions of the GPL or the LGPL are applicable instead
- of those above. If you wish to allow use of your version of this file only
- under the terms of either the GPL or the LGPL, and not to allow others to
- use your version of this file under the terms of the MPL, indicate your
- decision by deleting the provisions above and replace them with the notice
- and other provisions required by the LGPL or the GPL. If you do not delete
- the provisions above, a recipient may use your version of this file under
- the terms of any one of the MPL, the GPL or the LGPL.
-
- ***** END LICENSE BLOCK ***** -->
<!-- DTD File with all strings specific to the calendar -->
<!DOCTYPE overlay
[
<!ENTITY % dtd1 SYSTEM "chrome://calendar/locale/global.dtd" > %dtd1;
<!ENTITY % dtd2 SYSTEM "chrome://calendar/locale/calendar.dtd" > %dtd2;
]>
<!-- The Window -->
<overlay
xmlns:html="http://www.w3.org/1999/xhtml"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
>
<script type="application/x-javascript" src="chrome://calendar/content/calendarMonthView.js"/>
<script type="application/x-javascript">
var ArrayOfDayNames = new Array();
ArrayOfDayNames[0] = "&calendar.monthview.column.1.name;";
ArrayOfDayNames[1] = "&calendar.monthview.column.2.name;";
ArrayOfDayNames[2] = "&calendar.monthview.column.3.name;";
ArrayOfDayNames[3] = "&calendar.monthview.column.4.name;";
ArrayOfDayNames[4] = "&calendar.monthview.column.5.name;";
ArrayOfDayNames[5] = "&calendar.monthview.column.6.name;";
ArrayOfDayNames[6] = "&calendar.monthview.column.7.name;";
</script>
<vbox id="month-view-box" flex="1">
<!-- Month View: Controls-->
<hbox id="month-controls-box"> <!-- DO NOT SET FLEX, breaks resizing -->
<box class="month-previous-button-box">
<image id="month-previous-button" class="prevnextbuttons" onclick="gCalendarWindow.goToPrevious()"/>
</box>
<vbox id="month-title-container" flex="1">
<hbox id="month-title-box" flex="1">
<vbox class="month-title-label-box" flex="1">
<label id="-2-month-title" onclick="gCalendarWindow.goToPrevious( 2 )"/>
</vbox>
<vbox class="month-title-label-box" flex="1">
<label id="-1-month-title" onclick="gCalendarWindow.goToPrevious( 1 )"/>
</vbox>
<vbox class="month-title-label-box" flex="1">
<label id="0-month-title" />
</vbox>
<vbox class="month-title-label-box" flex="1">
<label id="1-month-title" onclick="gCalendarWindow.goToNext( 1 )"/>
</vbox>
<vbox class="month-title-label-box" flex="1">
<label id="2-month-title" onclick="gCalendarWindow.goToNext( 2 )"/>
</vbox>
</hbox>
<hbox id="year-title-box" flex="1">
<vbox class="month-title-label-box" flex="1">
<label id="0-year-title"/>
</vbox>
</hbox>
</vbox>
<box id="month-next-button-box">
<image id="month-next-button" class="prevnextbuttons" onclick="gCalendarWindow.goToNext()"/>
</box>
</hbox>
<vbox id="month-content-box">
<!-- Month View: Calendar Grid -->
<box id="month-grid-box" flex="1">
<grid id="month-grid" flex="1">
<columns>
<column class="month-column-class" flex="1"/>
<column class="month-column-class" flex="1"/>
<column class="month-column-class" flex="1"/>
<column class="month-column-class" flex="1"/>
<column class="month-column-class" flex="1"/>
<column class="month-column-class" flex="1"/>
<column class="month-column-class" flex="1"/>
</columns>
<rows >
<row flex="1">
<vbox class="month-column-center-day-class">
<label class="month-view-header-days" id="month-view-header-day-1"/>
</vbox>
<vbox class="month-column-center-day-class">
<label class="month-view-header-days" id="month-view-header-day-2"/>
</vbox>
<vbox class="month-column-center-day-class">
<label class="month-view-header-days" id="month-view-header-day-3"/>
</vbox>
<vbox class="month-column-center-day-class">
<label class="month-view-header-days" id="month-view-header-day-4"/>
</vbox>
<vbox class="month-column-center-day-class">
<label class="month-view-header-days" id="month-view-header-day-5"/>
</vbox>
<vbox class="month-column-center-day-class">
<label class="month-view-header-days" id="month-view-header-day-6"/>
</vbox>
<vbox class="month-column-center-day-class">
<label class="month-view-header-days" id="month-view-header-day-7"/>
</vbox>
</row>
<row flex="1" >
<vbox class="month-day-box-class" flex="1" id="month-week-1-day-1-box">
<label class="month-day-number-class" id="month-week-1-day-1"/>
</vbox>
<vbox class="month-day-box-class" flex="1" id="month-week-1-day-2-box">
<label class="month-day-number-class" id="month-week-1-day-2"/>
</vbox>
<vbox class="month-day-box-class" flex="1" id="month-week-1-day-3-box">
<label class="month-day-number-class" id="month-week-1-day-3"/>
</vbox>
<vbox class="month-day-box-class" flex="1" id="month-week-1-day-4-box">
<label class="month-day-number-class" id="month-week-1-day-4"/>
</vbox>
<vbox class="month-day-box-class" flex="1" id="month-week-1-day-5-box">
<label class="month-day-number-class" id="month-week-1-day-5"/>
</vbox>
<vbox class="month-day-box-class" flex="1" id="month-week-1-day-6-box">
<label class="month-day-number-class" id="month-week-1-day-6"/>
</vbox>
<vbox class="month-day-box-class" flex="1" id="month-week-1-day-7-box">
<label class="month-day-number-class" id="month-week-1-day-7"/>
</vbox>
</row>
<row flex="1" >
<vbox class="month-day-box-class" flex="1" id="month-week-2-day-1-box">
<label class="month-day-number-class" id="month-week-2-day-1"/>
</vbox>
<vbox class="month-day-box-class" flex="1" id="month-week-2-day-2-box">
<label class="month-day-number-class" id="month-week-2-day-2"/>
</vbox>
<vbox class="month-day-box-class" flex="1" id="month-week-2-day-3-box">
<label class="month-day-number-class" id="month-week-2-day-3"/>
</vbox>
<vbox class="month-day-box-class" flex="1" id="month-week-2-day-4-box">
<label class="month-day-number-class" id="month-week-2-day-4"/>
</vbox>
<vbox class="month-day-box-class" flex="1" id="month-week-2-day-5-box">
<label class="month-day-number-class" id="month-week-2-day-5"/>
</vbox>
<vbox class="month-day-box-class" flex="1" id="month-week-2-day-6-box">
<label class="month-day-number-class" id="month-week-2-day-6"/>
</vbox>
<vbox class="month-day-box-class" flex="1" id="month-week-2-day-7-box">
<label class="month-day-number-class" id="month-week-2-day-7"/>
</vbox>
</row>
<row flex="1" >
<vbox class="month-day-box-class" flex="1" id="month-week-3-day-1-box">
<label class="month-day-number-class" id="month-week-3-day-1"/>
</vbox>
<vbox class="month-day-box-class" flex="1" id="month-week-3-day-2-box">
<label class="month-day-number-class" id="month-week-3-day-2"/>
</vbox>
<vbox class="month-day-box-class" flex="1" id="month-week-3-day-3-box">
<label class="month-day-number-class" id="month-week-3-day-3"/>
</vbox>
<vbox class="month-day-box-class" flex="1" id="month-week-3-day-4-box">
<label class="month-day-number-class" id="month-week-3-day-4"/>
</vbox>
<vbox class="month-day-box-class" flex="1" id="month-week-3-day-5-box">
<label class="month-day-number-class" id="month-week-3-day-5"/>
</vbox>
<vbox class="month-day-box-class" flex="1" id="month-week-3-day-6-box">
<label class="month-day-number-class" id="month-week-3-day-6"/>
</vbox>
<vbox class="month-day-box-class" flex="1" id="month-week-3-day-7-box">
<label class="month-day-number-class" id="month-week-3-day-7"/>
</vbox>
</row>
<row flex="1" >
<vbox class="month-day-box-class" flex="1" id="month-week-4-day-1-box">
<label class="month-day-number-class" id="month-week-4-day-1"/>
</vbox>
<vbox class="month-day-box-class" flex="1" id="month-week-4-day-2-box">
<label class="month-day-number-class" id="month-week-4-day-2"/>
</vbox>
<vbox class="month-day-box-class" flex="1" id="month-week-4-day-3-box">
<label class="month-day-number-class" id="month-week-4-day-3"/>
</vbox>
<vbox class="month-day-box-class" flex="1" id="month-week-4-day-4-box">
<label class="month-day-number-class" id="month-week-4-day-4"/>
</vbox>
<vbox class="month-day-box-class" flex="1" id="month-week-4-day-5-box">
<label class="month-day-number-class" id="month-week-4-day-5"/>
</vbox>
<vbox class="month-day-box-class" flex="1" id="month-week-4-day-6-box">
<label class="month-day-number-class" id="month-week-4-day-6"/>
</vbox>
<vbox class="month-day-box-class" flex="1" id="month-week-4-day-7-box">
<label class="month-day-number-class" id="month-week-4-day-7"/>
</vbox>
</row>
<row flex="1" >
<vbox class="month-day-box-class" flex="1" id="month-week-5-day-1-box">
<label class="month-day-number-class" id="month-week-5-day-1"/>
</vbox>
<vbox class="month-day-box-class" flex="1" id="month-week-5-day-2-box">
<label class="month-day-number-class" id="month-week-5-day-2"/>
</vbox>
<vbox class="month-day-box-class" flex="1" id="month-week-5-day-3-box">
<label class="month-day-number-class" id="month-week-5-day-3"/>
</vbox>
<vbox class="month-day-box-class" flex="1" id="month-week-5-day-4-box">
<label class="month-day-number-class" id="month-week-5-day-4"/>
</vbox>
<vbox class="month-day-box-class" flex="1" id="month-week-5-day-5-box">
<label class="month-day-number-class" id="month-week-5-day-5"/>
</vbox>
<vbox class="month-day-box-class" flex="1" id="month-week-5-day-6-box">
<label class="month-day-number-class" id="month-week-5-day-6"/>
</vbox>
<vbox class="month-day-box-class" flex="1" id="month-week-5-day-7-box">
<label class="month-day-number-class" id="month-week-5-day-7"/>
</vbox>
</row>
<row flex="1">
<vbox class="month-day-box-class" flex="1" id="month-week-6-day-1-box">
<label class="month-day-number-class" id="month-week-6-day-1"/>
</vbox>
<vbox class="month-day-box-class" flex="1" id="month-week-6-day-2-box">
<label class="month-day-number-class" id="month-week-6-day-2"/>
</vbox>
<vbox class="month-day-box-class" flex="1" id="month-week-6-day-3-box">
<label class="month-day-number-class" id="month-week-6-day-3"/>
</vbox>
<vbox class="month-day-box-class" flex="1" id="month-week-6-day-4-box">
<label class="month-day-number-class" id="month-week-6-day-4"/>
</vbox>
<vbox class="month-day-box-class" flex="1" id="month-week-6-day-5-box">
<label class="month-day-number-class" id="month-week-6-day-5"/>
</vbox>
<vbox class="month-day-box-class" flex="1" id="month-week-6-day-6-box">
<label class="month-day-number-class" id="month-week-6-day-6"/>
</vbox>
<vbox class="month-day-box-class" flex="1" id="month-week-6-day-7-box">
<label class="month-day-number-class" id="month-week-6-day-7"/>
</vbox>
</row>
</rows>
</grid>
</box> <!-- End: Month grid box -->
</vbox> <!-- End: Month content box -->
</vbox>
</overlay>

View File

@@ -1,287 +0,0 @@
/* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Netscape Public License
* Version 1.1 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 2001-2002
* the Initial Developer. All Rights Reserved.
*
* Contributor(s): ArentJan Banck <ajbanck@planet.nl>
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the NPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the NPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
// Original code:
// http://lxr.mozilla.org/mozilla/source/editor/ui/composer/content/publish.js
// TODO Implement uploadfile with:
//void setUploadFile(in nsIFile file, in string contentType, in long contentLength);
var gPublishHandler = null;
/* Create an instance of the given ContractID, with given interface */
function createInstance(contractId, intf) {
return Components.classes[contractId].createInstance(Components.interfaces[intf]);
}
var gPublishIOService;
function GetIOService()
{
if (gPublishIOService)
return gPublishIOService;
gPublishIOService = Components.classes["@mozilla.org/network/io-service;1"].getService(Components.interfaces.nsIIOService);
if (!gPublishIOService)
dump("failed to get io service\n");
return gPublishIOService;
}
function calendarPublish(aDataString, newLocation, fileName, login, password, contentType)
{
try
{
var protocolChannel = get_destination_channel(newLocation, fileName, login, password);
if (!protocolChannel)
{
dump("failed to get a destination channel\n");
return;
}
output_string_to_channel(protocolChannel, aDataString, contentType);
protocolChannel.asyncOpen(gPublishingListener, null);
dump("done\n");
}
catch (e)
{
alert("an error occurred: " + e + "\n");
}
}
// XXX WARNING: I DIDN'T TEST THIS!!!!!
function calendarUploadFile(aSourceFilename, newLocation, fileName, login, password, contentType)
{
try
{
var protocolChannel = get_destination_channel(newLocation, fileName, login, password);
if (!protocolChannel)
{
dump("failed to get a destination channel\n");
return;
}
//void setUploadFile(in nsIFile file, in string contentType, in long contentLength);
output_file_to_channel(protocolChannel, aSourceFilename, contentType);
protocolChannel.asyncOpen(gPublishingListener, null);
dump("done\n");
}
catch (e)
{
alert("an error occurred: " + e + "\n");
}
}
function output_string_to_channel( aChannel, aDataString, contentType )
{
var uploadChannel = aChannel.QueryInterface(Components.interfaces.nsIUploadChannel);
var postStream = createInstance('@mozilla.org/io/string-input-stream;1', 'nsIStringInputStream');
postStream.setData(aDataString, aDataString.length);
uploadChannel.setUploadStream(postStream, contentType, -1);
}
function output_file_to_channel( aChannel, aFilePath, contentType )
{
var uploadChannel = aChannel.QueryInterface(Components.interfaces.nsIUploadChannel);
var file = createInstance('@mozilla.org/file/local;1', 'nsILocalFile');
file.initWithPath( aFilePath );
uploadChannel.setUploadFile(file, contentType, -1);
}
// this function takes a login and password and adds them to the destination url
function get_destination_channel(destinationDirectoryLocation, fileName, login, password)
{
try
{
var ioService = GetIOService();
if (!ioService)
{
return null;
}
// create a channel for the destination location
var fullurl = destinationDirectoryLocation + fileName;
destChannel = create_channel_from_url(ioService, fullurl, login, password);
if (!destChannel)
{
dump("can't create dest channel\n");
return null;
}
try {
dump("about to set callbacks\n");
destChannel.notificationCallbacks = window.docshell; // docshell
dump("notification callbacks set\n");
}
catch(e) {dump(e+"\n");}
try {
var httpChannel = destChannel.QueryInterface(Components.interfaces.nsIHttpChannel);
}
catch( e )
{
//alert( e );
}
if (httpChannel)
{
dump("http channel found\n");
return httpChannel;
}
var ftpChannel = destChannel.QueryInterface(Components.interfaces.nsIFTPChannel);
if (ftpChannel) dump("ftp channel found\n");
if (ftpChannel)
return ftpChannel;
var httpsChannel = destChannel.QueryInterface(Components.interfaces.nsIHttpsChannel);
if (httpsChannel) dump("https channel found\n");
if (httpsChannel)
return httpsChannel;
else
return null;
}
catch (e)
{
return null;
}
}
// this function takes a full url, creates an nsIURI, and then creates a channel from that nsIURI
function create_channel_from_url(ioService, aURL, aLogin, aPassword)
{
try
{
var nsiuri = Components.classes["@mozilla.org/network/standard-url;1"].createInstance(Components.interfaces.nsIURI);
if (!nsiuri)
return null;
nsiuri.spec = aURL;
if (aLogin)
{
nsiuri.username = aLogin;
if (aPassword)
nsiuri.password = aPassword;
}
return ioService.newChannelFromURI(nsiuri);
}
catch (e)
{
alert(e+"\n");
return null;
}
}
/*
function PublishCopyFile(srcDirectoryLocation, destinationDirectoryLocation, fileName, aLogin, aPassword)
{
// append '/' if it's not there; inputs should be directories so should end in '/'
if ( srcDirectoryLocation.charAt(srcDirectoryLocation.length-1) != '/' )
srcDirectoryLocation = srcDirectoryLocation + '/';
if ( destinationDirectoryLocation.charAt(destinationDirectoryLocation.length-1) != '/' )
destinationDirectoryLocation = destinationDirectoryLocation + '/';
try
{
// grab an io service
var ioService = GetIOService();
if (!ioService)
return;
// create a channel for the source location
srcChannel = create_channel_from_url(ioService, srcDirectoryLocation + fileName, null, null);
if (!srcChannel)
{
dump("can't create src channel\n");
return;
}
// create a channel for the destination location
var ftpChannel = get_destination_channel(destinationDirectoryLocation, fileName, aLogin, aPassword);
if (!ftpChannel)
{
dump("failed to get ftp channel\n");
return;
}
ftpChannel.open();
protocolChannel.uploadStream = srcChannel.open();
protocolChannel.asyncOpen(null, null);
dump("done\n");
}
catch (e)
{
dump("an error occurred: " + e + "\n");
}
}
*/
var gPublishingListener =
{
QueryInterface: function(aIId, instance)
{
if (aIId.equals(Components.interfaces.nsIStreamListener))
return this;
if (aIId.equals(Components.interfaces.nsISupports))
return this;
dump("QueryInterface " + aIId + "\n");
throw Components.results.NS_NOINTERFACE;
},
onStartRequest: function(request, ctxt)
{
dump("onStartRequest status = " + request.status + "\n");
},
onStopRequest: function(request, ctxt, status, errorMsg)
{
dump("onStopRequest status = " + request.status + " " + errorMsg + "\n");
},
onDataAvailable: function(request, ctxt, inStream, sourceOffset, count)
{
dump("onDataAvailable status = " + request.status + " " + count + "\n");
}
}

View File

@@ -1,132 +0,0 @@
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is OEone Calendar Code, released October 31st, 2001.
*
* The Initial Developer of the Original Code is
* OEone Corporation.
* Portions created by the Initial Developer are Copyright (C) 2001
* the Initial Developer. All Rights Reserved.
*
* Contributor(s): Garth Smedley <garths@oeone.com>
* Mike Potter <mikep@oeone.com>
* Colin Phillips <colinp@oeone.com>
* Chris Charabaruk <ccharabaruk@meldstar.com>
* ArentJan Banck <ajbanck@planet.nl>
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
/***** calendar/calendarEventDialog.js
* AUTHOR
* Garth Smedley
* REQUIRED INCLUDES
* <script type="application/x-javascript" src="chrome://calendar/content/dateUtils.js"/>
* <script type="application/x-javascript" src="chrome://calendar/content/calendarEvent.js"/>
*
* NOTES
* Code for the calendar's new/edit event dialog.
*
* Invoke this dialog to create a new event as follows:
var args = new Object();
args.mode = "new"; // "new" or "edit"
args.onOk = <function>; // funtion to call when OK is clicked
args.calendarEvent = calendarEvent; // newly creatd calendar event to be editted
calendar.openDialog("caNewEvent", "chrome://calendar/content/calendarEventDialog.xul", true, args );
*
* Invoke this dialog to edit an existing event as follows:
*
var args = new Object();
args.mode = "edit"; // "new" or "edit"
args.onOk = <function>; // funtion to call when OK is clicked
args.calendarEvent = calendarEvent; // javascript object containin the event to be editted
* When the user clicks OK the onOk function will be called with a calendar event object.
*
*
* IMPLEMENTATION NOTES
**********
*/
/*-----------------------------------------------------------------
* W I N D O W V A R I A B L E S
*/
var gOnOkFunction; // function to be called when user clicks OK
/*-----------------------------------------------------------------
* W I N D O W F U N C T I O N S
*/
/**
* Called when the dialog is loaded.
*/
function loadCalendarPublishDialog()
{
// Get arguments, see description at top of file
var args = window.arguments[0];
gOnOkFunction = args.onOk;
//get default values from the prefs
document.getElementById( "publish-url-textbox" ).value = opener.getCharPref( opener.gCalendarWindow.calendarPreferences.calendarPref, "publish.path", "" );
document.getElementById( "publish-remotefilename-textbox" ).value = opener.getCharPref( opener.gCalendarWindow.calendarPreferences.calendarPref, "publish.filename", "" );
document.getElementById( "publish-username-textbox" ).value = opener.getCharPref( opener.gCalendarWindow.calendarPreferences.calendarPref, "publish.username", "" );
document.getElementById( "publish-password-textbox" ).value = opener.getCharPref( opener.gCalendarWindow.calendarPreferences.calendarPref, "publish.password", "" );
var firstFocus = document.getElementById( "publish-url-textbox" );
firstFocus.focus();
}
/**
* Called when the OK button is clicked.
*/
function onOKCommand()
{
var CalendarPublishObject = new Object();
CalendarPublishObject.url = document.getElementById( "publish-url-textbox" ).value;
CalendarPublishObject.remotePath = document.getElementById( "publish-remotefilename-textbox" ).value;
CalendarPublishObject.username = document.getElementById( "publish-username-textbox" ).value;
CalendarPublishObject.password = document.getElementById( "publish-password-textbox" ).value;
// call caller's on OK function
gOnOkFunction( CalendarPublishObject );
// tell standard dialog stuff to close the dialog
return true;
}

View File

@@ -1,148 +0,0 @@
<?xml version="1.0"?>
<!-- ***** BEGIN LICENSE BLOCK *****
- Version: MPL 1.1/GPL 2.0/LGPL 2.1
-
- The contents of this file are subject to the Mozilla Public License Version
- 1.1 (the "License"); you may not use this file except in compliance with
- the License. You may obtain a copy of the License at
- http://www.mozilla.org/MPL/
-
- Software distributed under the License is distributed on an "AS IS" basis,
- WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- for the specific language governing rights and limitations under the
- License.
-
- The Original Code is OEone Calendar Code, released October 31st, 2001.
-
- The Initial Developer of the Original Code is
- OEone Corporation.
- Portions created by the Initial Developer are Copyright (C) 2001
- the Initial Developer. All Rights Reserved.
-
- Contributor(s): Mike Potter <mikep@oeone.com>
-
- Alternatively, the contents of this file may be used under the terms of
- either the GNU General Public License Version 2 or later (the "GPL"), or
- the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- in which case the provisions of the GPL or the LGPL are applicable instead
- of those above. If you wish to allow use of your version of this file only
- under the terms of either the GPL or the LGPL, and not to allow others to
- use your version of this file under the terms of the MPL, indicate your
- decision by deleting the provisions above and replace them with the notice
- and other provisions required by the LGPL or the GPL. If you do not delete
- the provisions above, a recipient may use your version of this file under
- the terms of any one of the MPL, the GPL or the LGPL.
-
- ***** END LICENSE BLOCK ***** -->
<?xml-stylesheet href="chrome://global/skin/global.css" type="text/css"?>
<?xul-overlay href="chrome://global/content/dialogOverlay.xul"?>
<!-- CSS File with all styles specific to the dialog -->
<?xml-stylesheet href="chrome://calendar/skin/dialogOverlay.css" type="text/css"?>
<!-- DTD File with all strings specific to the calendar -->
<!DOCTYPE dialog
[
<!ENTITY % dtd1 SYSTEM "chrome://calendar/locale/global.dtd" > %dtd1;
<!ENTITY % dtd2 SYSTEM "chrome://calendar/locale/calendar.dtd" > %dtd2;
]>
<dialog
id="calendar-publishwindow"
title="&calendar.publish.dialog.title;"
buttons="accept,cancel"
ondialogaccept="return onOKCommand();"
ondialogcancel="return true;"
onload="loadCalendarPublishDialog()"
persist="screenX screenY"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
xmlns:nc="http://home.netscape.com/NC-rdf#">
<!-- Javascript includes -->
<script type="application/x-javascript" src="chrome://global/content/strres.js"/>
<script type="application/x-javascript" src="chrome://calendar/content/calendarPublishDialog.js"/>
<!-- Data used in JS from dtd -->
<keyset id="dialogKeys"/>
<!-- The dialog -->
<!-- dialog-box: from dialogOverlay.xul -->
<vbox id="dialog-box" flex="1">
<!-- standard-dialog-content: from dialogOverlay.xul -->
<vbox id="standard-dialog-content" flex="1">
<grid>
<columns>
<column />
<column flex="1"/>
</columns>
<rows>
<!-- URL -->
<row align="center">
<hbox class="field-label-box-class" pack="end">
<description>&calendar.publish.url.label;</description>
</hbox>
<textbox flex="1" id="publish-url-textbox"/>
</row>
<row align="center">
<hbox class="field-label-box-class" pack="end"/>
<description>Something like http://www.myserver.com/webdav/</description>
</row>
<!-- File Name -->
<row align="center">
<hbox class="field-label-box-class" pack="end">
<description>&calendar.publish.remotefilename.label;</description>
</hbox>
<textbox flex="1" id="publish-remotefilename-textbox"/>
</row>
<row align="center">
<hbox class="field-label-box-class" pack="end"/>
<description>The filename to save to on the remote server.</description>
</row>
<!-- Username -->
<row align="center">
<hbox class="field-label-box-class" pack="end">
<description>&calendar.publish.username.label;</description>
</hbox>
<textbox id="publish-username-textbox" flex="1" />
</row>
<row align="center">
<hbox class="field-label-box-class" pack="end"/>
<description>(Optional) The username to upload to this server.</description>
</row>
<!-- Password -->
<row align="center">
<hbox class="field-label-box-class" pack="end">
<description>&calendar.publish.password.label;</description>
</hbox>
<textbox type="password" id="publish-password-textbox" flex="1" />
</row>
<row align="center">
<hbox class="field-label-box-class" pack="end"/>
<description>(Optional) The password to upload to this server.</description>
</row>
</rows>
</grid>
</vbox> <!-- standard-dialog-content -->
</vbox> <!-- dialog-box -->
</dialog>

View File

@@ -1,820 +0,0 @@
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is OEone Calendar Code, released October 31st, 2001.
*
* The Initial Developer of the Original Code is
* OEone Corporation.
* Portions created by the Initial Developer are Copyright (C) 2001
* the Initial Developer. All Rights Reserved.
*
* Contributor(s): Garth Smedley <garths@oeone.com>
* Mike Potter <mikep@oeone.com>
* Colin Phillips <colinp@oeone.com>
* Chris Charabaruk <ccharabaruk@meldstar.com>
* ArentJan Banck <ajbanck@planet.nl>
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
/**
* Enable/Disable Repeat items
*/
function updateRepeatItemEnabled()
{
var exceptionsDateButton = document.getElementById( "exception-dates-button" );
var exceptionsDateText = document.getElementById( "exception-dates-text" );
var repeatCheckBox = document.getElementById( "repeat-checkbox" );
var repeatDisableList = document.getElementsByAttribute( "disable-controller", "repeat" );
if( repeatCheckBox.checked )
{
exceptionsDateButton.setAttribute( "popup", "oe-date-picker-popup" );
exceptionsDateText.setAttribute( "popup", "oe-date-picker-popup" );
// call remove attribute beacuse some widget code checks for the presense of a
// disabled attribute, not the value.
for( var i = 0; i < repeatDisableList.length; ++i )
{
if( repeatDisableList[i].getAttribute( "today" ) != "true" )
repeatDisableList[i].removeAttribute( "disabled" );
}
}
else
{
exceptionsDateButton.removeAttribute( "popup" );
exceptionsDateText.removeAttribute( "popup" );
for( var j = 0; j < repeatDisableList.length; ++j )
{
repeatDisableList[j].setAttribute( "disabled", "true" );
}
}
// udpate plural/singular
updateRepeatPlural();
updateAlarmPlural();
// update until items whenever repeat changes
updateUntilItemEnabled();
// extra interface depending on units
updateRepeatUnitExtensions();
}
/**
* Update plural singular menu items
*/
function updateRepeatPlural()
{
updateMenuPlural( "repeat-length-field", "repeat-length-units" );
}
/**
* Update plural singular menu items
*/
function updateAlarmPlural()
{
updateMenuPlural( "alarm-length-field", "alarm-length-units" );
}
/**
* Update plural singular menu items
*/
function updateMenuPlural( lengthFieldId, menuId )
{
var field = document.getElementById( lengthFieldId );
var menu = document.getElementById( menuId );
// figure out whether we should use singular or plural
var length = field.value;
var newLabelNumber;
if( Number( length ) > 1 )
{
newLabelNumber = "labelplural"
}
else
{
newLabelNumber = "labelsingular"
}
// see what we currently show and change it if required
var oldLabelNumber = menu.getAttribute( "labelnumber" );
if( newLabelNumber != oldLabelNumber )
{
// remember what we are showing now
menu.setAttribute( "labelnumber", newLabelNumber );
// update the menu items
var items = menu.getElementsByTagName( "menuitem" );
for( var i = 0; i < items.length; ++i )
{
var menuItem = items[i];
var newLabel = menuItem.getAttribute( newLabelNumber );
menuItem.label = newLabel;
menuItem.setAttribute( "label", newLabel );
}
// force the menu selection to redraw
var saveSelectedIndex = menu.selectedIndex;
menu.selectedIndex = -1;
menu.selectedIndex = saveSelectedIndex;
}
}
/**
* Enable/Disable Until items
*/
function updateUntilItemEnabled()
{
var repeatUntilRadio = document.getElementById( "repeat-until-radio" );
var repeatCheckBox = document.getElementById( "repeat-checkbox" );
var repeatEndText = document.getElementById( "repeat-end-date-text" );
var repeatEndPicker = document.getElementById( "repeat-end-date-button" );
if( repeatCheckBox.checked && repeatUntilRadio.selected )
{
repeatEndText.removeAttribute( "disabled" );
repeatEndText.setAttribute( "popup", "oe-date-picker-popup" );
repeatEndPicker.removeAttribute( "disabled" );
repeatEndPicker.setAttribute( "popup", "oe-date-picker-popup" );
}
else
{
repeatEndText.setAttribute( "disabled", "true" );
repeatEndText.removeAttribute( "popup" );
repeatEndPicker.setAttribute( "disabled", "true" );
repeatEndPicker.removeAttribute( "popup" );
}
}
function updateRepeatUnitExtensions( )
{
var repeatMenu = document.getElementById( "repeat-length-units" );
var weekExtensions = document.getElementById( "repeat-extenstions-week" );
var monthExtensions = document.getElementById( "repeat-extenstions-month" );
//FIX ME! WHEN THE WINDOW LOADS, THIS DOESN'T EXIST
if( repeatMenu.selectedItem )
{
switch( repeatMenu.selectedItem.value )
{
case "days":
weekExtensions.setAttribute( "collapsed", "true" );
monthExtensions.setAttribute( "collapsed", "true" );
break;
case "weeks":
weekExtensions.removeAttribute( "collapsed" );
monthExtensions.setAttribute( "collapsed", "true" );
updateAdvancedWeekRepeat();
break;
case "months":
weekExtensions.setAttribute( "collapsed", "true" );
monthExtensions.removeAttribute( "collapsed" );
updateAdvancedRepeatDayOfMonth();
break;
case "years":
weekExtensions.setAttribute( "collapsed", "true" );
monthExtensions.setAttribute( "collapsed", "true" );
break;
}
sizeToContent();
}
}
/**
* Enable/Disable Start/End items
*/
function updateStartEndItemEnabled()
{
var allDayCheckBox = document.getElementById( "all-day-event-checkbox" );
var startTimeLabel = document.getElementById( "start-time-label" );
var startTimePicker = document.getElementById( "start-time-button" );
var startTimeText = document.getElementById( "start-time-text" );
var endTimeLabel = document.getElementById( "end-time-label" );
var endTimePicker = document.getElementById( "end-time-button" );
var endTimeText = document.getElementById( "end-time-text" );
if( allDayCheckBox.checked )
{
// disable popups by removing the popup attribute
startTimeLabel.setAttribute( "disabled", "true" );
startTimeText.setAttribute( "disabled", "true" );
startTimeText.removeAttribute( "popup" );
startTimePicker.setAttribute( "disabled", "true" );
startTimePicker.removeAttribute( "popup" );
endTimeLabel.setAttribute( "disabled", "true" );
endTimeText.setAttribute( "disabled", "true" );
endTimeText.removeAttribute( "popup" );
endTimePicker.setAttribute( "disabled", "true" );
endTimePicker.removeAttribute( "popup" );
}
else
{
// enable popups by setting the popup attribute
startTimeLabel.removeAttribute( "disabled" );
startTimeText.removeAttribute( "disabled" );
startTimeText.setAttribute( "popup", "oe-time-picker-popup" );
startTimePicker.removeAttribute( "disabled" );
startTimePicker.setAttribute( "popup", "oe-time-picker-popup" );
endTimeLabel.removeAttribute( "disabled" );
endTimeText.removeAttribute( "disabled" );
endTimeText.setAttribute( "popup", "oe-time-picker-popup" );
endTimePicker.removeAttribute( "disabled" );
endTimePicker.setAttribute( "popup", "oe-time-picker-popup" );
}
}
/**
* Handle key down in repeat field
*/
function repeatLengthKeyDown( repeatField )
{
updateRepeatPlural();
}
/**
* Handle key down in alarm field
*/
function alarmLengthKeyDown( repeatField )
{
updateAlarmPlural();
}
function repeatUnitCommand( repeatMenu )
{
updateRepeatUnitExtensions();
}
/*
** Functions for advanced repeating elements
*/
function setAdvancedWeekRepeat()
{
var checked = false;
if( gEvent.recurWeekdays > 0 )
{
for( var i = 0; i < 7; i++ )
{
checked = ( ( gEvent.recurWeekdays | eval( "kRepeatDay_"+i ) ) == eval( gEvent.recurWeekdays ) );
setFieldValue( "advanced-repeat-week-"+i, checked, "checked" );
setFieldValue( "advanced-repeat-week-"+i, false, "today" );
}
}
//get the day number for today.
var startTime = getDateTimeFieldValue( "start-date-text" );
var dayNumber = startTime.getDay();
setFieldValue( "advanced-repeat-week-"+dayNumber, "true", "checked" );
setFieldValue( "advanced-repeat-week-"+dayNumber, "true", "disabled" );
setFieldValue( "advanced-repeat-week-"+dayNumber, "true", "today" );
}
/*
** Functions for advanced repeating elements
*/
function getAdvancedWeekRepeat()
{
var Total = 0;
for( var i = 0; i < 7; i++ )
{
if( getFieldValue( "advanced-repeat-week-"+i, "checked" ) == true )
{
Total += eval( "kRepeatDay_"+i );
}
}
return( Total );
}
/*
** function to set the menu items text
*/
function updateAdvancedWeekRepeat()
{
//get the day number for today.
var startTime = getDateTimeFieldValue( "start-date-text" );
var dayNumber = startTime.getDay();
//uncheck them all if the repeat checkbox is checked
var repeatCheckBox = document.getElementById( "repeat-checkbox" );
if( repeatCheckBox.checked )
{
//uncheck them all
for( var i = 0; i < 7; i++ )
{
setFieldValue( "advanced-repeat-week-"+i, false, "disabled" );
setFieldValue( "advanced-repeat-week-"+i, false, "today" );
}
}
setFieldValue( "advanced-repeat-week-"+dayNumber, "true", "checked" );
setFieldValue( "advanced-repeat-week-"+dayNumber, "true", "disabled" );
setFieldValue( "advanced-repeat-week-"+dayNumber, "true", "today" );
}
/*
** function to set the menu items text
*/
function updateAdvancedRepeatDayOfMonth()
{
//get the day number for today.
var startTime = getDateTimeFieldValue( "start-date-text" );
var dayNumber = startTime.getDate();
var dayExtension = getDayExtension( dayNumber );
var weekNumber = getWeekNumberOfMonth();
document.getElementById( "advanced-repeat-dayofmonth" ).setAttribute( "label", "On the "+dayNumber+dayExtension+" of the month" );
if( weekNumber == 4 && isLastDayOfWeekOfMonth() )
{
//enable
document.getElementById( "advanced-repeat-dayofweek" ).setAttribute( "label", getWeekNumberText( weekNumber )+" "+getDayOfWeek( dayNumber )+" of the month" );
document.getElementById( "advanced-repeat-dayofweek-last" ).removeAttribute( "collapsed" );
document.getElementById( "advanced-repeat-dayofweek-last" ).setAttribute( "label", "Last "+getDayOfWeek( dayNumber )+" of the month" );
}
else if( weekNumber == 4 && !isLastDayOfWeekOfMonth() )
{
document.getElementById( "advanced-repeat-dayofweek" ).setAttribute( "label", getWeekNumberText( weekNumber )+" "+getDayOfWeek( dayNumber )+" of the month" );
document.getElementById( "advanced-repeat-dayofweek-last" ).setAttribute( "collapsed", "true" );
}
else
{
//disable
document.getElementById( "advanced-repeat-dayofweek" ).setAttribute( "collapsed", "true" );
document.getElementById( "advanced-repeat-dayofweek-last" ).setAttribute( "label", "Last "+getDayOfWeek( dayNumber )+" of the month" );
}
}
/*
** function to enable or disable the add exception button
*/
function updateAddExceptionButton()
{
//get the date from the picker
var datePickerValue = getDateTimeFieldValue( "exception-dates-text" );
if( isAlreadyException( datePickerValue ) || document.getElementById( "repeat-checkbox" ).getAttribute( "checked" ) != "true" )
{
document.getElementById( "exception-add-button" ).setAttribute( "disabled", "true" );
}
else
{
document.getElementById( "exception-add-button" ).removeAttribute( "disabled" );
}
}
function removeSelectedExceptionDate()
{
var Listbox = document.getElementById( "exception-dates-listbox" );
var SelectedItem = Listbox.selectedItem;
if( SelectedItem )
Listbox.removeChild( SelectedItem );
}
function addException( dateToAdd )
{
if( !dateToAdd )
{
//get the date from the date and time box.
//returns a date object
var dateToAdd = getDateTimeFieldValue( "exception-dates-text" );
}
if( isAlreadyException( dateToAdd ) )
return;
var DateLabel = formatDate( dateToAdd );
//add a row to the listbox
document.getElementById( "exception-dates-listbox" ).appendItem( DateLabel, dateToAdd.getTime() );
sizeToContent();
}
function isAlreadyException( dateObj )
{
//check to make sure that the date is not already added.
var listbox = document.getElementById( "exception-dates-listbox" );
for( var i = 0; i < listbox.childNodes.length; i++ )
{
var dateToMatch = new Date( );
dateToMatch.setTime( listbox.childNodes[i].value );
if( dateToMatch.getMonth() == dateObj.getMonth() && dateToMatch.getFullYear() == dateObj.getFullYear() && dateToMatch.getDate() == dateObj.getDate() )
return true;
}
return false;
}
function getDayExtension( dayNumber )
{
switch( dayNumber )
{
case 1:
case 21:
case 31:
return( "st" );
case 2:
case 22:
return( "nd" );
case 3:
case 23:
return( "rd" );
default:
return( "th" );
}
}
function getDayOfWeek( )
{
//get the day number for today.
var startTime = getDateTimeFieldValue( "start-date-text" );
var dayNumber = startTime.getDay();
var dateStringBundle = srGetStrBundle("chrome://calendar/locale/dateFormat.properties");
//add one to the dayNumber because in the above prop. file, it starts at day1, but JS starts at 0
var oneBasedDayNumber = parseInt( dayNumber ) + 1;
return( dateStringBundle.GetStringFromName( "day."+oneBasedDayNumber+".name" ) );
}
function getWeekNumberOfMonth()
{
//get the day number for today.
var startTime = getDateTimeFieldValue( "start-date-text" );
var oldStartTime = startTime;
var thisMonth = startTime.getMonth();
var monthToCompare = thisMonth;
var weekNumber = 0;
while( monthToCompare == thisMonth )
{
startTime = new Date( startTime.getTime() - ( 1000 * 60 * 60 * 24 * 7 ) );
monthToCompare = startTime.getMonth();
weekNumber++;
}
return( weekNumber );
}
function isLastDayOfWeekOfMonth()
{
//get the day number for today.
var startTime = getDateTimeFieldValue( "start-date-text" );
var oldStartTime = startTime;
var thisMonth = startTime.getMonth();
var monthToCompare = thisMonth;
var weekNumber = 0;
while( monthToCompare == thisMonth )
{
startTime = new Date( startTime.getTime() - ( 1000 * 60 * 60 * 24 * 7 ) );
monthToCompare = startTime.getMonth();
weekNumber++;
}
if( weekNumber > 3 )
{
var nextWeek = new Date( oldStartTime.getTime() + ( 1000 * 60 * 60 * 24 * 7 ) );
if( nextWeek.getMonth() != thisMonth )
{
//its the last week of the month
return( true );
}
}
return( false );
}
/* FILE ATTACHMENTS */
function removeSelectedAttachment()
{
var Listbox = document.getElementById( "attachmentBucket" );
var SelectedItem = Listbox.selectedItem;
if( SelectedItem )
Listbox.removeChild( SelectedItem );
}
function addAttachment( attachmentToAdd )
{
if( !attachmentToAdd )
{
return;
}
//add a row to the listbox
document.getElementById( "attachmentBucket" ).appendItem( attachmentToAdd.url, attachmentToAdd.url );
sizeToContent();
}
function getWeekNumberText( weekNumber )
{
switch( weekNumber )
{
case 1:
return( "First" );
case 2:
return( "Second" );
case 3:
return( "Third" );
case 4:
return( "Fourth" );
case 5:
return( "Last" );
default:
return( false );
}
}
/* URL */
function launchBrowser()
{
//get the URL from the text box
var UrlToGoTo = document.getElementById( "uri-field" ).value;
//launch the browser to that URL
opener.open( UrlToGoTo, "calendar-opened-window" );
}
/**
* Helper function for filling the form, set the value of a property of a XUL element
*
* PARAMETERS
* elementId - ID of XUL element to set
* newValue - value to set property to ( if undefined no change is made )
* propertyName - OPTIONAL name of property to set, default is "value", use "checked" for
* radios & checkboxes, "data" for drop-downs
*/
function setFieldValue( elementId, newValue, propertyName )
{
var undefined;
if( newValue !== undefined )
{
var field = document.getElementById( elementId );
if( newValue === false )
{
field.removeAttribute( propertyName );
}
else
{
if( propertyName )
{
field.setAttribute( propertyName, newValue );
}
else
{
field.value = newValue;
}
}
}
}
/**
* Helper function for getting data from the form,
* Get the value of a property of a XUL element
*
* PARAMETERS
* elementId - ID of XUL element to get from
* propertyName - OPTIONAL name of property to set, default is "value", use "checked" for
* radios & checkboxes, "data" for drop-downs
* RETURN
* newValue - value of property
*/
function getFieldValue( elementId, propertyName )
{
var field = document.getElementById( elementId );
if( propertyName )
{
return field[ propertyName ];
}
else
{
return field.value;
}
}
/**
* Helper function for getting a date/time from the form.
* The element must have been set up with setDateFieldValue or setTimeFieldValue.
*
* PARAMETERS
* elementId - ID of XUL element to get from
* RETURN
* newValue - Date value of element
*/
function getDateTimeFieldValue( elementId )
{
var field = document.getElementById( elementId );
return field.editDate;
}
/**
* Helper function for filling the form, set the value of a date field
*
* PARAMETERS
* elementId - ID of time textbox to set
* newDate - Date Object to use
*/
function setDateFieldValue( elementId, newDate )
{
// set the value to a formatted date string
var field = document.getElementById( elementId );
field.value = formatDate( newDate );
// add an editDate property to the item to hold the Date object
// used in onDatePick to update the date from the date picker.
// used in getDateTimeFieldValue to get the Date back out.
// we clone the date object so changes made in place do not propagte
field.editDate = new Date( newDate );
}
/**
* Helper function for filling the form, set the value of a time field
*
* PARAMETERS
* elementId - ID of time textbox to set
* newDate - Date Object to use
*/
function setTimeFieldValue( elementId, newDate )
{
// set the value to a formatted time string
var field = document.getElementById( elementId );
field.value = formatTime( newDate );
// add an editDate property to the item to hold the Date object
// used in onTimePick to update the date from the time picker.
// used in getDateTimeFieldValue to get the Date back out.
// we clone the date object so changes made in place do not propagte
field.editDate = new Date( newDate );
}
/**
* Take a Date object and return a displayable date string i.e.: May 5, 1959
* :TODO: This should be moved into DateFormater and made to use some kind of
* locale or user date format preference.
*/
function formatDate( date )
{
return( opener.gCalendarWindow.dateFormater.getFormatedDate( date ) );
}
/**
* Take a Date object and return a displayable time string i.e.: 12:30 PM
*/
function formatTime( time )
{
var timeString = opener.gCalendarWindow.dateFormater.getFormatedTime( time );
return timeString;
}
function debug( Text )
{
dump( "\n"+ Text + "\n");
}

View File

@@ -1,139 +0,0 @@
<?xml version="1.0"?>
<!-- ***** BEGIN LICENSE BLOCK *****
- Version: MPL 1.1/GPL 2.0/LGPL 2.1
-
- The contents of this file are subject to the Mozilla Public License Version
- 1.1 (the "License"); you may not use this file except in compliance with
- the License. You may obtain a copy of the License at
- http://www.mozilla.org/MPL/
-
- Software distributed under the License is distributed on an "AS IS" basis,
- WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- for the specific language governing rights and limitations under the
- License.
-
- The Original Code is OEone Calendar Code, released October 31st, 2001.
-
- The Initial Developer of the Original Code is
- OEone Corporation.
- Portions created by the Initial Developer are Copyright (C) 2001
- the Initial Developer. All Rights Reserved.
-
- Contributor(s): Mike Potter <mikep@oeone.com>
-
- Alternatively, the contents of this file may be used under the terms of
- either the GNU General Public License Version 2 or later (the "GPL"), or
- the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- in which case the provisions of the GPL or the LGPL are applicable instead
- of those above. If you wish to allow use of your version of this file only
- under the terms of either the GPL or the LGPL, and not to allow others to
- use your version of this file under the terms of the MPL, indicate your
- decision by deleting the provisions above and replace them with the notice
- and other provisions required by the LGPL or the GPL. If you do not delete
- the provisions above, a recipient may use your version of this file under
- the terms of any one of the MPL, the GPL or the LGPL.
-
- ***** END LICENSE BLOCK ***** -->
<!-- DTD File with all strings specific to the calendar -->
<!DOCTYPE overlay
[
<!ENTITY % dtd1 SYSTEM "chrome://calendar/locale/calendar.dtd" > %dtd1;
]>
<!-- This is the overlay that addes repeating information to the event and task dialogs. -->
<overlay id="calendarRepeatOverlay"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<!-- Repeat -->
<vbox id="repeat-outer-box">
<hbox id="repeat-box" align="center">
<checkbox id="repeat-checkbox" class="proper-align" label="&newevent.repeat.label;" checked="false" oncommand="commandRepeat()"/>
<textbox id="repeat-length-field" class="cursor-pointer" disable-controller="repeat" value="1" oninput="repeatLengthKeyDown( this )"/>
<menulist crop="none" oncommand="repeatUnitCommand( this )" labelnumber="labelplural" id="repeat-length-units" disable-controller="repeat">
<menupopup>
<menuitem label="&repeat.units.days;" labelplural="&repeat.units.days;" labelsingular="&repeat.units.days.singular;" id="repeat-length-days" value="days" />
<menuitem label="&repeat.units.weeks;" labelplural="&repeat.units.weeks;" labelsingular="&repeat.units.weeks.singular;" id="repeat-length-weeks" value="weeks"/>
<menuitem label="&repeat.units.months;" labelplural="&repeat.units.months;" labelsingular="&repeat.units.months.singular;" id="repeat-length-months" value="months"/>
<menuitem label="&repeat.units.years;" labelplural="&repeat.units.years;" labelsingular="&repeat.units.years.singular;" id="repeat-length-years" value="years" />
</menupopup>
</menulist>
</hbox>
<hbox id="repeat-extenstions-week" disabled="true" disable-controller="repeat" collapsed="false" align="center">
<checkbox disable-controller="repeat" class="repeat-day-class" label="Sun" id="advanced-repeat-week-0" value="0" checked="false" />
<checkbox disable-controller="repeat" class="repeat-day-class" label="Mon" id="advanced-repeat-week-1" value="1" checked="false" />
<checkbox disable-controller="repeat" class="repeat-day-class" label="Tue" id="advanced-repeat-week-2" value="2" checked="false" />
<checkbox disable-controller="repeat" class="repeat-day-class" label="Wed" id="advanced-repeat-week-3" value="3" checked="false" />
<checkbox disable-controller="repeat" class="repeat-day-class" label="Thu" id="advanced-repeat-week-4" value="4" checked="false" />
<checkbox disable-controller="repeat" class="repeat-day-class" label="Fri" id="advanced-repeat-week-5" value="5" checked="false" />
<checkbox disable-controller="repeat" class="repeat-day-class" label="Sat" id="advanced-repeat-week-6" value="6" checked="false" />
</hbox>
<hbox id="repeat-extenstions-month" diabled="true" collapsed="true" align="center">
<vbox align="center">
<radiogroup id="advanced-repeat-month" disable-controller="repeat">
<radio disable-controller="repeat" id="advanced-repeat-dayofmonth" label="On the xth day of the month" selected="true"/>
<radio disable-controller="repeat" id="advanced-repeat-dayofweek" label="4th Tuesday of the month"/>
<radio disable-controller="repeat" id="advanced-repeat-dayofweek-last" label="Last Tuesday of the month" disabled="true"/>
</radiogroup>
</vbox>
</hbox>
<spacer height="10" />
<hbox align="center">
<spacer class="repeat-left-spacer" />
<radiogroup id="repeat-until-group" disable-controller="repeat">
<radio id="repeat-forever-radio" disable-controller="repeat" label="&newevent.forever.label;" oncommand="commandUntil()"/>
<hbox id="repeat-end-box" align="center">
<vbox>
<hbox>
<radio id="repeat-until-radio" disable-controller="repeat" label="&newevent.until.label;" oncommand="commandUntil()"/>
<spacer id="until-spacer"/>
<textbox id="repeat-end-date-text" readonly="true" value="" onmousedown="prepareDatePicker('repeat-end-date-text')" popup="oe-date-picker-popup" position="before_start"/>
<image class="event-date-button-class" id="repeat-end-date-button" onmousedown="prepareDatePicker('repeat-end-date-text')" popup="oe-date-picker-popup" position="before_start"/>
</hbox>
<label id="repeat-time-warning" class="warning-text-class" value="&newevent.recurend.warning;" collapsed="true"/>
</vbox>
</hbox>
</radiogroup>
</hbox>
<hbox align="center">
<spacer class="repeat-left-spacer" />
<groupbox>
<caption label="&newevent.exceptions.caption;"/>
<grid>
<columns>
<column flex="1"/>
<column/>
</columns>
<rows>
<row>
<hbox align="center">
<textbox id="exception-dates-text" disable-controller="repeat" readonly="true" value="" onmousedown="prepareDatePicker('exception-dates-text')" popup="oe-date-picker-popup" position="before_start"/>
<image class="event-date-button-class" disable-controller="repeat" id="exception-dates-button" onmousedown="prepareDatePicker('exception-dates-text')" popup="oe-date-picker-popup" position="before_start"/>
</hbox>
<button id="exception-add-button" label="&newevent.addexceptions.label;" disable-controller="repeat" oncommand="addException()"/>
</row>
<row>
<listbox id="exception-dates-listbox" disable-controller="repeat" rows="4"/>
<vbox>
<button label="&newevent.deleteexceptions.label;" disable-controller="repeat" oncommand="removeSelectedExceptionDate()"/>
</vbox>
</row>
</rows>
</grid>
</groupbox>
</hbox>
</vbox>
<!-- /Repeat -->
</overlay>

View File

@@ -1,189 +0,0 @@
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is OEone Calendar Code, released October 31st, 2001.
*
* The Initial Developer of the Original Code is
* OEone Corporation.
* Portions created by the Initial Developer are Copyright (C) 2001
* the Initial Developer. All Rights Reserved.
*
* Contributor(s): Garth Smedley <garths@oeone.com>
* Mike Potter <mikep@oeone.com>
* Colin Phillips <colinp@oeone.com>
* Chris Charabaruk <ccharabaruk@meldstar.com>
* ArentJan Banck <ajbanck@planet.nl>
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
/***** calendar/calendarEventDialog.js
* AUTHOR
* Garth Smedley
* REQUIRED INCLUDES
* <script type="application/x-javascript" src="chrome://calendar/content/dateUtils.js"/>
* <script type="application/x-javascript" src="chrome://calendar/content/calendarEvent.js"/>
*
* NOTES
* Code for the calendar's new/edit event dialog.
*
* Invoke this dialog to create a new event as follows:
var args = new Object();
args.mode = "new"; // "new" or "edit"
args.onOk = <function>; // funtion to call when OK is clicked
args.calendarEvent = calendarEvent; // newly creatd calendar event to be editted
calendar.openDialog("caNewEvent", "chrome://calendar/content/calendarEventDialog.xul", true, args );
*
* Invoke this dialog to edit an existing event as follows:
*
var args = new Object();
args.mode = "edit"; // "new" or "edit"
args.onOk = <function>; // funtion to call when OK is clicked
args.calendarEvent = calendarEvent; // javascript object containin the event to be editted
* When the user clicks OK the onOk function will be called with a calendar event object.
*
*
* IMPLEMENTATION NOTES
**********
*/
/*-----------------------------------------------------------------
* W I N D O W V A R I A B L E S
*/
var gCalendarObject; // event being edited
var gOnOkFunction; // function to be called when user clicks OK
var gMode = ''; //what mode are we in? new or edit...
/*-----------------------------------------------------------------
* W I N D O W F U N C T I O N S
*/
/**
* Called when the dialog is loaded.
*/
function loadCalendarServerDialog()
{
// Get arguments, see description at top of file
var args = window.arguments[0];
gMode = args.mode;
gOnOkFunction = args.onOk;
gCalendarObject = args.CalendarObject;
// mode is "new or "edit" - show proper header
var titleDataItem = null;
if( "new" == args.mode )
{
titleDataItem = document.getElementById( "data-event-title-new" );
}
else
{
titleDataItem = document.getElementById( "data-event-title-edit" );
document.getElementById( "server-path-textbox" ).setAttribute( "readonly", "true" );
}
document.getElementById( "calendar-serverwindow" ).setAttribute( "title", titleDataItem.getAttribute( "value" ) );
document.getElementById( "server-name-textbox" ).value = gCalendarObject.name;
if( gCalendarObject.remote == true )
document.getElementById( "server-path-textbox" ).value = gCalendarObject.remotePath;
else
document.getElementById( "server-path-textbox" ).value = gCalendarObject.path;
// start focus on title
var firstFocus = document.getElementById( "server-name-textbox" );
firstFocus.focus();
}
/**
* Called when the OK button is clicked.
*/
function onOKCommand()
{
gCalendarObject.name = document.getElementById( "server-name-textbox" ).value;
gCalendarObject.path = document.getElementById( "server-path-textbox" ).value;
//TODO: check that the gCalendarObject.path is actually a file, if its not, create it.
// call caller's on OK function
gOnOkFunction( gCalendarObject );
// tell standard dialog stuff to close the dialog
return true;
}
function launchFilePicker()
{
// No show the 'Save As' dialog and ask for a filename to save to
const nsIFilePicker = Components.interfaces.nsIFilePicker;
var fp = Components.classes["@mozilla.org/filepicker;1"].createInstance(nsIFilePicker);
// caller can force disable of sand box, even if ON globally
fp.init(window, "Open", nsIFilePicker.modeOpen);
var ServerName = document.getElementById( "server-name-textbox" ).value;
if( ServerName == "" )
fp.defaultString = "MozillaCalendarFile.ics";
else
fp.defaultString = "MozillaCalendar"+ServerName+".ics";
fp.defaultExtension = "ics";
const filterCalendar = "Calendar Files";
const extensionCalendar = ".ics";
fp.appendFilter( filterCalendar, "*" + extensionCalendar );
fp.show();
if (fp.file && fp.file.path.length > 0)
{
document.getElementById( "server-path-textbox" ).value = fp.file.path;
gCalendarObject.path = fp.file.path;
}
}

View File

@@ -1,132 +0,0 @@
<?xml version="1.0"?>
<!-- ***** BEGIN LICENSE BLOCK *****
- Version: MPL 1.1/GPL 2.0/LGPL 2.1
-
- The contents of this file are subject to the Mozilla Public License Version
- 1.1 (the "License"); you may not use this file except in compliance with
- the License. You may obtain a copy of the License at
- http://www.mozilla.org/MPL/
-
- Software distributed under the License is distributed on an "AS IS" basis,
- WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- for the specific language governing rights and limitations under the
- License.
-
- The Original Code is OEone Calendar Code, released October 31st, 2001.
-
- The Initial Developer of the Original Code is
- OEone Corporation.
- Portions created by the Initial Developer are Copyright (C) 2001
- the Initial Developer. All Rights Reserved.
-
- Contributor(s): Mike Potter <mikep@oeone.com>
-
- Alternatively, the contents of this file may be used under the terms of
- either the GNU General Public License Version 2 or later (the "GPL"), or
- the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- in which case the provisions of the GPL or the LGPL are applicable instead
- of those above. If you wish to allow use of your version of this file only
- under the terms of either the GPL or the LGPL, and not to allow others to
- use your version of this file under the terms of the MPL, indicate your
- decision by deleting the provisions above and replace them with the notice
- and other provisions required by the LGPL or the GPL. If you do not delete
- the provisions above, a recipient may use your version of this file under
- the terms of any one of the MPL, the GPL or the LGPL.
-
- ***** END LICENSE BLOCK ***** -->
<?xml-stylesheet href="chrome://global/skin/global.css" type="text/css"?>
<?xul-overlay href="chrome://global/content/dialogOverlay.xul"?>
<!-- CSS File with all styles specific to the dialog -->
<?xml-stylesheet href="chrome://calendar/skin/dialogOverlay.css" type="text/css"?>
<!-- DTD File with all strings specific to the calendar -->
<!DOCTYPE dialog
[
<!ENTITY % dtd1 SYSTEM "chrome://calendar/locale/global.dtd" > %dtd1;
<!ENTITY % dtd2 SYSTEM "chrome://calendar/locale/calendar.dtd" > %dtd2;
]>
<dialog
id="calendar-serverwindow"
title="&calendar.server.dialog.title.new;"
buttons="accept,cancel"
ondialogaccept="return onOKCommand();"
ondialogcancel="return true;"
onload="loadCalendarServerDialog()"
persist="screenX screenY"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
xmlns:nc="http://home.netscape.com/NC-rdf#">
<!-- Javascript includes -->
<script type="application/x-javascript" src="chrome://global/content/strres.js"/>
<script type="application/x-javascript" src="chrome://calendar/content/calendarServerDialog.js"/>
<!-- Data used in JS from dtd -->
<dataset>
<data id="data-event-title-new" value="&calendar.server.dialog.title.new;" />
<data id="data-event-title-edit" value="&calendar.server.dialog.title.edit;" />
</dataset>
<keyset id="dialogKeys"/>
<!-- The dialog -->
<!-- dialog-box: from dialogOverlay.xul -->
<vbox id="dialog-box" flex="1">
<!-- standard-dialog-content: from dialogOverlay.xul -->
<vbox id="standard-dialog-content" flex="1">
<grid>
<columns>
<column />
<column flex="1"/>
</columns>
<rows>
<!-- Name -->
<row align="center">
<hbox class="field-label-box-class" pack="end">
<description>&calendar.server.dialog.name.label;</description>
</hbox>
<textbox flex="1" id="server-name-textbox"/>
</row>
<!-- Location -->
<row align="center">
<hbox class="field-label-box-class" pack="end">
<description>&calendar.server.dialog.location.label;</description>
</hbox>
<hbox>
<textbox id="server-path-textbox" flex="1" />
<button oncommand="launchFilePicker()" label="&calendar.server.dialog.browse.label;"/>
</hbox>
</row>
<!-- File Picker Button -->
<row align="center">
<hbox class="field-label-box-class" pack="end"/>
<hbox style="max-width: 400px;">
<description flex="1">&calendar.server.dialog.help.label;</description>
</hbox>
</row>
</rows>
</grid>
</vbox> <!-- standard-dialog-content -->
</vbox> <!-- dialog-box -->
</dialog>

View File

@@ -1,728 +0,0 @@
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is OEone Calendar Code, released October 31st, 2001.
*
* The Initial Developer of the Original Code is
* OEone Corporation.
* Portions created by the Initial Developer are Copyright (C) 2001
* the Initial Developer. All Rights Reserved.
*
* Contributor(s): Garth Smedley <garths@oeone.com>
* Mike Potter <mikep@oeone.com>
* Colin Phillips <colinp@oeone.com>
* Chris Charabaruk <coldacid@meldstar.com>
* ArentJan Banck <ajbanck@planet.nl>
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
/***** calendar/calendarEventDialog.js
* AUTHOR
* Garth Smedley
* REQUIRED INCLUDES
* <script type="application/x-javascript" src="chrome://calendar/content/dateUtils.js"/>
* <script type="application/x-javascript" src="chrome://calendar/content/calendarEvent.js"/>
*
* NOTES
* Code for the calendar's new/edit event dialog.
*
* Invoke this dialog to create a new event as follows:
var args = new Object();
args.mode = "new"; // "new" or "edit"
args.onOk = <function>; // funtion to call when OK is clicked
args.calendarEvent = calendarEvent; // newly creatd calendar event to be editted
calendar.openDialog("caNewEvent", "chrome://calendar/content/calendarEventDialog.xul", true, args );
*
* Invoke this dialog to edit an existing event as follows:
*
var args = new Object();
args.mode = "edit"; // "new" or "edit"
args.onOk = <function>; // funtion to call when OK is clicked
args.calendarEvent = calendarEvent; // javascript object containin the event to be editted
* When the user clicks OK the onOk function will be called with a calendar event object.
*
*
* IMPLEMENTATION NOTES
**********
*/
/*-----------------------------------------------------------------
* W I N D O W V A R I A B L E S
*/
var gToDo; // event being edited
var gOnOkFunction; // function to be called when user clicks OK
var gTimeDifference = 3600000; //when editing an event, we change the end time if the start time is changing. This is the difference for the event time.
var gDefaultAlarmLength = 15; //number of minutes to default the alarm to
var gMode = ''; //what mode are we in? new or edit...
/*-----------------------------------------------------------------
* W I N D O W F U N C T I O N S
*/
/**
* Called when the dialog is loaded.
*/
function loadCalendarToDoDialog()
{
// Get arguments, see description at top of file
var args = window.arguments[0];
gMode = args.mode;
gOnOkFunction = args.onOk;
gToDo = args.calendarToDo;
// mode is "new or "edit" - show proper header
var titleDataItem = null;
if( "new" == args.mode )
{
titleDataItem = document.getElementById( "data-todo-title-new" );
}
else
{
titleDataItem = document.getElementById( "data-todo-title-edit" );
}
var titleString = titleDataItem.getAttribute( "value" );
document.getElementById("calendar-new-taskwindow").setAttribute("title", titleString);
// fill in fields from the event
var dueDate = new Date( gToDo.due.getTime() );
document.getElementById( "due-date-picker" ).value = dueDate;
var startDate = new Date( gToDo.start.getTime() );
document.getElementById( "start-date-picker" ).value = startDate;
setFieldValue( "priority-levels", gToDo.priority );
setFieldValue( "percent-complete-menulist", gToDo.percent );
if( gToDo.completed.getTime() > 0 )
{
var completedDate = new Date( gToDo.completed.getTime() );
document.getElementById( "completed-date-picker" ).value = completedDate;
setFieldValue( "completed-checkbox", "true", "checked" );
}
else
{
var Today = new Date();
document.getElementById( "completed-date-picker" ).value = Today;
}
setFieldValue( "title-field", gToDo.title );
setFieldValue( "description-field", gToDo.description );
setFieldValue( "uri-field", gToDo.url );
switch( gToDo.status )
{
case gToDo.ICAL_STATUS_CANCELLED:
setFieldValue( "cancelled-checkbox", true, "checked" );
break;
}
setFieldValue( "private-checkbox", gToDo.privateEvent, "checked" );
if( gToDo.alarm === false && gToDo.alarmLength == 0 )
{
gToDo.alarmLength = gDefaultAlarmLength;
}
setFieldValue( "alarm-checkbox", gToDo.alarm, "checked" );
setFieldValue( "alarm-length-field", gToDo.alarmLength );
setFieldValue( "alarm-length-units", gToDo.alarmUnits );
// Load categories
var categoriesString = opener.getCharPref(opener.gCalendarWindow.calendarPreferences.calendarPref, "categories.names", getDefaultCategories() );
var categoriesList = categoriesString.split( "," );
// insert the category already in the task so it doesn't get lost
if( gToDo.categories )
if( categoriesString.indexOf( gToDo.categories ) == -1 )
categoriesList[categoriesList.length] = gToDo.categories;
categoriesList.sort();
var oldMenulist = document.getElementById( "categories-menulist-menupopup" );
while( oldMenulist.hasChildNodes() )
oldMenulist.removeChild( oldMenulist.lastChild );
for (var i = 0; i < categoriesList.length ; i++)
{
document.getElementById( "categories-field" ).appendItem(categoriesList[i], categoriesList[i]);
}
document.getElementById( "categories-field" ).selectedIndex = -1;
setFieldValue( "categories-field", gToDo.categories );
/* Server stuff */
var serverList = opener.gCalendarWindow.calendarManager.calendars;
document.getElementById( "server-menulist-menupopup" ).database.AddDataSource( opener.gCalendarWindow.calendarManager.rdf.getDatasource() );
document.getElementById( "server-menulist-menupopup" ).builder.rebuild();
if( args.mode == "new" )
{
if( args.server )
{
setFieldValue( "server-field", args.server );
}
else
{
document.getElementById( "server-field" ).selectedIndex = 1;
}
}
else
{
setFieldValue( "server-field", gToDo.parent.server );
//for now you can't edit which file the event is in.
setFieldValue( "server-field", "true", "disabled" );
setFieldValue( "server-field-label", "true", "disabled" );
}
//the next line seems to crash Mozilla
//setFieldValue( "server-field", gEvent.parent.server );
// update enabling and disabling
updateAlarmItemEnabled();
updateCompletedItemEnabled();
// start focus on title
var firstFocus = document.getElementById( "title-field" );
firstFocus.focus();
opener.setCursor( "default" );
}
/**
* Called when the OK button is clicked.
*/
function onOKCommand()
{
// get values from the form and put them into the event
gToDo.title = getFieldValue( "title-field" );
gToDo.description = getFieldValue( "description-field" );
var dueDate = document.getElementById( "due-date-picker" ).value;
gToDo.due.year = dueDate.getYear()+1900;
gToDo.due.month = dueDate.getMonth();
gToDo.due.day = dueDate.getDate();
gToDo.due.hour = 23;
gToDo.due.minute = 59;
var startDate = document.getElementById( "start-date-picker" ).value;
gToDo.start.year = startDate.getYear()+1900;
gToDo.start.month = startDate.getMonth();
gToDo.start.day = startDate.getDate();
gToDo.start.hour = 0;
gToDo.start.minute = 0;
gToDo.url = getFieldValue( "uri-field" );
gToDo.privateEvent = getFieldValue( "private-checkbox", "checked" );
gToDo.alarm = getFieldValue( "alarm-checkbox", "checked" );
gToDo.alarmLength = getFieldValue( "alarm-length-field" );
gToDo.alarmUnits = getFieldValue( "alarm-length-units", "value" );
gToDo.priority = getFieldValue( "priority-levels", "value" );
var completed = getFieldValue( "completed-checkbox", "checked" );
gToDo.categories = getFieldValue( "categories-field", "value" );
var percentcomplete = getFieldValue( "percent-complete-menulist" );
percentcomplete = parseInt( percentcomplete );
if(percentcomplete > 100)
percentcomplete = 100;
else if(percentcomplete < 0)
percentcomplete = 0;
gToDo.percent = percentcomplete;
if( completed )
{
//get the time for the completed event
var completedDate = document.getElementById( "completed-date-picker" ).value;
gToDo.completed.year = completedDate.getYear() + 1900;
gToDo.completed.month = completedDate.getMonth();
gToDo.completed.day = completedDate.getDate();
gToDo.status = gToDo.ICAL_STATUS_COMPLETED;
}
else
{
gToDo.completed.clear();
var cancelled = getFieldValue( "cancelled-checkbox", "checked" );
if( cancelled )
gToDo.status = gToDo.ICAL_STATUS_CANCELLED;
else if (percentcomplete > 0)
gToDo.status = gToDo.ICAL_STATUS_INPROCESS;
else
gToDo.status = gToDo.ICAL_STATUS_NEEDSACTION;
}
if ( getFieldValue( "alarm-email-checkbox", "checked" ) )
{
gToDo.alarmEmailAddress = getFieldValue( "alarm-email-field", "value" );
}
else
{
gToDo.alarmEmailAddress = "";
}
var Server = getFieldValue( "server-field" );
// :TODO: REALLY only do this if the alarm or start settings change.?
//if the end time is later than the start time... alert the user using text from the dtd.
// call caller's on OK function
gOnOkFunction( gToDo, Server );
// tell standard dialog stuff to close the dialog
return true;
}
/**
* Called when an item with a datepicker is clicked, BEFORE the picker is shown.
*/
function prepareDatePicker( dateFieldName )
{
// get the popup and the field we are editing
var datePickerPopup = document.getElementById( "oe-date-picker-popup" );
var dateField = document.getElementById( dateFieldName );
// tell the date picker the date to edit.
setFieldValue( "oe-date-picker-popup", dateField.editDate, "value" );
// remember the date field that is to be updated by adding a
// property "dateField" to the popup.
datePickerPopup.dateField = dateField;
}
/**
* Called when a datepicker is finished, and a date was picked.
*/
function onDatePick( datepopup )
{
// display the new date in the textbox
datepopup.dateField.value = formatDate( datepopup.value );
// remember the new date in a property, "editDate". we created on the date textbox
datepopup.dateField.editDate = datepopup.value;
checkStartAndDueDates();
}
function checkStartAndDueDates()
{
var StartDate = document.getElementById( "start-date-picker" ).value;
var dueDate = document.getElementById( "due-date-picker" ).value;
if( DueDate.getTime() < StartDate.getTime() )
{
//show alert message, disable OK button
document.getElementById( "start-date-warning" ).removeAttribute( "collapsed" );
document.getElementById( "calendar-new-taskwindow" ).getButton( "accept" ).setAttribute( "disabled", true );
}
else
{
//enable OK button
document.getElementById( "start-date-warning" ).setAttribute( "collapsed", true );
document.getElementById( "calendar-new-taskwindow" ).getButton( "accept" ).removeAttribute( "disabled" );
}
}
/**
* Called when the alarm checkbox is clicked.
*/
function commandAlarm()
{
updateAlarmItemEnabled();
}
/**
* Enable/Disable Alarm items
*/
function updateAlarmItemEnabled()
{
var alarmCheckBox = "alarm-checkbox";
var alarmField = "alarm-length-field";
var alarmMenu = "alarm-length-units";
var alarmLabel = "alarm-length-text";
var alarmEmailCheckbox = "alarm-email-checkbox";
var alarmEmailField = "alarm-email-field";
if( getFieldValue(alarmCheckBox, "checked" ) )
{
// call remove attribute beacuse some widget code checks for the presense of a
// disabled attribute, not the value.
setFieldValue( alarmField, false, "disabled" );
setFieldValue( alarmMenu, false, "disabled" );
setFieldValue( alarmLabel, false, "disabled" );
setFieldValue( alarmEmailCheckbox, false, "disabled" );
}
else
{
setFieldValue( alarmField, true, "disabled" );
setFieldValue( alarmMenu, true, "disabled" );
setFieldValue( alarmLabel, true, "disabled" );
setFieldValue( alarmEmailField, true, "disabled" );
setFieldValue( alarmEmailCheckbox, true, "disabled" );
setFieldValue( alarmEmailCheckbox, false, "checked" );
}
}
function updateCompletedItemEnabled()
{
var completedCheckbox = "completed-checkbox";
if( getFieldValue( completedCheckbox, "checked" ) )
{
setFieldValue( "completed-date-picker", false, "disabled" );
setFieldValue( "percent-complete-menulist", "100" );
setFieldValue( "percent-complete-menulist", true, "disabled" );
setFieldValue( "percent-complete-text", true, "disabled" );
}
else
{
setFieldValue( "completed-date-picker", true, "disabled" );
setFieldValue( "percent-complete-menulist", false, "disabled" );
setFieldValue( "percent-complete-text", false, "disabled" );
if( getFieldValue( "percent-complete-menulist" ) == 100 )
setFieldValue( "percent-complete-menulist", "0" );
}
}
function percentCompleteCommand()
{
var percentcompletemenu = "percent-complete-menulist";
var percentcomplete = getFieldValue( "percent-complete-menulist" );
percentcomplete = parseInt( percentcomplete );
if( percentcomplete == 100)
setFieldValue( "completed-checkbox", "true", "checked" );
updateCompletedItemEnabled();
}
/**
* Update plural singular menu items
*/
function updateAlarmPlural()
{
updateMenuPlural( "alarm-length-field", "alarm-length-units" );
}
/**
* Update plural singular menu items
*/
function updateMenuPlural( lengthFieldId, menuId )
{
var field = document.getElementById( lengthFieldId );
var menu = document.getElementById( menuId );
// figure out whether we should use singular or plural
var length = field.value;
var newLabelNumber;
if( Number( length ) > 1 )
{
newLabelNumber = "labelplural"
}
else
{
newLabelNumber = "labelsingular"
}
// see what we currently show and change it if required
var oldLabelNumber = menu.getAttribute( "labelnumber" );
if( newLabelNumber != oldLabelNumber )
{
// remember what we are showing now
menu.setAttribute( "labelnumber", newLabelNumber );
// update the menu items
var items = menu.getElementsByTagName( "menuitem" );
for( var i = 0; i < items.length; ++i )
{
var menuItem = items[i];
var newLabel = menuItem.getAttribute( newLabelNumber );
menuItem.label = newLabel;
menuItem.setAttribute( "label", newLabel );
}
// force the menu selection to redraw
var saveSelectedIndex = menu.selectedIndex;
menu.selectedIndex = -1;
menu.selectedIndex = saveSelectedIndex;
}
}
/**
* Handle key down in alarm field
*/
function alarmLengthKeyDown( repeatField )
{
updateAlarmPlural();
}
var launch = true;
/* URL */
function launchBrowser()
{
if( launch == false ) //stops them from clicking on it twice
return;
launch = false;
//get the URL from the text box
var UrlToGoTo = document.getElementById( "uri-field" ).value;
if( UrlToGoTo.length < 4 ) //it has to be > 4, since it needs at least 1 letter, a . and a two letter domain name.
return;
//check if it has a : in it
if( UrlToGoTo.indexOf( ":" ) == -1 )
UrlToGoTo = "http://"+UrlToGoTo;
//launch the browser to that URL
window.open( UrlToGoTo, "calendar-opened-window" );
launch = true;
}
/**
* Helper function for filling the form, set the value of a property of a XUL element
*
* PARAMETERS
* elementId - ID of XUL element to set
* newValue - value to set property to ( if undefined no change is made )
* propertyName - OPTIONAL name of property to set, default is "value", use "checked" for
* radios & checkboxes, "data" for drop-downs
*/
function setFieldValue( elementId, newValue, propertyName )
{
var undefined;
if( newValue !== undefined )
{
var field = document.getElementById( elementId );
if( !field )
alert( elementId+" not found" );
if( newValue === false )
{
field.removeAttribute( propertyName );
}
else
{
if( propertyName )
{
field.setAttribute( propertyName, newValue );
}
else
{
field.value = newValue;
}
}
}
}
/**
* Helper function for getting data from the form,
* Get the value of a property of a XUL element
*
* PARAMETERS
* elementId - ID of XUL element to get from
* propertyName - OPTIONAL name of property to set, default is "value", use "checked" for
* radios & checkboxes, "data" for drop-downs
* RETURN
* newValue - value of property
*/
function getFieldValue( elementId, propertyName )
{
var field = document.getElementById( elementId );
if( propertyName )
{
return field[ propertyName ];
}
else
{
return field.value;
}
}
/**
* Helper function for getting a date/time from the form.
* The element must have been set up with setDateFieldValue or setTimeFieldValue.
*
* PARAMETERS
* elementId - ID of XUL element to get from
* RETURN
* newValue - Date value of element
*/
function getDateTimeFieldValue( elementId )
{
var field = document.getElementById( elementId );
return field.editDate;
}
/**
* Helper function for filling the form, set the value of a date field
*
* PARAMETERS
* elementId - ID of time textbox to set
* newDate - Date Object to use
*/
function setDateFieldValue( elementId, newDate )
{
// set the value to a formatted date string
var field = document.getElementById( elementId );
field.value = formatDate( newDate );
// add an editDate property to the item to hold the Date object
// used in onDatePick to update the date from the date picker.
// used in getDateTimeFieldValue to get the Date back out.
// we clone the date object so changes made in place do not propagte
field.editDate = new Date( newDate );
}
/**
* Helper function for filling the form, set the value of a time field
*
* PARAMETERS
* elementId - ID of time textbox to set
* newDate - Date Object to use
*/
function setTimeFieldValue( elementId, newDate )
{
// set the value to a formatted time string
var field = document.getElementById( elementId );
field.value = formatTime( newDate );
// add an editDate property to the item to hold the Date object
// used in onTimePick to update the date from the time picker.
// used in getDateTimeFieldValue to get the Date back out.
// we clone the date object so changes made in place do not propagte
field.editDate = new Date( newDate );
}
/**
* Take a Date object and return a displayable date string i.e.: May 5, 1959
* :TODO: This should be moved into DateFormater and made to use some kind of
* locale or user date format preference.
*/
function formatDate( date )
{
return( opener.gCalendarWindow.dateFormater.getFormatedDate( date ) );
}
/**
* Take a Date object and return a displayable time string i.e.: 12:30 PM
*/
function formatTime( time )
{
var timeString = opener.gCalendarWindow.dateFormater.getFormatedTime( time );
return timeString;
}

View File

@@ -1,289 +0,0 @@
<?xml version="1.0"?>
<!-- ***** BEGIN LICENSE BLOCK *****
- Version: MPL 1.1/GPL 2.0/LGPL 2.1
-
- The contents of this file are subject to the Mozilla Public License Version
- 1.1 (the "License"); you may not use this file except in compliance with
- the License. You may obtain a copy of the License at
- http://www.mozilla.org/MPL/
-
- Software distributed under the License is distributed on an "AS IS" basis,
- WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- for the specific language governing rights and limitations under the
- License.
-
- The Original Code is OEone Calendar Code, released October 31st, 2001.
-
- The Initial Developer of the Original Code is
- OEone Corporation.
- Portions created by the Initial Developer are Copyright (C) 2001
- the Initial Developer. All Rights Reserved.
-
- Contributor(s): Garth Smedley <garths@oeone.com>
- Mike Potter <mikep@oeone.com>
- Colin Phillips <colinp@oeone.com>
-
- Alternatively, the contents of this file may be used under the terms of
- either the GNU General Public License Version 2 or later (the "GPL"), or
- the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- in which case the provisions of the GPL or the LGPL are applicable instead
- of those above. If you wish to allow use of your version of this file only
- under the terms of either the GPL or the LGPL, and not to allow others to
- use your version of this file under the terms of the MPL, indicate your
- decision by deleting the provisions above and replace them with the notice
- and other provisions required by the LGPL or the GPL. If you do not delete
- the provisions above, a recipient may use your version of this file under
- the terms of any one of the MPL, the GPL or the LGPL.
-
- ***** END LICENSE BLOCK ***** -->
<?xml-stylesheet href="chrome://global/skin/global.css" type="text/css"?>
<?xul-overlay href="chrome://global/content/dialogOverlay.xul"?>
<?xul-overlay href="chrome://calendar/content/timepicker/timepicker-overlay.xul"?>
<!-- CSS File with all styles specific to the dialog -->
<?xml-stylesheet href="chrome://calendar/skin/calendarEventDialog.css" ?>
<?xml-stylesheet href="chrome://calendar/skin/dialogOverlay.css" type="text/css"?>
<?xml-stylesheet href="chrome://calendar/context/datepicker/datepicker.css" ?>
<?xml-stylesheet href="chrome://calendar/context/datepicker/calendar.css" ?>
<!-- DTD File with all strings specific to the calendar -->
<!DOCTYPE dialog
[
<!ENTITY % dtd1 SYSTEM "chrome://calendar/locale/global.dtd" > %dtd1;
<!ENTITY % dtd2 SYSTEM "chrome://calendar/locale/calendar.dtd" > %dtd2;
]>
<dialog
id="calendar-new-taskwindow"
title="Calendar Event"
buttons="accept,cancel"
ondialogaccept="return onOKCommand();"
ondialogcancel="return true;"
onload="loadCalendarToDoDialog()"
persist="screenX screenY"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
>
<!-- Javascript DTD To Variable -->
<script type="application/x-javascript">
var neStartTimeErrorAlertMessage = "&newevent.starttimeerror.alertmessage;";
var neRecurErrorAlertMessage = "&newevent.recurendtimeerror.alertmessage;";
</script>
<!-- Javascript includes -->
<script type="application/x-javascript" src="chrome://global/content/strres.js"/>
<script type="application/x-javascript" src="chrome://calendar/content/dateUtils.js"/>
<script type="application/x-javascript" src="chrome://calendar/content/calendarToDoDialog.js"/>
<!-- needed to get the default categories -->
<script type="application/x-javascript" src="chrome://calendar/content/pref/rootCalendarPref.js"/>
<!-- Data used in JS from dtd -->
<dataset>
<data id="data-todo-title-new" value="&todo.title.new;" />
<data id="data-todo-title-edit" value="&todo.title.edit;" />
</dataset>
<!-- Picker popups -->
<popup id="oe-date-picker-popup" position="after_start" oncommand="onDatePick( this )" value=""/>
<keyset id="dialogKeys"/>
<!-- The dialog -->
<!-- dialog-box: from dialogOverlay.xul -->
<vbox id="dialog-box" flex="1">
<!-- standard-dialog-content: from dialogOverlay.xul -->
<vbox id="standard-dialog-content" flex="1">
<!-- Form elements -->
<grid>
<columns>
<column />
<column flex="1"/>
</columns>
<rows>
<!-- Title -->
<row align="center">
<hbox class="field-label-box-class" pack="end">
<label for="title-field" value="&newevent.title.label;"/>
</hbox>
<textbox id="title-field"/>
</row>
<!-- Start Date -->
<row align="center">
<hbox class="field-label-box-class" pack="end">
<label value="&newtodo.startdate.label;"/>
</hbox>
<hbox id="start-date-box" align="center">
<datepicker id="start-date-picker" value=""/>
</hbox>
</row>
<!-- Due Date -->
<row align="center">
<hbox class="field-label-box-class" pack="end">
<label value="&newtodo.duedate.label;"/>
</hbox>
<hbox id="due-date-box" align="center">
<datepicker id="due-date-picker" value=""/>
<label id="start-date-warning" class="warning-text-class" value="&newtodo.starttime.warning;" collapsed="true"/>
</hbox>
</row>
<!-- Description -->
<row flex="1" align="start">
<hbox class="field-label-box-class" pack="end">
<label for="description-field" value="&newevent.description.label;"/>
</hbox>
<textbox id="description-field" onkeypress="event.stopPropagation()" multiline="true" rows="3" cols="30" />
</row>
<!-- URI/URL -->
<row align="center">
<hbox class="field-label-box-class" pack="end">
<label for="uri-field" value="&newevent.uri.label;"/>
</hbox>
<hbox>
<textbox id="uri-field" flex="1"/>
<button label="&newevent.uri.visit.label;" oncommand="launchBrowser()"/>
</hbox>
</row>
<!-- Private -->
<row collapsed="true" align="center">
<spacer />
<checkbox id="private-checkbox" checked="false" label="&newevent.private.label;"/>
</row>
<!-- Priority -->
<row align="center">
<hbox class="field-label-box-class" pack="end">
<label value="&newtodo.priority.label;"/>
</hbox>
<hbox>
<menulist id="priority-levels">
<menupopup>
<menuitem label="&priority.level.none;" value="0"/>
<menuitem label="&priority.level.low;" value="9"/>
<menuitem label="&priority.level.medium;" value="5"/>
<menuitem label="&priority.level.high;" value="1"/>
</menupopup>
</menulist>
</hbox>
</row>
<!-- Alarm -->
<row align="center" collapsed="true">
<spacer />
<vbox>
<hbox id="alarm-box" align="center">
<checkbox id="alarm-checkbox" class="proper-align" label="&newevent.alarm.label;" checked="false" oncommand="commandAlarm()"/>
<textbox id="alarm-length-field" oninput="alarmLengthKeyDown( this )"/>
<menulist id="alarm-length-units" flex="1" labelnumber="labelplural">
<menupopup>
<menuitem label="&alarm.units.minutes;" labelplural="&alarm.units.minutes;" labelsingular="&alarm.units.minutes.singular;" value="minutes"/>
<menuitem label="&alarm.units.hours;" labelplural="&alarm.units.hours;" labelsingular="&alarm.units.hours.singular;" value="hours" />
<menuitem label="&alarm.units.days;" labelplural="&alarm.units.days;" labelsingular="&alarm.units.days.singular;" value="days"/>
</menupopup>
</menulist>
<label id="alarm-length-text" for="alarm-length-field" value="&newevent.beforealarm.label;"/>
</hbox>
<hbox id="alarm-box-email" collapsed="true" align="center">
<checkbox id="alarm-email-checkbox" label="&newevent.email.label;" checked="false" oncommand="commandAlarmEmail()"/>
<textbox id="alarm-email-field" disabled="true" size="39" value="" />
</hbox>
</vbox>
</row>
<!-- Completed -->
<row align="center">
<hbox class="field-label-box-class" pack="end">
<label value="&newtodo.completed.label;" pack="end"/>
</hbox>
<hbox>
<checkbox id="completed-checkbox" oncommand="updateCompletedItemEnabled()"/>
<datepicker id="completed-date-picker" disabled="true" value=""/>
<spacer/>
<menulist id="percent-complete-menulist" editable="true" oncommand="percentCompleteCommand()">
<menupopup>
<menuitem label="0" value="0"/>
<menuitem label="10" value="10"/>
<menuitem label="20" value="20"/>
<menuitem label="30" value="30"/>
<menuitem label="40" value="40"/>
<menuitem label="50" value="50"/>
<menuitem label="60" value="60"/>
<menuitem label="70" value="70"/>
<menuitem label="80" value="80"/>
<menuitem label="90" value="90"/>
<menuitem label="100" value="100"/>
</menupopup>
</menulist>
<label id="percent-complete-text" value="&newtodo.percentcomplete.label;"/>
</hbox>
</row>
<!-- Task Status -->
<row align="center">
<hbox class="field-label-box-class" pack="end">
<label value="&newtodo.status.label;"/>
</hbox>
<checkbox id="cancelled-checkbox" label="&newtodo.cancelled.label;" checked="false"/>
</row>
<!-- Categories -->
<row align="center">
<hbox class="field-label-box-class" pack="end">
<label value="&newtodo.categories.label;"/>
</hbox>
<menulist id="categories-field" label="&newevent.category.label;">
<menupopup id="categories-menulist-menupopup">
<menuitem label="&priority.level.none;" value="0"/>
</menupopup>
</menulist>
</row>
<!-- Calendar Server -->
<row align="center">
<hbox class="field-label-box-class" pack="end">
<label id="server-field-label" value="&newevent.server.label;"/>
</hbox>
<menulist id="server-field">
<menupopup id="server-menulist-menupopup" datasources="rdf:null" ref="urn:calendarcontainer">
<template>
<rule>
<menuitem uri="rdf:*" value="rdf:http://home.netscape.com/NC-rdf#path" label="rdf:http://home.netscape.com/NC-rdf#name"/>
</rule>
</template>
</menupopup>
</menulist>
</row>
</rows>
</grid>
</vbox> <!-- standard-dialog-content -->
</vbox> <!-- dialog-box -->
</dialog>

View File

@@ -1,728 +0,0 @@
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is OEone Calendar Code, released October 31st, 2001.
*
* The Initial Developer of the Original Code is
* OEone Corporation.
* Portions created by the Initial Developer are Copyright (C) 2001
* the Initial Developer. All Rights Reserved.
*
* Contributor(s): Garth Smedley <garths@oeone.com>
* Mike Potter <mikep@oeone.com>
* Colin Phillips <colinp@oeone.com>
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
/*-----------------------------------------------------------------
* WeekView Class subclass of CalendarView
*
* Calendar week view class :TODO: display of events has not been started
*
* PROPERTIES
* gHeaderDateItemArray - Array of text boxes used to display the dates of the currently displayed
* week.
*
*
*/
// Make WeekView inherit from CalendarView
WeekView.prototype = new CalendarView();
WeekView.prototype.constructor = WeekView;
/**
* WeekView Constructor.
*
* PARAMETERS
* calendarWindow - the owning instance of CalendarWindow.
*
*/
function WeekView( calendarWindow )
{
// call super
this.superConstructor( calendarWindow );
//set the time on the left hand side labels
//need to do this in JavaScript to preserve formatting
for( var i = 0; i < 24; i++ )
{
/*
** FOR SOME REASON, THIS IS NOT WORKING FOR MIDNIGHT
*/
var TimeToFormat = new Date();
TimeToFormat.setHours( i );
TimeToFormat.setMinutes( "0" );
var FormattedTime = calendarWindow.dateFormater.getFormatedTime( TimeToFormat );
var Label = document.getElementById( "week-view-hour-"+i );
Label.setAttribute( "value", FormattedTime );
}
// get week view header items
gHeaderDateItemArray = new Array();
for( var dayIndex = 1; dayIndex <= 7; ++dayIndex )
{
var headerDateItem = document.getElementById( "week-header-date-" + dayIndex );
gHeaderDateItemArray[ dayIndex ] = headerDateItem;
}
var weekViewEventSelectionObserver =
{
onSelectionChanged : function( EventSelectionArray )
{
for( i = 0; i < EventSelectionArray.length; i++ )
{
gCalendarWindow.weekView.selectBoxForEvent( EventSelectionArray[i] );
}
}
}
calendarWindow.EventSelection.addObserver( weekViewEventSelectionObserver );
}
/** PUBLIC
*
* Redraw the events for the current week
*/
WeekView.prototype.refreshEvents = function( )
{
this.kungFooDeathGripOnEventBoxes = new Array();
var eventBoxList = document.getElementsByAttribute( "eventbox", "weekview" );
for( var eventBoxIndex = 0; eventBoxIndex < eventBoxList.length; ++eventBoxIndex )
{
var eventBox = eventBoxList[ eventBoxIndex ];
eventBox.parentNode.removeChild( eventBox );
}
for( var dayIndex = 1; dayIndex <= 7; ++dayIndex )
{
var headerDateItem = document.getElementById( "week-header-date-" + dayIndex );
headerDateItem.numEvents = 0;
}
//get the all day box.
var AllDayBox = document.getElementById( "week-view-all-day-content-box" );
AllDayBox.setAttribute( "collapsed", "true" );
//expand the day's content box by setting allday to false..
document.getElementById( "week-view-content-box" ).removeAttribute( "allday" );
//START FOR LOOP FOR DAYS--->
for ( dayIndex = 1; dayIndex <= 7; ++dayIndex )
{
//make the text node that will contain the text for the all day box.
var TextNode = document.getElementById( "all-day-content-box-text-week-"+dayIndex );
// get the events for the day and loop through them
var dayToGet = new Date( gHeaderDateItemArray[dayIndex].getAttribute( "date" ) );
var dayEventList = new Array();
dayEventList = this.calendarWindow.eventSource.getEventsForDay( dayToGet );
//refresh the array and the current spot.
for ( i = 0; i < dayEventList.length; i++ )
{
dayEventList[i].OtherSpotArray = new Array('0');
dayEventList[i].CurrentSpot = 0;
dayEventList[i].NumberOfSameTimeEvents = 0;
}
for ( i = 0; i < dayEventList.length; i++ )
{
var ThisSpot = 0;
var calendarEventDisplay = dayEventList[i];
//check to make sure that the event is not an all day event...
if ( calendarEventDisplay.event.allDay != true )
{
//see if there's another event at the same start time.
for ( var j = 0; j < dayEventList.length; j++ )
{
var thisCalendarEventDisplay = dayEventList[j];
//if this event overlaps with another event...
if ( ( ( thisCalendarEventDisplay.displayDate >= calendarEventDisplay.displayDate &&
thisCalendarEventDisplay.displayDate.getTime() < calendarEventDisplay.event.end.getTime() ) ||
( calendarEventDisplay.displayDate >= thisCalendarEventDisplay.displayDate &&
calendarEventDisplay.displayDate.getTime() < thisCalendarEventDisplay.event.end.getTime() ) ) &&
calendarEventDisplay.event.id != thisCalendarEventDisplay.event.id &&
thisCalendarEventDisplay.event.allDay != true )
{
//get the spot that this event will go in.
ThisSpot = thisCalendarEventDisplay.CurrentSpot;
calendarEventDisplay.OtherSpotArray.push( ThisSpot );
ThisSpot++;
if ( ThisSpot > calendarEventDisplay.CurrentSpot )
{
calendarEventDisplay.CurrentSpot = ThisSpot;
}
}
}
var SortedOtherSpotArray = new Array();
//the sort must use the global variable gCalendarWindow, not this.calendarWindow
SortedOtherSpotArray = calendarEventDisplay.OtherSpotArray.sort( gCalendarWindow.compareNumbers);
var LowestNumber = this.calendarWindow.getLowestElementNotInArray( SortedOtherSpotArray );
//this is the actual spot (0 -> n) that the event will go in on the day view.
calendarEventDisplay.CurrentSpot = LowestNumber;
if ( SortedOtherSpotArray.length > 4 )
{
calendarEventDisplay.NumberOfSameTimeEvents = 4;
}
else
{
calendarEventDisplay.NumberOfSameTimeEvents = SortedOtherSpotArray.length;
}
dayEventList[i] = calendarEventDisplay;
}
}
var ThisDayAllDayBox = document.getElementById( "all-day-content-box-week-"+dayIndex );
while ( ThisDayAllDayBox.hasChildNodes() )
{
ThisDayAllDayBox.removeChild( ThisDayAllDayBox.firstChild );
}
for ( var eventIndex = 0; eventIndex < dayEventList.length; ++eventIndex )
{
calendarEventDisplay = dayEventList[ eventIndex ];
// get the day box for the calendarEvent's day
var eventDayInMonth = calendarEventDisplay.event.start.day;
var weekBoxItem = gHeaderDateItemArray[ dayIndex ];
// Display no more than three, show dots for the events > 3
if ( calendarEventDisplay.event.allDay != true )
{
weekBoxItem.numEvents += 1;
}
//if its an all day event, don't show it in the hours bulletin board.
if ( calendarEventDisplay.event.allDay == true )
{
// build up the text to show for this event
var eventText = calendarEventDisplay.event.title;
if( calendarEventDisplay.event.location )
{
eventText += " " + calendarEventDisplay.event.location;
}
if( calendarEventDisplay.event.description )
{
eventText += " " + calendarEventDisplay.event.description;
}
//show the all day box
AllDayBox.removeAttribute( "collapsed" );
//shrink the day's content box.
document.getElementById( "week-view-content-box" ).setAttribute( "allday", "true" );
//note the use of the WeekViewAllDayText Attribute.
//This is used to remove the text when the day is changed.
newHTMLNode = document.createElement( "label" );
newHTMLNode.setAttribute( "crop", "end" );
newHTMLNode.setAttribute( "flex", "1" );
newHTMLNode.setAttribute( "value", eventText );
newHTMLNode.setAttribute( "WeekViewAllDayText", "true" );
newHTMLNode.calendarEventDisplay = calendarEventDisplay;
newHTMLNode.setAttribute( "onmouseover", "gCalendarWindow.changeMouseOverInfo( calendarEventDisplay, event )" );
newHTMLNode.setAttribute( "onclick", "weekEventItemClick( this, event )" );
newHTMLNode.setAttribute( "ondblclick", "weekEventItemDoubleClick( this, event )" );
newHTMLNode.setAttribute( "tooltip", "eventTooltip" );
newImage = document.createElement("image");
newImage.setAttribute( "class", "all-day-event-class" );
newImage.setAttribute( "WeekViewAllDayText", "true" );
newImage.calendarEventDisplay = calendarEventDisplay;
newImage.setAttribute( "onmouseover", "gCalendarWindow.changeMouseOverInfo( calendarEventDisplay, event )" );
newImage.setAttribute( "onclick", "weekEventItemClick( this, event )" );
newImage.setAttribute( "ondblclick", "weekEventItemDoubleClick( this, event )" );
newImage.setAttribute( "tooltip", "eventTooltip" );
ThisDayAllDayBox.appendChild( newImage );
ThisDayAllDayBox.appendChild( newHTMLNode );
}
else if ( calendarEventDisplay.CurrentSpot <= 4 )
{
eventBox = this.createEventBox( calendarEventDisplay, dayIndex );
//add the box to the bulletin board.
document.getElementById( "week-view-content-board" ).appendChild( eventBox );
}
if( this.calendarWindow.EventSelection.isSelectedEvent( calendarEventDisplay.event ) )
{
this.selectBoxForEvent( calendarEventDisplay.event );
}
}
}
//--> END THE FOR LOOP FOR THE WEEK VIEW
}
/** PRIVATE
*
* This creates an event box for the day view
*/
WeekView.prototype.createEventBox = function ( calendarEventDisplay, dayIndex )
{
// build up the text to show for this event
var eventText = calendarEventDisplay.event.title;
var eventStartDate = calendarEventDisplay.displayDate;
var startHour = eventStartDate.getHours();
var startMinutes = eventStartDate.getMinutes();
var eventEndDateTime = new Date( 2000, 1, 1, calendarEventDisplay.event.end.hour, calendarEventDisplay.event.end.minute, 0 );
var eventStartDateTime = new Date( 2000, 1, 1, eventStartDate.getHours(), eventStartDate.getMinutes(), 0 );
var eventDuration = new Date( eventEndDateTime - eventStartDateTime );
var hourDuration = eventDuration / (3600000);
var eventBox = document.createElement( "vbox" );
eventBox.calendarEventDisplay = calendarEventDisplay;
var totalWeekWidth = parseFloat(document.defaultView.getComputedStyle(document.getElementById("week-view-content-holder"), "").getPropertyValue("width")) + 1;
var boxLeftOffset = Math.ceil(parseFloat(document.defaultView.getComputedStyle(document.getElementById("week-tree-hour-0"), "").getPropertyValue("width")));
var boxWidth = (totalWeekWidth - boxLeftOffset)/ kDaysInWeek;
var Height = ( hourDuration * kWeekViewHourHeight ) + 1;
var Width = Math.floor( boxWidth / calendarEventDisplay.NumberOfSameTimeEvents ) + 1;
eventBox.setAttribute( "height", Height );
eventBox.setAttribute( "width", Width );
var top = eval( ( startHour*kWeekViewHourHeight ) + ( ( startMinutes/60 ) * kWeekViewHourHeight ) - kWeekViewHourHeightDifference );
eventBox.setAttribute( "top", top );
var left = eval( boxLeftOffset + ( boxWidth * ( dayIndex - 1 ) ) + ( ( calendarEventDisplay.CurrentSpot - 1 ) * eventBox.getAttribute( "width" ) ) ) ;
eventBox.setAttribute( "left", left );
eventBox.setAttribute( "class", "week-view-event-class" );
eventBox.setAttribute( "eventbox", "weekview" );
eventBox.setAttribute( "onclick", "weekEventItemClick( this, event )" );
eventBox.setAttribute( "ondblclick", "weekEventItemDoubleClick( this, event )" );
eventBox.setAttribute( "ondraggesture", "nsDragAndDrop.startDrag(event,calendarViewDNDObserver);" );
eventBox.setAttribute( "ondragover", "nsDragAndDrop.dragOver(event,calendarViewDNDObserver)" );
eventBox.setAttribute( "ondragdrop", "nsDragAndDrop.drop(event,calendarViewDNDObserver)" );
eventBox.setAttribute( "id", "week-view-event-box-"+calendarEventDisplay.event.id );
eventBox.setAttribute( "name", "week-view-event-box-"+calendarEventDisplay.event.id );
eventBox.setAttribute( "onmouseover", "gCalendarWindow.changeMouseOverInfo( calendarEventDisplay, event )" );
eventBox.setAttribute( "tooltip", "eventTooltip" );
if( calendarEventDisplay.event.categories && calendarEventDisplay.event.categories != "" )
{
eventBox.setAttribute( calendarEventDisplay.event.categories, "true" );
}
/*
** 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( "style", "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 );
// add a property to the event box that holds the calendarEvent that the
// box represents
this.kungFooDeathGripOnEventBoxes.push( eventBox );
return( eventBox );
}
/** PUBLIC
*
* Called when the user switches to a different view
*/
WeekView.prototype.switchFrom = function( )
{
}
/** PUBLIC
*
* Called when the user switches to the week view
*/
WeekView.prototype.switchTo = function( )
{
// disable/enable view switching buttons
var weekViewButton = document.getElementById( "week_view_command" );
var monthViewButton = document.getElementById( "month_view_command" );
var dayViewButton = document.getElementById( "day_view_command" );
monthViewButton.removeAttribute( "disabled" );
weekViewButton.setAttribute( "disabled", "true" );
dayViewButton.removeAttribute( "disabled" );
// switch views in the deck
var calendarDeckItem = document.getElementById( "calendar-deck" );
calendarDeckItem.selectedIndex = 1;
}
/** PUBLIC
*
* Redraw the display, but not the events
*/
WeekView.prototype.refreshDisplay = function( )
{
// Set the from-to title string, based on the selected date
var Offset = getIntPref(this.calendarWindow.calendarPreferences.calendarPref, "week.start", 0 );
var viewDay = this.calendarWindow.getSelectedDate().getDay();
var viewDayOfMonth = this.calendarWindow.getSelectedDate().getDate();
var viewMonth = this.calendarWindow.getSelectedDate().getMonth();
var viewYear = this.calendarWindow.getSelectedDate().getFullYear();
viewDay -= Offset;
if( viewDay < 0 )
viewDay += 7;
NewArrayOfDayNames = new Array();
/*
Set the header information for the week view
*/
for( i = 0; i < ArrayOfDayNames.length; i++ )
{
NewArrayOfDayNames[i] = ArrayOfDayNames[i];
}
for( i = 0; i < Offset; i++ )
{
var FirstElement = NewArrayOfDayNames.shift();
NewArrayOfDayNames.push( FirstElement );
}
var dateOfLastDayInWeek = viewDayOfMonth + ( 6 - viewDay );
var dateOfFirstDayInWeek = viewDayOfMonth - viewDay;
var firstDayOfWeek = new Date( viewYear, viewMonth, dateOfFirstDayInWeek );
var lastDayOfWeek = new Date( viewYear, viewMonth, dateOfLastDayInWeek );
var firstDayMonthName = this.calendarWindow.dateFormater.getMonthName( firstDayOfWeek.getMonth() );
var lastDayMonthName = this.calendarWindow.dateFormater.getMonthName( lastDayOfWeek.getMonth() );
var weekNumber = this.getWeekNumber();
var dateString = "Week "+weekNumber+ ": "+firstDayMonthName + " " + firstDayOfWeek.getDate() + " - " +
lastDayMonthName + " " + lastDayOfWeek.getDate();
var weekTextItem = document.getElementById( "week-title-text" );
weekTextItem.setAttribute( "value" , dateString );
/* done setting the header information */
/* Fix the day names because users can choose which day the week starts on */
var weekDate = new Date( viewYear, viewMonth, dateOfFirstDayInWeek );
for( var dayIndex = 1; dayIndex < 8; ++dayIndex )
{
var dateOfDay = weekDate.getDate();
var headerDateItem = document.getElementById( "week-header-date-"+dayIndex );
headerDateItem.setAttribute( "value" , dateOfDay );
headerDateItem.setAttribute( "date", weekDate );
headerDateItem.numEvents = 0;
document.getElementById( "week-header-date-text-"+dayIndex ).setAttribute( "value", NewArrayOfDayNames[dayIndex-1] );
var arrayOfBoxes = new Array();
if( weekDate.getDay() == 0 || weekDate.getDay() == 6 )
{
/* its a weekend */
arrayOfBoxes = document.getElementsByAttribute( "day", dayIndex );
for( i = 0; i < arrayOfBoxes.length; i++ )
{
arrayOfBoxes[i].setAttribute( "weekend", "true" );
}
}
else
{
/* its not a weekend */
arrayOfBoxes = document.getElementsByAttribute( "day", dayIndex );
for( i = 0; i < arrayOfBoxes.length; i++ )
{
arrayOfBoxes[i].removeAttribute( "weekend" );
}
}
// advance to next day
weekDate.setDate( dateOfDay + 1 );
}
this.hiliteTodaysDate( );
}
/** PUBLIC
*
* This is called when we are about the make a new event
* and we want to know what the default start date should be for the event.
*/
WeekView.prototype.getNewEventDate = function( )
{
return this.calendarWindow.getSelectedDate();
}
/** PUBLIC
*
* Go to the next week.
*/
WeekView.prototype.goToNext = function()
{
var nextWeek = new Date( this.calendarWindow.selectedDate.getFullYear(), this.calendarWindow.selectedDate.getMonth(), this.calendarWindow.selectedDate.getDate() + 7 );
this.goToDay( nextWeek );
}
/** PUBLIC
*
* Go to the previous week.
*/
WeekView.prototype.goToPrevious = function()
{
var prevWeek = new Date( this.calendarWindow.selectedDate.getFullYear(), this.calendarWindow.selectedDate.getMonth(), this.calendarWindow.selectedDate.getDate() - 7 );
this.goToDay( prevWeek );
}
WeekView.prototype.selectBoxForEvent = function( calendarEvent )
{
var EventBoxes = document.getElementsByAttribute( "name", "week-view-event-box-"+calendarEvent.id );
for ( j = 0; j < EventBoxes.length; j++ )
{
EventBoxes[j].setAttribute( "eventselected", "true" );
}
}
WeekView.prototype.getVisibleEvent = function( calendarEvent )
{
eventBox = document.getElementById( "week-view-event-box-"+calendarEvent.id );
if ( eventBox )
{
return eventBox;
}
else
return false;
}
/** PRIVATE
*
* Mark today as selected, also unmark the old today if there was one.
*/
WeekView.prototype.hiliteTodaysDate = function( )
{
//clear out the old today boxes.
var OldTodayArray = document.getElementsByAttribute( "today", "true" );
for ( i = 0; i < OldTodayArray.length; i++ )
{
OldTodayArray[i].removeAttribute( "today" );
}
// get the events for the day and loop through them
var FirstDay = new Date( gHeaderDateItemArray[1].getAttribute( "date" ) );
var LastDay = new Date( gHeaderDateItemArray[7].getAttribute( "date" ) );
LastDay.setHours( 23 );
LastDay.setMinutes( 59 );
LastDay.setSeconds( 59 );
var Today = new Date();
if ( Today.getTime() > FirstDay.getTime() && Today.getTime() < LastDay.getTime() )
{
var ThisDate;
//today is visible, get the day index for today
for ( var dayIndex = 1; dayIndex <= 7; ++dayIndex )
{
ThisDate = new Date( gHeaderDateItemArray[dayIndex].getAttribute( "date" ) );
if ( ThisDate.getFullYear() == Today.getFullYear()
&& ThisDate.getMonth() == Today.getMonth()
&& ThisDate.getDay() == Today.getDay() )
{
break;
}
}
//dayIndex now contains the box numbers that we need.
for ( i = 0; i < 24; i++ )
{
document.getElementById( "week-tree-day-"+(dayIndex-1)+"-item-"+i ).setAttribute( "today", "true" );
}
}
}
/** PUBLIC
*
* clear the selected event by taking off the selected attribute.
*/
WeekView.prototype.clearSelectedEvent = function( )
{
//Event = gCalendarWindow.getSelectedEvent();
var ArrayOfBoxes = document.getElementsByAttribute( "eventselected", "true" );
for( i = 0; i < ArrayOfBoxes.length; i++ )
{
ArrayOfBoxes[i].removeAttribute( "eventselected" );
}
}
/** PUBLIC
*
* This is called when we are about the make a new event
* and we want to know what the default start date should be for the event.
*/
WeekView.prototype.getNewEventDate = function( )
{
var start = new Date( this.calendarWindow.getSelectedDate() );
start.setHours( start.getHours() );
start.setMinutes( Math.ceil( start.getMinutes() / 5 ) * 5 );
start.setSeconds( 0 );
return start;
}
/** PUBLIC
*
* Unmark the selected date if there is one.
*/
WeekView.prototype.clearSelectedDate = function( )
{
if ( this.selectedBox )
{
this.selectedBox.removeAttribute( "eventselected" );
this.selectedBox = null;
}
}
WeekView.prototype.getWeekNumber = function()
{
var today = new Date( this.calendarWindow.getSelectedDate() );
var Year = today.getYear() + 1900;
var Month = today.getMonth();
var Day = today.getDate();
var now = new Date(Year,Month,Day+1);
now = now.getTime();
var Firstday = new Date( this.calendarWindow.getSelectedDate() );
Firstday.setYear(Year);
Firstday.setMonth(0);
Firstday.setDate(1);
var then = new Date(Year,0,1);
then = then.getTime();
var Compensation = Firstday.getDay();
if (Compensation > 3) Compensation -= 4;
else Compensation += 3;
NumberOfWeek = Math.round((((now-then)/86400000)+Compensation)/7);
return NumberOfWeek;
}

View File

@@ -1,540 +0,0 @@
<?xml version="1.0"?>
<!-- ***** BEGIN LICENSE BLOCK *****
- Version: MPL 1.1/GPL 2.0/LGPL 2.1
-
- The contents of this file are subject to the Mozilla Public License Version
- 1.1 (the "License"); you may not use this file except in compliance with
- the License. You may obtain a copy of the License at
- http://www.mozilla.org/MPL/
-
- Software distributed under the License is distributed on an "AS IS" basis,
- WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- for the specific language governing rights and limitations under the
- License.
-
- The Original Code is OEone Calendar Code, released October 31st, 2001.
-
- The Initial Developer of the Original Code is
- OEone Corporation.
- Portions created by the Initial Developer are Copyright (C) 2001
- the Initial Developer. All Rights Reserved.
-
- Contributor(s): Garth Smedley <garths@oeone.com>
- Mike Potter <mikep@oeone.com>
- Colin Phillips <colinp@oeone.com>
- Karl Guertin <grayrest@grayrest.com>
-
- Alternatively, the contents of this file may be used under the terms of
- either the GNU General Public License Version 2 or later (the "GPL"), or
- the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- in which case the provisions of the GPL or the LGPL are applicable instead
- of those above. If you wish to allow use of your version of this file only
- under the terms of either the GPL or the LGPL, and not to allow others to
- use your version of this file under the terms of the MPL, indicate your
- decision by deleting the provisions above and replace them with the notice
- and other provisions required by the LGPL or the GPL. If you do not delete
- the provisions above, a recipient may use your version of this file under
- the terms of any one of the MPL, the GPL or the LGPL.
-
- ***** END LICENSE BLOCK ***** -->
<!-- DTD File with all strings specific to the calendar -->
<!DOCTYPE overlay
[
<!ENTITY % dtd1 SYSTEM "chrome://calendar/locale/global.dtd" > %dtd1;
<!ENTITY % dtd2 SYSTEM "chrome://calendar/locale/calendar.dtd" > %dtd2;
]>
<!-- The Window -->
<overlay
xmlns:html="http://www.w3.org/1999/xhtml"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
>
<script type="application/x-javascript" src="chrome://global/content/nsDragAndDrop.js"/>
<script type="application/x-javascript" src="chrome://global/content/nsTransferable.js"/>
<script type="application/x-javascript" src="chrome://global/content/nsJSSupportsUtils.js"/>
<script type="application/x-javascript" src="chrome://global/content/nsJSComponentManager.js"/>
<script type="application/x-javascript" src="chrome://calendar/content/calendarWeekView.js"/>
<script type="application/x-javascript">
var ArrayOfDayNames = new Array();
ArrayOfDayNames[0] = "&day.1.DDD;";
ArrayOfDayNames[1] = "&day.2.DDD;";
ArrayOfDayNames[2] = "&day.3.DDD;";
ArrayOfDayNames[3] = "&day.4.DDD;";
ArrayOfDayNames[4] = "&day.5.DDD;";
ArrayOfDayNames[5] = "&day.6.DDD;";
ArrayOfDayNames[6] = "&day.7.DDD;";
</script>
<vbox id="week-view-box" flex="1">
<!-- Week View: Controls-->
<hbox id="week-controls-box"> <!-- DO NOT SET FLEX, breaks resizing -->
<box class="week-previous-button-box">
<image id="week-previous-button" class="prevnextbuttons" onclick="gCalendarWindow.goToPrevious()" ondraggesture="nsDragAndDrop.startDrag(event,calendarViewDNDObserver);" ondragover="nsDragAndDrop.dragOver(event,calendarViewDNDObserver)"/>
</box>
<hbox id="week-title-container" flex="1">
<vbox class="week-title-label-box" flex="1">
<label id="week-title-text" value="" />
</vbox>
</hbox>
<box id="week-next-button-box">
<image id="week-next-button" class="prevnextbuttons" onclick="gCalendarWindow.goToNext()" ondraggesture="nsDragAndDrop.startDrag(event,calendarViewDNDObserver);" ondragover="nsDragAndDrop.dragOver(event,calendarViewDNDObserver)"/>
</box>
</hbox>
<!-- Week View: All Day Boxes -->
<vbox id="inner-week-view-box" flex="1">
<box id="week-view-header" flex="1">
<box id="weekview-daynumber-spacer">
<box id="weekview-header-spacer-left" flex="1" />
<box id="weekview-daynumber-spacer-mid" />
</box>
<box id="week-view-header-days" flex="1">
<hbox flex="1" class="weekview-daynumber-class">
<label id="week-header-date-1" class="week-header-date" value=""/>
<label id="week-header-date-text-1" class="week-header-date-text" value="&day.1.DDD;" />
</hbox>
<hbox flex="1" class="weekview-daynumber-class">
<label id="week-header-date-2" class="week-header-date" value="" />
<label id="week-header-date-text-2" class="week-header-date-text" value="&day.2.DDD;" />
</hbox>
<hbox flex="1" class="weekview-daynumber-class">
<label id="week-header-date-3" class="week-header-date" value="" />
<label id="week-header-date-text-3" class="week-header-date-text" value="&day.3.DDD;" />
</hbox>
<hbox flex="1" class="weekview-daynumber-class">
<label id="week-header-date-4" class="week-header-date" value="" />
<label id="week-header-date-text-4" class="week-header-date-text" value="&day.4.DDD;" />
</hbox>
<hbox flex="1" class="weekview-daynumber-class">
<label id="week-header-date-5" class="week-header-date" value="" />
<label id="week-header-date-text-5" class="week-header-date-text" value="&day.5.DDD;" />
</hbox>
<hbox flex="1" class="weekview-daynumber-class">
<label id="week-header-date-6" class="week-header-date" value="" />
<label id="week-header-date-text-6" class="week-header-date-text" value="&day.6.DDD;" />
</hbox>
<hbox flex="1" class="weekview-daynumber-class">
<label id="week-header-date-7" class="week-header-date" value="" />
<label id="week-header-date-text-7" class="week-header-date-text" value="&day.7.DDD;" />
</hbox>
<vbox id="week-view-header-spacer"/>
</box>
</box>
<box id="week-view-all-day-content-box" align="center" flex="1" >
<vbox id="weekview-daynumber-spacer-left">
<label class="all-day-content-box-text-title" value="&allDayEvents.label;"/>
</vbox>
<box equalsize="always" flex="1">
<hbox class="all-day-content-box-week" id="all-day-content-box-week-1" flex="1"/>
<hbox class="all-day-content-box-week" id="all-day-content-box-week-2" flex="1"/>
<hbox class="all-day-content-box-week" id="all-day-content-box-week-3" flex="1"/>
<hbox class="all-day-content-box-week" id="all-day-content-box-week-4" flex="1"/>
<hbox class="all-day-content-box-week" id="all-day-content-box-week-5" flex="1"/>
<hbox class="all-day-content-box-week" id="all-day-content-box-week-6" flex="1"/>
<hbox class="all-day-content-box-week" id="all-day-content-box-week-7" flex="1"/>
</box>
<vbox id="all-day-content-spacer"/>
</box>
<box id="week-view-content-outer-box" flex="1">
<box id="week-view-content-box" flex="1">
<vbox id="leftgradientbox" >
<image id="week-view-day-gradient" />
</vbox>
<stack id="week-view-content-board" flex="1">
<grid id="week-view-content-holder" flex="1">
<columns equalsize="always">
<column id="week-view-top-left-box">
<!-- HOURS -->
<box class="week-view-hours-only-box-class" id="week-tree-hour-0">
<box class="week-time-class" flex="1">
<label class="week-time-class-text" id="week-view-hour-0" value="&time.midnight;"/>
</box>
</box>
<box class="week-view-hours-only-box-class" id="week-tree-hour-1">
<box class="week-time-class" flex="1">
<label class="week-time-class-text" id="week-view-hour-1"/>
</box>
</box>
<box class="week-view-hours-only-box-class" id="week-tree-hour-2">
<box class="week-time-class" flex="1">
<label class="week-time-class-text" id="week-view-hour-2"/>
</box>
</box>
<box class="week-view-hours-only-box-class" id="week-tree-hour-3">
<box class="week-time-class" flex="1">
<label class="week-time-class-text" id="week-view-hour-3"/>
</box>
</box>
<box class="week-view-hours-only-box-class" id="week-tree-hour-4">
<box class="week-time-class" flex="1">
<label class="week-time-class-text" id="week-view-hour-4"/>
</box>
</box>
<box class="week-view-hours-only-box-class" id="week-tree-hour-5">
<box class="week-time-class" flex="1">
<label class="week-time-class-text" id="week-view-hour-5"/>
</box>
</box>
<box class="week-view-hours-only-box-class" id="week-tree-hour-6">
<box class="week-time-class" flex="1">
<label class="week-time-class-text" id="week-view-hour-6"/>
</box>
</box>
<box class="week-view-hours-only-box-class" id="week-tree-hour-7">
<box class="week-time-class" flex="1">
<label class="week-time-class-text" id="week-view-hour-7"/>
</box>
</box>
<box class="week-view-hours-only-box-class" id="week-tree-hour-8">
<box class="week-time-class" flex="1">
<label class="week-time-class-text" id="week-view-hour-8"/>
</box>
</box>
<box class="week-view-hours-only-box-class" id="week-tree-hour-9">
<box class="week-time-class" flex="1">
<label class="week-time-class-text" id="week-view-hour-9"/>
</box>
</box>
<box class="week-view-hours-only-box-class" id="week-tree-hour-10">
<box class="week-time-class" flex="1">
<label class="week-time-class-text" id="week-view-hour-10"/>
</box>
</box>
<box class="week-view-hours-only-box-class" id="week-tree-hour-11">
<box class="week-time-class" flex="1">
<label class="week-time-class-text" id="week-view-hour-11"/>
</box>
</box>
<box class="week-view-hours-only-box-class" id="week-tree-hour-12">
<box class="week-time-class" flex="1">
<label class="week-time-class-text" id="week-view-hour-12"/>
</box>
</box>
<box class="week-view-hours-only-box-class" id="week-tree-hour-13">
<box class="week-time-class" flex="1">
<label class="week-time-class-text" id="week-view-hour-13"/>
</box>
</box>
<box class="week-view-hours-only-box-class" id="week-tree-hour-14">
<box class="week-time-class" flex="1">
<label class="week-time-class-text" id="week-view-hour-14"/>
</box>
</box>
<box class="week-view-hours-only-box-class" id="week-tree-hour-15">
<box class="week-time-class" flex="1">
<label class="week-time-class-text" id="week-view-hour-15"/>
</box>
</box>
<box class="week-view-hours-only-box-class" id="week-tree-hour-16">
<box class="week-time-class" flex="1">
<label class="week-time-class-text" id="week-view-hour-16"/>
</box>
</box>
<box class="week-view-hours-only-box-class" id="week-tree-hour-17">
<box class="week-time-class" flex="1">
<label class="week-time-class-text" id="week-view-hour-17"/>
</box>
</box>
<box class="week-view-hours-only-box-class" id="week-tree-hour-18">
<box class="week-time-class" flex="1">
<label class="week-time-class-text" id="week-view-hour-18"/>
</box>
</box>
<box class="week-view-hours-only-box-class" id="week-tree-hour-19">
<box class="week-time-class" flex="1">
<label class="week-time-class-text" id="week-view-hour-19"/>
</box>
</box>
<box class="week-view-hours-only-box-class" id="week-tree-hour-20">
<box class="week-time-class" flex="1">
<label class="week-time-class-text" id="week-view-hour-20"/>
</box>
</box>
<box class="week-view-hours-only-box-class" id="week-tree-hour-21">
<box class="week-time-class" flex="1">
<label class="week-time-class-text" id="week-view-hour-21"/>
</box>
</box>
<box class="week-view-hours-only-box-class" id="week-tree-hour-22">
<box class="week-time-class" flex="1">
<label class="week-time-class-text" id="week-view-hour-22"/>
</box>
</box>
<box class="week-view-hours-only-box-class" id="week-tree-hour-23">
<box class="week-time-class" flex="1">
<label class="week-time-class-text" id="week-view-hour-23"/>
</box>
</box>
<!-- / HOURS -->
</column>
<!-- DAY 0 -->
<column class="week-view-day-container-box" id="week-view-hour-0" flex="1">
<box class="week-view-hour-box-class" id="week-tree-day-0-item-0" day="1" hour="0" onclick="weekViewHourClick( event )" ondblclick="weekViewHourDoubleClick( event )" ondraggesture="nsDragAndDrop.startDrag(event,calendarViewDNDObserver);" ondragover="nsDragAndDrop.dragOver(event,calendarViewDNDObserver)" oncontextmenu="weekViewContextClick( event )"/>
<box class="week-view-hour-box-class" id="week-tree-day-0-item-1" day="1" hour="1" onclick="weekViewHourClick( event )" ondblclick="weekViewHourDoubleClick( event )" ondraggesture="nsDragAndDrop.startDrag(event,calendarViewDNDObserver);" ondragover="nsDragAndDrop.dragOver(event,calendarViewDNDObserver)" oncontextmenu="weekViewContextClick( event )"/>
<box class="week-view-hour-box-class" id="week-tree-day-0-item-2" day="1" hour="2" onclick="weekViewHourClick( event )" ondblclick="weekViewHourDoubleClick( event )" ondraggesture="nsDragAndDrop.startDrag(event,calendarViewDNDObserver);" ondragover="nsDragAndDrop.dragOver(event,calendarViewDNDObserver)" oncontextmenu="weekViewContextClick( event )"/>
<box class="week-view-hour-box-class" id="week-tree-day-0-item-3" day="1" hour="3" onclick="weekViewHourClick( event )" ondblclick="weekViewHourDoubleClick( event )" ondraggesture="nsDragAndDrop.startDrag(event,calendarViewDNDObserver);" ondragover="nsDragAndDrop.dragOver(event,calendarViewDNDObserver)" oncontextmenu="weekViewContextClick( event )"/>
<box class="week-view-hour-box-class" id="week-tree-day-0-item-4" day="1" hour="4" onclick="weekViewHourClick( event )" ondblclick="weekViewHourDoubleClick( event )" ondraggesture="nsDragAndDrop.startDrag(event,calendarViewDNDObserver);" ondragover="nsDragAndDrop.dragOver(event,calendarViewDNDObserver)" oncontextmenu="weekViewContextClick( event )"/>
<box class="week-view-hour-box-class" id="week-tree-day-0-item-5" day="1" hour="5" onclick="weekViewHourClick( event )" ondblclick="weekViewHourDoubleClick( event )" ondraggesture="nsDragAndDrop.startDrag(event,calendarViewDNDObserver);" ondragover="nsDragAndDrop.dragOver(event,calendarViewDNDObserver)" oncontextmenu="weekViewContextClick( event )"/>
<box class="week-view-hour-box-class" id="week-tree-day-0-item-6" day="1" hour="6" onclick="weekViewHourClick( event )" ondblclick="weekViewHourDoubleClick( event )" ondraggesture="nsDragAndDrop.startDrag(event,calendarViewDNDObserver);" ondragover="nsDragAndDrop.dragOver(event,calendarViewDNDObserver)" oncontextmenu="weekViewContextClick( event )"/>
<box class="week-view-hour-box-class" id="week-tree-day-0-item-7" day="1" hour="7" onclick="weekViewHourClick( event )" ondblclick="weekViewHourDoubleClick( event )" ondraggesture="nsDragAndDrop.startDrag(event,calendarViewDNDObserver);" ondragover="nsDragAndDrop.dragOver(event,calendarViewDNDObserver)" oncontextmenu="weekViewContextClick( event )"/>
<box class="week-view-hour-box-class" id="week-tree-day-0-item-8" day="1" hour="8" onclick="weekViewHourClick( event )" ondblclick="weekViewHourDoubleClick( event )" ondraggesture="nsDragAndDrop.startDrag(event,calendarViewDNDObserver);" ondragover="nsDragAndDrop.dragOver(event,calendarViewDNDObserver)" oncontextmenu="weekViewContextClick( event )"/>
<box class="week-view-hour-box-class" id="week-tree-day-0-item-9" day="1" hour="9" onclick="weekViewHourClick( event )" ondblclick="weekViewHourDoubleClick( event )" ondraggesture="nsDragAndDrop.startDrag(event,calendarViewDNDObserver);" ondragover="nsDragAndDrop.dragOver(event,calendarViewDNDObserver)" oncontextmenu="weekViewContextClick( event )"/>
<box class="week-view-hour-box-class" id="week-tree-day-0-item-10" day="1" hour="10" onclick="weekViewHourClick( event )" ondblclick="weekViewHourDoubleClick( event )" ondraggesture="nsDragAndDrop.startDrag(event,calendarViewDNDObserver);" ondragover="nsDragAndDrop.dragOver(event,calendarViewDNDObserver)" oncontextmenu="weekViewContextClick( event )"/>
<box class="week-view-hour-box-class" id="week-tree-day-0-item-11" day="1" hour="11" onclick="weekViewHourClick( event )" ondblclick="weekViewHourDoubleClick( event )" ondraggesture="nsDragAndDrop.startDrag(event,calendarViewDNDObserver);" ondragover="nsDragAndDrop.dragOver(event,calendarViewDNDObserver)" oncontextmenu="weekViewContextClick( event )"/>
<box class="week-view-hour-box-class" id="week-tree-day-0-item-12" day="1" hour="12" onclick="weekViewHourClick( event )" ondblclick="weekViewHourDoubleClick( event )" ondraggesture="nsDragAndDrop.startDrag(event,calendarViewDNDObserver);" ondragover="nsDragAndDrop.dragOver(event,calendarViewDNDObserver)" oncontextmenu="weekViewContextClick( event )"/>
<box class="week-view-hour-box-class" id="week-tree-day-0-item-13" day="1" hour="13" onclick="weekViewHourClick( event )" ondblclick="weekViewHourDoubleClick( event )" ondraggesture="nsDragAndDrop.startDrag(event,calendarViewDNDObserver);" ondragover="nsDragAndDrop.dragOver(event,calendarViewDNDObserver)" oncontextmenu="weekViewContextClick( event )"/>
<box class="week-view-hour-box-class" id="week-tree-day-0-item-14" day="1" hour="14" onclick="weekViewHourClick( event )" ondblclick="weekViewHourDoubleClick( event )" ondraggesture="nsDragAndDrop.startDrag(event,calendarViewDNDObserver);" ondragover="nsDragAndDrop.dragOver(event,calendarViewDNDObserver)" oncontextmenu="weekViewContextClick( event )"/>
<box class="week-view-hour-box-class" id="week-tree-day-0-item-15" day="1" hour="15" onclick="weekViewHourClick( event )" ondblclick="weekViewHourDoubleClick( event )" ondraggesture="nsDragAndDrop.startDrag(event,calendarViewDNDObserver);" ondragover="nsDragAndDrop.dragOver(event,calendarViewDNDObserver)" oncontextmenu="weekViewContextClick( event )"/>
<box class="week-view-hour-box-class" id="week-tree-day-0-item-16" day="1" hour="16" onclick="weekViewHourClick( event )" ondblclick="weekViewHourDoubleClick( event )" ondraggesture="nsDragAndDrop.startDrag(event,calendarViewDNDObserver);" ondragover="nsDragAndDrop.dragOver(event,calendarViewDNDObserver)" oncontextmenu="weekViewContextClick( event )"/>
<box class="week-view-hour-box-class" id="week-tree-day-0-item-17" day="1" hour="17" onclick="weekViewHourClick( event )" ondblclick="weekViewHourDoubleClick( event )" ondraggesture="nsDragAndDrop.startDrag(event,calendarViewDNDObserver);" ondragover="nsDragAndDrop.dragOver(event,calendarViewDNDObserver)" oncontextmenu="weekViewContextClick( event )"/>
<box class="week-view-hour-box-class" id="week-tree-day-0-item-18" day="1" hour="18" onclick="weekViewHourClick( event )" ondblclick="weekViewHourDoubleClick( event )" ondraggesture="nsDragAndDrop.startDrag(event,calendarViewDNDObserver);" ondragover="nsDragAndDrop.dragOver(event,calendarViewDNDObserver)" oncontextmenu="weekViewContextClick( event )"/>
<box class="week-view-hour-box-class" id="week-tree-day-0-item-19" day="1" hour="19" onclick="weekViewHourClick( event )" ondblclick="weekViewHourDoubleClick( event )" ondraggesture="nsDragAndDrop.startDrag(event,calendarViewDNDObserver);" ondragover="nsDragAndDrop.dragOver(event,calendarViewDNDObserver)" oncontextmenu="weekViewContextClick( event )"/>
<box class="week-view-hour-box-class" id="week-tree-day-0-item-20" day="1" hour="20" onclick="weekViewHourClick( event )" ondblclick="weekViewHourDoubleClick( event )" ondraggesture="nsDragAndDrop.startDrag(event,calendarViewDNDObserver);" ondragover="nsDragAndDrop.dragOver(event,calendarViewDNDObserver)" oncontextmenu="weekViewContextClick( event )"/>
<box class="week-view-hour-box-class" id="week-tree-day-0-item-21" day="1" hour="21" onclick="weekViewHourClick( event )" ondblclick="weekViewHourDoubleClick( event )" ondraggesture="nsDragAndDrop.startDrag(event,calendarViewDNDObserver);" ondragover="nsDragAndDrop.dragOver(event,calendarViewDNDObserver)" oncontextmenu="weekViewContextClick( event )"/>
<box class="week-view-hour-box-class" id="week-tree-day-0-item-22" day="1" hour="22" onclick="weekViewHourClick( event )" ondblclick="weekViewHourDoubleClick( event )" ondraggesture="nsDragAndDrop.startDrag(event,calendarViewDNDObserver);" ondragover="nsDragAndDrop.dragOver(event,calendarViewDNDObserver)" oncontextmenu="weekViewContextClick( event )"/>
<box class="week-view-hour-box-class" id="week-tree-day-0-item-23" day="1" hour="23" onclick="weekViewHourClick( event )" ondblclick="weekViewHourDoubleClick( event )" ondraggesture="nsDragAndDrop.startDrag(event,calendarViewDNDObserver);" ondragover="nsDragAndDrop.dragOver(event,calendarViewDNDObserver)" oncontextmenu="weekViewContextClick( event )"/>
</column>
<!-- / DAY 0 -->
<!-- DAY 1 -->
<column class="week-view-day-container-box" flex="1">
<box class="week-view-hour-box-class" id="week-tree-day-1-item-0" day="2" hour="0" onclick="weekViewHourClick( event )" ondblclick="weekViewHourDoubleClick( event )" ondraggesture="nsDragAndDrop.startDrag(event,calendarViewDNDObserver);" ondragover="nsDragAndDrop.dragOver(event,calendarViewDNDObserver)" oncontextmenu="weekViewContextClick( event )"/>
<box class="week-view-hour-box-class" id="week-tree-day-1-item-1" day="2" hour="1" onclick="weekViewHourClick( event )" ondblclick="weekViewHourDoubleClick( event )" ondraggesture="nsDragAndDrop.startDrag(event,calendarViewDNDObserver);" ondragover="nsDragAndDrop.dragOver(event,calendarViewDNDObserver)" oncontextmenu="weekViewContextClick( event )"/>
<box class="week-view-hour-box-class" id="week-tree-day-1-item-2" day="2" hour="2" onclick="weekViewHourClick( event )" ondblclick="weekViewHourDoubleClick( event )" ondraggesture="nsDragAndDrop.startDrag(event,calendarViewDNDObserver);" ondragover="nsDragAndDrop.dragOver(event,calendarViewDNDObserver)" oncontextmenu="weekViewContextClick( event )"/>
<box class="week-view-hour-box-class" id="week-tree-day-1-item-3" day="2" hour="3" onclick="weekViewHourClick( event )" ondblclick="weekViewHourDoubleClick( event )" ondraggesture="nsDragAndDrop.startDrag(event,calendarViewDNDObserver);" ondragover="nsDragAndDrop.dragOver(event,calendarViewDNDObserver)" oncontextmenu="weekViewContextClick( event )"/>
<box class="week-view-hour-box-class" id="week-tree-day-1-item-4" day="2" hour="4" onclick="weekViewHourClick( event )" ondblclick="weekViewHourDoubleClick( event )" ondraggesture="nsDragAndDrop.startDrag(event,calendarViewDNDObserver);" ondragover="nsDragAndDrop.dragOver(event,calendarViewDNDObserver)" oncontextmenu="weekViewContextClick( event )"/>
<box class="week-view-hour-box-class" id="week-tree-day-1-item-5" day="2" hour="5" onclick="weekViewHourClick( event )" ondblclick="weekViewHourDoubleClick( event )" ondraggesture="nsDragAndDrop.startDrag(event,calendarViewDNDObserver);" ondragover="nsDragAndDrop.dragOver(event,calendarViewDNDObserver)" oncontextmenu="weekViewContextClick( event )"/>
<box class="week-view-hour-box-class" id="week-tree-day-1-item-6" day="2" hour="6" onclick="weekViewHourClick( event )" ondblclick="weekViewHourDoubleClick( event )" ondraggesture="nsDragAndDrop.startDrag(event,calendarViewDNDObserver);" ondragover="nsDragAndDrop.dragOver(event,calendarViewDNDObserver)" oncontextmenu="weekViewContextClick( event )"/>
<box class="week-view-hour-box-class" id="week-tree-day-1-item-7" day="2" hour="7" onclick="weekViewHourClick( event )" ondblclick="weekViewHourDoubleClick( event )" ondraggesture="nsDragAndDrop.startDrag(event,calendarViewDNDObserver);" ondragover="nsDragAndDrop.dragOver(event,calendarViewDNDObserver)" oncontextmenu="weekViewContextClick( event )"/>
<box class="week-view-hour-box-class" id="week-tree-day-1-item-8" day="2" hour="8" onclick="weekViewHourClick( event )" ondblclick="weekViewHourDoubleClick( event )" ondraggesture="nsDragAndDrop.startDrag(event,calendarViewDNDObserver);" ondragover="nsDragAndDrop.dragOver(event,calendarViewDNDObserver)" oncontextmenu="weekViewContextClick( event )"/>
<box class="week-view-hour-box-class" id="week-tree-day-1-item-9" day="2" hour="9" onclick="weekViewHourClick( event )" ondblclick="weekViewHourDoubleClick( event )" ondraggesture="nsDragAndDrop.startDrag(event,calendarViewDNDObserver);" ondragover="nsDragAndDrop.dragOver(event,calendarViewDNDObserver)" oncontextmenu="weekViewContextClick( event )"/>
<box class="week-view-hour-box-class" id="week-tree-day-1-item-10" day="2" hour="10" onclick="weekViewHourClick( event )" ondblclick="weekViewHourDoubleClick( event )" ondraggesture="nsDragAndDrop.startDrag(event,calendarViewDNDObserver);" ondragover="nsDragAndDrop.dragOver(event,calendarViewDNDObserver)" oncontextmenu="weekViewContextClick( event )"/>
<box class="week-view-hour-box-class" id="week-tree-day-1-item-11" day="2" hour="11" onclick="weekViewHourClick( event )" ondblclick="weekViewHourDoubleClick( event )" ondraggesture="nsDragAndDrop.startDrag(event,calendarViewDNDObserver);" ondragover="nsDragAndDrop.dragOver(event,calendarViewDNDObserver)" oncontextmenu="weekViewContextClick( event )"/>
<box class="week-view-hour-box-class" id="week-tree-day-1-item-12" day="2" hour="12" onclick="weekViewHourClick( event )" ondblclick="weekViewHourDoubleClick( event )" ondraggesture="nsDragAndDrop.startDrag(event,calendarViewDNDObserver);" ondragover="nsDragAndDrop.dragOver(event,calendarViewDNDObserver)" oncontextmenu="weekViewContextClick( event )"/>
<box class="week-view-hour-box-class" id="week-tree-day-1-item-13" day="2" hour="13" onclick="weekViewHourClick( event )" ondblclick="weekViewHourDoubleClick( event )" ondraggesture="nsDragAndDrop.startDrag(event,calendarViewDNDObserver);" ondragover="nsDragAndDrop.dragOver(event,calendarViewDNDObserver)" oncontextmenu="weekViewContextClick( event )"/>
<box class="week-view-hour-box-class" id="week-tree-day-1-item-14" day="2" hour="14" onclick="weekViewHourClick( event )" ondblclick="weekViewHourDoubleClick( event )" ondraggesture="nsDragAndDrop.startDrag(event,calendarViewDNDObserver);" ondragover="nsDragAndDrop.dragOver(event,calendarViewDNDObserver)" oncontextmenu="weekViewContextClick( event )"/>
<box class="week-view-hour-box-class" id="week-tree-day-1-item-15" day="2" hour="15" onclick="weekViewHourClick( event )" ondblclick="weekViewHourDoubleClick( event )" ondraggesture="nsDragAndDrop.startDrag(event,calendarViewDNDObserver);" ondragover="nsDragAndDrop.dragOver(event,calendarViewDNDObserver)" oncontextmenu="weekViewContextClick( event )"/>
<box class="week-view-hour-box-class" id="week-tree-day-1-item-16" day="2" hour="16" onclick="weekViewHourClick( event )" ondblclick="weekViewHourDoubleClick( event )" ondraggesture="nsDragAndDrop.startDrag(event,calendarViewDNDObserver);" ondragover="nsDragAndDrop.dragOver(event,calendarViewDNDObserver)" oncontextmenu="weekViewContextClick( event )"/>
<box class="week-view-hour-box-class" id="week-tree-day-1-item-17" day="2" hour="17" onclick="weekViewHourClick( event )" ondblclick="weekViewHourDoubleClick( event )" ondraggesture="nsDragAndDrop.startDrag(event,calendarViewDNDObserver);" ondragover="nsDragAndDrop.dragOver(event,calendarViewDNDObserver)" oncontextmenu="weekViewContextClick( event )"/>
<box class="week-view-hour-box-class" id="week-tree-day-1-item-18" day="2" hour="18" onclick="weekViewHourClick( event )" ondblclick="weekViewHourDoubleClick( event )" ondraggesture="nsDragAndDrop.startDrag(event,calendarViewDNDObserver);" ondragover="nsDragAndDrop.dragOver(event,calendarViewDNDObserver)" oncontextmenu="weekViewContextClick( event )"/>
<box class="week-view-hour-box-class" id="week-tree-day-1-item-19" day="2" hour="19" onclick="weekViewHourClick( event )" ondblclick="weekViewHourDoubleClick( event )" ondraggesture="nsDragAndDrop.startDrag(event,calendarViewDNDObserver);" ondragover="nsDragAndDrop.dragOver(event,calendarViewDNDObserver)" oncontextmenu="weekViewContextClick( event )"/>
<box class="week-view-hour-box-class" id="week-tree-day-1-item-20" day="2" hour="20" onclick="weekViewHourClick( event )" ondblclick="weekViewHourDoubleClick( event )" ondraggesture="nsDragAndDrop.startDrag(event,calendarViewDNDObserver);" ondragover="nsDragAndDrop.dragOver(event,calendarViewDNDObserver)" oncontextmenu="weekViewContextClick( event )"/>
<box class="week-view-hour-box-class" id="week-tree-day-1-item-21" day="2" hour="21" onclick="weekViewHourClick( event )" ondblclick="weekViewHourDoubleClick( event )" ondraggesture="nsDragAndDrop.startDrag(event,calendarViewDNDObserver);" ondragover="nsDragAndDrop.dragOver(event,calendarViewDNDObserver)" oncontextmenu="weekViewContextClick( event )"/>
<box class="week-view-hour-box-class" id="week-tree-day-1-item-22" day="2" hour="22" onclick="weekViewHourClick( event )" ondblclick="weekViewHourDoubleClick( event )" ondraggesture="nsDragAndDrop.startDrag(event,calendarViewDNDObserver);" ondragover="nsDragAndDrop.dragOver(event,calendarViewDNDObserver)" oncontextmenu="weekViewContextClick( event )"/>
<box class="week-view-hour-box-class" id="week-tree-day-1-item-23" day="2" hour="23" onclick="weekViewHourClick( event )" ondblclick="weekViewHourDoubleClick( event )" ondraggesture="nsDragAndDrop.startDrag(event,calendarViewDNDObserver);" ondragover="nsDragAndDrop.dragOver(event,calendarViewDNDObserver)" oncontextmenu="weekViewContextClick( event )"/>
</column>
<!-- / DAY 1 -->
<!-- DAY 2 -->
<column class="week-view-day-container-box" flex="1">
<box class="week-view-hour-box-class" id="week-tree-day-2-item-0" day="3" hour="0" onclick="weekViewHourClick( event )" ondblclick="weekViewHourDoubleClick( event )" ondraggesture="nsDragAndDrop.startDrag(event,calendarViewDNDObserver);" ondragover="nsDragAndDrop.dragOver(event,calendarViewDNDObserver)" oncontextmenu="weekViewContextClick( event )"/>
<box class="week-view-hour-box-class" id="week-tree-day-2-item-1" day="3" hour="1" onclick="weekViewHourClick( event )" ondblclick="weekViewHourDoubleClick( event )" ondraggesture="nsDragAndDrop.startDrag(event,calendarViewDNDObserver);" ondragover="nsDragAndDrop.dragOver(event,calendarViewDNDObserver)" oncontextmenu="weekViewContextClick( event )"/>
<box class="week-view-hour-box-class" id="week-tree-day-2-item-2" day="3" hour="2" onclick="weekViewHourClick( event )" ondblclick="weekViewHourDoubleClick( event )" ondraggesture="nsDragAndDrop.startDrag(event,calendarViewDNDObserver);" ondragover="nsDragAndDrop.dragOver(event,calendarViewDNDObserver)" oncontextmenu="weekViewContextClick( event )"/>
<box class="week-view-hour-box-class" id="week-tree-day-2-item-3" day="3" hour="3" onclick="weekViewHourClick( event )" ondblclick="weekViewHourDoubleClick( event )" ondraggesture="nsDragAndDrop.startDrag(event,calendarViewDNDObserver);" ondragover="nsDragAndDrop.dragOver(event,calendarViewDNDObserver)" oncontextmenu="weekViewContextClick( event )"/>
<box class="week-view-hour-box-class" id="week-tree-day-2-item-4" day="3" hour="4" onclick="weekViewHourClick( event )" ondblclick="weekViewHourDoubleClick( event )" ondraggesture="nsDragAndDrop.startDrag(event,calendarViewDNDObserver);" ondragover="nsDragAndDrop.dragOver(event,calendarViewDNDObserver)" oncontextmenu="weekViewContextClick( event )"/>
<box class="week-view-hour-box-class" id="week-tree-day-2-item-5" day="3" hour="5" onclick="weekViewHourClick( event )" ondblclick="weekViewHourDoubleClick( event )" ondraggesture="nsDragAndDrop.startDrag(event,calendarViewDNDObserver);" ondragover="nsDragAndDrop.dragOver(event,calendarViewDNDObserver)" oncontextmenu="weekViewContextClick( event )"/>
<box class="week-view-hour-box-class" id="week-tree-day-2-item-6" day="3" hour="6" onclick="weekViewHourClick( event )" ondblclick="weekViewHourDoubleClick( event )" ondraggesture="nsDragAndDrop.startDrag(event,calendarViewDNDObserver);" ondragover="nsDragAndDrop.dragOver(event,calendarViewDNDObserver)" oncontextmenu="weekViewContextClick( event )"/>
<box class="week-view-hour-box-class" id="week-tree-day-2-item-7" day="3" hour="7" onclick="weekViewHourClick( event )" ondblclick="weekViewHourDoubleClick( event )" ondraggesture="nsDragAndDrop.startDrag(event,calendarViewDNDObserver);" ondragover="nsDragAndDrop.dragOver(event,calendarViewDNDObserver)" oncontextmenu="weekViewContextClick( event )"/>
<box class="week-view-hour-box-class" id="week-tree-day-2-item-8" day="3" hour="8" onclick="weekViewHourClick( event )" ondblclick="weekViewHourDoubleClick( event )" ondraggesture="nsDragAndDrop.startDrag(event,calendarViewDNDObserver);" ondragover="nsDragAndDrop.dragOver(event,calendarViewDNDObserver)" oncontextmenu="weekViewContextClick( event )"/>
<box class="week-view-hour-box-class" id="week-tree-day-2-item-9" day="3" hour="9" onclick="weekViewHourClick( event )" ondblclick="weekViewHourDoubleClick( event )" ondraggesture="nsDragAndDrop.startDrag(event,calendarViewDNDObserver);" ondragover="nsDragAndDrop.dragOver(event,calendarViewDNDObserver)" oncontextmenu="weekViewContextClick( event )"/>
<box class="week-view-hour-box-class" id="week-tree-day-2-item-10" day="3" hour="10" onclick="weekViewHourClick( event )" ondblclick="weekViewHourDoubleClick( event )" ondraggesture="nsDragAndDrop.startDrag(event,calendarViewDNDObserver);" ondragover="nsDragAndDrop.dragOver(event,calendarViewDNDObserver)" oncontextmenu="weekViewContextClick( event )"/>
<box class="week-view-hour-box-class" id="week-tree-day-2-item-11" day="3" hour="11" onclick="weekViewHourClick( event )" ondblclick="weekViewHourDoubleClick( event )" ondraggesture="nsDragAndDrop.startDrag(event,calendarViewDNDObserver);" ondragover="nsDragAndDrop.dragOver(event,calendarViewDNDObserver)" oncontextmenu="weekViewContextClick( event )"/>
<box class="week-view-hour-box-class" id="week-tree-day-2-item-12" day="3" hour="12" onclick="weekViewHourClick( event )" ondblclick="weekViewHourDoubleClick( event )" ondraggesture="nsDragAndDrop.startDrag(event,calendarViewDNDObserver);" ondragover="nsDragAndDrop.dragOver(event,calendarViewDNDObserver)" oncontextmenu="weekViewContextClick( event )"/>
<box class="week-view-hour-box-class" id="week-tree-day-2-item-13" day="3" hour="13" onclick="weekViewHourClick( event )" ondblclick="weekViewHourDoubleClick( event )" ondraggesture="nsDragAndDrop.startDrag(event,calendarViewDNDObserver);" ondragover="nsDragAndDrop.dragOver(event,calendarViewDNDObserver)" oncontextmenu="weekViewContextClick( event )"/>
<box class="week-view-hour-box-class" id="week-tree-day-2-item-14" day="3" hour="14" onclick="weekViewHourClick( event )" ondblclick="weekViewHourDoubleClick( event )" ondraggesture="nsDragAndDrop.startDrag(event,calendarViewDNDObserver);" ondragover="nsDragAndDrop.dragOver(event,calendarViewDNDObserver)" oncontextmenu="weekViewContextClick( event )"/>
<box class="week-view-hour-box-class" id="week-tree-day-2-item-15" day="3" hour="15" onclick="weekViewHourClick( event )" ondblclick="weekViewHourDoubleClick( event )" ondraggesture="nsDragAndDrop.startDrag(event,calendarViewDNDObserver);" ondragover="nsDragAndDrop.dragOver(event,calendarViewDNDObserver)" oncontextmenu="weekViewContextClick( event )"/>
<box class="week-view-hour-box-class" id="week-tree-day-2-item-16" day="3" hour="16" onclick="weekViewHourClick( event )" ondblclick="weekViewHourDoubleClick( event )" ondraggesture="nsDragAndDrop.startDrag(event,calendarViewDNDObserver);" ondragover="nsDragAndDrop.dragOver(event,calendarViewDNDObserver)" oncontextmenu="weekViewContextClick( event )"/>
<box class="week-view-hour-box-class" id="week-tree-day-2-item-17" day="3" hour="17" onclick="weekViewHourClick( event )" ondblclick="weekViewHourDoubleClick( event )" ondraggesture="nsDragAndDrop.startDrag(event,calendarViewDNDObserver);" ondragover="nsDragAndDrop.dragOver(event,calendarViewDNDObserver)" oncontextmenu="weekViewContextClick( event )"/>
<box class="week-view-hour-box-class" id="week-tree-day-2-item-18" day="3" hour="18" onclick="weekViewHourClick( event )" ondblclick="weekViewHourDoubleClick( event )" ondraggesture="nsDragAndDrop.startDrag(event,calendarViewDNDObserver);" ondragover="nsDragAndDrop.dragOver(event,calendarViewDNDObserver)" oncontextmenu="weekViewContextClick( event )"/>
<box class="week-view-hour-box-class" id="week-tree-day-2-item-19" day="3" hour="19" onclick="weekViewHourClick( event )" ondblclick="weekViewHourDoubleClick( event )" ondraggesture="nsDragAndDrop.startDrag(event,calendarViewDNDObserver);" ondragover="nsDragAndDrop.dragOver(event,calendarViewDNDObserver)" oncontextmenu="weekViewContextClick( event )"/>
<box class="week-view-hour-box-class" id="week-tree-day-2-item-20" day="3" hour="20" onclick="weekViewHourClick( event )" ondblclick="weekViewHourDoubleClick( event )" ondraggesture="nsDragAndDrop.startDrag(event,calendarViewDNDObserver);" ondragover="nsDragAndDrop.dragOver(event,calendarViewDNDObserver)" oncontextmenu="weekViewContextClick( event )"/>
<box class="week-view-hour-box-class" id="week-tree-day-2-item-21" day="3" hour="21" onclick="weekViewHourClick( event )" ondblclick="weekViewHourDoubleClick( event )" ondraggesture="nsDragAndDrop.startDrag(event,calendarViewDNDObserver);" ondragover="nsDragAndDrop.dragOver(event,calendarViewDNDObserver)" oncontextmenu="weekViewContextClick( event )"/>
<box class="week-view-hour-box-class" id="week-tree-day-2-item-22" day="3" hour="22" onclick="weekViewHourClick( event )" ondblclick="weekViewHourDoubleClick( event )" ondraggesture="nsDragAndDrop.startDrag(event,calendarViewDNDObserver);" ondragover="nsDragAndDrop.dragOver(event,calendarViewDNDObserver)" oncontextmenu="weekViewContextClick( event )"/>
<box class="week-view-hour-box-class" id="week-tree-day-2-item-23" day="3" hour="23" onclick="weekViewHourClick( event )" ondblclick="weekViewHourDoubleClick( event )" ondraggesture="nsDragAndDrop.startDrag(event,calendarViewDNDObserver);" ondragover="nsDragAndDrop.dragOver(event,calendarViewDNDObserver)" oncontextmenu="weekViewContextClick( event )"/>
</column>
<!-- / DAY 2 -->
<!-- DAY 3 -->
<column class="week-view-day-container-box" flex="1">
<box class="week-view-hour-box-class" id="week-tree-day-3-item-0" day="4" hour="0" onclick="weekViewHourClick( event )" ondblclick="weekViewHourDoubleClick( event )" ondraggesture="nsDragAndDrop.startDrag(event,calendarViewDNDObserver);" ondragover="nsDragAndDrop.dragOver(event,calendarViewDNDObserver)" oncontextmenu="weekViewContextClick( event )"/>
<box class="week-view-hour-box-class" id="week-tree-day-3-item-1" day="4" hour="1" onclick="weekViewHourClick( event )" ondblclick="weekViewHourDoubleClick( event )" ondraggesture="nsDragAndDrop.startDrag(event,calendarViewDNDObserver);" ondragover="nsDragAndDrop.dragOver(event,calendarViewDNDObserver)" oncontextmenu="weekViewContextClick( event )"/>
<box class="week-view-hour-box-class" id="week-tree-day-3-item-2" day="4" hour="2" onclick="weekViewHourClick( event )" ondblclick="weekViewHourDoubleClick( event )" ondraggesture="nsDragAndDrop.startDrag(event,calendarViewDNDObserver);" ondragover="nsDragAndDrop.dragOver(event,calendarViewDNDObserver)" oncontextmenu="weekViewContextClick( event )"/>
<box class="week-view-hour-box-class" id="week-tree-day-3-item-3" day="4" hour="3" onclick="weekViewHourClick( event )" ondblclick="weekViewHourDoubleClick( event )" ondraggesture="nsDragAndDrop.startDrag(event,calendarViewDNDObserver);" ondragover="nsDragAndDrop.dragOver(event,calendarViewDNDObserver)" oncontextmenu="weekViewContextClick( event )"/>
<box class="week-view-hour-box-class" id="week-tree-day-3-item-4" day="4" hour="4" onclick="weekViewHourClick( event )" ondblclick="weekViewHourDoubleClick( event )" ondraggesture="nsDragAndDrop.startDrag(event,calendarViewDNDObserver);" ondragover="nsDragAndDrop.dragOver(event,calendarViewDNDObserver)" oncontextmenu="weekViewContextClick( event )"/>
<box class="week-view-hour-box-class" id="week-tree-day-3-item-5" day="4" hour="5" onclick="weekViewHourClick( event )" ondblclick="weekViewHourDoubleClick( event )" ondraggesture="nsDragAndDrop.startDrag(event,calendarViewDNDObserver);" ondragover="nsDragAndDrop.dragOver(event,calendarViewDNDObserver)" oncontextmenu="weekViewContextClick( event )"/>
<box class="week-view-hour-box-class" id="week-tree-day-3-item-6" day="4" hour="6" onclick="weekViewHourClick( event )" ondblclick="weekViewHourDoubleClick( event )" ondraggesture="nsDragAndDrop.startDrag(event,calendarViewDNDObserver);" ondragover="nsDragAndDrop.dragOver(event,calendarViewDNDObserver)" oncontextmenu="weekViewContextClick( event )"/>
<box class="week-view-hour-box-class" id="week-tree-day-3-item-7" day="4" hour="7" onclick="weekViewHourClick( event )" ondblclick="weekViewHourDoubleClick( event )" ondraggesture="nsDragAndDrop.startDrag(event,calendarViewDNDObserver);" ondragover="nsDragAndDrop.dragOver(event,calendarViewDNDObserver)" oncontextmenu="weekViewContextClick( event )"/>
<box class="week-view-hour-box-class" id="week-tree-day-3-item-8" day="4" hour="8" onclick="weekViewHourClick( event )" ondblclick="weekViewHourDoubleClick( event )" ondraggesture="nsDragAndDrop.startDrag(event,calendarViewDNDObserver);" ondragover="nsDragAndDrop.dragOver(event,calendarViewDNDObserver)" oncontextmenu="weekViewContextClick( event )"/>
<box class="week-view-hour-box-class" id="week-tree-day-3-item-9" day="4" hour="9" onclick="weekViewHourClick( event )" ondblclick="weekViewHourDoubleClick( event )" ondraggesture="nsDragAndDrop.startDrag(event,calendarViewDNDObserver);" ondragover="nsDragAndDrop.dragOver(event,calendarViewDNDObserver)" oncontextmenu="weekViewContextClick( event )"/>
<box class="week-view-hour-box-class" id="week-tree-day-3-item-10" day="4" hour="10" onclick="weekViewHourClick( event )" ondblclick="weekViewHourDoubleClick( event )" ondraggesture="nsDragAndDrop.startDrag(event,calendarViewDNDObserver);" ondragover="nsDragAndDrop.dragOver(event,calendarViewDNDObserver)" oncontextmenu="weekViewContextClick( event )"/>
<box class="week-view-hour-box-class" id="week-tree-day-3-item-11" day="4" hour="11" onclick="weekViewHourClick( event )" ondblclick="weekViewHourDoubleClick( event )" ondraggesture="nsDragAndDrop.startDrag(event,calendarViewDNDObserver);" ondragover="nsDragAndDrop.dragOver(event,calendarViewDNDObserver)" oncontextmenu="weekViewContextClick( event )"/>
<box class="week-view-hour-box-class" id="week-tree-day-3-item-12" day="4" hour="12" onclick="weekViewHourClick( event )" ondblclick="weekViewHourDoubleClick( event )" ondraggesture="nsDragAndDrop.startDrag(event,calendarViewDNDObserver);" ondragover="nsDragAndDrop.dragOver(event,calendarViewDNDObserver)" oncontextmenu="weekViewContextClick( event )"/>
<box class="week-view-hour-box-class" id="week-tree-day-3-item-13" day="4" hour="13" onclick="weekViewHourClick( event )" ondblclick="weekViewHourDoubleClick( event )" ondraggesture="nsDragAndDrop.startDrag(event,calendarViewDNDObserver);" ondragover="nsDragAndDrop.dragOver(event,calendarViewDNDObserver)" oncontextmenu="weekViewContextClick( event )"/>
<box class="week-view-hour-box-class" id="week-tree-day-3-item-14" day="4" hour="14" onclick="weekViewHourClick( event )" ondblclick="weekViewHourDoubleClick( event )" ondraggesture="nsDragAndDrop.startDrag(event,calendarViewDNDObserver);" ondragover="nsDragAndDrop.dragOver(event,calendarViewDNDObserver)" oncontextmenu="weekViewContextClick( event )"/>
<box class="week-view-hour-box-class" id="week-tree-day-3-item-15" day="4" hour="15" onclick="weekViewHourClick( event )" ondblclick="weekViewHourDoubleClick( event )" ondraggesture="nsDragAndDrop.startDrag(event,calendarViewDNDObserver);" ondragover="nsDragAndDrop.dragOver(event,calendarViewDNDObserver)" oncontextmenu="weekViewContextClick( event )"/>
<box class="week-view-hour-box-class" id="week-tree-day-3-item-16" day="4" hour="16" onclick="weekViewHourClick( event )" ondblclick="weekViewHourDoubleClick( event )" ondraggesture="nsDragAndDrop.startDrag(event,calendarViewDNDObserver);" ondragover="nsDragAndDrop.dragOver(event,calendarViewDNDObserver)" oncontextmenu="weekViewContextClick( event )"/>
<box class="week-view-hour-box-class" id="week-tree-day-3-item-17" day="4" hour="17" onclick="weekViewHourClick( event )" ondblclick="weekViewHourDoubleClick( event )" ondraggesture="nsDragAndDrop.startDrag(event,calendarViewDNDObserver);" ondragover="nsDragAndDrop.dragOver(event,calendarViewDNDObserver)" oncontextmenu="weekViewContextClick( event )"/>
<box class="week-view-hour-box-class" id="week-tree-day-3-item-18" day="4" hour="18" onclick="weekViewHourClick( event )" ondblclick="weekViewHourDoubleClick( event )" ondraggesture="nsDragAndDrop.startDrag(event,calendarViewDNDObserver);" ondragover="nsDragAndDrop.dragOver(event,calendarViewDNDObserver)" oncontextmenu="weekViewContextClick( event )"/>
<box class="week-view-hour-box-class" id="week-tree-day-3-item-19" day="4" hour="19" onclick="weekViewHourClick( event )" ondblclick="weekViewHourDoubleClick( event )" ondraggesture="nsDragAndDrop.startDrag(event,calendarViewDNDObserver);" ondragover="nsDragAndDrop.dragOver(event,calendarViewDNDObserver)" oncontextmenu="weekViewContextClick( event )"/>
<box class="week-view-hour-box-class" id="week-tree-day-3-item-20" day="4" hour="20" onclick="weekViewHourClick( event )" ondblclick="weekViewHourDoubleClick( event )" ondraggesture="nsDragAndDrop.startDrag(event,calendarViewDNDObserver);" ondragover="nsDragAndDrop.dragOver(event,calendarViewDNDObserver)" oncontextmenu="weekViewContextClick( event )"/>
<box class="week-view-hour-box-class" id="week-tree-day-3-item-21" day="4" hour="21" onclick="weekViewHourClick( event )" ondblclick="weekViewHourDoubleClick( event )" ondraggesture="nsDragAndDrop.startDrag(event,calendarViewDNDObserver);" ondragover="nsDragAndDrop.dragOver(event,calendarViewDNDObserver)" oncontextmenu="weekViewContextClick( event )"/>
<box class="week-view-hour-box-class" id="week-tree-day-3-item-22" day="4" hour="22" onclick="weekViewHourClick( event )" ondblclick="weekViewHourDoubleClick( event )" ondraggesture="nsDragAndDrop.startDrag(event,calendarViewDNDObserver);" ondragover="nsDragAndDrop.dragOver(event,calendarViewDNDObserver)" oncontextmenu="weekViewContextClick( event )"/>
<box class="week-view-hour-box-class" id="week-tree-day-3-item-23" day="4" hour="23" onclick="weekViewHourClick( event )" ondblclick="weekViewHourDoubleClick( event )" ondraggesture="nsDragAndDrop.startDrag(event,calendarViewDNDObserver);" ondragover="nsDragAndDrop.dragOver(event,calendarViewDNDObserver)" oncontextmenu="weekViewContextClick( event )"/>
</column>
<!-- / DAY 3 -->
<!-- DAY 4 -->
<column class="week-view-day-container-box" flex="1">
<box class="week-view-hour-box-class" id="week-tree-day-4-item-0" day="5" hour="0" onclick="weekViewHourClick( event )" ondblclick="weekViewHourDoubleClick( event )" ondraggesture="nsDragAndDrop.startDrag(event,calendarViewDNDObserver);" ondragover="nsDragAndDrop.dragOver(event,calendarViewDNDObserver)" oncontextmenu="weekViewContextClick( event )"/>
<box class="week-view-hour-box-class" id="week-tree-day-4-item-1" day="5" hour="1" onclick="weekViewHourClick( event )" ondblclick="weekViewHourDoubleClick( event )" ondraggesture="nsDragAndDrop.startDrag(event,calendarViewDNDObserver);" ondragover="nsDragAndDrop.dragOver(event,calendarViewDNDObserver)" oncontextmenu="weekViewContextClick( event )"/>
<box class="week-view-hour-box-class" id="week-tree-day-4-item-2" day="5" hour="2" onclick="weekViewHourClick( event )" ondblclick="weekViewHourDoubleClick( event )" ondraggesture="nsDragAndDrop.startDrag(event,calendarViewDNDObserver);" ondragover="nsDragAndDrop.dragOver(event,calendarViewDNDObserver)" oncontextmenu="weekViewContextClick( event )"/>
<box class="week-view-hour-box-class" id="week-tree-day-4-item-3" day="5" hour="3" onclick="weekViewHourClick( event )" ondblclick="weekViewHourDoubleClick( event )" ondraggesture="nsDragAndDrop.startDrag(event,calendarViewDNDObserver);" ondragover="nsDragAndDrop.dragOver(event,calendarViewDNDObserver)" oncontextmenu="weekViewContextClick( event )"/>
<box class="week-view-hour-box-class" id="week-tree-day-4-item-4" day="5" hour="4" onclick="weekViewHourClick( event )" ondblclick="weekViewHourDoubleClick( event )" ondraggesture="nsDragAndDrop.startDrag(event,calendarViewDNDObserver);" ondragover="nsDragAndDrop.dragOver(event,calendarViewDNDObserver)" oncontextmenu="weekViewContextClick( event )"/>
<box class="week-view-hour-box-class" id="week-tree-day-4-item-5" day="5" hour="5" onclick="weekViewHourClick( event )" ondblclick="weekViewHourDoubleClick( event )" ondraggesture="nsDragAndDrop.startDrag(event,calendarViewDNDObserver);" ondragover="nsDragAndDrop.dragOver(event,calendarViewDNDObserver)" oncontextmenu="weekViewContextClick( event )"/>
<box class="week-view-hour-box-class" id="week-tree-day-4-item-6" day="5" hour="6" onclick="weekViewHourClick( event )" ondblclick="weekViewHourDoubleClick( event )" ondraggesture="nsDragAndDrop.startDrag(event,calendarViewDNDObserver);" ondragover="nsDragAndDrop.dragOver(event,calendarViewDNDObserver)" oncontextmenu="weekViewContextClick( event )"/>
<box class="week-view-hour-box-class" id="week-tree-day-4-item-7" day="5" hour="7" onclick="weekViewHourClick( event )" ondblclick="weekViewHourDoubleClick( event )" ondraggesture="nsDragAndDrop.startDrag(event,calendarViewDNDObserver);" ondragover="nsDragAndDrop.dragOver(event,calendarViewDNDObserver)" oncontextmenu="weekViewContextClick( event )"/>
<box class="week-view-hour-box-class" id="week-tree-day-4-item-8" day="5" hour="8" onclick="weekViewHourClick( event )" ondblclick="weekViewHourDoubleClick( event )" ondraggesture="nsDragAndDrop.startDrag(event,calendarViewDNDObserver);" ondragover="nsDragAndDrop.dragOver(event,calendarViewDNDObserver)" oncontextmenu="weekViewContextClick( event )"/>
<box class="week-view-hour-box-class" id="week-tree-day-4-item-9" day="5" hour="9" onclick="weekViewHourClick( event )" ondblclick="weekViewHourDoubleClick( event )" ondraggesture="nsDragAndDrop.startDrag(event,calendarViewDNDObserver);" ondragover="nsDragAndDrop.dragOver(event,calendarViewDNDObserver)" oncontextmenu="weekViewContextClick( event )"/>
<box class="week-view-hour-box-class" id="week-tree-day-4-item-10" day="5" hour="10" onclick="weekViewHourClick( event )" ondblclick="weekViewHourDoubleClick( event )" ondraggesture="nsDragAndDrop.startDrag(event,calendarViewDNDObserver);" ondragover="nsDragAndDrop.dragOver(event,calendarViewDNDObserver)" oncontextmenu="weekViewContextClick( event )"/>
<box class="week-view-hour-box-class" id="week-tree-day-4-item-11" day="5" hour="11" onclick="weekViewHourClick( event )" ondblclick="weekViewHourDoubleClick( event )" ondraggesture="nsDragAndDrop.startDrag(event,calendarViewDNDObserver);" ondragover="nsDragAndDrop.dragOver(event,calendarViewDNDObserver)" oncontextmenu="weekViewContextClick( event )"/>
<box class="week-view-hour-box-class" id="week-tree-day-4-item-12" day="5" hour="12" onclick="weekViewHourClick( event )" ondblclick="weekViewHourDoubleClick( event )" ondraggesture="nsDragAndDrop.startDrag(event,calendarViewDNDObserver);" ondragover="nsDragAndDrop.dragOver(event,calendarViewDNDObserver)" oncontextmenu="weekViewContextClick( event )"/>
<box class="week-view-hour-box-class" id="week-tree-day-4-item-13" day="5" hour="13" onclick="weekViewHourClick( event )" ondblclick="weekViewHourDoubleClick( event )" ondraggesture="nsDragAndDrop.startDrag(event,calendarViewDNDObserver);" ondragover="nsDragAndDrop.dragOver(event,calendarViewDNDObserver)" oncontextmenu="weekViewContextClick( event )"/>
<box class="week-view-hour-box-class" id="week-tree-day-4-item-14" day="5" hour="14" onclick="weekViewHourClick( event )" ondblclick="weekViewHourDoubleClick( event )" ondraggesture="nsDragAndDrop.startDrag(event,calendarViewDNDObserver);" ondragover="nsDragAndDrop.dragOver(event,calendarViewDNDObserver)" oncontextmenu="weekViewContextClick( event )"/>
<box class="week-view-hour-box-class" id="week-tree-day-4-item-15" day="5" hour="15" onclick="weekViewHourClick( event )" ondblclick="weekViewHourDoubleClick( event )" ondraggesture="nsDragAndDrop.startDrag(event,calendarViewDNDObserver);" ondragover="nsDragAndDrop.dragOver(event,calendarViewDNDObserver)" oncontextmenu="weekViewContextClick( event )"/>
<box class="week-view-hour-box-class" id="week-tree-day-4-item-16" day="5" hour="16" onclick="weekViewHourClick( event )" ondblclick="weekViewHourDoubleClick( event )" ondraggesture="nsDragAndDrop.startDrag(event,calendarViewDNDObserver);" ondragover="nsDragAndDrop.dragOver(event,calendarViewDNDObserver)" oncontextmenu="weekViewContextClick( event )"/>
<box class="week-view-hour-box-class" id="week-tree-day-4-item-17" day="5" hour="17" onclick="weekViewHourClick( event )" ondblclick="weekViewHourDoubleClick( event )" ondraggesture="nsDragAndDrop.startDrag(event,calendarViewDNDObserver);" ondragover="nsDragAndDrop.dragOver(event,calendarViewDNDObserver)" oncontextmenu="weekViewContextClick( event )"/>
<box class="week-view-hour-box-class" id="week-tree-day-4-item-18" day="5" hour="18" onclick="weekViewHourClick( event )" ondblclick="weekViewHourDoubleClick( event )" ondraggesture="nsDragAndDrop.startDrag(event,calendarViewDNDObserver);" ondragover="nsDragAndDrop.dragOver(event,calendarViewDNDObserver)" oncontextmenu="weekViewContextClick( event )"/>
<box class="week-view-hour-box-class" id="week-tree-day-4-item-19" day="5" hour="19" onclick="weekViewHourClick( event )" ondblclick="weekViewHourDoubleClick( event )" ondraggesture="nsDragAndDrop.startDrag(event,calendarViewDNDObserver);" ondragover="nsDragAndDrop.dragOver(event,calendarViewDNDObserver)" oncontextmenu="weekViewContextClick( event )"/>
<box class="week-view-hour-box-class" id="week-tree-day-4-item-20" day="5" hour="20" onclick="weekViewHourClick( event )" ondblclick="weekViewHourDoubleClick( event )" ondraggesture="nsDragAndDrop.startDrag(event,calendarViewDNDObserver);" ondragover="nsDragAndDrop.dragOver(event,calendarViewDNDObserver)" oncontextmenu="weekViewContextClick( event )"/>
<box class="week-view-hour-box-class" id="week-tree-day-4-item-21" day="5" hour="21" onclick="weekViewHourClick( event )" ondblclick="weekViewHourDoubleClick( event )" ondraggesture="nsDragAndDrop.startDrag(event,calendarViewDNDObserver);" ondragover="nsDragAndDrop.dragOver(event,calendarViewDNDObserver)" oncontextmenu="weekViewContextClick( event )"/>
<box class="week-view-hour-box-class" id="week-tree-day-4-item-22" day="5" hour="22" onclick="weekViewHourClick( event )" ondblclick="weekViewHourDoubleClick( event )" ondraggesture="nsDragAndDrop.startDrag(event,calendarViewDNDObserver);" ondragover="nsDragAndDrop.dragOver(event,calendarViewDNDObserver)" oncontextmenu="weekViewContextClick( event )"/>
<box class="week-view-hour-box-class" id="week-tree-day-4-item-23" day="5" hour="23" onclick="weekViewHourClick( event )" ondblclick="weekViewHourDoubleClick( event )" ondraggesture="nsDragAndDrop.startDrag(event,calendarViewDNDObserver);" ondragover="nsDragAndDrop.dragOver(event,calendarViewDNDObserver)" oncontextmenu="weekViewContextClick( event )"/>
</column>
<!-- / DAY 4 -->
<!-- DAY 5 -->
<column class="week-view-day-container-box" flex="1">
<box class="week-view-hour-box-class" id="week-tree-day-5-item-0" day="6" hour="0" onclick="weekViewHourClick( event )" ondblclick="weekViewHourDoubleClick( event )" ondraggesture="nsDragAndDrop.startDrag(event,calendarViewDNDObserver);" ondragover="nsDragAndDrop.dragOver(event,calendarViewDNDObserver)" oncontextmenu="weekViewContextClick( event )"/>
<box class="week-view-hour-box-class" id="week-tree-day-5-item-1" day="6" hour="1" onclick="weekViewHourClick( event )" ondblclick="weekViewHourDoubleClick( event )" ondraggesture="nsDragAndDrop.startDrag(event,calendarViewDNDObserver);" ondragover="nsDragAndDrop.dragOver(event,calendarViewDNDObserver)" oncontextmenu="weekViewContextClick( event )"/>
<box class="week-view-hour-box-class" id="week-tree-day-5-item-2" day="6" hour="2" onclick="weekViewHourClick( event )" ondblclick="weekViewHourDoubleClick( event )" ondraggesture="nsDragAndDrop.startDrag(event,calendarViewDNDObserver);" ondragover="nsDragAndDrop.dragOver(event,calendarViewDNDObserver)" oncontextmenu="weekViewContextClick( event )"/>
<box class="week-view-hour-box-class" id="week-tree-day-5-item-3" day="6" hour="3" onclick="weekViewHourClick( event )" ondblclick="weekViewHourDoubleClick( event )" ondraggesture="nsDragAndDrop.startDrag(event,calendarViewDNDObserver);" ondragover="nsDragAndDrop.dragOver(event,calendarViewDNDObserver)" oncontextmenu="weekViewContextClick( event )"/>
<box class="week-view-hour-box-class" id="week-tree-day-5-item-4" day="6" hour="4" onclick="weekViewHourClick( event )" ondblclick="weekViewHourDoubleClick( event )" ondraggesture="nsDragAndDrop.startDrag(event,calendarViewDNDObserver);" ondragover="nsDragAndDrop.dragOver(event,calendarViewDNDObserver)" oncontextmenu="weekViewContextClick( event )"/>
<box class="week-view-hour-box-class" id="week-tree-day-5-item-5" day="6" hour="5" onclick="weekViewHourClick( event )" ondblclick="weekViewHourDoubleClick( event )" ondraggesture="nsDragAndDrop.startDrag(event,calendarViewDNDObserver);" ondragover="nsDragAndDrop.dragOver(event,calendarViewDNDObserver)" oncontextmenu="weekViewContextClick( event )"/>
<box class="week-view-hour-box-class" id="week-tree-day-5-item-6" day="6" hour="6" onclick="weekViewHourClick( event )" ondblclick="weekViewHourDoubleClick( event )" ondraggesture="nsDragAndDrop.startDrag(event,calendarViewDNDObserver);" ondragover="nsDragAndDrop.dragOver(event,calendarViewDNDObserver)" oncontextmenu="weekViewContextClick( event )"/>
<box class="week-view-hour-box-class" id="week-tree-day-5-item-7" day="6" hour="7" onclick="weekViewHourClick( event )" ondblclick="weekViewHourDoubleClick( event )" ondraggesture="nsDragAndDrop.startDrag(event,calendarViewDNDObserver);" ondragover="nsDragAndDrop.dragOver(event,calendarViewDNDObserver)" oncontextmenu="weekViewContextClick( event )"/>
<box class="week-view-hour-box-class" id="week-tree-day-5-item-8" day="6" hour="8" onclick="weekViewHourClick( event )" ondblclick="weekViewHourDoubleClick( event )" ondraggesture="nsDragAndDrop.startDrag(event,calendarViewDNDObserver);" ondragover="nsDragAndDrop.dragOver(event,calendarViewDNDObserver)" oncontextmenu="weekViewContextClick( event )"/>
<box class="week-view-hour-box-class" id="week-tree-day-5-item-9" day="6" hour="9" onclick="weekViewHourClick( event )" ondblclick="weekViewHourDoubleClick( event )" ondraggesture="nsDragAndDrop.startDrag(event,calendarViewDNDObserver);" ondragover="nsDragAndDrop.dragOver(event,calendarViewDNDObserver)" oncontextmenu="weekViewContextClick( event )"/>
<box class="week-view-hour-box-class" id="week-tree-day-5-item-10" day="6" hour="10" onclick="weekViewHourClick( event )" ondblclick="weekViewHourDoubleClick( event )" ondraggesture="nsDragAndDrop.startDrag(event,calendarViewDNDObserver);" ondragover="nsDragAndDrop.dragOver(event,calendarViewDNDObserver)" oncontextmenu="weekViewContextClick( event )"/>
<box class="week-view-hour-box-class" id="week-tree-day-5-item-11" day="6" hour="11" onclick="weekViewHourClick( event )" ondblclick="weekViewHourDoubleClick( event )" ondraggesture="nsDragAndDrop.startDrag(event,calendarViewDNDObserver);" ondragover="nsDragAndDrop.dragOver(event,calendarViewDNDObserver)" oncontextmenu="weekViewContextClick( event )"/>
<box class="week-view-hour-box-class" id="week-tree-day-5-item-12" day="6" hour="12" onclick="weekViewHourClick( event )" ondblclick="weekViewHourDoubleClick( event )" ondraggesture="nsDragAndDrop.startDrag(event,calendarViewDNDObserver);" ondragover="nsDragAndDrop.dragOver(event,calendarViewDNDObserver)" oncontextmenu="weekViewContextClick( event )"/>
<box class="week-view-hour-box-class" id="week-tree-day-5-item-13" day="6" hour="13" onclick="weekViewHourClick( event )" ondblclick="weekViewHourDoubleClick( event )" ondraggesture="nsDragAndDrop.startDrag(event,calendarViewDNDObserver);" ondragover="nsDragAndDrop.dragOver(event,calendarViewDNDObserver)" oncontextmenu="weekViewContextClick( event )"/>
<box class="week-view-hour-box-class" id="week-tree-day-5-item-14" day="6" hour="14" onclick="weekViewHourClick( event )" ondblclick="weekViewHourDoubleClick( event )" ondraggesture="nsDragAndDrop.startDrag(event,calendarViewDNDObserver);" ondragover="nsDragAndDrop.dragOver(event,calendarViewDNDObserver)" oncontextmenu="weekViewContextClick( event )"/>
<box class="week-view-hour-box-class" id="week-tree-day-5-item-15" day="6" hour="15" onclick="weekViewHourClick( event )" ondblclick="weekViewHourDoubleClick( event )" ondraggesture="nsDragAndDrop.startDrag(event,calendarViewDNDObserver);" ondragover="nsDragAndDrop.dragOver(event,calendarViewDNDObserver)" oncontextmenu="weekViewContextClick( event )"/>
<box class="week-view-hour-box-class" id="week-tree-day-5-item-16" day="6" hour="16" onclick="weekViewHourClick( event )" ondblclick="weekViewHourDoubleClick( event )" ondraggesture="nsDragAndDrop.startDrag(event,calendarViewDNDObserver);" ondragover="nsDragAndDrop.dragOver(event,calendarViewDNDObserver)" oncontextmenu="weekViewContextClick( event )"/>
<box class="week-view-hour-box-class" id="week-tree-day-5-item-17" day="6" hour="17" onclick="weekViewHourClick( event )" ondblclick="weekViewHourDoubleClick( event )" ondraggesture="nsDragAndDrop.startDrag(event,calendarViewDNDObserver);" ondragover="nsDragAndDrop.dragOver(event,calendarViewDNDObserver)" oncontextmenu="weekViewContextClick( event )"/>
<box class="week-view-hour-box-class" id="week-tree-day-5-item-18" day="6" hour="18" onclick="weekViewHourClick( event )" ondblclick="weekViewHourDoubleClick( event )" ondraggesture="nsDragAndDrop.startDrag(event,calendarViewDNDObserver);" ondragover="nsDragAndDrop.dragOver(event,calendarViewDNDObserver)" oncontextmenu="weekViewContextClick( event )"/>
<box class="week-view-hour-box-class" id="week-tree-day-5-item-19" day="6" hour="19" onclick="weekViewHourClick( event )" ondblclick="weekViewHourDoubleClick( event )" ondraggesture="nsDragAndDrop.startDrag(event,calendarViewDNDObserver);" ondragover="nsDragAndDrop.dragOver(event,calendarViewDNDObserver)" oncontextmenu="weekViewContextClick( event )"/>
<box class="week-view-hour-box-class" id="week-tree-day-5-item-20" day="6" hour="20" onclick="weekViewHourClick( event )" ondblclick="weekViewHourDoubleClick( event )" ondraggesture="nsDragAndDrop.startDrag(event,calendarViewDNDObserver);" ondragover="nsDragAndDrop.dragOver(event,calendarViewDNDObserver)" oncontextmenu="weekViewContextClick( event )"/>
<box class="week-view-hour-box-class" id="week-tree-day-5-item-21" day="6" hour="21" onclick="weekViewHourClick( event )" ondblclick="weekViewHourDoubleClick( event )" ondraggesture="nsDragAndDrop.startDrag(event,calendarViewDNDObserver);" ondragover="nsDragAndDrop.dragOver(event,calendarViewDNDObserver)" oncontextmenu="weekViewContextClick( event )"/>
<box class="week-view-hour-box-class" id="week-tree-day-5-item-22" day="6" hour="22" onclick="weekViewHourClick( event )" ondblclick="weekViewHourDoubleClick( event )" ondraggesture="nsDragAndDrop.startDrag(event,calendarViewDNDObserver);" ondragover="nsDragAndDrop.dragOver(event,calendarViewDNDObserver)" oncontextmenu="weekViewContextClick( event )"/>
<box class="week-view-hour-box-class" id="week-tree-day-5-item-23" day="6" hour="23" onclick="weekViewHourClick( event )" ondblclick="weekViewHourDoubleClick( event )" ondraggesture="nsDragAndDrop.startDrag(event,calendarViewDNDObserver);" ondragover="nsDragAndDrop.dragOver(event,calendarViewDNDObserver)" oncontextmenu="weekViewContextClick( event )"/>
</column>
<!-- / DAY 5 -->
<!-- DAY 6 -->
<column class="week-view-day-container-box" flex="1">
<box class="week-view-hour-box-class week-view-hour-box-class-last-day" id="week-tree-day-6-item-0" day="7" hour="0" onclick="weekViewHourClick( event )" ondblclick="weekViewHourDoubleClick( event )" ondraggesture="nsDragAndDrop.startDrag(event,calendarViewDNDObserver);" ondragover="nsDragAndDrop.dragOver(event,calendarViewDNDObserver)" oncontextmenu="weekViewContextClick( event )"/>
<box class="week-view-hour-box-class week-view-hour-box-class-last-day" id="week-tree-day-6-item-1" day="7" hour="1" onclick="weekViewHourClick( event )" ondblclick="weekViewHourDoubleClick( event )" ondraggesture="nsDragAndDrop.startDrag(event,calendarViewDNDObserver);" ondragover="nsDragAndDrop.dragOver(event,calendarViewDNDObserver)" oncontextmenu="weekViewContextClick( event )"/>
<box class="week-view-hour-box-class week-view-hour-box-class-last-day" id="week-tree-day-6-item-2" day="7" hour="2" onclick="weekViewHourClick( event )" ondblclick="weekViewHourDoubleClick( event )" ondraggesture="nsDragAndDrop.startDrag(event,calendarViewDNDObserver);" ondragover="nsDragAndDrop.dragOver(event,calendarViewDNDObserver)" oncontextmenu="weekViewContextClick( event )"/>
<box class="week-view-hour-box-class week-view-hour-box-class-last-day" id="week-tree-day-6-item-3" day="7" hour="3" onclick="weekViewHourClick( event )" ondblclick="weekViewHourDoubleClick( event )" ondraggesture="nsDragAndDrop.startDrag(event,calendarViewDNDObserver);" ondragover="nsDragAndDrop.dragOver(event,calendarViewDNDObserver)" oncontextmenu="weekViewContextClick( event )"/>
<box class="week-view-hour-box-class week-view-hour-box-class-last-day" id="week-tree-day-6-item-4" day="7" hour="4" onclick="weekViewHourClick( event )" ondblclick="weekViewHourDoubleClick( event )" ondraggesture="nsDragAndDrop.startDrag(event,calendarViewDNDObserver);" ondragover="nsDragAndDrop.dragOver(event,calendarViewDNDObserver)" oncontextmenu="weekViewContextClick( event )"/>
<box class="week-view-hour-box-class week-view-hour-box-class-last-day" id="week-tree-day-6-item-5" day="7" hour="5" onclick="weekViewHourClick( event )" ondblclick="weekViewHourDoubleClick( event )" ondraggesture="nsDragAndDrop.startDrag(event,calendarViewDNDObserver);" ondragover="nsDragAndDrop.dragOver(event,calendarViewDNDObserver)" oncontextmenu="weekViewContextClick( event )"/>
<box class="week-view-hour-box-class week-view-hour-box-class-last-day" id="week-tree-day-6-item-6" day="7" hour="6" onclick="weekViewHourClick( event )" ondblclick="weekViewHourDoubleClick( event )" ondraggesture="nsDragAndDrop.startDrag(event,calendarViewDNDObserver);" ondragover="nsDragAndDrop.dragOver(event,calendarViewDNDObserver)" oncontextmenu="weekViewContextClick( event )"/>
<box class="week-view-hour-box-class week-view-hour-box-class-last-day" id="week-tree-day-6-item-7" day="7" hour="7" onclick="weekViewHourClick( event )" ondblclick="weekViewHourDoubleClick( event )" ondraggesture="nsDragAndDrop.startDrag(event,calendarViewDNDObserver);" ondragover="nsDragAndDrop.dragOver(event,calendarViewDNDObserver)" oncontextmenu="weekViewContextClick( event )"/>
<box class="week-view-hour-box-class week-view-hour-box-class-last-day" id="week-tree-day-6-item-8" day="7" hour="8" onclick="weekViewHourClick( event )" ondblclick="weekViewHourDoubleClick( event )" ondraggesture="nsDragAndDrop.startDrag(event,calendarViewDNDObserver);" ondragover="nsDragAndDrop.dragOver(event,calendarViewDNDObserver)" oncontextmenu="weekViewContextClick( event )"/>
<box class="week-view-hour-box-class week-view-hour-box-class-last-day" id="week-tree-day-6-item-9" day="7" hour="9" onclick="weekViewHourClick( event )" ondblclick="weekViewHourDoubleClick( event )" ondraggesture="nsDragAndDrop.startDrag(event,calendarViewDNDObserver);" ondragover="nsDragAndDrop.dragOver(event,calendarViewDNDObserver)" oncontextmenu="weekViewContextClick( event )"/>
<box class="week-view-hour-box-class week-view-hour-box-class-last-day" id="week-tree-day-6-item-10" day="7" hour="10" onclick="weekViewHourClick( event )" ondblclick="weekViewHourDoubleClick( event )" ondraggesture="nsDragAndDrop.startDrag(event,calendarViewDNDObserver);" ondragover="nsDragAndDrop.dragOver(event,calendarViewDNDObserver)" oncontextmenu="weekViewContextClick( event )"/>
<box class="week-view-hour-box-class week-view-hour-box-class-last-day" id="week-tree-day-6-item-11" day="7" hour="11" onclick="weekViewHourClick( event )" ondblclick="weekViewHourDoubleClick( event )" ondraggesture="nsDragAndDrop.startDrag(event,calendarViewDNDObserver);" ondragover="nsDragAndDrop.dragOver(event,calendarViewDNDObserver)" oncontextmenu="weekViewContextClick( event )"/>
<box class="week-view-hour-box-class week-view-hour-box-class-last-day" id="week-tree-day-6-item-12" day="7" hour="12" onclick="weekViewHourClick( event )" ondblclick="weekViewHourDoubleClick( event )" ondraggesture="nsDragAndDrop.startDrag(event,calendarViewDNDObserver);" ondragover="nsDragAndDrop.dragOver(event,calendarViewDNDObserver)" oncontextmenu="weekViewContextClick( event )"/>
<box class="week-view-hour-box-class week-view-hour-box-class-last-day" id="week-tree-day-6-item-13" day="7" hour="13" onclick="weekViewHourClick( event )" ondblclick="weekViewHourDoubleClick( event )" ondraggesture="nsDragAndDrop.startDrag(event,calendarViewDNDObserver);" ondragover="nsDragAndDrop.dragOver(event,calendarViewDNDObserver)" oncontextmenu="weekViewContextClick( event )"/>
<box class="week-view-hour-box-class week-view-hour-box-class-last-day" id="week-tree-day-6-item-14" day="7" hour="14" onclick="weekViewHourClick( event )" ondblclick="weekViewHourDoubleClick( event )" ondraggesture="nsDragAndDrop.startDrag(event,calendarViewDNDObserver);" ondragover="nsDragAndDrop.dragOver(event,calendarViewDNDObserver)" oncontextmenu="weekViewContextClick( event )"/>
<box class="week-view-hour-box-class week-view-hour-box-class-last-day" id="week-tree-day-6-item-15" day="7" hour="15" onclick="weekViewHourClick( event )" ondblclick="weekViewHourDoubleClick( event )" ondraggesture="nsDragAndDrop.startDrag(event,calendarViewDNDObserver);" ondragover="nsDragAndDrop.dragOver(event,calendarViewDNDObserver)" oncontextmenu="weekViewContextClick( event )"/>
<box class="week-view-hour-box-class week-view-hour-box-class-last-day" id="week-tree-day-6-item-16" day="7" hour="16" onclick="weekViewHourClick( event )" ondblclick="weekViewHourDoubleClick( event )" ondraggesture="nsDragAndDrop.startDrag(event,calendarViewDNDObserver);" ondragover="nsDragAndDrop.dragOver(event,calendarViewDNDObserver)" oncontextmenu="weekViewContextClick( event )"/>
<box class="week-view-hour-box-class week-view-hour-box-class-last-day" id="week-tree-day-6-item-17" day="7" hour="17" onclick="weekViewHourClick( event )" ondblclick="weekViewHourDoubleClick( event )" ondraggesture="nsDragAndDrop.startDrag(event,calendarViewDNDObserver);" ondragover="nsDragAndDrop.dragOver(event,calendarViewDNDObserver)" oncontextmenu="weekViewContextClick( event )"/>
<box class="week-view-hour-box-class week-view-hour-box-class-last-day" id="week-tree-day-6-item-18" day="7" hour="18" onclick="weekViewHourClick( event )" ondblclick="weekViewHourDoubleClick( event )" ondraggesture="nsDragAndDrop.startDrag(event,calendarViewDNDObserver);" ondragover="nsDragAndDrop.dragOver(event,calendarViewDNDObserver)" oncontextmenu="weekViewContextClick( event )"/>
<box class="week-view-hour-box-class week-view-hour-box-class-last-day" id="week-tree-day-6-item-19" day="7" hour="19" onclick="weekViewHourClick( event )" ondblclick="weekViewHourDoubleClick( event )" ondraggesture="nsDragAndDrop.startDrag(event,calendarViewDNDObserver);" ondragover="nsDragAndDrop.dragOver(event,calendarViewDNDObserver)" oncontextmenu="weekViewContextClick( event )"/>
<box class="week-view-hour-box-class week-view-hour-box-class-last-day" id="week-tree-day-6-item-20" day="7" hour="20" onclick="weekViewHourClick( event )" ondblclick="weekViewHourDoubleClick( event )" ondraggesture="nsDragAndDrop.startDrag(event,calendarViewDNDObserver);" ondragover="nsDragAndDrop.dragOver(event,calendarViewDNDObserver)" oncontextmenu="weekViewContextClick( event )"/>
<box class="week-view-hour-box-class week-view-hour-box-class-last-day" id="week-tree-day-6-item-21" day="7" hour="21" onclick="weekViewHourClick( event )" ondblclick="weekViewHourDoubleClick( event )" ondraggesture="nsDragAndDrop.startDrag(event,calendarViewDNDObserver);" ondragover="nsDragAndDrop.dragOver(event,calendarViewDNDObserver)" oncontextmenu="weekViewContextClick( event )"/>
<box class="week-view-hour-box-class week-view-hour-box-class-last-day" id="week-tree-day-6-item-22" day="7" hour="22" onclick="weekViewHourClick( event )" ondblclick="weekViewHourDoubleClick( event )" ondraggesture="nsDragAndDrop.startDrag(event,calendarViewDNDObserver);" ondragover="nsDragAndDrop.dragOver(event,calendarViewDNDObserver)" oncontextmenu="weekViewContextClick( event )"/>
<box class="week-view-hour-box-class week-view-hour-box-class-last-day" id="week-tree-day-6-item-23" day="7" hour="23" onclick="weekViewHourClick( event )" ondblclick="weekViewHourDoubleClick( event )" ondraggesture="nsDragAndDrop.startDrag(event,calendarViewDNDObserver);" ondragover="nsDragAndDrop.dragOver(event,calendarViewDNDObserver)" oncontextmenu="weekViewContextClick( event )"/>
</column>
<!-- / DAY 6 -->
</columns>
</grid>
</stack>
</box>
</box>
</vbox>
</vbox>
</overlay>

View File

@@ -1,272 +0,0 @@
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is OEone Calendar Code, released October 31st, 2001.
*
* The Initial Developer of the Original Code is
* OEone Corporation.
* Portions created by the Initial Developer are Copyright (C) 2001
* the Initial Developer. All Rights Reserved.
*
* Contributor(s): Mike Potter <mikep@oeone.com>
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
var gWizardType;
function checkInitialPage()
{
gWizardType = document.getElementById( "initial-radiogroup" ).selectedItem.value;
document.getElementsByAttribute( "pageid", "initialPage" )[0].setAttribute( "next", gWizardType );
}
function onPageShow( PageId )
{
switch( PageId )
{
case "import":
if( document.getElementById( "import-path-textbox" ).value.length == 0 )
{
document.getElementById( "calendar-wizard" ).canAdvance = false;
}
else
{
document.getElementById( "calendar-wizard" ).canAdvance = true;
}
break;
case "import-2":
buildCalendarsListbox( 'import-calendar-radiogroup' );
if( document.getElementById( "import-calendar-radiogroup" ).selectedItem == null )
{
document.getElementById( "calendar-wizard" ).canAdvance = false;
}
else
{
document.getElementById( "calendar-wizard" ).canAdvance = true;
}
document.getElementById( "import-calendar-radiogroup" ).childNodes[0].setAttribute( "selected", "true" );
break;
}
}
function buildCalendarsListbox( ListBoxId )
{
document.getElementById( ListBoxId ).database.AddDataSource( opener.gCalendarWindow.calendarManager.rdf.getDatasource() );
document.getElementById( ListBoxId ).builder.rebuild();
}
function doWizardFinish( )
{
window.setCursor( "wait" );
switch( gWizardType )
{
case "import":
return true;
break;
case "export":
return doWizardExport();
break;
case "subscribe":
return doWizardSubscribe();
break;
case "publish":
return doWizardPublish();
break;
}
}
function doWizardImport()
{
window.setCursor( "wait" );
var calendarEventArray;
var fileName = document.getElementById( "import-path-textbox" ).value;
var aDataStream = readDataFromFile( fileName, "UTF-8" );
if( fileName.indexOf( ".ics" ) != -1 )
calendarEventArray = parseIcalData( aDataStream );
else if( fileName.indexOf( ".xcs" ) != -1 )
calendarEventArray = parseXCSData( aDataStream );
if( document.getElementById( "import-2-radiogroup" ).selectedItem.value == "silent" )
{
var ServerName = document.getElementById( "import-calendar-radiogroup" ).selectedItem.value;
doAddEventsToCalendar( calendarEventArray, true, ServerName );
}
else
{
doAddEventsToCalendar( calendarEventArray, true, null );
}
}
function doAddEventsToCalendar( calendarEventArray, silent, ServerName )
{
gICalLib.batchMode = true;
for(var i = 0; i < calendarEventArray.length; i++)
{
calendarEvent = calendarEventArray[i];
// Check if event with same ID already in Calendar. If so, import event with new ID.
if( gICalLib.fetchEvent( calendarEvent.id ) != null ) {
calendarEvent.id = createUniqueID( );
}
// the start time is in zulu time, need to convert to current time
if(calendarEvent.allDay != true)
convertZuluToLocal( calendarEvent );
// open the event dialog with the event to add
if( silent )
{
if( ServerName == null || ServerName == "" || ServerName == false )
var ServerName = gCalendarWindow.calendarManager.getDefaultServer();
gICalLib.addEvent( calendarEvent, ServerName );
document.getElementById( "import-progress-meter" ).setAttribute( "value", ( (i/calendarEventArray.length)*100 )+"%" );
}
else
editNewEvent( calendarEvent );
}
gICalLib.batchMode = false;
window.setCursor( "default" );
document.getElementById( "importing-box" ).setAttribute( "collapsed", "true" );
document.getElementById( "done-importing-box" ).removeAttribute( "collapsed" );
}
function doWizardExport()
{
const UTF8 = "UTF-8";
var aDataStream;
var extension;
var charset;
var fileName = document.getElementById( "export-path-textbox" ).value;
if( fileName.indexOf( ".ics" ) == -1 )
{
aDataStream = eventArrayToICalString( calendarEventArray, true );
extension = extensionCalendar;
charset = "UTF-8";
}
else if( fileName.indexOf( ".rtf" ) == -1 )
{
aDataStream = eventArrayToRTF( calendarEventArray );
extension = extensionRtf;
}
else if( fileName.indexOf( ".htm" ) == -1 )
{
aDataStream = eventArrayToHTML( calendarEventArray );
extension = ".htm";
charset = "UTF-8";
}
else if( fileName.indexOf( ".csv" ) == -1 )
{
aDataStream = eventArrayToCsv( calendarEventArray );
extension = extensionCsv;
charset = "UTF-8";
}
else if( fileName.indexOf( ".xml" ) == -1 )
{
aDataStream = eventArrayToXCS( calendarEventArray );
extension = extensionXcs;
charset = "UTF-8";
}
else if( fileName.indexOf( ".rdf" ) == -1 )
{
aDataStream = eventArrayToRdf( calendarEventArray );
extension = extensionRdf;
charset = "UTF-8";
}
saveDataToFile( filePath, aDataStream, charset );
}
function launchFilePicker( Mode, ElementToGiveValueTo )
{
// No show the 'Save As' dialog and ask for a filename to save to
const nsIFilePicker = Components.interfaces.nsIFilePicker;
var fp = Components.classes["@mozilla.org/filepicker;1"].createInstance(nsIFilePicker);
// caller can force disable of sand box, even if ON globally
switch( Mode )
{
case "open":
fp.defaultExtension = "ics";
fp.appendFilter( filterCalendar, "*" + extensionCalendar );
fp.appendFilter( filterXcs, "*" + extensionXcs );
fp.init(window, "Open", nsIFilePicker.modeOpen);
break;
case "save":
fp.init(window, "Save", nsIFilePicker.modeSave);
//if(calendarEventArray.length == 1 && calendarEventArray[0].title)
// fp.defaultString = calendarEventArray[0].title;
//else
fp.defaultString = "Mozilla Calendar events";
fp.defaultExtension = "ics";
fp.appendFilter( filterCalendar, "*" + extensionCalendar );
fp.appendFilter( filterRtf, "*" + extensionRtf );
fp.appendFilters(nsIFilePicker.filterHTML);
fp.appendFilter( filterCsv, "*" + extensionCsv );
fp.appendFilter( filterXcs, "*" + extensionXcs );
fp.appendFilter( filterRdf, "*" + extensionRdf );
break;
}
fp.show();
if (fp.file && fp.file.path.length > 0)
{
/*if(filePath.indexOf(".") == -1 )
filePath += extension;
*/
document.getElementById( ElementToGiveValueTo ).value = fp.file.path;
document.getElementById( "calendar-wizard" ).canAdvance = true;
}
}

View File

@@ -1,247 +0,0 @@
<?xml version="1.0"?>
<!-- ***** BEGIN LICENSE BLOCK *****
- Version: MPL 1.1/GPL 2.0/LGPL 2.1
-
- The contents of this file are subject to the Mozilla Public License Version
- 1.1 (the "License"); you may not use this file except in compliance with
- the License. You may obtain a copy of the License at
- http://www.mozilla.org/MPL/
-
- Software distributed under the License is distributed on an "AS IS" basis,
- WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- for the specific language governing rights and limitations under the
- License.
-
- The Original Code is OEone Calendar Code, released October 31st, 2001.
-
- The Initial Developer of the Original Code is
- OEone Corporation.
- Portions created by the Initial Developer are Copyright (C) 2001
- the Initial Developer. All Rights Reserved.
-
- Contributor(s): Mike Potter <mikep@oeone.com>
-
- Alternatively, the contents of this file may be used under the terms of
- either the GNU General Public License Version 2 or later (the "GPL"), or
- the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- in which case the provisions of the GPL or the LGPL are applicable instead
- of those above. If you wish to allow use of your version of this file only
- under the terms of either the GPL or the LGPL, and not to allow others to
- use your version of this file under the terms of the MPL, indicate your
- decision by deleting the provisions above and replace them with the notice
- and other provisions required by the LGPL or the GPL. If you do not delete
- the provisions above, a recipient may use your version of this file under
- the terms of any one of the MPL, the GPL or the LGPL.
-
- ***** END LICENSE BLOCK ***** -->
<!-- Style sheets -->
<?xml-stylesheet href="chrome://global/skin/global.css" type="text/css"?>
<?xml-stylesheet href="chrome://calendar/skin/calendar.css" type="text/css"?>
<?xml-stylesheet href="chrome://communicator/skin/communicator.css" type="text/css"?>
<!-- Overlays -->
<?xul-overlay href="chrome://global/content/globalOverlay.xul"?>
<!-- DTDs -->
<!-- DTD File with all strings specific to the calendar -->
<!DOCTYPE wizard
[
<!ENTITY % dtd1 SYSTEM "chrome://calendar/locale/global.dtd" > %dtd1;
<!ENTITY % dtd2 SYSTEM "chrome://calendar/locale/calendar.dtd" > %dtd2;
]>
<!-- The Window -->
<wizard
id="calendar-wizard"
title="Mozilla Calendar Wizard"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
onwizardfinish="return doWizardFinish();"
persist="screenX screenY"
>
<script type="application/x-javascript" src="chrome://calendar/content/calendar.js"/>
<script type="application/x-javascript" src="chrome://calendar/content/calendarWizard.js"/>
<script type="application/x-javascript" src="chrome://calendar/content/calendarImportExport.js"/>
<wizardpage pageid="initialPage" description="Choose An Action" onpagehide="checkInitialPage()" next="import">
<radiogroup id="initial-radiogroup">
<radio value="import" label="&calendar.wizard.import.label;" selected="true"/>
<radio value="export" label="&calendar.wizard.export.label;"/>
<radio value="subscribe" label="&calendar.wizard.subscribe.label;"/>
<radio value="publish" label="&calendar.wizard.publish.label;"/>
</radiogroup>
</wizardpage>
<wizardpage pageid="import" label="Import Events" description="Choose the events you want to import." onpagehide="" onpageshow="onPageShow( 'import' );" next="import-2">
<textbox id="import-path-textbox"/>
<button oncommand="launchFilePicker( 'open', 'import-path-textbox' )" label="Find a File"/>
<description>
To import events, find the file you are looking to import, then click next.
The calendar currently only imports .ics files, which are standard calendar data files.
</description>
</wizardpage>
<wizardpage pageid="import-2" label="Select Calendar" description="Choose the file to import into." onpagehide="" onpageshow="onPageShow( 'import-2' );" next="import-3">
<radiogroup id="import-calendar-radiogroup" datasources="rdf:null" ref="urn:calendarcontainer">
<template>
<rule>
<radio oncommand="document.getElementById( 'calendar-wizard' ).canAdvance = true;" uri="rdf:*" label="rdf:http://home.netscape.com/NC-rdf#name" value="rdf:http://home.netscape.com/NC-rdf#path"/>
</rule>
</template>
</radiogroup>
</wizardpage>
<wizardpage pageid="import-3" onpagehide="" onpageshow="" next="import-4">
<description>Should I open each event before importing it?</description>
<radiogroup id="import-2-radiogroup">
<radio id="import-2-no" value="silent" label="No, just import the events." selected="true"/>
<radio id="import-2-yes" value="promtp" label="Yes, open each event."/>
</radiogroup>
</wizardpage>
<wizardpage pageid="import-4" onpagehide="" onpageshow="setTimeout( 'doWizardImport()', 1000 );">
<box id="importing-box">
<description>Importing...</description>
<progressmeter id="import-progress-meter" mode="determined" flex="1"/>
</box>
<box id="done-importing-box" collapsed="true">
<description>All your events have been imported. Click finish to close the wizard.</description>
</box>
</wizardpage>
<wizardpage pageid="export" label="Export Events" onpagehide="" onpageshow="buildCalendarsListbox( 'export-calendars-listbox' )" next="export-2">
<radiogroup id="export-calendar-radiogroup" datasources="rdf:null" ref="urn:calendarcontainer">
<template>
<rule>
<radio oncommand="document.getElementById( 'calendar-wizard' ).canAdvance = true;" uri="rdf:*" label="rdf:http://home.netscape.com/NC-rdf#name" value="rdf:http://home.netscape.com/NC-rdf#path"/>
</rule>
</template>
</radiogroup>
</wizardpage>
<wizardpage pageid="export-2" onpagehide="" onpageshow="">
<description>Choose the file location to save the events to.</description>
<textbox id="export-path-textbox"/>
<button oncommand="launchFilePicker( 'save', 'export-path-textbox' )" label="Find a File"/>
</wizardpage>
<wizardpage pageid="subscribe" onpagehide="" onpageshow="">
<!-- Name -->
<description>&calendar.server.dialog.name.label;</description>
<textbox id="server-name-textbox"/>
<description>&calendar.server.dialog.location.label;</description>
<textbox id="server-path-textbox"/>
<description>
You can subscribe to remote calendars by entering in their URL here.
</description>
</wizardpage>
<wizardpage pageid="publish" next="publish-2" onpagehide="" onpageshow="buildCalendarsListbox( 'publish-calendars-listbox' )">
<radiogroup>
<radio id="publish-calendars" label="Publish Entire Calendar" selected="true"/>
<!-- show a list of calendars here -->
<listbox id="publish-calendars-listbox" class="unifinder-tree-class" flex="1"
contextmenu="calendarlist-context-menu" datasources="rdf:null" ref="urn:calendarcontainer">
<listhead>
<listheader flex="1" crop="end" label="&calendar.calendarlistbox.label;"/>
<listheader/>
</listhead>
<listcols>
<listcol flex="1"/>
<listcol/>
</listcols>
<template>
<rule>
<listitem uri="rdf:*"
calendarPath="rdf:http://home.netscape.com/NC-rdf#path">
<listcell id="calendar-list-item-^rdf://http://home.netscape.com/NC-rdf#serverNumber"
class="calendar-list-item-class"
label="rdf:http://home.netscape.com/NC-rdf#name"
flex="1"
type="checkbox"
checked="rdf:http://home.netscape.com/NC-rdf#active"
/>
<listcell>
<image id="calendar-list-image-^rdf://http://home.netscape.com/NC-rdf#serverNumber"
class="calendar-list-item-class"/>
</listcell>
</listitem>
</rule>
</template>
</listbox>
<radio id="publish-events" label="Publish Selected Events" disabled="true"/>
<!-- TODO: show a list of events here -->
</radiogroup>
</wizardpage>
<wizardpage pageid="publish-2" onpagehide="" onpageshow="">
<grid>
<columns>
<column />
<column flex="1"/>
</columns>
<rows>
<!-- URL -->
<row align="center">
<hbox class="field-label-box-class" pack="end">
<description>&calendar.publish.url.label;</description>
</hbox>
<textbox flex="1" id="publish-url-textbox"/>
</row>
<row align="center">
<hbox class="field-label-box-class" pack="end"/>
<description>Something like http://www.myserver.com/webdav/</description>
</row>
<!-- File Name -->
<row align="center">
<hbox class="field-label-box-class" pack="end">
<description>&calendar.publish.remotefilename.label;</description>
</hbox>
<textbox flex="1" id="publish-remotefilename-textbox"/>
</row>
<row align="center">
<hbox class="field-label-box-class" pack="end"/>
<description>The filename to save to on the remote server.</description>
</row>
<!-- Username -->
<row align="center">
<hbox class="field-label-box-class" pack="end">
<description>&calendar.publish.username.label;</description>
</hbox>
<textbox id="publish-username-textbox" flex="1" />
</row>
<row align="center">
<hbox class="field-label-box-class" pack="end"/>
<description>(Optional) The username to upload to this server.</description>
</row>
<!-- Password -->
<row align="center">
<hbox class="field-label-box-class" pack="end">
<description>&calendar.publish.password.label;</description>
</hbox>
<textbox type="password" id="publish-password-textbox" flex="1" />
</row>
<row align="center">
<hbox class="field-label-box-class" pack="end"/>
<description>(Optional) The password to upload to this server.</description>
</row>
</rows>
</grid>
</wizardpage>
</wizard>