bug 320869: remove unused calendar files. r=jminta

This commit is contained in:
mvl%exedo.nl 2006-02-12 20:23:21 +00:00
parent 8dd4eef0a8
commit 75716cc9c5
22 changed files with 0 additions and 15047 deletions

View File

@ -1,691 +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>
* Chris Allen <christopher.allen@mint.steelcase.com>
* Eric Belhaire <belhaire@ief.u-psud.fr>
*
* 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/ca-calender-event.js
* AUTHOR
* Garth Smedley
* REQUIRED INCLUDES
*
* NOTES
* CalendarEventDataSource class:
* Saves and loads calendar events, provides methods
* for adding, deleting, modifying and searching calendar events.
*
* CalendarEvent class:
* Contains info about calendar events.
*
* Also provides an observer interface for clients that need to be
* notified when calendar event data changes.
*
* IMPLEMENTATION NOTES
* Currently uses the Ical library to store events.
* Access to ical is through the libxpical xpcom object.
*
**********
*/
/*-----------------------------------------------------------------
* G L O B A L V A R I A B L E S
*/
/*-----------------------------------------------------------------
* CalendarEventDataSource Class
*
* Maintains all of the calendar events.
*
* PROPERTIES
* observerList - array of observers, see constructor notes.
*/
/**
* CalendarEventDataSource Constructor.
*
* PARAMETERS
* observer - An object that implements methods that are called when the
* data source is modified. The following methods should be implemented
* by the observer object.
*
{
onLoad : function() {}, // called when server is ready
onAddItem : function( calendarEvent ) {},
onModifyItem : function( calendarEvent, originalEvent ) {},
onDeleteItem : function( calendarEvent ) {},
onAlarm : function( calendarEvent ) {},
onError : function() {},
};
These methods are now called synchronously, if you add an event the onAddItem
method will be called during your call to add the event.
*
* NOTES
* Is a singleton, the first invocation creates an instance, subsequent calls return the same instance.
*/
function CalendarEventDataSource( )
{
try {
var iCalLibComponent = Components.classes["@mozilla.org/ical-container;1"].getService();
} catch ( e ) {
alert(
"The calendar cannot run due to the following error:\n"+
"The ICAL Component is not registered properly. Please follow the instructions given at:\n"+
"http://bugzilla.mozilla.org/attachment.cgi?id=122860&action=view\n"+
"If these instructions don't solve the problem, please add yourself to the cc list of\n"+
"bug 134432 at http://bugzilla.mozilla.org/show_bug.cgi?id=134432.\n"+
"and give more feedback on your platform, Mozilla version, calendar install type:\n"+
"(build or xpi), any errors you see on the console that you think is related and any\n"+
" other problems you come across when following the above insructions.\n\n"+e );
window.close();
}
this.gICalLib = iCalLibComponent.QueryInterface(Components.interfaces.oeIICalContainer);
this.currentEvents = new Array();
this.prepareAlarms( );
}
CalendarEventDataSource.InitService = function calEvent_InitService( root )
{
return new CalendarEventDataSource( null, root.getUserPath() );
}
// turn on/off debugging
CalendarEventDataSource.gDebug = true;
// Singleton CalendarEventDataSource variable.
CalendarEventDataSource.debug = function( str )
{
if( CalendarEventDataSource.gDebug )
{
dump( "\n CalendarEventDataSource DEBUG: "+ str + "\n");
}
}
/** PUBLIC
*
* NOTES
* Called at start up after all services have been inited.
*/
CalendarEventDataSource.prototype.onServiceStartup = function calEvent_onServiceStartup( root )
{
}
/** PUBLIC
*
* CalendarEventDataSource/search.
*
* First hacked in implementation of search
*
* NOTES
* This should be search ing by all content, not just the beginning
* of the title field, A LOT remains to be done..
*/
CalendarEventDataSource.prototype.search = function calEvent_search( searchText, fieldName )
{
searchText = searchText.toLowerCase();
/*
** Try to get rid of all the spaces in the search text.
** At present, this only gets rid of one.. I don't know why.
*/
var regexp = "\s+";
searchText = searchText.replace( regexp, "" );
var searchEventTable = new Array();
if( searchText != "" )
{
var eventTable = this.currentEvents;
for( var index = 0; index < eventTable.length; ++index )
{
var calendarEvent = eventTable[ index ];
if ( typeof fieldName == "string")
{
var value = calendarEvent[ fieldName ].toLowerCase();
if( value )
{
if( value.indexOf( searchText ) != -1 )
{
searchEventTable[ searchEventTable.length ] = calendarEvent;
break;
}
}
}
else if ( typeof fieldName == "object" )
{
for ( i in fieldName )
{
var objValue = calendarEvent[ fieldName[i] ];
if( objValue )
{
objValue = objValue.toLowerCase();
if( objValue.indexOf( searchText ) != -1 )
{
searchEventTable[ searchEventTable.length ] = calendarEvent;
break;
}
}
}
}
}
}
searchEventTable.sort( this.orderRawEventsByDate );
return searchEventTable;
}
CalendarEventDataSource.prototype.searchBySql = function calEvent_searchBySql( Query )
{
var eventDisplays = new Array();
var eventList = this.gICalLib.searchBySQL( Query );
while( eventList.hasMoreElements() )
{
eventDisplays[ eventDisplays.length ] = eventList.getNext().QueryInterface(Components.interfaces.oeIICalEvent);
}
eventDisplays.sort( this.orderRawEventsByDate );
return eventDisplays;
}
/** PUBLIC
*
* CalendarEventDataSource/getEventsForDay.
*
* PARAMETERS
* date - Date object, uses the month and year and date to get all events
* for the given day.
* RETURN
* array - of events for the day
*/
CalendarEventDataSource.prototype.getEventsForDay = function calEvent_getEventsForDay( date )
{
var eventDisplays = new Array();
var eventList = this.gICalLib.getEventsForDay( date );
while( eventList.hasMoreElements() )
{
var tmpevent = eventList.getNext().QueryInterface(Components.interfaces.oeIICalEventDisplay);
var EventObject = new Object;
EventObject.event = tmpevent.event;
EventObject.displayDate = tmpevent.displayDate;
EventObject.displayEndDate = tmpevent.displayEndDate;
eventDisplays[ eventDisplays.length ] = EventObject;
}
eventDisplays.sort( this.orderEventsByDisplayDate );
return eventDisplays;
}
/** PUBLIC
*
* CalendarEventDataSource/getEventsForWeek.
*
* PARAMETERS
* date - Date object, uses the month and year and date to get all events
* for the given day.
* RETURN
* array - of events for the day
*/
CalendarEventDataSource.prototype.getEventsForWeek = function calEvent_getEventsForWeek( date )
{
var eventDisplays = new Array();
var eventList = this.gICalLib.getEventsForWeek( date );
while( eventList.hasMoreElements() )
{
var tmpevent = eventList.getNext().QueryInterface(Components.interfaces.oeIICalEventDisplay);
var EventObject = new Object;
EventObject.event = tmpevent.event;
EventObject.displayDate = tmpevent.displayDate;
EventObject.displayEndDate = tmpevent.displayEndDate;
eventDisplays[ eventDisplays.length ] = EventObject;
}
eventDisplays.sort( this.orderEventsByDisplayDate );
return eventDisplays;
}
/** PUBLIC
*
* CalendarEventDataSource/getEventsForMonth.
*
* PARAMETERS
* date - Date object, uses the month and year to get all events
* for the given month.
* RETURN
* array - of events for the month
*/
CalendarEventDataSource.prototype.getEventsForMonth = function calEvent_getEventsForMonth( date )
{
var eventDisplays = new Array();
var eventList = this.gICalLib.getEventsForMonth( date );
while( eventList.hasMoreElements() )
{
eventDisplays[ eventDisplays.length ] = eventList.getNext().QueryInterface(Components.interfaces.oeIICalEventDisplay);
}
eventDisplays.sort( this.orderEventsByDisplayDate );
return eventDisplays;
}
/** PRIVATE
*
* CalendarEventDataSource/getEventsDisplayForRange.
*
* PARAMETERS
* startdate - Date object, startdate
* enddate - Date object, enddate
* .
* RETURN
* array - of events for the month
*/
CalendarEventDataSource.prototype.getEventsDisplayForRange = function calEvent_getEventsDisplayForRange( startdate,enddate )
{
var eventDisplays = new Array();
var eventList = this.gICalLib.getEventsForRange( startdate, enddate);
while( eventList.hasMoreElements() )
{
eventDisplays[ eventDisplays.length ] = eventList.getNext().QueryInterface(Components.interfaces.oeIICalEventDisplay);
}
eventDisplays.sort( this.orderEventsByDisplayDate );
return eventDisplays;
}
/** PUBLIC
*
* CalendarEventDataSource/getNextEvents.
*
* PARAMETERS
* EventsToGet - The number of events to return
*
* RETURN
* array - of the next "EventsToGet" events
*/
CalendarEventDataSource.prototype.getNextEvents = function calEvent_getNextEvents( EventsToGet )
{
var eventDisplays = new Array();
var today = new Date();
var eventList = this.gICalLib.getNextNEvents( today, EventsToGet );
while( eventList.hasMoreElements() )
{
eventDisplays[ eventDisplays.length ] = eventList.getNext().QueryInterface(Components.interfaces.oeIICalEventDisplay);;
}
eventDisplays.sort( this.orderRawEventsByDate );
return eventDisplays;
}
/** PUBLIC
*
* CalendarEventDataSource/getAllEvents.
*
* RETURN
* array - of ALL events
*/
CalendarEventDataSource.prototype.getAllEvents = function calEvent_getAllEvents( )
{
// clone the array in case the caller messes with it
var eventList = this.gICalLib.getAllEvents();
this.currentEvents = new Array();
while( eventList.hasMoreElements() )
{
var tmpevent = eventList.getNext().QueryInterface(Components.interfaces.oeIICalEvent);
this.currentEvents.push( tmpevent );
}
this.currentEvents.sort( this.orderRawEventsByDate );
return this.currentEvents;
}
CalendarEventDataSource.prototype.getEventsForRange = function calEvent_getEventsForRange( StartDate, EndDate )
{
//dump( "\n->get events from "+StartDate+"\n"+EndDate );
var eventList = this.gICalLib.getFirstEventsForRange( StartDate, EndDate );
this.currentEvents = new Array();
while( eventList.hasMoreElements() )
{
var tmpevent = eventList.getNext().QueryInterface(Components.interfaces.oeIICalEvent);
dump( "\n->event is "+tmpevent );
this.currentEvents.push( tmpevent );
}
this.currentEvents.sort( this.orderRawEventsByDate );
return this.currentEvents;
}
CalendarEventDataSource.prototype.getAllFutureEvents = function calEvent_getAllFutureEvents()
{
var Today = new Date();
//do this to allow all day events to show up all day long
var Start = new Date( Today.getFullYear(), Today.getMonth(), Today.getDate(), 0, 0, 0 );
var Infinity = new Date( Today.getFullYear()+100, 31, 11 );
var eventList = this.gICalLib.getFirstEventsForRange( Start, Infinity );
this.currentEvents = new Array();
while( eventList.hasMoreElements() )
{
var tmpevent = eventList.getNext().QueryInterface(Components.interfaces.oeIICalEvent);
this.currentEvents.push ( tmpevent );
}
this.currentEvents.sort( this.orderRawEventsByDate );
return this.currentEvents;
}
CalendarEventDataSource.prototype.getICalLib = function calEvent_getICalLib()
{
return this.gICalLib;
}
/** PUBLIC
*
* CalendarEventDataSource/makeNewEvent.
*
* RETURN
* new event, not SAVED yet, use addEvent to save it.
*/
CalendarEventDataSource.prototype.makeNewEvent = function calEvent_makeNewEvent( date )
{
var iCalEventComponent = Components.classes["@mozilla.org/icalevent;1"].createInstance();
var iCalEvent = iCalEventComponent.QueryInterface(Components.interfaces.oeIICalEvent);
if( date )
{
iCalEvent.start.setTime( date );
}
return iCalEvent;
}
/* TO DO STUFF */
/* getAllToDos()
* return all todos
*
*
*/
CalendarEventDataSource.prototype.getAllToDos = function calEvent_getAllToDos()
{
var eventList = this.gICalLib.getAllTodos( );
var eventArray = new Array();
while( eventList.hasMoreElements() )
{
var tmpevent = eventList.getNext().QueryInterface(Components.interfaces.oeIICalTodo);
eventArray[ eventArray.length ] = tmpevent;
}
eventArray.sort( this.orderToDosByDueDate );
return eventArray;
}
/* getToDosForRange()
* getToDosForRange
* return the ToDos which due date is in the given date range
* return only the completed ones if the unifindertodo checkbox
* is true
*/
CalendarEventDataSource.prototype.getToDosForRange = function calEvent_getToDosForRange( StartDate, EndDate )
{
var Checked = document.getElementById( "hide-completed-checkbox" ).checked;
gICalLib.resetFilter();
if( Checked === true )
gICalLib.filter.completed.setTime( new Date() );
var eventList = this.gICalLib.getAllTodos( );
var eventArray = new Array();
var EndDatePlusOne = new Date(EndDate.getFullYear(),EndDate.getMonth(),EndDate.getDate()+1) ;
while( eventList.hasMoreElements() )
{
var tmpevent = eventList.getNext().QueryInterface(Components.interfaces.oeIICalTodo);
var dueTime = tmpevent.due.getTime() ;
if( (dueTime >= StartDate.getTime()) && (dueTime < EndDatePlusOne.getTime()) )
{
eventArray[ eventArray.length ] = tmpevent;
}
}
eventArray.sort( this.orderToDosByDueDate );
return eventArray;
}
/** PACKAGE STATIC
* CalendarEvent orderToDosByDueDate.
*
* NOTES
* Used to sort todo table by date
*/
CalendarEventDataSource.prototype.orderToDosByDueDate = function calEvent_orderToDosByDueDate( toDoA, toDoB )
{
if( ( toDoA.due.getTime() - toDoB.due.getTime() ) == 0 )
{
return( toDoA.start.getTime() - toDoB.start.getTime() );
}
return( toDoA.due.getTime() - toDoB.due.getTime() );
}
/** PACKAGE STATIC
* CalendarEvent orderEventsByDisplayDate.
*
* NOTES
* Used to sort events table by date
*/
CalendarEventDataSource.prototype.orderEventsByDisplayDate = function calEvent_orderEventsByDisplayDate( eventA, eventB )
{
var r=eventA.displayDate - eventB.displayDate;
if (r==0) {
var titleA = eventTitleOrEmpty(eventA);
var titleB = eventTitleOrEmpty(eventB);
return ( titleA < titleB ? -1 :
titleA > titleB ? 1 : 0);
}
return(r);
}
function eventTitleOrEmpty(event) {
return ("title" in event && event.title != null) ? event.title : "";
}
/** PACKAGE STATIC
* CalendarEvent orderRawEventsByDate.
*
* NOTES
* Used to sort events table by date
*/
CalendarEventDataSource.prototype.orderRawEventsByDate = function calEvent_orderRawEventsByDate( eventA, eventB )
{
return( getCurrentNextOrPreviousRecurrence( eventA ).getTime() - getCurrentNextOrPreviousRecurrence( eventB ).getTime() );
}
/******************************************************************************************************
******************************************************************************************************
ALARM RELATED CODE
******************************************************************************************************
*******************************************************************************************************/
CalendarEventDataSource.prototype.prepareAlarms = function calEvent_prepareAlarms( )
{
this.alarmObserver = new CalendarAlarmObserver( this );
this.gICalLib.addObserver( this.alarmObserver );
}
function CalendarAlarmObserver( calendarService )
{
this.pendingAlarmList = new Array();
this.addToPending = true;
this.calendarService = calendarService;
}
CalendarAlarmObserver.prototype.firePendingAlarms = function calAlarm_firePendingAlarms( observer )
{
this.addToPending = false;
if( this.pendingAlarmList )
{
for( var i in this.pendingAlarmList )
{
this.fireAlarm( this.pendingAlarmList[ i ] );
}
}
this.pendingAlarmList = null;
}
CalendarAlarmObserver.prototype.onStartBatch = function(){}
CalendarAlarmObserver.prototype.onEndBatch = function(){}
CalendarAlarmObserver.prototype.onLoad = function( calendarEvent ){}
CalendarAlarmObserver.prototype.onAddItem = function( calendarEvent ){}
CalendarAlarmObserver.prototype.onModifyItem = function( calendarEvent, originalEvent ){}
CalendarAlarmObserver.prototype.onDeleteItem = function( calendarEvent ){}
CalendarAlarmObserver.prototype.onError = function(){}
CalendarAlarmObserver.prototype.onAlarm = function calAlarm_onAlarm( calendarEvent )
{
dump( "caEvent.alarmWentOff is "+ calendarEvent + "\n" );
if( this.addToPending )
{
dump( "defering alarm "+ calendarEvent + "\n" );
this.pendingAlarmList.push( calendarEvent );
}
else
{
this.fireAlarm( calendarEvent )
}
}
CalendarAlarmObserver.prototype.fireAlarm = function calAlarm_fireAlarm( calendarEvent )
{
dump( "Fire alarm "+ calendarEvent + "\n" );
if( typeof( gCalendarWindow ) == "undefined" )
{
return;
}
if( getBoolPref(gCalendarWindow.calendarPreferences.calendarPref,
"alarms.playsound",
gCalendarBundle.getString("playAlarmSound") )
)
{
playSound();
}
addEventToDialog( calendarEvent );
if ( calendarEvent.alarmEmailAddress )
{
var EmailBody = gCalendarEmailBundle.getFormattedString("AlarmEmailBody", [calendarEvent.title, calendarEvent.start.toString()]);
var EmailSubject = gCalendarEmailBundle.getFormattedString("AlarmEmailSubject", [calendarEvent.title]);
//send an email for the event
sendEmail( EmailSubject, EmailBody, calendarEvent.alarmEmailAddress, null, null, null, null );
}
}

View File

@ -51,93 +51,3 @@ function openCalendar()
else
calendarWindow = window.open("chrome://calendar/content/calendar.xul", "calendar", "chrome,extrachrome,menubar,resizable,scrollbars,status,toolbar");
}
function getAlarmDialog( Event )
{
var wmediator = Components.classes["@mozilla.org/appshell/window-mediator;1"].getService(Components.interfaces.nsIWindowMediator);
var calendarAlarmWindow = wmediator.getMostRecentWindow( "calendarAlarmWindow" );
//the topWindow is always null, but it loads chrome://calendar/content/calendar.xul into the open window.
if ( calendarAlarmWindow )
return calendarAlarmWindow;
else
{
return false;
}
}
function openCalendarAlarmWindow( Event )
{
var args = new Object();
args.calendarEvent = Event;
// Acknowledging alarms on calendars with auto-publish enabled may bring up
// a username/password dialog, therefore we can't be modal/alwaysraised.
calendarAlarmWindow = window.openDialog("chrome://calendar/content/alertDialog.xul", "caAlarmDialog", "chrome,extrachrome,resizable,scrollbars,status,toolbar", args);
setTimeout( "resetAlarmDialog()", 2000 );
}
function resetAlarmDialog()
{
gAllowWindowOpen = true;
firePendingEvents();
}
function firePendingEvents()
{
for( var i = 0; i < gPendingEvents.length; i++ )
{
addEventToDialog( gPendingEvents[i] );
}
}
function addEventToDialog( Event )
{
var calendarAlarmWindow = getAlarmDialog( Event );
if( calendarAlarmWindow )
{
dump( "\n\n!!!!!!!!!!!calendar alarm window, in iff" );
if( "createAlarmBox" in calendarAlarmWindow )
{
calendarAlarmWindow.onAlarmCall( Event );
}
else
{
if( !("pendingEvents" in calendarAlarmWindow) )
{
calendarAlarmWindow.pendingEvents = new Array();
}
dump( "\n ADDING PENDING EVENT TO DIALOG _______________________" );
calendarAlarmWindow.pendingEvents.push( Event );
}
}
else if( gAllowWindowOpen )
{
gAllowWindowOpen = false;
var categoriesStringBundle = srGetStrBundle("chrome://calendar/locale/calendar.properties");
if( getBoolPref(gCalendarWindow.calendarPreferences.calendarPref, "alarms.show", categoriesStringBundle.GetStringFromName("showAlarms" ) ) )
{
calendarAlarmWindow = openCalendarAlarmWindow( Event );
}
else
{
gPendingEvents.push( Event );
}
}
else
{
gPendingEvents.push( Event );
}
}

View File

@ -1,724 +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 );
var TimeToFormat = new Date();
TimeToFormat.setMinutes( "0" );
//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
*/
TimeToFormat.setHours( i );
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 day
*/
DayView.prototype.refreshEvents = function()
{
// clean up anything that was here before
this.removeElementsByAttribute("eventbox", "dayview");
this.eventList = new Array();
// Figure out the start and end days for the week we're currently viewing
var selectedDateTime = this.calendarWindow.getSelectedDate();
this.displayStartDate = new Date(selectedDateTime.getFullYear(),
selectedDateTime.getMonth(),
selectedDateTime.getDate());
this.displayEndDate = new Date(this.displayStartDate);
this.displayEndDate.setDate(this.displayEndDate.getDate() + 1)
// Save this off so we can get it again in onGetResult below
var eventController = this;
var getListener = {
onOperationComplete: function(aCalendar, aStatus, aOperationType, aId, aDetail) {
eventController.drawEventBoxes();
},
onGetResult: function(aCalendar, aStatus, aItemType, aDetail, aCount, aItems) {
for (var i = 0; i < aCount; ++i) {
eventController.createEventBox(aItems[i],
function(a1, a2, a3) { eventController.addToDisplayList(a1, a2, a3); } );
}
}
};
var ccalendar = getDisplayComposite();
var start = jsDateToDateTime(this.displayStartDate).getInTimezone(calendarDefaultTimezone());
var end = jsDateToDateTime(this.displayEndDate).getInTimezone(calendarDefaultTimezone());
dump("Fetching events from " + start + " to " + end + "\n");
ccalendar.getItems(ccalendar.ITEM_FILTER_TYPE_EVENT | ccalendar.ITEM_FILTER_CLASS_OCCURRENCES,
0, start, end, getListener);
return;
this.kungFooDeathGripOnEventBoxes = new Array();
var dayEventList = gEventSource.getEventsForDay( this.calendarWindow.getSelectedDate() );
var allDayEvents = new Array();
var normalEvents = new Array();
var calendarStringBundle = srGetStrBundle("chrome://calendar/locale/calendar.properties");
// DOM elements
var collapsibleBox = document.getElementById( "all-day-collapsible-box" );
var allDayBox = document.getElementById( "all-day-content-box" );
var allDayLabel = document.getElementById( "all-day-content-title" );
var dayViewContent = document.getElementById( "day-view-content-box" );
//remove all the all day row -boxes from the all day content box.
while( allDayBox.hasChildNodes() )
allDayBox.removeChild( allDayBox.firstChild );
this.removeElementsByAttribute("eventbox", "dayview");
// set view limits for the day
var limits = this.getViewLimits(dayEventList,this.calendarWindow.getSelectedDate());
var i;
for( i = 0; i < 24; i++ ) {
if( ( i < limits.startHour ) || ( i > limits.endHour ) )
document.getElementById( "day-tree-item-"+i ).setAttribute( "collapsed", "true" );
else
document.getElementById( "day-tree-item-"+i ).removeAttribute( "collapsed" );
}
// Divide events into all day and other events
for( i = 0; i < dayEventList.length; i++ ) {
if (dayEventList[i].event.startDate.isDate)
allDayEvents.push(dayEventList[i]);
else
normalEvents.push(dayEventList[i]);
}
// Calculate event draw properties (where events are drawn )
this.setDrawProperties(normalEvents);
this.setAllDayDrawProperties(allDayEvents, this.calendarWindow.getSelectedDate() );
// Sort all day events to correct draw order
allDayEvents.sort(this.compareAllDayEvents);
// add allday events to DOM (if any)
if( allDayEvents.length == 0 ) {
dayViewContent.removeAttribute( "allday" );
collapsibleBox.setAttribute( "collapsed", "true" );
} else {
//resize the day's content box.
dayViewContent.setAttribute( "allday", "true" );
//show the all day box
collapsibleBox.removeAttribute( "collapsed" );
allDayLabel.value = calendarStringBundle.GetStringFromName( "AllDayEvents" );
allDayLabel.setAttribute("width", kDayViewHourLeftStart - 10);
for( i = 0; i < allDayEvents.length; i++ ) {
var allDayEventBox = this.createAllDayEventBox( allDayEvents[i] );
this.insertAllDayEventBox(allDayEventBox, allDayBox);
this.kungFooDeathGripOnEventBoxes.push( allDayEventBox );
}
}
// Add non-allday events to DOM
for ( i = 0; i < normalEvents.length; ++i )
{
var eventBox = this.createEventBox( normalEvents[i] );
document.getElementById( "day-view-content-board" ).appendChild( eventBox );
this.kungFooDeathGripOnEventBoxes.push( eventBox );
}
}
/** PRIVATE
*
* Inserts the eventBox into DOM, possibly creating a new all day row (hbox) as well
* This could probably be done more efficiently. Curently the eventbox
* is inserted in to a hbox. Then if the width of the hbox has changed
* (hbox is wider than the page), the eventbox is removed from the hbox,
* and the next hbox is tried...
*/
DayView.prototype.insertAllDayEventBox = function dayview_insertAllDayEventBox( eventBox, allDayBox ) {
var allDayRow;
var inserted = false;
var lastOnRow;
var rowWidth;
if( !eventBox.calendarEventDisplay.allDayStartsBefore ) {
var rows = allDayBox.childNodes;
for( var row = 0; row < rows.length; row++) {
lastOnRow = rows[row].lastChild;
rowWidth = rows[row].boxObject.width;
if( lastOnRow.calendarEventDisplay.allDayEndsAfter ) {
if( !eventBox.calendarEventDisplay.allDayEndsAfter &&
!lastOnRow.calendarEventDisplay.allDayStartsBefore) {
rows[row].insertBefore(eventBox,rows[row].lastChild);
inserted = true;
}
} else {
rows[row].appendChild(eventBox);
inserted = true;
}
if( inserted ) {
// test if row really had room for this event...
if( rows[row].boxObject.width > rowWidth ) {
// row is too full
rows[row].removeChild(eventBox);
inserted = false;
} else {
break;
}
}
}
}
if( !inserted ) {
// allDayStartsBefore == true or a proper place was not found.
// Must add a row to allDayBox
allDayRow = document.createElement( "hbox" );
allDayRow.appendChild( eventBox );
allDayBox.appendChild( allDayRow );
}
}
/** PRIVATE
*
* Compare function for array.sort(). Events will be sorted into a proper oder
* for day view all-day event drawing.
*/
DayView.prototype.compareAllDayEvents = function dayview_compareAllDayEvents( a, b ) {
if( ( ( a.allDayStartsBefore ) && ( a.allDayEndsAfter ) ) &&
( ( !b.allDayStartsBefore ) || ( !b.allDayEndsAfter ) ) ) {
return -1;
} else if( ( ( b.allDayStartsBefore ) && ( b.allDayEndsAfter ) ) &&
( ( !a.allDayStartsBefore ) || ( !a.allDayEndsAfter ) ) ) {
return 1;
} else {
if( a.allDayStartsBefore ) {
if( !b.allDayStartsBefore )
return -1;
} else {
if( b.allDayStartsBefore )
return 1;
}
var res = a.event.start.getTime() - b.event.start.getTime();
if( res == 0)
res = a.event.end.getTime() - b.event.end.getTime();
return res;
}
}
/** PRIVATE
*
* This creates an all day event box for the day view
*/
DayView.prototype.createAllDayEventBox = function dayview_createAllDayEventBox( calendarEventDisplay ) {
// build up the label and image for the eventbox
var eventText = calendarEventDisplay.event.title;
var locationText = calendarEventDisplay.event.location;
var newLabel = document.createElement( "label" );
newLabel.setAttribute( "class", "day-view-allday-event-title-label-class" );
if( calendarEventDisplay.event.location )
newLabel.setAttribute( "value", eventText+" (" + locationText + ")" );
else
newLabel.setAttribute( "value", eventText );
var newImage = document.createElement("image");
newImage.setAttribute( "class", "all-day-event-class" );
//create the actual event box
var eventBox = document.createElement( "hbox" );
eventBox.calendarEventDisplay = calendarEventDisplay;
eventBox.appendChild( newImage );
eventBox.appendChild( newLabel );
eventBox.setAttribute( "name", "day-view-event-box-" + calendarEventDisplay.event.id );
eventBox.setAttribute("class", "day-view-event-class");
this.setEventboxClass( eventBox, calendarEventDisplay.event, "day-view-all-day");
eventBox.setAttribute( "onclick", "dayEventItemClick( this, event )" );
eventBox.setAttribute( "ondblclick", "dayEventItemDoubleClick( this, event )" );
eventBox.setAttribute( "onmouseover", "gCalendarWindow.changeMouseOverInfo( calendarEventDisplay, event )" );
eventBox.setAttribute( "tooltip", "gridOccurrenceTooltip" );
eventBox.setAttribute( "flex", "1" );
// mark the box as selected, if the event is
if( this.calendarWindow.EventSelection.isSelectedEvent( calendarEventDisplay.event ) )
eventBox.setAttribute( "eventselected", "true" );
if( calendarEventDisplay.allDayStartsBefore )
eventBox.setAttribute("continues-left", "true");
if( calendarEventDisplay.allDayEndsAfter)
eventBox.setAttribute("continues-right", "true");
return eventBox;
}
DayView.prototype.addToDisplayList = function(itemOccurrence, startDate, endDate)
{
//HACK because startDate is convert to the proper TZ, but
//startDate.jsDate is not
var adjustedStartDate = new Date(startDate.year, startDate.month, startDate.day);
var adjustedEndDate = new Date(endDate.year, endDate.month, endDate.day);
// Check if the event is within the bounds of events to be displayed.
if ((adjustedEndDate < this.displayStartDate) ||
(adjustedStartDate >= this.displayEndDate) ||
(adjustedEndDate == this.displayStartDate &&
adjustedStartDate < this.displayStartDate))
return;
this.eventList.push({event:itemOccurrence, start:startDate.clone(), end:endDate.clone()});
}
DayView.prototype.drawEventBoxes = function()
{
var sHour = getIntPref(this.calendarWindow.calendarPreferences.calendarPref, "event.defaultstarthour", 8);
var eHour = getIntPref(this.calendarWindow.calendarPreferences.calendarPref, "event.defaultendhour", 17);
for each (event in this.eventList) {
if (!(event.start.isDate)) {
if(event.end.hour > eHour)
eHour = event.end.hour;
if(event.start.hour < sHour)
sHour = event.start.hour;
}
}
var i;
for (i = 0; i < 24; i++) {
if ((i < sHour) || (i > eHour))
document.getElementById("day-tree-item-"+i).setAttribute("hidden", "true");
else
document.getElementById("day-tree-item-"+i).removeAttribute("hidden");
}
this.setDrawProperties(this.eventList);
var event;
for (event in this.eventList) {
this.createEventBoxInternal(this.eventList[event]);
}
}
/** PRIVATE
*
* This creates an event box for the day view
*/
DayView.prototype.createEventBoxInternal = function(event)
{
var itemOccurrence = event.event;
var startDate = event.start;
var endDate = event.end;
var calEvent = itemOccurrence.QueryInterface(Components.interfaces.calIEvent);
startDate.normalize();
endDate.normalize();
/*
if (calEvent.isAllDay) {
endDate = endDate.clone();
endDate.hour = 23;
endDate.minute = 59;
endDate.normalize();
}
*/
dump("all day: " + calEvent.startDate.isDate + "\n");
dump("startdate: " + startDate + "\n");
dump("enddate: " + endDate + "\n");
var startHour = startDate.hour;
var startMinutes = startDate.minute;
var eventDuration = (endDate.jsDate - startDate.jsDate) / (60 * 60 * 1000);
dump("duration: " + eventDuration + "\n");
var startHourTreeItem = document.getElementById( "day-tree-item-"+startHour );
var hourHeight = startHourTreeItem.boxObject.height;
var hourWidth = startHourTreeItem.boxObject.width;
var eventSlotWidth = Math.round( ( hourWidth - kDayViewHourLeftStart )
/ event.totalSlotCount);
//calculate event dimensions
var eventTop = startHourTreeItem.boxObject.y -
startHourTreeItem.parentNode.boxObject.y +
Math.round( hourHeight * startMinutes/ 60 ) - 1;
var eventLeft = kDayViewHourLeftStart + ( event.startDrawSlot * eventSlotWidth );
var eventHeight = Math.round( eventDuration * hourHeight ) + 1;
var eventWidth = ( event.drawSlotCount * eventSlotWidth ) - 1;
// create title label, location label and description description :)
var eventTitleLabel = document.createElement( "label" );
eventTitleLabel.setAttribute( "class", "day-view-event-title-label-class" );
var eventLocation = calEvent.getProperty("LOCATION");
if (eventLocation)
eventTitleLabel.setAttribute( "value", calEvent.title + " (" + eventLocation + ")" );
else
eventTitleLabel.setAttribute( "value", calEvent.title );
var desc = calEvent.getProperty("DESCRIPTION");
if (!desc)
desc = ""
var eventText = document.createTextNode(desc);
var eventDescription = document.createElement( "description" );
eventDescription.setAttribute( "class", "day-view-event-description-class" );
eventDescription.appendChild( eventText );
//create actual eventbox
var eventBox = document.createElement( "vbox" );
eventBox.occurrence = itemOccurrence;
eventBox.event = calEvent;
eventBox.setAttribute( "name", "day-view-event-box-"+calEvent.id );
// set the event box to be of class day-view-event-class and the appropriate calendar-color class
eventBox.setAttribute("class", "day-view-event-class");
this.setEventboxClass( eventBox, calEvent, "day-view");
if (!startDate.isDate) {
eventBox.setAttribute( "top", eventTop );
eventBox.setAttribute( "left", eventLeft );
eventBox.setAttribute( "height", eventHeight );
eventBox.setAttribute( "width", eventWidth );
}
eventBox.setAttribute( "flex", "1" );
eventBox.setAttribute( "eventbox", "dayview" ); // ?
eventBox.setAttribute( "onclick", "dayEventItemClick( this, event )" );
eventBox.setAttribute( "ondblclick", "dayEventItemDoubleClick( this, event )" );
eventBox.setAttribute( "onmouseover", "onMouseOverGridOccurrence(event)" );
eventBox.setAttribute( "tooltip", "gridOccurrenceTooltip" );
// mark the box as selected, if the event is
if (this.calendarWindow.EventSelection.isSelectedEvent(calEvent))
eventBox.setAttribute( "eventselected", "true" );
eventBox.appendChild( eventTitleLabel );
eventBox.appendChild( eventDescription );
if (!startDate.isDate) {
document.getElementById("day-view-content-board").appendChild(eventBox);
} else {
allDayRow = document.createElement("hbox");
allDayRow.appendChild(eventBox);
document.getElementById("all-day-content-box").appendChild(allDayRow);
}
}
/** 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 weekNumber = DateUtils.getWeekNumber( this.calendarWindow.getSelectedDate() );
var weekViewStringBundle = srGetStrBundle("chrome://calendar/locale/calendar.properties");
var dateString = weekViewStringBundle.GetStringFromName( "Week" )+" "+weekNumber+ ": " + this.calendarWindow.dateFormater.getFormatedDate( this.calendarWindow.getSelectedDate() ) ;
var dayTextItemPrev2 = document.getElementById( "d-2-day-title" );
var dayTextItemPrev1 = document.getElementById( "d-1-day-title" );
var dayTextItem = document.getElementById( "d0-day-title" );
var dayTextItemNext1 = document.getElementById( "d1-day-title" );
var dayTextItemNext2 = document.getElementById( "d2-day-title" );
var daySpecificTextItem = document.getElementById( "d0-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 ( var 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( )
{
daydebug("clearSelectedEvent");
this.removeAttributeFromElements("eventselected", "true");
}
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;
}
function daydebug( Text )
{
dump( "dayView.js: "+ Text +"\n");
}

View File

@ -1,528 +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/dayView.js"/>
<script type="application/x-javascript" src="chrome://global/content/nsDragAndDrop.js"/>
<script type="application/x-javascript" src="chrome://global/content/nsTransferable.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="d-2-day-title" onclick="gCalendarWindow.goToPrevious( 2 )" value="" />
</vbox>
<vbox class="day-title-label-box" flex="1">
<label id="d-1-day-title" onclick="gCalendarWindow.goToPrevious( 1 )" value="" />
</vbox>
<vbox class="day-title-label-box" flex="1">
<label id="d0-day-title" value="" />
</vbox>
<vbox class="day-title-label-box" flex="1">
<label id="d1-day-title" onclick="gCalendarWindow.goToNext( 1 )" value="" />
</vbox>
<vbox class="day-title-label-box" flex="1">
<label id="d2-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="d0-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">
<hbox id="all-day-collapsible-box" ondblclick="dayAllDayDoubleClick( event )">
<label id="all-day-content-title" value="&allDayEvents.label;"/>
<vbox id="all-day-content-box" flex="1">
</vbox>
</hbox>
<!-- This is an overlay being included from above -->
<box id="day-view-content-box" flex="1">
<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,390 +0,0 @@
/* -*- Mode: javascript; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 2 -*-
* ***** 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): James Maidment <james@mouseboks.org.uk>
*
* 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 ) {
var currentTarget = aEvent.currentTarget;
var currentTargetFirstClassName = currentTarget.className.split(" ")[0];
if(currentTargetFirstClassName == "day-view-hour-box-class")
dayViewHourClick( aEvent );
if(currentTargetFirstClassName == "day-view-event-class")
gCalendarWindow.EventSelection.replaceSelection( currentTarget.event );
//dayEventItemClick( aEvent.target, aEvent );
if(currentTargetFirstClassName == "week-view-event-class")
gCalendarWindow.EventSelection.replaceSelection( currentTarget.event );
//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"); // not implemented
flavourSet.appendFlavour("application/x-moz-file", "nsIFile");
return flavourSet;
},
onDragStart: function (aEvent, aXferData, aDragAction){
//Clear any dragged over events left from last drag selection.
var liveList = document.getElementsByAttribute( "draggedover", "true" );
// Delete in reverse order. Moz1.8+ getElementsByAttribute list is
// 'live', so when attribute is deleted the indexes of later elements
// change, but Moz1.7- is not. Reversed order works with both.
for (var i = liveList.length - 1; i >= 0; i--) {
liveList.item(i).removeAttribute( "draggedover" );
}
// select clicked object, Mozilla doesn'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
var eventIsDragged ;
var currentTargetFirstClassName = aEvent.currentTarget.className.split(" ")[0];
switch (currentTargetFirstClassName) {
case "day-view-event-class" :
eventIsDragged = true ;
this.startDragDayIndex = 0 ;
break;
case "week-view-event-class" :
eventIsDragged = true ;
this.startDragDayIndex = aEvent.currentTarget.getAttribute( "dayindex" );
break;
default :
eventIsDragged = false ;
}
if(eventIsDragged == true) {
// 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() );
// The date the drap action initiated on.
var gStartDate;
this.startDateIndex = aEvent.target.getAttribute( "day" );
// In the week view, the drag can start on a date different from the currently
// selected one. However, in the day view, the event target does not have a 'day'
// attribute.
if( gCalendarWindow.currentView == gCalendarWindow.weekView ) {
//Week view.
gStartDate = new Date ( gHeaderDateItemArray[this.startDateIndex].getAttribute( "date" ));
} else {
//Day view.
gStartDate = new Date ( gCalendarWindow.getSelectedDate() );
}
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"); // not implemented
//trans.addDataFlavor("text/x-moz-url"); // not implemented
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
var icalStr = dataObj.data.substring(0, len.value);
var beginEventIndex = icalStr.indexOf("BEGIN:VEVENT");
var endEventIndex = icalStr.indexOf("END:VEVENT") + 10;
var eventData = icalStr.substring(beginEventIndex, endEventIndex);
// set the event based on parsing ical data
dropEvent.icalString = 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.startDate.jsDate );
if(aEvent.target.getAttribute( "hour" ))
gDropzoneStartTime.setHours( aEvent.target.getAttribute( "hour" ) );
else
gDropzoneStartTime.setHours( aEvent.target.parentNode.event.startDate.hour );
if(aEvent.target.getAttribute( "day" )) {
//We are is the week view, so we check the drop day
var theNewDate = gDropzoneStartTime.getDate() - this.startDragDayIndex + parseInt(aEvent.target.getAttribute( "day" ));
gDropzoneStartTime.setDate(theNewDate);
}
var eventDuration = dropEvent.duration;
if(aDragSession.dragAction == nsIDragService.DRAGDROP_ACTION_MOVE) {
var calendarEvent = null;
var operationListener = {
onOperationComplete: function(calendar, status, type, id, detail) {
var newStartDate = jsDateToDateTime(gDropzoneStartTime);
if (calendarEvent) {
// if we got a calendar event from onGetResult, then clone it and modify its
// time directly and then call modify on it
var newEvent = calendarEvent.clone().QueryInterface(Components.interfaces.calIEvent);
newEvent.startDate = newStartDate;
newEvent.endDate = newStartDate.clone();
newEvent.endDate.addDuration(eventDuration);
doTransaction('modify', newEvent, newEvent.calendar, calendarEvent, null);
} else {
// if we didn't get a calendar event, then we want to open the edit dialog with
// the new event
dropEvent.id = newEventId;
// XXX TODO Check if stamp/DTSTAMP is correclty set to current time
dropEvent.startDate = newStartDate;
dropEvent.endDate = newStartDate.clone();
dropEvent.endDate.addDuration(eventDuration);
editNewEvent( dropEvent );
}
},
onGetResult: function(calendar, status, type, detail, count, items) {
if (count == 1) {
calendarEvent = items[0].QueryInterface(calIEvent);
}
}
}
getDisplayComposite().getItem(dropEvent.id, operationListener);
} else {
dump("failed\n");
}
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 = parseIcalEvents( aDataStream );
// LINAGORA (- TODO Move to calendarImportExport to have the option to turn off dialogs)
addEventsToCalendar( calendarEventArray, 1 );
} catch(ex) {
alert(ex.message);
}
break;
}
// cleanup
var liveList = document.getElementsByAttribute( "draggedover", "true" );
// Delete in reverse order. Moz1.8+ getElementsByAttribute list is
// 'live', so when attribute is deleted the indexes of later elements
// change, but Moz1.7- is not. Reversed order works with both.
for (var i = liveList.length - 1; i >= 0; i--) {
liveList.item(i).removeAttribute( "draggedover" );
}
},
onDragExit: function (aEvent, aDragSession)
{
// nothing, doesn't fire for cancel? needed for interval-drag cleanup
}
};

File diff suppressed because it is too large Load Diff

View File

@ -1,899 +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>
- Mostafa Hosseini <mostafah@oeone.com>
- Matthew Willis <mattwillis@gmail.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"?>
<!-- CSS File with all styles specific to the dialog -->
<?xml-stylesheet href="chrome://calendar/skin/eventDialog.css" ?>
<?xml-stylesheet href="chrome://calendar/content/datetimepickers/datetimepickers.css" ?>
<!-- CSS for selecting contacts to invite to event -->
<?xml-stylesheet href="chrome://calendar/skin/selectAddresses.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/selectAddresses.dtd" > %dtd3;
]>
<dialog id="calendar-new-component-window"
title="Calendar Component"
onload="loadCalendarEventDialog()"
buttons="accept,cancel"
ondialogaccept="return onOKCommand();"
ondialogcancel="return true;"
persist="screenX screenY"
minwidth="500" minheight="500"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
xmlns:nc="http://home.netscape.com/NC-rdf#">
<stringbundleset id="stringbundleset">
<stringbundle id="bundle_calendar" src="chrome://calendar/locale/calendar.properties"/>
</stringbundleset>
<script type="application/x-javascript">
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/calendarUtils.js"/>
<script type="application/x-javascript" src="chrome://calendar/content/dateUtils.js"/>
<script type="application/x-javascript" src="chrome://calendar/content/eventDialog.js"/>
<script type="application/x-javascript" src="chrome://calendar/content/selectAddressesDialog.js"/>
<script type="application/x-javascript" src="chrome://calendar/content/attachFile.js"/>
<!-- NEEDED FOR APPLICATION SUPPORT -->
<script type="application/x-javascript" src="chrome://calendar/content/applicationUtil.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="data-todo-title-new" value="&todo.title.new;" />
<data id="data-todo-title-edit" value="&todo.title.edit;" />
<data id="onthe-text" value="&onthe-text;" />
<data id="last-text" value="&last-text;" />
<data id="ofthemonth-text" value="&ofthemonth-text;" />
</dataset>
<!-- Dialog content -->
<label id="read-only-item" value="&newevent.readonly.item.warning;"
class="warning-text-class" hidden="true"/>
<tabbox>
<tabs>
<tab label="&newevent.general.tab.label;"/>
<tab label="&newevent.recurrence.tab.label;"/>
<tab label="&newevent.attendees.tab.label;"/>
<tab label="&newevent.attachments.tab.label;"/>
<tab label="&newevent.advanced.tab.label;"/>
</tabs>
<tabpanels>
<tabpanel>
<vbox flex="1">
<hbox flex="1">
<groupbox flex="1">
<caption label="&newevent.settings.label;"/>
<grid>
<columns>
<column />
<column flex="1"/>
</columns>
<rows>
<!-- Title -->
<row align="center">
<hbox pack="end">
<label for="title-field" value="&newevent.title.label;"/>
</hbox>
<textbox id="title-field"/>
</row>
<!-- Location -->
<row align="center">
<hbox pack="end">
<label for="location-field" value="&newevent.location.label;"/>
</hbox>
<textbox id="location-field"/>
</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"
multiline="true"
rows="1"
cols="65"
flex="1" />
</row>
<row align="center">
<!-- Categories -->
<hbox pack="end">
<label for="categories-menulist-menupopup"
value="&newtodo.categories.label;"/>
</hbox>
<hbox>
<menulist id="categories-field">
<menupopup id="categories-menulist-menupopup">
<menuitem label="&priority.level.none;" value="0"/>
</menupopup>
</menulist>
<spacer width="10px"/>
<!-- Server -->
<hbox align="center" flex="1">
<label id="server-field-label" value="&newevent.server.label;"/>
<menulist id="server-field" oncommand="updateOKButton()"/>
<label id="read-only-cal"
value="&newevent.readonly.cal.warning;"
class="warning-text-class" hidden="true"/>
</hbox>
</hbox>
</row>
<row align="center" flex="1">
<!-- Privacy -->
<hbox class="field-label-box-class" pack="end">
<label for="privacy-menulist" value="&newevent.privacy.label;"/>
</hbox>
<hbox flex="1">
<menulist id="privacy-menulist" crop="none">
<menupopup>
<menuitem label="&newevent.public.label;"
value="PUBLIC"/>
<menuitem label="&newevent.private.label;"
value="PRIVATE"/>
<menuitem label="&newevent.confidential.label;"
value="CONFIDENTIAL"/>
</menupopup>
</menulist>
<spacer width="10px"/>
<!-- Priority -->
<hbox align="center" flex="1">
<label id="priority-label"
for="priority-levels"
value="&newtodo.priority.label;"/>
<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>
<spacer flex="1"/>
</hbox>
</row>
</rows>
</grid>
<hbox>
<separator class="thin"/>
</hbox>
</groupbox>
</hbox>
<hbox flex="1">
<!-- Schedule -->
<groupbox flex="1">
<caption label="&newevent.details.label;"/>
<hbox>
<grid>
<columns>
<column/>
<column/>
</columns>
<rows>
<row>
<hbox pack="end" align="center">
<label for="component-type" value="&newevent.itemType.label;"/>
</hbox>
<hbox flex="1">
<menulist id="component-type" crop="none"
oncommand="processComponentType(this.value)">
<menupopup id="component-menulist-menupopup">
<menuitem label="&newevent.itemType.event.label;"
value="event"/>
<menuitem label="&newevent.itemType.todo.label;"
value="todo"/>
<!--<menuitem label="newevent.itemType.journal.label"
value="journal"
hidden="true"
disabled="true"/>-->
</menupopup>
</menulist>
<spacer flex="1"/>
</hbox>
</row>
<row>
<hbox pack="end" align="center">
<label id="event-start-datetime-label"
class="field-label-box-class"
value="&newevent.from.label;"
hidden-controller="event"
hidden="true"/>
<label id="task-start-datetime-label"
class="field-label-box-class"
value="&newevent.date.label;"
hidden-controller="todo"
hidden="true"/>
</hbox>
<hbox flex="1">
<checkbox id="start-checkbox"
oncommand="onDateTimeCheckbox(this, 'start-datetime')"
hidden-controller="todo"
hidden="true"/>
<datetimepicker id="start-datetime"
value=""
onchange="onStartDateTimePick( this );"/>
<spacer width="10px"/>
<hbox pack="end" align="center">
<checkbox id="all-day-event-checkbox"
label="&newevent.alldayevent.label;"
oncommand="commandAllDay()"
hidden-controller="event"
hidden="true"/>
</hbox>
<spacer flex="1"/>
</hbox>
</row>
<row>
<hbox pack="end" align="center">
<label id="event-end-datetime-label"
value="&newevent.to.label;"
hidden-controller="event"
hidden="true"/>
<label id="task-due-datetime-label"
value="&newtodo.duedate.label;"
hidden-controller="todo"
hidden="true"/>
</hbox>
<hbox flex="1">
<checkbox id="due-checkbox"
oncommand="onDateTimeCheckbox(this, 'due-datetime')"
hidden-controller="todo"
hidden="true"/>
<datetimepicker id="due-datetime"
value=""
onchange="onDueDateTimePick( this );"
hidden-controller="todo"
hidden="true"/>
<datetimepicker id="end-datetime"
value=""
onchange="onEndDateTimePick( this );"
hidden-controller="event"
hidden="true"/>
<spacer flex="1"/>
</hbox>
</row>
<!-- Invalid end date/time warnings -->
<row align="center">
<spacer />
<label id="end-time-warning" class="warning-text-class"
value="&newevent.endtime.warning;" hidden="true"/>
</row>
<row align="center">
<spacer />
<label id="end-date-warning" class="warning-text-class"
value="&newevent.enddate.warning;" hidden="true"/>
</row>
<!-- Invalid due date/time warnings -->
<row align="center">
<spacer />
<label id="due-time-warning" class="warning-text-class"
value="&newtodo.duetime.warning;" hidden="true"/>
</row>
<row align="center">
<spacer />
<label id="due-date-warning" class="warning-text-class"
value="&newtodo.duedate.warning;" hidden="true"/>
</row>
<!-- Status -->
<row>
<hbox pack="end" align="center">
<label id="event-status-label"
for="event-status-menulist-menupopup"
value="&newevent.status.label;"/>
</hbox>
<hbox flex="1" align="center">
<menulist id="event-status-field"
hidden-controller="event"
hidden="true">
<menupopup id="event-status-menulist-menupopup">
<menuitem label="&priority.level.none;"
value="NONE"/>
<menuitem label="&newevent.status.tentative.label;"
value="TENTATIVE"/>
<menuitem label="&newevent.status.confirmed.label;"
value="CONFIRMED"/>
<menuitem label="&newevent.status.cancelled.label;"
value="CANCELLED"/>
</menupopup>
</menulist>
<menulist id="todo-status-field"
oncommand="processToDoStatus(this.value)"
hidden-controller="todo"
hidden="true">
<menupopup id="todo-status-menulist-menupopup">
<menuitem label="&priority.level.none;"
value="NONE"/>
<menuitem label="&newevent.status.needsaction.label;"
value="NEEDS-ACTION"/>
<menuitem label="&newevent.status.inprogress.label;"
value="IN-PROCESS"/>
<menuitem label="&newevent.status.completed.label;"
value="COMPLETED"/>
<menuitem label="&newevent.status.cancelled.label;"
value="CANCELLED"/>
</menupopup>
</menulist>
<spacer/>
<datepicker id="completed-date-picker"
value=""
disabled="true"
hidden-controller="todo"
hidden="true"/>
<spacer/>
<menulist id="percent-complete-menulist"
editable="true"
hidden-controller="todo"
hidden="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-label"
for="percent-complete-menulist"
value="&newtodo.percentcomplete.label;"
hidden-controller="todo"
hidden="true"/>
<spacer flex="1"/>
</hbox>
</row>
<!-- Alarm -->
<!-- XXX Should support alarm firing on absolute date/time - rfc2245 does -->
<row>
<hbox pack="end" align="center">
<label id="alarm-label"
for="alarm-type"
value="&newevent.alarm.label;"/>
</hbox>
<hbox flex="1" align="center">
<menulist id="alarm-type" crop="none" oncommand="processAlarmType()">
<menupopup>
<menuitem label="&priority.level.none;" value="none"/>
<menuitem label="&newevent.popup.label;" value="popup"/>
<menuitem label="&newevent.popupsound.label;" value="popupAndSound"
hidden="true" disabled="true"/>
<menuitem label="&newevent.sendmail.label;" value="email"/>
</menupopup>
</menulist>
<textbox id="alarm-length-field" size="5" maxlength="3"
oninput="alarmLengthKeyDown( this )"/>
<menulist id="alarm-length-units"
crop="none"
labelnumber="label2">
<menupopup>
<menuitem label="&alarm.units.minutes;"
label1="&alarm.units.minutes.singular;"
label2="&alarm.units.minutes;"
value="minutes"/>
<menuitem label="&alarm.units.hours;"
label1="&alarm.units.hours.singular;"
label2="&alarm.units.hours;"
value="hours"/>
<menuitem label="&alarm.units.days;"
label1="&alarm.units.days.singular;"
label2="&alarm.units.days;"
value="days"/>
</menupopup>
</menulist>
<label id="before-this-event-label"
value="&newevent.beforealarm.label;"
hidden-controller="event"
hidden="true"/>
<label id="before-this-todo-label"
value="&newtodo.beforealarm.label;"
hidden-controller="todo"
hidden="true"/>
<!-- Here we're reusing the plural/singular code to
switch the text for events vs. todos.
Event text is plural (2), Todo is singular (1). -->
<textbox id="alarm-trigger-text-kludge"
maxlength="1" value="2" hidden="true"/>
<menulist id="alarm-trigger-relation"
crop="none"
labelnumber="label2">
<menupopup>
<menuitem label="&newevent.begin.label;"
label1="&newevent.begin.label;"
label2="&newevent.begin.label;"
value="START"/>
<menuitem label="&newevent.end.label;"
label1="&newevent.isdue.label;"
label2="&newevent.end.label;"
value="END"/>
</menupopup>
</menulist>
</hbox>
</row>
<row>
<hbox pack="end" align="center">
<spacer />
</hbox>
<hbox flex="1" align="center">
<label id="alarm-email-field-label"
class="field-label-box-class"
for="alarm-email-field"
value="&newevent.sendmail.label;"/>
<!-- XXX oncommand="commandAlarmEmail()" -->
<textbox id="alarm-email-field"
#ifndef MOZ_SUNBIRD
type="autocomplete"
searchSessions="addrbook"
#endif
size="40"
value=""
hidden="false"/>
<textbox id="alarm-trigger-relation" hidden="true"/>
</hbox>
</row>
</rows>
</grid>
</hbox>
<hbox>
<separator class="thin"/>
</hbox>
</groupbox>
</hbox>
<hbox flex="10"/> <!-- Creates white space at bottom of dialog -->
</vbox>
</tabpanel>
<!-- Repeat -->
<tabpanel>
<vbox flex="1">
<hbox flex="1">
<groupbox flex="1">
<caption label="&newevent.recurrence.tab.label;"/>
<hbox id="repeat-box" align="center">
<checkbox id="repeat-checkbox"
class="proper-align"
label="&newevent.repeat.label;"
checked="false"
oncommand="commandRepeat();commandUntil()"/>
<textbox id="repeat-length-field"
class="cursor-pointer"
disable-controller="repeat"
value="1"
oninput="repeatLengthKeyDown( this ); commandUntil()"/>
<menulist crop="none"
oncommand="repeatUnitCommand( this )"
labelnumber="label2"
id="repeat-length-units"
disable-controller="repeat">
<menupopup>
<menuitem label="&repeat.units.days;"
label1="&repeat.units.days.singular;"
label2="&repeat.units.days;"
id="repeat-length-days"
value="DAILY" />
<menuitem label="&repeat.units.weeks;"
label1="&repeat.units.weeks.singular;"
label2="&repeat.units.weeks;"
id="repeat-length-weeks"
value="WEEKLY"/>
<menuitem label="&repeat.units.months;"
label1="&repeat.units.months.singular;"
label2="&repeat.units.months;"
id="repeat-length-months"
value="MONTHLY"/>
<menuitem label="&repeat.units.years;"
label1="&repeat.units.years.singular;"
label2="&repeat.units.years;"
id="repeat-length-years"
value="YEARLY" />
</menupopup>
</menulist>
</hbox>
<hbox id="repeat-extensions-week"
disabled="true"
disable-controller="repeat"
align="center">
<checkbox disable-controller="repeat"
class="repeat-day-class"
label="&day.1.Ddd;"
id="advanced-repeat-week-0"
value="0"
checked="false" />
<checkbox disable-controller="repeat"
class="repeat-day-class"
label="&day.2.Ddd;"
id="advanced-repeat-week-1"
value="1"
checked="false" />
<checkbox disable-controller="repeat"
class="repeat-day-class"
label="&day.3.Ddd;"
id="advanced-repeat-week-2"
value="2"
checked="false" />
<checkbox disable-controller="repeat"
class="repeat-day-class"
label="&day.4.Ddd;"
id="advanced-repeat-week-3"
value="3"
checked="false" />
<checkbox disable-controller="repeat"
class="repeat-day-class"
label="&day.5.Ddd;"
id="advanced-repeat-week-4"
value="4"
checked="false" />
<checkbox disable-controller="repeat"
class="repeat-day-class"
label="&day.6.Ddd;"
id="advanced-repeat-week-5"
value="5"
checked="false" />
<checkbox disable-controller="repeat"
class="repeat-day-class"
label="&day.7.Ddd;"
id="advanced-repeat-week-6"
value="6"
checked="false" />
</hbox>
<hbox id="repeat-extensions-month"
disabled="true"
hidden="true"
align="center">
<vbox align="center">
<radiogroup id="advanced-repeat-month"
disable-controller="repeat">
<radio disable-controller="repeat"
id="advanced-repeat-dayofmonth"
label="&newevent.advanced.repeat.dayofmonth.label;"
selected="true"
class="indent"/>
<radio disable-controller="repeat"
id="advanced-repeat-dayofweek"
label="&newevent.advanced.repeat.dayofweek.label;"
class="indent"/>
<radio disable-controller="repeat"
id="advanced-repeat-dayofweek-last"
label="&newevent.advanced.repeat.lastdayofweek.label;"
class="indent"
disabled="true"/>
</radiogroup>
</vbox>
</hbox>
<label id="repeat-interval-warning"
class="warning-text-class"
value="&newevent.recurinterval.warning;"
hidden="true"/>
<spacer height="10" />
<hbox align="center">
<spacer class="repeat-left-spacer" />
<radiogroup id="repeat-until-group"
disable-controller="repeat">
<hbox class="indent">
<radio id="repeat-forever-radio"
disable-controller="repeat"
label="&newevent.forever.label;"
oncommand="commandUntil()"
selected="true"/>
</hbox>
<hbox class="indent">
<radio id="repeat-numberoftimes-radio"
disable-controller="repeat"
label="&newevent.numberoftimes.label;"
oncommand="commandUntil()"/>
<textbox id="repeat-numberoftimes-textbox"
disable-controller="repeat"
value="1"
oninput="commandUntil()"/>
</hbox>
<label id="repeat-numberoftimes-warning"
class="warning-text-class"
value="&newevent.recurnumberoftimes.warning;"
hidden="true"/>
<hbox class="indent">
<radio id="repeat-until-radio"
disable-controller="repeat"
label="&newevent.until.label;"
oncommand="commandUntil()"/>
<spacer id="until-spacer"/>
<datepicker id="repeat-end-date-picker"
disable-controller="repeat"
value=""
onchange="commandUntil()"/>
</hbox>
<label id="repeat-time-warning"
class="warning-text-class"
value="&newevent.recurend.warning;"
hidden="true"/>
</radiogroup>
</hbox>
<hbox>
<separator class="thin"/>
</hbox>
</groupbox>
</hbox>
<hbox flex="1">
<spacer class="repeat-left-spacer" />
<groupbox flex="1">
<caption label="&newevent.exceptions.caption;"/>
<hbox align="start" flex="1">
<vbox flex="1" align="start" pack="start">
<datepicker id="exceptions-date-picker"
disable-controller="repeat"
onchange="updateAddExceptionButton();"
value=""/>
<spacer flex="1"/>
</vbox>
<vbox flex="1" align="start" pack="start">
<listbox id="exception-dates-listbox"
disable-controller="repeat"
flex="1"/> <!--rows="4"-->
</vbox>
<vbox flex="1" align="center" pack="center">
<button id="exception-add-button"
label="&newevent.addexceptions.label;"
disable-controller="repeat"
oncommand="addException()"/>
<button id="delete-exception-button"
label="&newevent.deleteexceptions.label;"
disabled="true"
oncommand="removeSelectedExceptionDate()"/>
<spacer flex="1"/>
</vbox>
</hbox>
<hbox>
<separator class="thin"/>
</hbox>
</groupbox>
</hbox>
</vbox>
</tabpanel><!-- /Repeat -->
<!-- "Contacts" tab -->
<tabpanel orient="vertical">
<!-- Invite -->
<vbox collapsed="false">
<hbox id="invite-box" align="center">
<checkbox id="invite-checkbox"
label="&newevent.invite.label;"
checked="false"
oncommand="processInviteCheckbox()"/>
<textbox id="invite-email-field"
size="39"
oninput="processTextboxWithButton( this.id, 'invite-email-button' );"
disabled="true"/>
<button id="invite-email-button"
label="&newevent.add.contact.label;"
onclick="onInviteeAdd();"
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"
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"
hidecolumnpicker="true"
onclick="selectEventRecipient(this);">
<treecols>
<treecol id="addressCol"
flex="1"
hideheader="true"/>
</treecols>
<treechildren id="bucketBody" flex="1"/>
</tree>
</vbox>
</hbox>
</vbox>
</tabpanel>
<!-- "Attachments" tab -->
<tabpanel>
<groupbox flex="1">
<listbox id="attachmentBucket" flex="1" rows="12"
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);"/>
<hbox pack="end">
<spacer flex="1"/>
<button id="attachment-delete-button"
onclick="removeSelectedAttachment()"
label="&newevent.removeselectedfile.label;"/>
<button id="attachment-add-button"
onclick="AttachFile()"
label="&newevent.attach.file.label;"/>
</hbox>
</groupbox>
</tabpanel>
<!-- "Advanced" tab -->
<tabpanel>
<vbox flex="1">
<hbox flex="1">
<groupbox flex="1">
<grid>
<columns>
<column/>
<column flex="1"/>
</columns>
<rows>
<!-- URI/URL -->
<row align="center" flex="1">
<hbox class="field-label-box-class" pack="end">
<label for="uri-field" value="&newevent.uri.label;"/>
</hbox>
<hbox>
<textbox id="uri-field"
oninput="processTextboxWithButton( this.id, 'load-url-button' );"
#ifndef MOZ_SUNBIRD
type="autocomplete"
searchSessions="history"
#endif
flex="1"/>
<button id="load-url-button"
label="&newevent.uri.visit.label;"
oncommand="loadURL()"
disabled="true"/>
</hbox>
</row>
</rows>
</grid>
</groupbox>
</hbox>
</vbox>
</tabpanel>
</tabpanels>
</tabbox>
</dialog>

File diff suppressed because it is too large Load Diff

View File

@ -1,230 +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>
* Eric Belhaire <eric.belhaire@ief.u-psud.fr>
*
* 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/localCalDialog.js
* AUTHOR
* Mike Potter
* REQUIRED INCLUDES
*
* NOTES
* Code for creating a new local calendar.
*
* Invoke this dialog to create a new calendar file as follows:
var args = new Object();
args.mode = "new"; // "new", "open", or "edit"
args.onOk = <function>; // funtion to call when OK is clicked
calendar.openDialog("caNewCalendar", "chrome://calendar/content/localCalDialog.xul", true, args );
*
* Invoke this dialog to open an existing local calendar file as follows:
var args = new Object();
args.mode = "open"; // "new", "open", or "edit"
args.onOk = <function>; // funtion to call when OK is clicked
calendar.openDialog("caNewCalendar", "chrome://calendar/content/localCalDialog.xul", true, args );
*
* Invoke this dialog to edit a known calendar file as follows:
*
var args = new Object();
args.mode = "edit"; // "new", "open", or "edit"
args.onOk = <function>; // funtion to call when OK is clicked
* 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 open 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 if( "open" == args.mode )
{
titleDataItem = document.getElementById( "data-event-title-open" );
}
else
{
titleDataItem = document.getElementById( "data-event-title-edit" );
document.getElementById( "server-path-textbox" ).setAttribute( "readonly", "true" );
}
// CofC - calendar coloring change
document.getElementById("calendar-color").color = gCalendarObject.color;
document.getElementById( "calendar-local-serverwindow" ).setAttribute( "title", titleDataItem.getAttribute( "value" ) );
document.getElementById( "server-name-textbox" ).value = gCalendarObject.name;
document.getElementById( "server-path-textbox" ).value = gCalendarObject.path;
document.getElementById( "server-remotepath-textbox" ).value = gCalendarObject.remotePath;
document.getElementById( "server-publish-checkbox" ).setAttribute( "checked", gCalendarObject.publishAutomatically );
// start focus on title
var firstFocus = document.getElementById( "server-name-textbox" );
firstFocus.focus();
sizeToContent();
}
/**
* 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;
gCalendarObject.remotePath = document.getElementById( "server-remotepath-textbox" ).value;
gCalendarObject.publishAutomatically = document.getElementById( "server-publish-checkbox" ).checked;
//Dallas
gCalendarObject.color = document.getElementById( "calendar-color" ).color;
// 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 gCalendarBundle = document.getElementById("bundle_calendar");
var fp = Components.classes["@mozilla.org/filepicker;1"].createInstance(nsIFilePicker);
// caller can force disable of sand box, even if ON globally
// Note: because all changes are saved immediately,
// must save a file name for new calendar files as well.
if (gMode == "new")
fp.init(window, gCalendarBundle.getString( "New" ), nsIFilePicker.modeSave);
else if (gMode == "open")
fp.init(window, gCalendarBundle.getString( "Open" ), nsIFilePicker.modeOpen);
else /* gMode == "edit" */
fp.init(window, gCalendarBundle.getString( "Save" ), nsIFilePicker.modeSave);
var ServerName = document.getElementById( "server-name-textbox" ).value;
if( ServerName == "" )
fp.defaultString = gCalendarBundle.getString( "filepickerDefString" );
else
fp.defaultString = gCalendarBundle.getFormattedString( "filepickerDefServerString", [ServerName] );
fp.defaultExtension = "ics";
const filterCalendar = gCalendarBundle.getString( "filterCalendar" );
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;
if( document.getElementById( "server-name-textbox" ).value == "" )
{
var fullPathRegex = new RegExp(".*[/\\\\:]([^/\\\\:]+)[\.]ics$");
var filename;
if (fullPathRegex.test(fp.file.path))
filename = fp.file.path.replace(fullPathRegex, "$1");
document.getElementById( "server-name-textbox" ).value = filename;
}
}
}

View File

@ -1,185 +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-local-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"
width="500"
xmlns:nc="http://home.netscape.com/NC-rdf#">
<!-- width 600 for long path names; height set by onload sizeToContent() -->
<!-- Javascript includes -->
<script type="application/x-javascript" src="chrome://global/content/strres.js"/>
<script type="application/x-javascript" src="chrome://calendar/content/localCalDialog.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-open" value="&calendar.server.dialog.title.open;" />
<data id="data-event-title-edit" value="&calendar.server.dialog.title.edit;" />
</dataset>
<!-- STRING BUNDLE for calendar properties -->
<stringbundleset id="stringbundleset">
<stringbundle id="bundle_calendar" src="chrome://calendar/locale/calendar.properties"/>
</stringbundleset>
<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>
<!-- Color -->
<row align="center">
<hbox class="field-label-box-class" pack="end">
<description>&calendarproperties.color.label;</description>
</hbox>
<hbox align="center">
<colorpicker id="calendar-color"
class="small-margin"
type="button"
palettename="standard"/>
</hbox>
</row>
<row align="center">
<separator class="groove" orient="horizontal" flex="1"/>
<separator class="groove" orient="horizontal" flex="1"/>
</row>
<!-- Local Calendar File Location -->
<row align="center">
<hbox class="field-label-box-class" pack="end">
<description>&calendar.server.dialog.local.location.label;</description>
</hbox>
<hbox>
<textbox id="server-path-textbox" flex="1" />
</hbox>
</row>
<row align="center">
<hbox class="field-label-box-class" pack="end"/>
<hbox flex="1">
<description flex="1">&calendar.local.calendar.dialog.help.label;</description>
<button oncommand="launchFilePicker()"
label="&calendar.server.dialog.browse.label;"/>
</hbox>
</row>
<row align="center">
<separator class="groove" orient="horizontal" flex="1"/>
<separator class="groove" orient="horizontal" flex="1"/>
</row>
<!-- Remote Calendar File Location -->
<row align="center">
<hbox class="field-label-box-class" pack="end"/>
<hbox flex="1">
<description flex="1">&calendar.local.calendar.dialog.optional.label;</description>
</hbox>
</row>
<row align="center">
<hbox class="field-label-box-class" pack="end">
<description>&calendar.server.dialog.location.label;</description>
</hbox>
<textbox id="server-remotepath-textbox" flex="1" />
</row>
<row align="center">
<separator flex="1"/>
<separator flex="1"/>
</row>
<!-- Auto-Publish Checkbox -->
<row align="center">
<hbox class="field-label-box-class" align="end" pack="end">
<checkbox id="server-publish-checkbox"/>
</hbox>
<description flex="1">&calendar.server.dialog.publish.label;</description>
</row>
</rows>
</grid>
</vbox> <!-- standard-dialog-content -->
</vbox> <!-- dialog-box -->
</dialog>

File diff suppressed because it is too large Load Diff

View File

@ -1,374 +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/monthView.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="m-2-month-title" onclick="gCalendarWindow.goToPrevious( 2 )"/>
</vbox>
<vbox class="month-title-label-box" flex="1">
<label id="m-1-month-title" onclick="gCalendarWindow.goToPrevious( 1 )"/>
</vbox>
<vbox class="month-title-label-box" flex="1">
<label id="m0-month-title" />
</vbox>
<vbox class="month-title-label-box" flex="1">
<label id="m1-month-title" onclick="gCalendarWindow.goToNext( 1 )"/>
</vbox>
<vbox class="month-title-label-box" flex="1">
<label id="m2-month-title" onclick="gCalendarWindow.goToNext( 2 )"/>
</vbox>
</hbox>
<!-- Eric modification : the year is now included in the 0-month-title by the JS file
<hbox id="year-title-box" flex="1">
<vbox class="month-title-label-box" flex="1">
<label id="m0-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 id="month-view-leftcol" class="month-leftcol-class"/>
<column id="month-view-column-1" class="month-column-class" flex="1"/>
<column id="month-view-column-2" class="month-column-class" flex="1"/>
<column id="month-view-column-3" class="month-column-class" flex="1"/>
<column id="month-view-column-4" class="month-column-class" flex="1"/>
<column id="month-view-column-5" class="month-column-class" flex="1"/>
<column id="month-view-column-6" class="month-column-class" flex="1"/>
<column id="month-view-column-7" class="month-column-class" flex="1"/>
</columns>
<rows >
<row id="month-week-header-row" flex="1">
<vbox>
</vbox>
<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 id="month-week-1-row" flex="1" >
<vbox class="month-leftcol-box-class" flex="1" id="month-week-1-left-box">
<label class="week-short-text" value="&week.short;"/>
<label class="month-leftcol-number-class" id="month-week-1-left"/>
</vbox>
<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-leftcol-box-class" flex="1" id="month-week-2-left-box">
<label class="week-short-text" value="&week.short;" />
<label class="month-leftcol-number-class" id="month-week-2-left"/>
</vbox>
<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-leftcol-box-class" flex="1" id="month-week-3-left-box">
<label class="week-short-text" value="&week.short;" />
<label class="month-leftcol-number-class" id="month-week-3-left"/>
</vbox>
<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-leftcol-box-class" flex="1" id="month-week-4-left-box">
<label class="week-short-text" value="&week.short;" />
<label class="month-leftcol-number-class" id="month-week-4-left"/>
</vbox>
<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 id="month-week-5-row" flex="1" >
<vbox class="month-leftcol-box-class" flex="1" id="month-week-5-left-box">
<label class="week-short-text" value="&week.short;" />
<label class="month-leftcol-number-class" id="month-week-5-left"/>
</vbox>
<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 id="month-week-6-row" flex="1">
<vbox class="month-leftcol-box-class" flex="1" id="month-week-6-left-box">
<label class="week-short-text" value="&week.short;" />
<label class="month-leftcol-number-class" id="month-week-6-left"/>
</vbox>
<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>

File diff suppressed because it is too large Load Diff

View File

@ -1,358 +0,0 @@
<?xml version="1.0"?><!-- -*- sgml -*- -->
<!-- ***** 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>
- Eric Belhaire <belhaire@ief.u-psud.fr>
-
- 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/multiweekView.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="multiweek-view-box" flex="1">
<hbox id="multiweek-content-box">
<box id="multiweek-grid-box" flex="1">
<grid id="multiweek-grid" flex="1">
<columns>
<column id="multiweek-view-leftcol" class="multiweek-leftcol-class"/>
<column id="multiweek-view-column-1" class="month-column-class" flex="1"/>
<column id="multiweek-view-column-2" class="month-column-class" flex="1"/>
<column id="multiweek-view-column-3" class="month-column-class" flex="1"/>
<column id="multiweek-view-column-4" class="month-column-class" flex="1"/>
<column id="multiweek-view-column-5" class="month-column-class" flex="1"/>
<column id="multiweek-view-column-6" class="month-column-class" flex="1"/>
<column id="multiweek-view-column-7" class="month-column-class" flex="1"/>
</columns>
<rows >
<row id="multiweek-week-header-row">
<vbox class="multiweek-header-left-class">
<label id="multiweek-title" />
</vbox>
<vbox class="multiweek-header-class">
<label class="month-view-header-days" id="multiweek-view-header-day-1"/>
</vbox>
<vbox class="multiweek-header-class">
<label class="month-view-header-days" id="multiweek-view-header-day-2"/>
</vbox>
<vbox class="multiweek-header-class">
<label class="month-view-header-days" id="multiweek-view-header-day-3"/>
</vbox>
<vbox class="multiweek-header-class">
<label class="month-view-header-days" id="multiweek-view-header-day-4"/>
</vbox>
<vbox class="multiweek-header-class">
<label class="month-view-header-days" id="multiweek-view-header-day-5"/>
</vbox>
<vbox class="multiweek-header-class">
<label class="month-view-header-days" id="multiweek-view-header-day-6"/>
</vbox>
<vbox class="multiweek-header-class">
<label class="month-view-header-days" id="multiweek-view-header-day-7"/>
</vbox>
</row>
<row id="multiweek-week-1-row" flex="1" >
<vbox flex="1" class="multiweek-leftcol-box-class" id="multiweek-week-1-left-box">
<vbox class="multiweek-leftcol-box-class">
<label class="week-short-text" value="&week.short;"/>
<label class="month-leftcol-number-class" id="multiweek-week-1-left"/>
</vbox>
</vbox>
<vbox class="month-day-box-class" flex="1" id="multiweek-week-1-day-1-box">
<label class="month-day-number-class" id="multiweek-week-1-day-1"/>
</vbox>
<vbox class="month-day-box-class" flex="1" id="multiweek-week-1-day-2-box">
<label class="month-day-number-class" id="multiweek-week-1-day-2"/>
</vbox>
<vbox class="month-day-box-class" flex="1" id="multiweek-week-1-day-3-box">
<label class="month-day-number-class" id="multiweek-week-1-day-3"/>
</vbox>
<vbox class="month-day-box-class" flex="1" id="multiweek-week-1-day-4-box">
<label class="month-day-number-class" id="multiweek-week-1-day-4"/>
</vbox>
<vbox class="month-day-box-class" flex="1" id="multiweek-week-1-day-5-box">
<label class="month-day-number-class" id="multiweek-week-1-day-5"/>
</vbox>
<vbox class="month-day-box-class" flex="1" id="multiweek-week-1-day-6-box">
<label class="month-day-number-class" id="multiweek-week-1-day-6"/>
</vbox>
<vbox class="month-day-box-class" flex="1" id="multiweek-week-1-day-7-box">
<label class="month-day-number-class" id="multiweek-week-1-day-7"/>
</vbox>
</row>
<row id="multiweek-week-2-row" flex="1" >
<vbox class="multiweek-leftcol-box-class" flex="1" id="multiweek-week-2-left-box">
<label class="week-short-text" value="&week.short;"/>
<label class="month-leftcol-number-class" id="multiweek-week-2-left"/>
</vbox>
<vbox class="month-day-box-class" flex="1" id="multiweek-week-2-day-1-box">
<label class="month-day-number-class" id="multiweek-week-2-day-1"/>
</vbox>
<vbox class="month-day-box-class" flex="1" id="multiweek-week-2-day-2-box">
<label class="month-day-number-class" id="multiweek-week-2-day-2"/>
</vbox>
<vbox class="month-day-box-class" flex="1" id="multiweek-week-2-day-3-box">
<label class="month-day-number-class" id="multiweek-week-2-day-3"/>
</vbox>
<vbox class="month-day-box-class" flex="1" id="multiweek-week-2-day-4-box">
<label class="month-day-number-class" id="multiweek-week-2-day-4"/>
</vbox>
<vbox class="month-day-box-class" flex="1" id="multiweek-week-2-day-5-box">
<label class="month-day-number-class" id="multiweek-week-2-day-5"/>
</vbox>
<vbox class="month-day-box-class" flex="1" id="multiweek-week-2-day-6-box">
<label class="month-day-number-class" id="multiweek-week-2-day-6"/>
</vbox>
<vbox class="month-day-box-class" flex="1" id="multiweek-week-2-day-7-box">
<label class="month-day-number-class" id="multiweek-week-2-day-7"/>
</vbox>
</row>
<row id="multiweek-week-3-row" flex="1" >
<vbox class="multiweek-leftcol-box-class" flex="1" id="multiweek-week-3-left-box">
<label class="week-short-text" value="&week.short;"/>
<label class="month-leftcol-number-class" id="multiweek-week-3-left"/>
</vbox>
<vbox class="month-day-box-class" flex="1" id="multiweek-week-3-day-1-box">
<label class="month-day-number-class" id="multiweek-week-3-day-1"/>
</vbox>
<vbox class="month-day-box-class" flex="1" id="multiweek-week-3-day-2-box">
<label class="month-day-number-class" id="multiweek-week-3-day-2"/>
</vbox>
<vbox class="month-day-box-class" flex="1" id="multiweek-week-3-day-3-box">
<label class="month-day-number-class" id="multiweek-week-3-day-3"/>
</vbox>
<vbox class="month-day-box-class" flex="1" id="multiweek-week-3-day-4-box">
<label class="month-day-number-class" id="multiweek-week-3-day-4"/>
</vbox>
<vbox class="month-day-box-class" flex="1" id="multiweek-week-3-day-5-box">
<label class="month-day-number-class" id="multiweek-week-3-day-5"/>
</vbox>
<vbox class="month-day-box-class" flex="1" id="multiweek-week-3-day-6-box">
<label class="month-day-number-class" id="multiweek-week-3-day-6"/>
</vbox>
<vbox class="month-day-box-class" flex="1" id="multiweek-week-3-day-7-box">
<label class="month-day-number-class" id="multiweek-week-3-day-7"/>
</vbox>
</row>
<row id="multiweek-week-4-row" flex="1" >
<vbox class="multiweek-leftcol-box-class" flex="1" id="multiweek-week-4-left-box">
<label class="week-short-text" value="&week.short;"/>
<label class="month-leftcol-number-class" id="multiweek-week-4-left"/>
</vbox>
<vbox class="month-day-box-class" flex="1" id="multiweek-week-4-day-1-box">
<label class="month-day-number-class" id="multiweek-week-4-day-1"/>
</vbox>
<vbox class="month-day-box-class" flex="1" id="multiweek-week-4-day-2-box">
<label class="month-day-number-class" id="multiweek-week-4-day-2"/>
</vbox>
<vbox class="month-day-box-class" flex="1" id="multiweek-week-4-day-3-box">
<label class="month-day-number-class" id="multiweek-week-4-day-3"/>
</vbox>
<vbox class="month-day-box-class" flex="1" id="multiweek-week-4-day-4-box">
<label class="month-day-number-class" id="multiweek-week-4-day-4"/>
</vbox>
<vbox class="month-day-box-class" flex="1" id="multiweek-week-4-day-5-box">
<label class="month-day-number-class" id="multiweek-week-4-day-5"/>
</vbox>
<vbox class="month-day-box-class" flex="1" id="multiweek-week-4-day-6-box">
<label class="month-day-number-class" id="multiweek-week-4-day-6"/>
</vbox>
<vbox class="month-day-box-class" flex="1" id="multiweek-week-4-day-7-box">
<label class="month-day-number-class" id="multiweek-week-4-day-7"/>
</vbox>
</row>
<row id="multiweek-week-5-row" flex="1" >
<vbox class="multiweek-leftcol-box-class" flex="1" id="multiweek-week-5-left-box">
<label class="week-short-text" value="&week.short;"/>
<label class="month-leftcol-number-class" id="multiweek-week-5-left"/>
</vbox>
<vbox class="month-day-box-class" flex="1" id="multiweek-week-5-day-1-box">
<label class="month-day-number-class" id="multiweek-week-5-day-1"/>
</vbox>
<vbox class="month-day-box-class" flex="1" id="multiweek-week-5-day-2-box">
<label class="month-day-number-class" id="multiweek-week-5-day-2"/>
</vbox>
<vbox class="month-day-box-class" flex="1" id="multiweek-week-5-day-3-box">
<label class="month-day-number-class" id="multiweek-week-5-day-3"/>
</vbox>
<vbox class="month-day-box-class" flex="1" id="multiweek-week-5-day-4-box">
<label class="month-day-number-class" id="multiweek-week-5-day-4"/>
</vbox>
<vbox class="month-day-box-class" flex="1" id="multiweek-week-5-day-5-box">
<label class="month-day-number-class" id="multiweek-week-5-day-5"/>
</vbox>
<vbox class="month-day-box-class" flex="1" id="multiweek-week-5-day-6-box">
<label class="month-day-number-class" id="multiweek-week-5-day-6"/>
</vbox>
<vbox class="month-day-box-class" flex="1" id="multiweek-week-5-day-7-box">
<label class="month-day-number-class" id="multiweek-week-5-day-7"/>
</vbox>
</row>
<row id="multiweek-week-6-row" flex="1">
<vbox class="multiweek-leftcol-box-class" flex="1" id="multiweek-week-6-left-box">
<label class="week-short-text" value="&week.short;"/>
<label class="month-leftcol-number-class" id="multiweek-week-6-left"/>
</vbox>
<vbox class="month-day-box-class" flex="1" id="multiweek-week-6-day-1-box">
<label class="month-day-number-class" id="multiweek-week-6-day-1"/>
</vbox>
<vbox class="month-day-box-class" flex="1" id="multiweek-week-6-day-2-box">
<label class="month-day-number-class" id="multiweek-week-6-day-2"/>
</vbox>
<vbox class="month-day-box-class" flex="1" id="multiweek-week-6-day-3-box">
<label class="month-day-number-class" id="multiweek-week-6-day-3"/>
</vbox>
<vbox class="month-day-box-class" flex="1" id="multiweek-week-6-day-4-box">
<label class="month-day-number-class" id="multiweek-week-6-day-4"/>
</vbox>
<vbox class="month-day-box-class" flex="1" id="multiweek-week-6-day-5-box">
<label class="month-day-number-class" id="multiweek-week-6-day-5"/>
</vbox>
<vbox class="month-day-box-class" flex="1" id="multiweek-week-6-day-6-box">
<label class="month-day-number-class" id="multiweek-week-6-day-6"/>
</vbox>
<vbox class="month-day-box-class" flex="1" id="multiweek-week-6-day-7-box">
<label class="month-day-number-class" id="multiweek-week-6-day-7"/>
</vbox>
</row>
</rows>
</grid>
</box> <!-- End: Multiweek grid box -->
<vbox class="multiweek-rightcol-class">
<vbox class="multiweek-header-left-class">
<label value=" " />
</vbox>
<vbox class="multiweek-previous-button-box">
<image id="multiweek-previous-button" class="updownbuttons" onclick="gCalendarWindow.goToPrevious()"/>
</vbox>
<spacer flex="1"/>
<vbox class="multiweek-previouspage-button-box">
<image id="multiweek-previouspage-button" class="updownbuttons" onclick="gCalendarWindow.currentView.goToPreviousPage()"/>
</vbox>
<spacer flex="1"/>
<vbox class="multiweek-nextpage-button-box">
<image id="multiweek-nextpage-button" class="updownbuttons" onclick="gCalendarWindow.currentView.goToNextPage()"/>
</vbox>
<spacer flex="1"/>
<vbox class="multiweek-next-button-box">
<image id="multiweek-next-button" class="updownbuttons" onclick="gCalendarWindow.goToNext()"/>
</vbox>
</vbox>
</hbox> <!-- End: Multiweek content box -->
</vbox>
</overlay>

View File

@ -1,128 +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 ***** */
/*-----------------------------------------------------------------
* 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;
document.getElementById( "server-publish-checkbox" ).checked = gCalendarObject.publishAutomatically;
document.getElementById( "server-path-textbox" ).value = gCalendarObject.remotePath;
document.getElementById( "server-local-path-textbox" ).value = gCalendarObject.path;
document.getElementById( "calendar-color" ).color = gCalendarObject.color; //added by Dallas
// start focus on title
var firstFocus = document.getElementById( "server-name-textbox" );
firstFocus.focus();
sizeToContent();
}
/**
* Called when the OK button is clicked.
*/
function onOKCommand()
{
gCalendarObject.name = document.getElementById( "server-name-textbox" ).value;
gCalendarObject.remotePath = document.getElementById( "server-path-textbox" ).value;
gCalendarObject.publishAutomatically = document.getElementById( "server-publish-checkbox" ).checked;
gCalendarObject.color = document.getElementById( "calendar-color" ).color; //added by Dallas
//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;
}

View File

@ -1,141 +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 width height"
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/serverDialog.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>
<!-- Color -->
<row align="center">
<hbox class="field-label-box-class" pack="end">
<description>&calendarproperties.color.label;</description>
</hbox>
<hbox align="center">
<colorpicker id="calendar-color"
class="small-margin"
type="button"
palettename="standard"/>
</hbox>
</row>
<!-- Remote 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" />
</hbox>
</row>
<!-- Local Location -->
<row align="center">
<hbox class="field-label-box-class" pack="end">
<description>&calendar.server.dialog.local.location.label;</description>
</hbox>
<hbox>
<textbox readonly="true"
id="server-local-path-textbox"
flex="1" />
</hbox>
</row>
<!-- Publish Automatically -->
<row align="center">
<hbox class="field-label-box-class" pack="end"/>
<hbox>
<checkbox id="server-publish-checkbox"/>
<description flex="1">&calendar.server.dialog.publish.label;</description>
</hbox>
</row>
</rows>
</grid>
</vbox> <!-- standard-dialog-content -->
</vbox> <!-- dialog-box -->
</dialog>

View File

@ -1,49 +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>
-
- 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 ***** -->
<html>
<head>
<title>JsUnit Test Suite</title>
<script type="application/x-javascript" src="chrome://calendar/content/test/jsunit/app/jsUnitCore.js"></script>
<script type="application/x-javascript" src="chrome://calendar/content/test/jsunit/app/jsUnitUtility.js"></script>
<script type="application/x-javascript" src="chrome://calendar/content/test/testAll.js"></script>
</head>
<body>
<p >JsUnit Test Suite</p>
<p >This page contains a suite of tests for testing calendar.</p>
</body>
</html>

View File

@ -1,51 +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>
*
* 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 ***** */
function calendarTestSuite()
{
var testSuite = new JsUnitTestSuite();
testSuite.addTestPage( "chrome://calendar/content/test/testCalendarEvent.xul" );
return testSuite;
}
function suite()
{
var testSuite = new JsUnitTestSuite();
testSuite.addTestSuite( calendarTestSuite() );
return testSuite;
}

File diff suppressed because it is too large Load Diff

View File

@ -1,69 +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>
-
- 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://navigator/skin/" type="text/css"?>
<!-- Begin main dialog window -->
<window
id="test-send-command-window"
title="Test Send Command"
width="490"
height="532"
orient="vertical"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<!-- JS Includes -->
<script type="application/x-javascript" src="chrome://penglobal/content/test/jsunit/app/jsUnitCore.js"></script>
<script type="application/x-javascript" src="chrome://penglobal/content/test/jsunit/app/jsUnitUtility.js"></script>
<script type="application/x-javascript" src="chrome://penglobal/content/test/jsunit/app/jsUnitAsync.js"></script>
<script type="application/x-javascript" src="chrome://global/content/strres.js"/>
<script type="application/x-javascript" src="chrome://jslib/content/jslib.js"/>
<script type="application/x-javascript" src="chrome://jslib/content/io/fileUtils.js"/>
<script type="application/x-javascript" src="chrome://penglobal/content/jslib/libraries/io/dir.js"/>
<script type="application/x-javascript" src="chrome://penglobal/content/jslib/libraries/io/io.js"/>
<script type="application/x-javascript" src="chrome://penglobal/content/jslib/libraries/io/file.js"/>
<script type="application/x-javascript" src="chrome://penglobal/content/penFileUtils.js"></script>
<script type="application/x-javascript" src="chrome://calendar/content/dateUtils.js"/>
<script type="application/x-javascript" src="chrome://penglobal/content/ParseUtils.js"></script>
<script type="application/x-javascript" src="chrome://calendar/content/test/testCalendarEvent.js"></script>
<description> Calendar Event Testing </description>
</window>

View File

@ -1,778 +0,0 @@
/* -*- Mode: javascript; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 4 -*-
* ***** 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>
* Eric Belhaire <belhaire@ief.u-psud.fr>
* Stuart Parmenter <pavlov@pavlov.net>
*
* 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
*
* PROPERTIES
* gHeaderDateItemArray - Array of text boxes used to display the dates
* of the currently displayed week.
*
*/
var gDebugEnabled=false;
var gRefColumnIndex = 0;
// 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 )
{
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++) {
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 ) {
if( EventSelectionArray.length > 0 ) {
//for some reason, this function causes the tree to go into a select / unselect loop
//putting it in a settimeout fixes this.
setTimeout( "gCalendarWindow.weekView.clearSelectedDate();", 1 );
var i = 0;
for( i = 0; i < EventSelectionArray.length; i++ ) {
gCalendarWindow.weekView.selectBoxForEvent( EventSelectionArray[i] );
}
} else {
//select the proper day
gCalendarWindow.weekView.hiliteSelectedDate();
}
}
}
calendarWindow.EventSelection.addObserver( weekViewEventSelectionObserver );
}
/** PUBLIC
*
* Redraw the events for the current week
*/
WeekView.prototype.refreshEvents = function()
{
// clean up anything that was here before
this.removeElementsByAttribute("eventbox", "weekview");
this.eventList = new Array();
// Figure out the start and end days for the week we're currently viewing
this.displayStartDate = new Date(gHeaderDateItemArray[1].getAttribute("date"));
this.displayEndDate = new Date(this.displayStartDate);
this.displayEndDate.setDate(this.displayEndDate.getDate() + 7);
// Save this off so we can get it again in onGetResult below
var eventController = this;
var getListener = {
onOperationComplete: function(aCalendar, aStatus, aOperationType, aId, aDetail) {
debug("onOperationComplete\n");
eventController.drawEventBoxes();
},
onGetResult: function(aCalendar, aStatus, aItemType, aDetail, aCount, aItems) {
for (var i = 0; i < aCount; ++i) {
eventController.createEventBox(aItems[i],
function(a1, a2, a3) { eventController.addToDisplayList(a1, a2, a3); } );
}
}
};
var ccalendar = getDisplayComposite();
var start = jsDateToDateTime(this.displayStartDate).getInTimezone(calendarDefaultTimezone());
var end = jsDateToDateTime(this.displayEndDate).getInTimezone(calendarDefaultTimezone());
dump("Fetching events from " + start + " to " + end + "\n");
ccalendar.getItems(ccalendar.ITEM_FILTER_TYPE_EVENT | ccalendar.ITEM_FILTER_CLASS_OCCURRENCES,
0, start, end, getListener);
return;
/*
var isOnlyWorkDays = (gOnlyWorkdayChecked == "true");
var isDayOff = (isOnlyWorkDays? this.preferredDaysOff() : null);
this.kungFooDeathGripOnEventBoxes = new Array();
for( var dayIndex = 1; dayIndex <= 7; ++dayIndex ) {
var headerDateItem = document.getElementById( "week-header-date-" + dayIndex );
headerDateItem.numEvents = 0;
}
//get the all day box.
var AllDayRow = document.getElementById( "week-view-allday-row" ) ;
AllDayRow.setAttribute( "collapsed", "true" );
//expand the day's content box by setting allday to false..
document.getElementById( "week-view-content-box" ).removeAttribute( "allday" );
var allDayExist = false ;
var allDayEventList = new Array();
var normalEventList = new Array();
var eventList = new Array();
var i;
for ( dayIndex = 1; dayIndex <= 7; ++dayIndex ) {
// get the events for the day and loop through them
var dayToGet = new Date( gHeaderDateItemArray[dayIndex].getAttribute( "date" ) );
var dayToGetDay = dayToGet.getDay() ;
if (isOnlyWorkDays && isDayOff[dayToGetDay]) {
continue;
}
eventList[dayIndex] = gEventSource.getEventsForDay( dayToGet );
allDayEventList[dayIndex] = new Array();
normalEventList[dayIndex] = new Array();
// get limits for current day
var limits = this.getViewLimits(eventList[dayIndex], dayToGet);
if( limits.startHour < LowestStartHour ) {
LowestStartHour = limits.startHour;
}
if( limits.endHour > HighestEndHour ) {
HighestEndHour = limits.endHour;
}
//divide events into allday and normal (non-allday) events
for ( i = 0; i < eventList[dayIndex].length; i++ ) {
if( eventList[dayIndex][i].event.allDay == true ) {
allDayEventList[dayIndex].push(eventList[dayIndex][i]);
allDayExist = true;
} else {
normalEventList[dayIndex].push(eventList[dayIndex][i]);
}
}
}
if ( allDayExist == true ) {
//show the all day box
AllDayRow.removeAttribute( "collapsed" );
//shrink the day's content box.
document.getElementById( "week-view-content-box" ).setAttribute( "allday", "true" );
}
//START FOR LOOP FOR DAYS--->
for ( dayIndex = 1; dayIndex <= 7; ++dayIndex ) {
dayToGet = new Date( gHeaderDateItemArray[dayIndex].getAttribute( "date" ) );
dayToGetDay = dayToGet.getDay() ;
if (isOnlyWorkDays && isDayOff[dayToGetDay]) {
continue;
}
// Calculate event draw properties (where events are drawn on view)
this.setDrawProperties(normalEventList[dayIndex]);
// Add non-allday events to DOM
for ( i = 0; i < normalEventList[dayIndex].length; ++i )
{
var eventBox = this.createEventBox( normalEventList[dayIndex][i] );
document.getElementById( "week-view-content-board" ).appendChild( eventBox );
this.kungFooDeathGripOnEventBoxes.push( eventBox );
}
//
//Everything below this point is old code that will be changed in the near future.
//It only deals with allday events
//
var ThisDayAllDayBox = document.getElementById( "all-day-content-box-week-"+dayIndex );
while ( ThisDayAllDayBox.hasChildNodes() ) {
ThisDayAllDayBox.removeChild( ThisDayAllDayBox.firstChild );
}
for ( var eventIndex = 0; eventIndex < eventList[dayIndex].length; ++eventIndex ) {
var calendarEventDisplay = eventList[dayIndex][ eventIndex ];
// get the day box for the calendarEvent's 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;
}
//note the use of the WeekViewAllDayText Attribute.
//This is used to remove the text when the day is changed.
var 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", "gridOccurrenceTooltip" );
var 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", "gridOccurrenceTooltip" );
ThisDayAllDayBox.appendChild( newImage );
ThisDayAllDayBox.appendChild( newHTMLNode );
}
if( this.calendarWindow.EventSelection.isSelectedEvent( calendarEventDisplay.event ) ) {
this.selectBoxForEvent( calendarEventDisplay.event );
}
}
} //--> END THE FOR LOOP FOR THE WEEK VIEW
*/
}
WeekView.prototype.addToDisplayList = function(itemOccurrence, startDate, endDate)
{
this.eventList.push({event:itemOccurrence, start:startDate.clone(), end:endDate.clone()});
}
WeekView.prototype.drawEventBoxes = function()
{
//initialize view limits from prefs
this.lowestStartHour = getIntPref(this.calendarWindow.calendarPreferences.calendarPref, "event.defaultstarthour", 8);
this.highestEndHour = getIntPref(this.calendarWindow.calendarPreferences.calendarPref, "event.defaultendhour", 17);
for each (event in this.eventList) {
if (!(event.start.isDate)) {
if(event.end.hour > this.highestEndHour)
this.highestEndHour = event.end.hour;
if(event.start.hour < this.lowestStartHour)
this.lowestStartHour = event.start.hour;
}
}
//now hide those that aren't applicable
for (var i = 0; i < 24; i++) {
document.getElementById("week-view-row-"+i).removeAttribute("collapsed");
}
for (i = 0; i < this.lowestStartHour; i++) {
document.getElementById("week-view-row-"+i).setAttribute("collapsed", "true");
}
for (i = (this.highestEndHour + 1); i < 24; i++) {
document.getElementById("week-view-row-"+i ).setAttribute("collapsed", "true");
}
// Need to split in seperate lists for each day.
var lists = new Array();
for (var i=0; i<7; ++i) {
lists[i] = new Array();
}
var event;
for each (event in this.eventList) {
lists[event.start.weekday].push(event);
}
for (var i=0; i<7; ++i) {
this.setDrawProperties(lists[i]);
for each (event in lists[i]) {
this.createEventBoxInternal(event);
}
}
}
/** PRIVATE
*
* This creates an event box for the week view
*/
WeekView.prototype.createEventBoxInternal = function (event)
{
var itemOccurrence = event.event;
var startDate = event.start;
var endDate = event.end;
var calEvent = itemOccurrence.QueryInterface(Components.interfaces.calIEvent);
//HACK because event.start is convert to the proper TZ, but
//event.start.jsDate is not!
var adjustedStartDate = new Date(startDate.year, startDate.month, startDate.day);
var adjustedEndDate = new Date(endDate.year, endDate.month, endDate.day);
// Check if the event is within the bounds of events to be displayed.
if ((adjustedEndDate < this.displayStartDate) ||
(adjustedStartDate > this.displayEndDate) ||
(adjustedEndDate == this.displayStartDate &&
adjustedStartDate < this.displayStartDate))
return;
/*
if (calEvent.isAllDay) {
endDate = endDate.clone();
endDate.hour = 23;
endDate.minute = 59;
endDate.normalize();
}
*/
debug("all day: " + calEvent.startDate.isDate + "\n");
debug("startdate: " + startDate + "\n");
debug("enddate: " + endDate + "\n");
var startHour = startDate.hour;
var startMinutes = startDate.minute;
var eventDuration = (endDate.jsDate - startDate.jsDate) / (60 * 60 * 1000);
debug("duration: " + eventDuration + "\n");
var eventBox = document.createElement("vbox");
// XXX Consider changing this to only store the ID
eventBox.occurrence = itemOccurrence;
eventBox.event = calEvent;
// figure out what column we need to put this on
var index = (startDate.weekday - this.displayStartDate.getDay() + 7) % 7;
var ElementOfRef = document.getElementById("week-tree-day-" + gRefColumnIndex + "-item-" + startHour) ;
// All-day events won't find a good ElementOfRef normally,
if (!ElementOfRef.boxObject.width) {
var sHour = getIntPref(this.calendarWindow.calendarPreferences.calendarPref,
"event.defaultstarthour", 8);
ElementOfRef = document.getElementById("week-tree-day-" + gRefColumnIndex
+ "-item-" + sHour);
}
var hourHeight = ElementOfRef.boxObject.height;
var ElementOfRefEnd = document.getElementById("week-tree-day-" + gRefColumnIndex + "-item-" + endDate.hour) ;
var hourHeightEnd = ElementOfRefEnd.boxObject.height;
var hourWidth = ElementOfRef.boxObject.width;
if (!startDate.isDate) {
var eventSlotWidth = Math.round(hourWidth / event.totalSlotCount);
var Width = ( event.drawSlotCount * eventSlotWidth ) - 1;
eventBox.setAttribute( "width", Width );
var top = eval( ElementOfRef.boxObject.y + ( ( startMinutes/60 ) * hourHeight ) );
top = top - ElementOfRef.parentNode.boxObject.y - 2;
eventBox.setAttribute("top", top);
var bottom = eval( ElementOfRefEnd.boxObject.y + ( ( endDate.minute/60 ) * hourHeightEnd ) );
bottom = bottom - ElementOfRefEnd.parentNode.boxObject.y - 2;
eventBox.setAttribute("height", bottom - top);
var boxLeft = document.getElementById("week-tree-day-"+index+"-item-"+startHour).boxObject.x -
document.getElementById( "week-view-content-box" ).boxObject.x +
( event.startDrawSlot * eventSlotWidth );
//dump(boxLeft + "\n");
eventBox.setAttribute("left", boxLeft);
} else {
eventBox.setAttribute( "width", hourWidth );
}
// set the event box to be of class week-view-event-class and the appropriate calendar-color class
this.setEventboxClass(eventBox, calEvent, "week-view");
eventBox.setAttribute("eventbox", "weekview");
eventBox.setAttribute("dayindex", index + 1);
eventBox.setAttribute("onclick", "weekEventItemClick(this, event)" );
eventBox.setAttribute("ondblclick", "weekEventItemDoubleClick(this, event)");
eventBox.setAttribute("id", "week-view-event-box-" + calEvent.id);
eventBox.setAttribute("name", "week-view-event-box-" + calEvent.id);
eventBox.setAttribute("onmouseover", "onMouseOverGridOccurrence(event)" );
eventBox.setAttribute("tooltip", "gridOccurrenceTooltip");
// Event box text (title, location and description)
var locationText = calEvent.getProperty("LOCATION");
if (calEvent.title || locationText) {
var titleText = ( (calEvent.title || "") +
(locationText ? " ("+locationText+")" : "") );
var titleElement = document.createElement( "label" );
titleElement.setAttribute( "class", "week-view-event-title-label-class" );
titleElement.appendChild( document.createTextNode( titleText ));
eventBox.appendChild( titleElement );
}
var descriptionText = calEvent.getProperty("DESCRIPTION");
if (descriptionText) {
var descriptionElement = document.createElement( "description" );
descriptionElement.setAttribute( "class", "week-view-event-description-class" );
descriptionElement.appendChild(document.createTextNode(descriptionText));
eventBox.appendChild( descriptionElement );
}
if(this.calendarWindow.EventSelection.isSelectedEvent(calEvent))
eventBox.setAttribute( "eventselected", "true" );
debug("Adding eventBox " + eventBox + "\n");
if (!startDate.isDate) {
document.getElementById("week-view-content-board").appendChild(eventBox);
} else {
var allDayBox = document.getElementById("all-day-content-box-week-"+(index+1));
allDayBox.appendChild(eventBox);
}
}
/** PUBLIC
*
* Called when the user switches to a different view
*/
WeekView.prototype.switchFrom = function( )
{
//Enable menu options
document.getElementById( "only-workday-checkbox-1" ).setAttribute( "disabled", "true" );
document.getElementById( "only-workday-checkbox-2" ).setAttribute( "disabled", "true" );
}
/** 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" );
//Enable menu options
document.getElementById( "only-workday-checkbox-1" ).removeAttribute( "disabled" );
document.getElementById( "only-workday-checkbox-2" ).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( )
{
var Offset = this.preferredWeekStart();
var isOnlyWorkDays = (gOnlyWorkdayChecked == "true");
var isDayOff = this.preferredDaysOff();
// Define a reference column (which will not be collapsed latter) to use to get its width.
// This is used to place the event Box
gRefColumnIndex = Offset;
if (isOnlyWorkDays) {
for (var day = 0; day < 7; day++) {
if (!isDayOff[day]) {
gRefColumnIndex = day;
break;
}
}
isDayOff[gRefColumnIndex] = false; // in case all days off, make one visible.
}
// Set the from-to title string, based on the selected date
var selectedDate = this.calendarWindow.getSelectedDate();
var viewDay = selectedDate.getDay();
var viewDayOfMonth = selectedDate.getDate();
var viewMonth = selectedDate.getMonth();
var viewYear = selectedDate.getFullYear();
var NewArrayOfDayNames = new Array();
// Set the header information for the week view
var i;
for( i = 0; i < ArrayOfDayNames.length; i++ ) {
NewArrayOfDayNames[i] = ArrayOfDayNames[i];
}
for( i = 0; i < Offset; i++ ) {
var FirstElement = NewArrayOfDayNames.shift();
NewArrayOfDayNames.push( FirstElement );
}
viewDay -= Offset;
if( viewDay < 0 ) {
viewDay += 7;
}
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.getFormatedDateWithoutYear( firstDayOfWeek );
var lastDayMonthName = this.calendarWindow.dateFormater.getFormatedDateWithoutYear( lastDayOfWeek );
var mondayDiff = (Offset >= 5) ? 8 - Offset : 1 - Offset ;
var mondayDate = new Date( firstDayOfWeek.getFullYear(),
firstDayOfWeek.getMonth(),
firstDayOfWeek.getDate() + mondayDiff );
var weekNumber = DateUtils.getWeekNumber(mondayDate);
var weekViewStringBundle = srGetStrBundle("chrome://calendar/locale/calendar.properties");
var dateString = weekViewStringBundle.GetStringFromName( "Week" )+" "+weekNumber+ ": "+firstDayMonthName + " - " + lastDayMonthName ;
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 */
for( var dayIndex = 1; dayIndex <= 7; ++dayIndex ) {
var dateOfDay = firstDayOfWeek.getDate();
var headerDateItem = document.getElementById( "week-header-date-"+dayIndex );
headerDateItem.setAttribute( "value" , dateOfDay );
headerDateItem.setAttribute( "date", firstDayOfWeek );
headerDateItem.numEvents = 0;
var col = dayIndex - 1;
document.getElementById( "week-header-date-text-"+dayIndex ).setAttribute( "value", NewArrayOfDayNames[col] );
var headColumn = document.getElementById( "weekview-header-column-day-"+dayIndex );
var bodyColumn = document.getElementById( "weekview-column-day-"+dayIndex );
var dayOfWeek = (Offset + col) % 7;
if( isOnlyWorkDays && isDayOff[ dayOfWeek ]) {
headColumn.setAttribute( "hidden", "true" );
bodyColumn.setAttribute( "hidden", "true" );
} else {
headColumn.removeAttribute( "hidden" );
bodyColumn.removeAttribute( "hidden" );
if ( isDayOff[ dayOfWeek ] ) {
headColumn.setAttribute("weekend", "true");
bodyColumn.setAttribute("weekend", "true");
} else {
headColumn.removeAttribute("weekend");
bodyColumn.removeAttribute("weekend");
}
}
// advance to next day
firstDayOfWeek.setDate( dateOfDay + 1 );
}
this.hiliteTodaysDate( );
}
/** 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 ( var j = 0; j < EventBoxes.length; j++ ) {
EventBoxes[j].setAttribute( "eventselected", "true" );
}
}
WeekView.prototype.getVisibleEvent = function( calendarEvent )
{
var eventBox = document.getElementById( "week-view-event-box-"+calendarEvent.id );
if ( eventBox ) {
return eventBox;
} else {
return false;
}
}
/** PRIVATE
*
* Mark the selected date, also unmark the old selection if there was one
*/
WeekView.prototype.hiliteSelectedDate = function multiweekView_hiliteSelectedDate( )
{
// Clear the old selection if there was one
this.clearSelectedDate();
this.clearSelectedEvent();
// 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 selectedDay = this.calendarWindow.getSelectedDate();
if ( selectedDay.getTime() > FirstDay.getTime() && selectedDay.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() == selectedDay.getFullYear()
&& ThisDate.getMonth() == selectedDay.getMonth()
&& ThisDate.getDay() == selectedDay.getDay() ) {
break;
}
}
//dayIndex now contains the box numbers that we need.
for (var i = 0; i < 24; i++ ) {
document.getElementById( "week-tree-day-"+(dayIndex-1)+"-item-"+i ).setAttribute( "weekselected", "true" );
}
}
}
/** PRIVATE
*
* Mark today as selected, also unmark the old today if there was one.
*/
WeekView.prototype.hiliteTodaysDate = function( )
{
//clear out the old today boxes.
this.removeAttributeFromElements("today","true");
// 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 (var 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();
this.removeAttributeFromElements("eventselected", "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.
*/
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( )
{
this.removeAttributeFromElements("weekselected","true");
}

File diff suppressed because it is too large Load Diff