This commit is contained in:
mikep%oeone.com 2001-11-07 19:18:46 +00:00
Родитель 0c64fcd0aa
Коммит 955cd040d5
252 изменённых файлов: 23353 добавлений и 0 удалений

14
calendar/docs/index.html Normal file
Просмотреть файл

@ -0,0 +1,14 @@
<center><font size="+1"><i>Mozilla Calendar</i></font></center>
<hr width=100% size=1 noshade>
<p><b>The Goal:</b>
The Mozilla Calendar project is meant to create an open source, standards based calendar solution. The initial codebase is being donated by <a href="http://www.oeone.com">OEone Corporation</a> and should be thought of only as a demonstration of what can be accomplished using XUL, JS, CSS and XPCOM.
<p>
The first thing that we would like to accomplish is to define a set of requirements. What do you want the calendar to do? The place to voice your opinion is in the <a href="news://news.mozilla.org/netscape.public.mozilla.calendar">Calendar Newsgroup</a>. Once all the requirements have been established, we will go about designing the calendar.
<p>
The sample code from OEone is available online, as well as instructions on how to build it. Here's a screenshot for you. Presently the code only runs under Linux, with plans in the works to quickly convert the code to run uner Windows and Mac.
<p>
<b>How You Can Help:</b>
<ul>
<li>Get Involved / Share Ideas: The people in the calendar project hand out on #calendar on irc.mozilla.org. We also read the newsgroup regularly.
<li>Write Code: We need people who know how to program in XUL, CSS, JavaScript or C++. If you've never tried XUL, you'll find out how easy it is by reading the programmers guide here at Mozilla.org, or by reading the tutorial at XulPlanet.com.
</ul>

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

@ -0,0 +1,15 @@
<center><font size="+1"><i>Mozilla Calendar Installation</i></font></center>
<hr width=100% size=1 noshade>
<p><b>Installation Instructions</b>
<ul>
<li>Download and install a clean version of Mozilla 0.9.5. Presently, the calendar only works with this version.
<li>Download and install libical (version 0.23 ). We've provided an RPM that installs it to /usr here.
<li>Download and unzip calendar.tar.gz
<li>Follow the instructions in the INSTALL file, which are:
<ul>
<li>Ensure that calendar and setupcalendar variables MOZ_PATH point to your install directory of Mozilla 0.9.5.
<li>Edit content/penglobal/penroot.js and change "/home/mikep" to your home directory.
<li>Run "./setupcalendar" from the calendar directory.
<li>Launch the calendar by running "./calendar"
</ul>
</ul>

10
calendar/docs/who.html Normal file
Просмотреть файл

@ -0,0 +1,10 @@
<center><font size="+1"><i>Mozilla Calendar - Who's Involved</i></font></center>
<hr width=100% size=1 noshade>
<p><b>The Team:</b>
The current Mozilla Calendar Team is as follows:
<ul>
<li>Mike Potter: Module owner and general XUL / CSS / JS guy.
<li>Colin Phillips: Code reviewer
<li>Peter Bojanic: Module mentor.
<li>Gervase Markham: Mozilla contact.
</ul>

218
calendar/libxpical/Makefile Normal file
Просмотреть файл

@ -0,0 +1,218 @@
# 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 OEone Corporation are Copyright (C) 2001
# OEone Corporation. All Rights Reserved.
#
# Contributor(s): Steve Crouse (stevec@oeone.com), Garth Smedley (garths@oeone.com), Jody McIntyre (jodym@oeone.com), Mostafa Hosseini (mostafah@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.
#
#
#
# Generic XPCOM component makefile
#
# Authors: Steve Crouse, Garth Smedley, Jody McIntyre
#--------------------------------------------------------
# Usage:
#
# make clean - remove output files, does not install
# make - build the component and the test program, if not up to date
# make reset - delete registration files from mozilla. good idea to run this after install
# make install - install xpcom component into mozilla components directory
# make uninstall - remove xpcom component from mozilla components directory
# make dist - tars the distribution files up.
# make test - run the test program
#
# By setting the following environment variable before invoking make, you can control the directories
# that install and uninstall use:
#
# DESTDIR - install/uninstall directory, ( Do not add a trailing slash )
#
# This Makefile can be customized for use by any XPCOM component
# by modifying some of the variables below.
#
# MOZZY - Provide the path to your Mozilla installation
# MOZZYDEV - Provide the path to your Mozilla development installation
# LIBRARY_NAME - Name of the final shared object to be built
# IDLFILE - Components IDL file
# IDL_OUTPUT_BASENAME - Base name of the .xpt and .h files to be generated
# SOURCE_FILES - Source files needed to build component
# HEADER_FILES - Header files needed to build component, used for dependencies and distribution
# EXTRA_DISTFILES - extra files to be added to the tarball
# TEST_PROGRAM - Name of standalone test program
# TEST_SOURCE_FILES - Source files needed to build test program
#
# You can also specify additional include paths and libraries to be linked
# in using:
#
# INCLUDES - Specify any additional include paths here
# EXTRA_LIBS - Specify any additional libraries to be linked
#
CC = g++
# Path to src directory
#
SRC = .
# set PACKAGE and VERSION for distrbution tarball
PACKAGE=xpcomical
VERSION=0.1
# Distribution files
# Add any extra files to go in the tarball, by default .so, .idl, .xpt and Makefile are included.
EXTRA_DISTFILES= caltst.xul caltst.js
# Path to your Mozilla installation
#
MOZZY = /usr/local/mozilla0.9.5
MOZZYDEV = /usr/include/mozilla0.9.5
# Define the name for the final shared object file
#
LIBRARY_NAME = libxpical.so
# Define the name of the executable test program
#
TEST_PROGRAM = TestIcal
TEST_SOURCE_FILES = $(SRC)/TestIcal.cpp
# Provide the name for the components IDL file
#
IDLFILE = $(SRC)/oeIICal.idl
# Define the base name for the generated .h and .xpt files
#
IDL_OUTPUT_BASENAME = oeIICal
# List the source files needed for building the component
#
SOURCE_FILES = $(SRC)/oeICalFactory.cpp $(SRC)/oeICalImpl.cpp $(SRC)/oeICalEventImpl.cpp
HEADER_FILES = $(SRC)/oeICalImpl.h $(SRC)/oeICalEventImpl.h
# List any custom include paths here
#
#INCLUDES = -I ./ -I../libical/src/libicalss -I../libical/src/libical -DICAL_DEBUG
INCLUDES = -I ./ -I/usr/local/include -DICAL_DEBUG
# List any custom libraries to be linked here
#
EXTRA_LIBS = -lical -licalss
# Mozilla directories
#
MOZINCLUDES = -I $(MOZZYDEV) -I $(MOZZYDEV)/nspr -I $(MOZZYDEV)/xpcom
MOZIDLS = $(MOZZYDEV)/idl
MOZLIBS = $(MOZZY)
MOZCOMPONENTS = $(MOZZY)/components
MOZINSTALL = $(DESTDIR)/$(MOZCOMPONENTS)
XPIDL = /usr/bin/xpidl
# Standard Netscape Portable Runtime and XPCOM libraries to be linked in
#
NSPR_LIBS =
XPCOM_LIBS = -L $(MOZLIBS) -lxpcom
LIBS = $(NSPR_LIBS) $(XPCOM_LIBS) $(EXTRA_LIBS)
TESTLIBS = $(NSPR_LIBS) $(XPCOM_LIBS)
# Make targets
#
all: $(LIBRARY_NAME) $(IDLFILE) $(TEST_PROGRAM)
clean:
rm -f *.obj *.pdb *.res *.map *.lib *.exp *.o *.so *.dll *.xpt $(IDL_OUTPUT_BASENAME).h $(TEST_PROGRAM)
reset:
rm -f $(MOZZY)/component.reg
rm -f $(MOZZY)/chrome/*.rdf
install:
install -d $(MOZINSTALL)/
install $(LIBRARY_NAME) $(MOZINSTALL)/
install $(IDL_OUTPUT_BASENAME).xpt $(MOZINSTALL)/
uninstall:
rm $(MOZINSTALL)/$(LIBRARY_NAME)
rm $(MOZINSTALL)/$(IDL_OUTPUT_BASENAME).xpt
test:
export NSPR_LOG_MODULES=nsComponentManager:5;\
export NSPR_LOG_FILE=xpcom.log;\
export MOZILLA_FIVE_HOME=$(MOZZY);\
export LD_LIBRARY_PATH=$(MOZZY);\
./$(TEST_PROGRAM)
# Builds xpcom shared object
$(LIBRARY_NAME): $(SOURCE_FILES) $(HEADER_FILES) $(IDL_OUTPUT_BASENAME)
$(CC) -shared -o $(LIBRARY_NAME) $(SOURCE_FILES) $(INCLUDES) $(MOZINCLUDES) $(LIBS)
# Generates .xpt and .h files from the IDL
$(IDLFILE): $(IDL_OUTPUT_BASENAME)
$(IDL_OUTPUT_BASENAME):
$(XPIDL) -m typelib -w -I $(MOZIDLS) -o $(IDL_OUTPUT_BASENAME) $(IDLFILE)
$(XPIDL) -m header -w -I $(MOZIDLS) -o $(IDL_OUTPUT_BASENAME) $(IDLFILE)
# Build test program
$(TEST_PROGRAM) : $(TEST_SOURCE_FILES)
$(CC) -g -o $(TEST_PROGRAM) $(TEST_SOURCE_FILES) $(MOZINCLUDES) $(INCLUDES) $(TESTLIBS) -lplds4 -lplc4 -lnspr4
# distribution build
DISTFILES= $(SOURCE_FILES) $(HEADER_FILES) $(IDLFILE) $(TEST_SOURCE_FILES) Makefile $(EXTRA_DISTFILES)
distdir = $(PACKAGE)-$(VERSION)
dist: distdir
chmod -R a+r $(distdir)
tar czf $(distdir).tar.gz $(distdir)
rm -rf $(distdir)
distdir:
rm -rf $(distdir)
mkdir $(distdir)
for file in $(DISTFILES); do \
cp -p $$file $(distdir) ;\
done

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

@ -0,0 +1,100 @@
/*
* 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 Corporation.
*
* The Initial Developer of the Original Code is
* OEone Corporation.
* Portions created by OEone Corporation are Copyright (C) 2001
* OEone Corporation. All Rights Reserved.
*
* Contributor(s): Mostafa Hosseini (mostafah@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.
*
*
*/
#include <unistd.h>
#include <oeIICal.h>
#include <oeICalImpl.h>
#include <oeICalEventImpl.h>
#include <nsIServiceManager.h>
//#include <nsXPIDLString.h>
main()
{
nsresult rv;
char buf[80];
// Initialize XPCOM
rv = NS_InitXPCOM(nsnull, nsnull);
if (NS_FAILED(rv))
{
printf("ERROR: XPCOM intialization error [%x].\n", rv);
return -1;
}
// Do Autoreg to make sure our component is registered. The real way of
// doing this is running the xpcom registraion tool, regxpcom, at install
// time to get components registered and not make this call everytime.
// Ignore return value.
//
// Here we use the global component manager. Note that this will cause
// linkage dependency to XPCOM library. We feel that linkage dependency
// to XPCOM is inevitable and this is simpler to code.
// To break free from such dependencies, we can GetService() the component
// manager from the service manager that is returned from NS_InitXPCOM().
// We feel that linkage dependency to XPCOM library is inevitable.
(void) nsComponentManager::AutoRegister(nsIComponentManager::NS_Startup, nsnull);
// Create an instance of our component
nsCOMPtr<oeIICal> mysample = do_CreateInstance(OE_ICAL_CONTRACTID, &rv);
if (NS_FAILED(rv))
{
printf("ERROR: Cannot create instance of component " OE_ICAL_CONTRACTID " [%x].\n"
"Debugging hint:\n"
"\tsetenv NSPR_LOG_MODULES nsComponentManager:5\n"
"\tsetenv NSPR_LOG_FILE xpcom.log\n"
"\t./TestICal\n"
"\t<check the contents for xpcom.log for possible cause of error>.\n",
rv);
return -2;
}
mysample->SetServer( "/home/mostafah/calendar" );
rv = mysample->Test();
if ( rv != NS_OK )
{
printf("ERROR: Calling oeIICal::Test()\n");
return 0;
}
printf("Test finished\n");
// Shutdown XPCOM
NS_ShutdownXPCOM(nsnull);
return 0;
}

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

@ -0,0 +1,211 @@
/*
* 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 Corporation.
*
* The Initial Developer of the Original Code is
* OEone Corporation.
* Portions created by OEone Corporation are Copyright (C) 2001
* OEone Corporation. All Rights Reserved.
*
* Contributor(s): Mostafa Hosseini (mostafah@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.
*
*
*/
function Test()
{
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
var iCalLibComponent = Components.classes["@mozilla.org/ical;1"].createInstance();
this.iCalLib = iCalLibComponent.QueryInterface(Components.interfaces.oeIICal);
this.iCalLib.SetServer( "/home/mostafah/calendar" );
this.iCalLib.Test();
}
function TestAddEvent()
{
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
var iCalLibComponent = Components.classes["@mozilla.org/ical;1"].createInstance();
this.iCalLib = iCalLibComponent.QueryInterface(Components.interfaces.oeIICal);
var iCalLibEvent = Components.classes["@mozilla.org/icalevent;1"].createInstance();
this.iCalLibEvent = iCalLibEvent.QueryInterface(Components.interfaces.oeIICalEvent);
this.iCalLib.SetServer( "/home/mostafah/calendar" );
iCalLibEvent.Title = "Lunch Time";
iCalLibEvent.Description = "Will be out for one hour";
iCalLibEvent.Location = "Restaurant";
iCalLibEvent.Category = "Personal";
iCalLibEvent.PrivateEvent = false;
iCalLibEvent.AllDay = true;
iCalLibEvent.AlarmLength = 55;
iCalLibEvent.Alarm = true;
// iCalLibEvent.AlarmWentOff = false;
iCalLibEvent.AlarmEmailAddress = "mostafah@oeone.com";
iCalLibEvent.InviteEmailAddress = "mostafah@oeone.com";
iCalLibEvent.SnoozeTime = "5";
iCalLibEvent.RecurType = 3;
iCalLibEvent.RecurInterval = 7;
iCalLibEvent.RepeatUnits = "days";
iCalLibEvent.RepeatForever = true;
iCalLibEvent.SetStartDate( 2001, 9, 22, 12, 24 );
iCalLibEvent.SetEndDate( 2001, 9, 22, 13, 24 );
iCalLibEvent.SetRecurInfo( 1, 1, 2002, 9, 21 );
// iCalLibEvent.SetAlarm( 2001, 9, 21, 12, 26 );
var id = this.iCalLib.AddEvent( iCalLibEvent );
// alert( "Id:"+id );
// alert( "Title:"+iCalLibEvent.Title );
// alert( "Description:"+iCalLibEvent.Description );
// alert( "Location:"+iCalLibEvent.Location );
// alert( "Category:"+iCalLibEvent.Category );
// alert( "IsPrivate:"+iCalLibEvent.PrivateEvent );
// alert( "AllDay:"+iCalLibEvent.AllDay );
// alert( "Alarm:"+iCalLibEvent.Alarm );
// alert( "AlarmWentOff:"+iCalLibEvent.AlarmWentOff );
// alert( "AlarmLength:"+iCalLibEvent.AlarmLength );
// alert( "AlarmEmailAddress:"+iCalLibEvent.AlarmEmailAddress );
// alert( "InviteEmailAddress:"+iCalLibEvent.InviteEmailAddress );
// alert( "SnoozeTime:"+iCalLibEvent.SnoozeTime );
// alert( "RecurType:"+iCalLibEvent.RecurType );
// alert( "RecurInterval:"+iCalLibEvent.RecurInterval );
// alert( "RepeatUnits:"+iCalLibEvent.RepeatUnits );
// alert( "RepeatForever:"+iCalLibEvent.RepeatForever );
// alert( "StartDate:"+iCalLibEvent.GetStartDate() );
// alert( "EndDate:"+iCalLibEvent.GetEndDate() );
// alert( "EndDate:"+iCalLibEvent.GetRecurEndDate() );
// var result = iCalLibEvent.GetNextRecurrence( 2001, 8, 28 );
// alert( result );
return id;
}
function TestFetchEvent( id )
{
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
var iCalLibComponent = Components.classes["@mozilla.org/ical;1"].createInstance();
this.iCalLib = iCalLibComponent.QueryInterface(Components.interfaces.oeIICal);
this.iCalLib.SetServer( "/home/mostafah/calendar" );
var iCalLibEventFetched = iCalLib.FetchEvent( id );
// alert( "Title:"+iCalLibEventFetched.Title );
// alert( "Description:"+iCalLibEventFetched.Description );
// alert( "Location:"+iCalLibEventFetched.Location );
// alert( "Category:"+iCalLibEventFetched.Category );
// alert( "IsPrivate:"+iCalLibEventFetched.PrivateEvent );
// alert( "AllDay:"+iCalLibEventFetched.AllDay );
// alert( "Alarm:"+iCalLibEventFetched.Alarm );
// alert( "AlarmWentOff:"+iCalLibEventFetched.AlarmWentOff );
// alert( "AlarmLength:"+iCalLibEventFetched.AlarmLength );
// alert( "AlarmEmailAddress:"+iCalLibEventFetched.AlarmEmailAddress );
// alert( "InviteEmailAddress:"+iCalLibEventFetched.InviteEmailAddress );
// alert( "SnoozeTime:"+iCalLibEventFetched.SnoozeTime );
// alert( "RecurType:"+iCalLibEventFetched.RecurType );
// alert( "RecurInterval:"+iCalLibEventFetched.RecurInterval );
// alert( "RepeatUnits:"+iCalLibEventFetched.RepeatUnits );
// alert( "RepeatForever:"+iCalLibEventFetched.RepeatForever );
// alert( "StartDate:"+iCalLibEventFetched.GetStartDate() );
// alert( "EndDate:"+iCalLibEventFetched.GetEndDate() );
}
function TestUpdateEvent( iCalLibEvent )
{
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
var iCalLibComponent = Components.classes["@mozilla.org/ical;1"].createInstance();
this.iCalLib = iCalLibComponent.QueryInterface(Components.interfaces.oeIICal);
this.iCalLib.SetServer( "/home/mostafah/calendar" );
iCalLibEvent.Title = "Lunch & Learn";
iCalLibEvent.Location = "Conference Room";
var id = this.iCalLib.UpdateEvent( iCalLibEvent );
// alert( "Id:"+id );
// alert( "Title:"+iCalLibEvent.Title );
// alert( "Description:"+iCalLibEvent.Description );
// alert( "Location:"+iCalLibEvent.Location );
// alert( "Category:"+iCalLibEvent.Category );
// alert( "IsPrivate:"+iCalLibEvent.PrivateEvent );
// alert( "AllDay:"+iCalLibEvent.AllDay );
// alert( "Alarm:"+iCalLibEvent.Alarm );
// alert( "AlarmWentOff:"+iCalLibEvent.AlarmWentOff );
// alert( "AlarmLength:"+iCalLibEvent.AlarmLength );
// alert( "AlarmEmailAddress:"+iCalLibEvent.AlarmEmailAddress );
// alert( "InviteEmailAddress:"+iCalLibEvent.InviteEmailAddress );
// alert( "SnoozeTime:"+iCalLibEvent.SnoozeTime );
// alert( "RecurType:"+iCalLibEvent.RecurType );
// alert( "RecurInterval:"+iCalLibEvent.RecurInterval );
// alert( "RepeatUnits:"+iCalLibEvent.RepeatUnits );
// alert( "RepeatForever:"+iCalLibEvent.RepeatForever );
// alert( "StartDate:"+iCalLibEvent.GetStartDate() );
// alert( "EndDate:"+iCalLibEvent.GetEndDate() );
return id;
}
function TestDeleteEvent( id )
{
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
var iCalLibComponent = Components.classes["@mozilla.org/ical;1"].createInstance();
this.iCalLib = iCalLibComponent.QueryInterface(Components.interfaces.oeIICal);
this.iCalLib.SetServer( "/home/mostafah/calendar" );
iCalLib.DeleteEvent( id );
}
function TestSearchEvent()
{
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
var iCalLibComponent = Components.classes["@mozilla.org/ical;1"].createInstance();
this.iCalLib = iCalLibComponent.QueryInterface(Components.interfaces.oeIICal);
this.iCalLib.SetServer( "/home/mostafah/calendar" );
var result = this.iCalLib.SearchEvent( 2000,01,01,00,00,2002,01,01,00,00 );
result = this.iCalLib.SearchForEvent( "SELECT * FROM VEVENT WHERE CATEGORIES = 'Personal'" );
result = this.iCalLib.SearchAlarm( 2001,9,22,11,30 );
alert( "Result : " + result );
}
function TestAll()
{
var id = TestAddEvent();
var iCalLibEventFetched = TestFetchEvent( id );
id = TestUpdateEvent( iCalLibEvent );
TestSearchEvent();
TestDeleteEvent( id );
}

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

@ -0,0 +1,60 @@
<?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 OEone Corporation are Copyright (C) 2001
- OEone Corporation. All Rights Reserved.
-
- Contributor(s): Mostafa Hosseini (mostafah@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.
-
-
-->
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
<!DOCTYPE window>
<window
id="ICalendar"
title="ICalendar"
orient="vertical"
xmlns:html="http://www.w3.org/1999/xhtml"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<script src="caltst.js"/>
<hbox>
<box align="left">
<button id="test_btn" label="Test1" onclick="Test();"/>
<button id="test2_btn" label="Test2" onclick="TestAll();"/>
</box>
<spring flex="1"/>
</hbox>
</window>

Разница между файлами не показана из-за своего большого размера Загрузить разницу

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

@ -0,0 +1,61 @@
/*
* 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 Corporation.
*
* The Initial Developer of the Original Code is
* OEone Corporation.
* Portions created by OEone Corporation are Copyright (C) 2001
* OEone Corporation. All Rights Reserved.
*
* Contributor(s): Mostafa Hosseini (mostafah@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.
*
*
*/
#include "oeIICal.h"
extern "C" {
#include "ical.h"
}
#define OE_ICALEVENT_CID \
{ 0x31bda500, 0xee5e, 0x4a4a, { 0x9a, 0xb4, 0x7b, 0x4b, 0x3e, 0x87, 0x40, 0x05 } }
#define OE_ICALEVENT_CONTRACTID "@mozilla.org/icalevent;1"
/* oeIcalEvent Header file */
class oeICalEventImpl : public oeIICalEvent
{
public:
NS_DECL_ISUPPORTS
NS_DECL_OEIICALEVENT
icalcomponent *vcalendar;
oeICalEventImpl();
virtual ~oeICalEventImpl();
/* additional members */
};

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

@ -0,0 +1,67 @@
/*
* 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 Corporation.
*
* The Initial Developer of the Original Code is
* OEone Corporation.
* Portions created by OEone Corporation are Copyright (C) 2001
* OEone Corporation. All Rights Reserved.
*
* Contributor(s): Mostafa Hosseini (mostafah@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.
*
*
*/
#include "oeICalImpl.h"
#include "oeICalEventImpl.h"
#include "nsIGenericFactory.h"
NS_GENERIC_FACTORY_CONSTRUCTOR(oeICalImpl);
NS_GENERIC_FACTORY_CONSTRUCTOR(oeICalEventImpl);
static nsModuleComponentInfo pModuleInfo[] =
{
{ "ICal Service",
OE_ICAL_CID,
OE_ICAL_CONTRACTID,
oeICalImplConstructor,
},
{ "ICal Event",
OE_ICALEVENT_CID,
OE_ICALEVENT_CONTRACTID,
oeICalEventImplConstructor,
}
};
NS_IMPL_NSGETMODULE("ICal Component", pModuleInfo)

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

@ -0,0 +1,818 @@
/*
* 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 Corporation.
*
* The Initial Developer of the Original Code is
* OEone Corporation.
* Portions created by OEone Corporation are Copyright (C) 2001
* OEone Corporation. All Rights Reserved.
*
* Contributor(s): Mostafa Hosseini (mostafah@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.
*
*
*/
#include <unistd.h>
#define __cplusplus__ 1
#include "oeICalImpl.h"
#include "oeICalEventImpl.h"
#include "nsMemory.h"
#include "stdlib.h"
extern "C" {
#include "icalss.h"
}
#define MAXEVENTSTRINGSIZE 500
char serveraddr[200]="/var/calendar/mostafah";
char *idliststr; //global string for returning id list strings
void
cc_searched(unsigned long id)
{
char tmp[80];
char *newstr;
sprintf( tmp, "%lu,", id );
if( idliststr == NULL ) {
idliststr = new char[strlen( tmp ) + 1];
strcpy( idliststr, tmp );
} else {
newstr = new char[ strlen( idliststr ) + strlen( tmp ) + 1 ];
sprintf( newstr, "%s%s", idliststr, tmp );
delete idliststr;
idliststr = newstr;
}
}
//////////////////////////////////////////////////
// ICal Factory
//////////////////////////////////////////////////
nsresult
NS_NewICal( oeIICal** inst )
{
NS_PRECONDITION(inst != nsnull, "null ptr");
if (! inst)
return NS_ERROR_NULL_POINTER;
*inst = new oeICalImpl();
if (! *inst)
return NS_ERROR_OUT_OF_MEMORY;
NS_ADDREF(*inst);
return NS_OK;
}
oeICalImpl::oeICalImpl()
{
NS_INIT_REFCNT();
}
oeICalImpl::~oeICalImpl()
{
}
char icalrawcalendarstr[] = "BEGIN:VCALENDAR\n\
BEGIN:VEVENT\n\
UID:900000000\n\
END:VEVENT\n\
END:VCALENDAR\n\
";
/**
* NS_IMPL_ISUPPORTS1 expands to a simple implementation of the nsISupports
* interface. This includes a proper implementation of AddRef, Release,
* and QueryInterface. If this class supported more interfaces than just
* nsISupports,
* you could use NS_IMPL_ADDREF() and NS_IMPL_RELEASE() to take care of the
* simple stuff, but you would have to create QueryInterface on your own.
* nsSampleFactory.cpp is an example of this approach.
* Notice that the second parameter to the macro is the static IID accessor
* method, and NOT the #defined IID.
*/
NS_IMPL_ISUPPORTS1(oeICalImpl, oeIICal);
/**
*
* Test
*
* DESCRIPTION: An exported XPCOM function used by the tester program to make sure
* all main internal functions are working properly
* PARAMETERS:
* None
*
* RETURN
* None
*/
NS_IMETHODIMP
oeICalImpl::Test(void)
{
icalfileset *stream;
icalcomponent *icalcalendar,*icalevent;
struct icaltimetype start, end;
char uidstr[10]="900000000";
stream = icalfileset_new(serveraddr);
assert(stream != 0);
icalcalendar = icalparser_parse_string(icalrawcalendarstr);
assert(icalcalendar != 0);
icalevent = icalcomponent_get_first_component(icalcalendar,ICAL_VEVENT_COMPONENT);
assert(icalevent != 0);
icalproperty *uid = icalproperty_new_uid( uidstr );
icalcomponent_add_property( icalevent, uid );
icalproperty *title = icalproperty_new_summary( "Lunch time" );
icalcomponent_add_property( icalevent, title );
icalproperty *description = icalproperty_new_description( "Will be out for one hour" );
icalcomponent_add_property( icalevent, description );
icalproperty *location = icalproperty_new_location( "Restaurant" );
icalcomponent_add_property( icalevent, location );
icalproperty *category = icalproperty_new_categories( "Personal" );
icalcomponent_add_property( icalevent, category );
icalproperty *classp = icalproperty_new_class( "PRIVATE" );
icalcomponent_add_property( icalevent, classp );
start.year = 2001; start.month = 8; start.day = 15;
start.hour = 12; start.minute = 24; start.second = 0;
start.is_utc = false; start.is_date = false;
end.year = 2001; end.month = 8; end.day = 15;
end.hour = 13; end.minute = 24; end.second = 0;
end.is_utc = false; end.is_date = false;
icalproperty *dtstart = icalproperty_new_dtstart( start );
icalproperty *dtend = icalproperty_new_dtend( end );
icalcomponent_add_property( icalevent, dtstart );
icalcomponent_add_property( icalevent, dtend );
//
icalproperty *xprop = icalproperty_new_x( "TRUE" );
icalparameter *xpar = icalparameter_new_member( "AllDay" ); //NOTE: new_member is used because new_x didn't work
// Better to be changed to new_x when problem is solved
icalproperty_add_parameter( xprop, xpar );
icalcomponent_add_property( icalevent, xprop );
//
xprop = icalproperty_new_x( "FALSE" );
xpar = icalparameter_new_member( "Alarm" );
icalproperty_add_parameter( xprop, xpar );
icalcomponent_add_property( icalevent, xprop );
//
xprop = icalproperty_new_x( "FALSE" );
xpar = icalparameter_new_member( "AlarmWentOff" );
icalproperty_add_parameter( xprop, xpar );
icalcomponent_add_property( icalevent, xprop );
//
xprop = icalproperty_new_x( "5" );
xpar = icalparameter_new_member( "AlarmLength" );
icalproperty_add_parameter( xprop, xpar );
icalcomponent_add_property( icalevent, xprop );
//
xprop = icalproperty_new_x( "mostafah@oeone.com" );
xpar = icalparameter_new_member( "AlarmEmailAddres" );
icalproperty_add_parameter( xprop, xpar );
icalcomponent_add_property( icalevent, xprop );
//
xprop = icalproperty_new_x( "mostafah@oeone.com" );
xpar = icalparameter_new_member( "InviteEmailAddres" );
icalproperty_add_parameter( xprop, xpar );
icalcomponent_add_property( icalevent, xprop );
//
xprop = icalproperty_new_x( "5" );
xpar = icalparameter_new_member( "SnoozeTime" );
icalproperty_add_parameter( xprop, xpar );
icalcomponent_add_property( icalevent, xprop );
//
xprop = icalproperty_new_x( "0" );
xpar = icalparameter_new_member( "RecurType" );
icalproperty_add_parameter( xprop, xpar );
icalcomponent_add_property( icalevent, xprop );
//
xprop = icalproperty_new_x( "0" );
xpar = icalparameter_new_member( "RecurInterval" );
icalproperty_add_parameter( xprop, xpar );
icalcomponent_add_property( icalevent, xprop );
//
xprop = icalproperty_new_x( "days" );
xpar = icalparameter_new_member( "RepeatUnits" );
icalproperty_add_parameter( xprop, xpar );
icalcomponent_add_property( icalevent, xprop );
//
xprop = icalproperty_new_x( "FALSE" );
xpar = icalparameter_new_member( "RepeatForever" );
icalproperty_add_parameter( xprop, xpar );
icalcomponent_add_property( icalevent, xprop );
//
icalfileset_add_component(stream,icalcalendar);
icalfileset_commit(stream);
printf("Appended Event\n");
icalcomponent *fetchedcal = icalfileset_fetch( stream, uidstr );
assert( fetchedcal != 0 );
icalcomponent *fetchedevent = icalcomponent_get_first_component( fetchedcal,ICAL_VEVENT_COMPONENT);
assert( fetchedevent != 0 );
printf("Fetched Event\n");
icalproperty *tmpprop;
//
tmpprop = icalcomponent_get_first_property( fetchedevent, ICAL_UID_PROPERTY );
assert( tmpprop != 0 );
printf("id: %s\n", icalproperty_get_value_as_string( tmpprop ) );
//
tmpprop = icalcomponent_get_first_property( fetchedevent, ICAL_SUMMARY_PROPERTY );
assert( tmpprop != 0 );
printf("Title: %s\n", icalproperty_get_value_as_string( tmpprop ) );
//
tmpprop = icalcomponent_get_first_property( fetchedevent, ICAL_CATEGORIES_PROPERTY );
assert( tmpprop != 0 );
printf("Category: %s\n", icalproperty_get_value_as_string( tmpprop ) );
//
tmpprop = icalcomponent_get_first_property( fetchedevent, ICAL_DESCRIPTION_PROPERTY );
assert( tmpprop != 0 );
printf("Description: %s\n", icalproperty_get_value_as_string( tmpprop ) );
//
tmpprop = icalcomponent_get_first_property( fetchedevent, ICAL_LOCATION_PROPERTY );
assert( tmpprop != 0 );
printf("Location: %s\n", icalproperty_get_value_as_string( tmpprop ) );
//
tmpprop = icalcomponent_get_first_property( fetchedevent, ICAL_CLASS_PROPERTY );
assert( tmpprop != 0 );
printf("Class: %s\n", icalproperty_get_value_as_string( tmpprop ) );
//
tmpprop = icalcomponent_get_first_property( fetchedevent, ICAL_DTSTART_PROPERTY );
assert( tmpprop != 0 );
start = icalproperty_get_dtstart( tmpprop );
printf("Start: %d-%d-%d %d:%d\n", start.year, start.month, start.day, start.hour, start.minute );
//
tmpprop = icalcomponent_get_first_property( fetchedevent, ICAL_DTEND_PROPERTY );
assert( tmpprop != 0 );
end = icalproperty_get_dtstart( tmpprop );
printf("End: %d-%d-%d %d:%d\n", end.year, end.month, end.day, end.hour, end.minute );
//
for( tmpprop = icalcomponent_get_first_property( fetchedevent, ICAL_X_PROPERTY );
tmpprop != 0 ;
tmpprop = icalcomponent_get_next_property( fetchedevent, ICAL_X_PROPERTY ) ) {
icalparameter *tmppar = icalproperty_get_first_parameter( tmpprop, ICAL_MEMBER_PARAMETER );
printf("%s: %s\n", icalparameter_get_member( tmppar ), icalproperty_get_value_as_string( tmpprop ) );
}
icalcomponent *newcomp = icalcomponent_new_clone( fetchedcal );
assert( newcomp != 0 );
icalcomponent *newevent = icalcomponent_get_first_component( newcomp, ICAL_VEVENT_COMPONENT );
assert( newevent != 0 );
tmpprop = icalcomponent_get_first_property( newevent, ICAL_SUMMARY_PROPERTY );
assert( tmpprop != 0 );
icalproperty_set_summary( tmpprop, "LUNCH AND LEARN TIME" );
// icalfileset_modify( stream, fetchedcal, newcomp );
icalfileset_remove_component( stream, fetchedcal );
icalfileset_add_component( stream, newcomp );
icalcomponent_free( fetchedcal );
//
icalfileset_commit(stream);
printf("Event updated\n");
printf( "New Title: %s\n", icalproperty_get_value_as_string( tmpprop ) );
fetchedcal = icalfileset_fetch( stream, uidstr );
assert( fetchedcal != 0 );
icalfileset_remove_component( stream, fetchedcal );
printf("Removed Event\n");
icalfileset_free(stream);
return NS_OK;
}
/**
*
* SetServer
*
* DESCRIPTION: Sets the Calendar address string of the server.
* PARAMETERS:
* str - The calendar address string
*
* RETURN
* None
*/
NS_IMETHODIMP
oeICalImpl::SetServer( const char *str ) {
#ifdef ICAL_DEBUG
printf( "SetServer()\n" );
#endif
strcpy( serveraddr, str );
return NS_OK;
}
/**
*
* AddEvent
*
* DESCRIPTION: Adds an event
*
* PARAMETERS:
* icalcalendar - The XPCOM component representing an event
* retid - Place to store the returned id
*
* RETURN
* None
*/
NS_IMETHODIMP oeICalImpl::AddEvent(oeIICalEvent *icalcalendar, PRInt32 *retid)
{
#ifdef ICAL_DEBUG
printf( "AddEvent()\n" );
#endif
unsigned long id;
icalfileset *stream;
icalcomponent *vcalendar,*fetchedcal;
char uidstr[10];
*retid = 0;
stream = icalfileset_new(serveraddr);
assert(stream != 0);
vcalendar = ((oeICalEventImpl *)icalcalendar)->vcalendar;
icalcomponent *vevent = icalcomponent_get_first_component( vcalendar, ICAL_VEVENT_COMPONENT );
assert( vevent != 0);
icalproperty *uid = icalcomponent_get_first_property( vevent, ICAL_UID_PROPERTY );
assert( uid != 0);
do {
id = 900000000 + ((rand()%0x4ff) << 16) + rand()%0xFFFF;
sprintf( uidstr, "%lu", id );
} while ( (fetchedcal = icalfileset_fetch( stream, uidstr )) != 0 );
icalproperty_set_uid( uid, uidstr );
icalcomponent *vcalclone = icalcomponent_new_clone( vcalendar );
assert(vcalclone != 0);
icalfileset_add_component( stream, vcalclone );
*retid = id;
icalfileset_commit( stream );
icalfileset_free( stream );
return NS_OK;
}
/**
*
* UpdateEvent
*
* DESCRIPTION: Updates an event
*
* PARAMETERS:
* icalcalendar - The XPCOM component representing an event
* retid - Place to store the returned id
*
* RETURN
* None
*/
NS_IMETHODIMP oeICalImpl::UpdateEvent(oeIICalEvent *icalcalendar, PRInt32 *retid)
{
#ifdef ICAL_DEBUG
printf( "UpdateEvent()\n" );
#endif
unsigned long id;
icalfileset *stream;
icalcomponent *vcalendar,*vcalclone;
char uidstr[10];
stream = icalfileset_new(serveraddr);
assert(stream != 0);
vcalendar = ((oeICalEventImpl *)icalcalendar)->vcalendar;
icalcomponent *vevent = icalcomponent_get_first_component( vcalendar, ICAL_VEVENT_COMPONENT );
assert( vevent != 0);
icalproperty *prop = icalcomponent_get_first_property( vevent, ICAL_UID_PROPERTY );
assert( prop != 0);
id = atol( icalproperty_get_value_as_string( prop ) );
sprintf( uidstr, "%lu", id );
icalcomponent *fetchedcal = icalfileset_fetch( stream, uidstr );
if( fetchedcal ) {
icalfileset_remove_component( stream, fetchedcal );
icalcomponent_free( fetchedcal );
}
vcalclone = icalcomponent_new_clone( vcalendar );
icalfileset_add_component( stream, vcalclone );
*retid = id;
icalfileset_commit( stream );
icalfileset_free(stream);
return NS_OK;
}
/**
*
* FetchEvent
*
* DESCRIPTION: Fetches an event
*
* PARAMETERS:
* ev - Place to store the XPCOM representation of the fetched event
* id - Id of the event to fetch
*
* RETURN
* None
*/
NS_IMETHODIMP oeICalImpl::FetchEvent(PRInt32 id, oeIICalEvent **ev)
{
#ifdef ICAL_DEBUG
printf( "FetchEvent()\n" );
#endif
icalfileset *stream;
char uidstr[10];
stream = icalfileset_new(serveraddr);
assert(stream != 0);
sprintf( uidstr, "%lu", id );
nsresult rv;
oeICalEventImpl *icalevent;
if( NS_FAILED( rv = NS_NewICalEvent((oeIICalEvent**) &icalevent ))) {
*ev = NULL;
return rv;
}
icalcomponent_free( icalevent->vcalendar );
icalcomponent *tmpcomp = icalfileset_fetch( stream, uidstr );
if( tmpcomp == 0 ) {
printf("FetchEvent() failed\n");
*ev = NULL;
return NS_OK;
}
icalevent->vcalendar = icalcomponent_new_clone( tmpcomp );
*ev = icalevent;
icalfileset_free(stream);
return NS_OK;
}
/**
*
* SearchEvent
*
* DESCRIPTION: Searches for events
*
* PARAMETERS:
* startstr - String representation of the start date-time
* endstr - String representation of the end date-time
* resultstr - Place to store the string representation of the id list
*
* RETURN
* None
*/
NS_IMETHODIMP
oeICalImpl::SearchEvent( PRInt16 startyear, PRInt16 startmonth, PRInt16 startday,
PRInt16 starthour, PRInt16 startmin,
PRInt16 endyear, PRInt16 endmonth, PRInt16 endday,
PRInt16 endhour, PRInt16 endmin,
char **resultstr )
{
#ifdef ICAL_DEBUG
printf( "SearchEvent()\n" );
#endif
icalgauge* gauge;
char sqlstr[200];
icalfileset *stream;
idliststr = NULL;
stream = icalfileset_new(serveraddr);
assert(stream != 0);
sprintf( sqlstr, "SELECT * FROM VEVENT WHERE DTSTART >= '%04d%02d%02dT%02d%02d00' and DTEND < '%04d%02d%02dT%02d%02d00'",
startyear,startmonth,startday,starthour,startmin,
endyear,endmonth,endday,endhour,endmin );
gauge = icalgauge_new_from_sql( sqlstr );
assert( gauge != 0 );
icalfileset_select( stream, gauge );
icalcomponent *comp;
for( comp = icalfileset_get_first_component( stream );
comp != 0;
comp = icalfileset_get_next_component( stream ) ) {
icalcomponent *vevent = icalcomponent_get_first_component( comp, ICAL_VEVENT_COMPONENT );
assert( vevent != 0);
icalproperty *prop = icalcomponent_get_first_property( vevent, ICAL_UID_PROPERTY );
assert( prop != 0);
cc_searched( atol( icalproperty_get_value_as_string( prop ) ) );
}
*resultstr = idliststr;
icalfileset_free(stream);
return NS_OK;
}
NS_IMETHODIMP
oeICalImpl::SearchForEvent( const char *sqlstr, char **resultstr )
{
#ifdef ICAL_DEBUG
printf( "SearchForEvent()\n" );
#endif
icalgauge* gauge;
icalfileset *stream;
idliststr = NULL;
stream = icalfileset_new(serveraddr);
assert(stream != 0);
gauge = icalgauge_new_from_sql( (char *)sqlstr );
assert( gauge != 0 );
icalfileset_select( stream, gauge );
icalcomponent *comp;
for( comp = icalfileset_get_first_component( stream );
comp != 0;
comp = icalfileset_get_next_component( stream ) ) {
icalcomponent *vevent = icalcomponent_get_first_component( comp, ICAL_VEVENT_COMPONENT );
assert( vevent != 0);
icalproperty *prop = icalcomponent_get_first_property( vevent, ICAL_UID_PROPERTY );
assert( prop != 0);
cc_searched( atol( icalproperty_get_value_as_string( prop ) ) );
}
*resultstr = idliststr;
icalfileset_free(stream);
return NS_OK;
}
/**
*
* DeleteEvent
*
* DESCRIPTION: Deletes an event
*
* PARAMETERS:
* id - Id of the event to delete
*
* RETURN
* None
*/
NS_IMETHODIMP
oeICalImpl::DeleteEvent( PRInt32 id )
{
#ifdef ICAL_DEBUG
printf( "DeleteEvent()\n" );
#endif
icalfileset *stream;
char uidstr[10];
stream = icalfileset_new(serveraddr);
assert(stream != 0);
sprintf( uidstr, "%lu", id );
icalcomponent *fetchedcal = icalfileset_fetch( stream, uidstr );
if( fetchedcal == 0 ) {
icalfileset_free(stream);
return NS_OK;
}
icalfileset_remove_component( stream, fetchedcal );
icalcomponent_free( fetchedcal );
icalfileset_commit( stream );
icalfileset_free(stream);
return NS_OK;
}
/**
*
* SnoozeEvent
*
* DESCRIPTION: Deactivates an alarm of an event
*
* PARAMETERS:
* id - Id of the event to deactivet its alarm
*
* RETURN
* None
*/
NS_IMETHODIMP
oeICalImpl::SnoozeEvent( PRInt32 id )
{
/* cal_open(serveraddr, 0);
if( 0 ) {
printf("cal_open() failed - SnoozeEvent\n");
return 0;
}
if (!cal_snooze(id)) {
printf("cal_snooze() failed\n");
return 0;
}
cal_close(0);
if ( 0 ) {
printf("cal_close() failed\n");
return 0;
}
*/
return NS_OK;
}
void GetNextRecurrence( icalcomponent *vevent, PRInt16 year, PRInt16 month, PRInt16 day, struct icaldurationtype before, char *aRetVal ) {
struct icaltimetype start, estart, next;
struct icalrecurrencetype recur;
icalrecur_iterator* ritr;
start.year = year; start.month = month; start.day = day;
start.hour = 0; start.minute = 0; start.second = 0;
icalproperty *dtstart = icalcomponent_get_first_property( vevent, ICAL_DTSTART_PROPERTY );
if( dtstart != 0 ) {
estart = icalproperty_get_dtstart( dtstart );
start.hour = estart.hour; start.minute = estart.minute; start.second = estart.second;
}
aRetVal[0]= 0;
icalproperty *prop = icalcomponent_get_first_property( vevent, ICAL_RRULE_PROPERTY );
if ( prop != 0) {
recur = icalproperty_get_rrule(prop);
ritr = icalrecur_iterator_new(recur,estart);
for(next = icalrecur_iterator_next(ritr);
!icaltime_is_null_time(next);
next = icalrecur_iterator_next(ritr)){
struct icaltimetype tmpnext = icaltime_add( next, before );
if( icaltime_compare( tmpnext , start ) >= 0 ) {
sprintf( aRetVal, "%04d%02d%02dT%02d%02d%02d" , next.year, next.month, next.day, next.hour, next.minute, next.second );
break;
}
}
}
}
/**
*
* SearchAlarm
*
* DESCRIPTION: Searches for events having active alarms
*
* PARAMETERS:
* whenstr - String representation of the date-time reference of the alarm
* resultstr - Place to store the string representation of the id list
*
* RETURN
* None
*/
NS_IMETHODIMP
oeICalImpl::SearchAlarm( PRInt16 startyear, PRInt16 startmonth, PRInt16 startday,
PRInt16 starthour, PRInt16 startmin,
char **resultstr )
{
#ifdef ICAL_DEBUG
printf( "SearchAlarm()\n" );
#endif
icalfileset *stream;
icaltimetype check,checkend;
icaldurationtype checkduration;
icalproperty *prop;
idliststr = NULL;
check.year = startyear; check.month = startmonth; check.day = startday;
check.hour = starthour; check.minute = startmin; check.second = 0;
printf( "CHECK: %d-%d-%d %d:%d:%d\n", check.year, check.month, check.day, check.hour, check.minute, check.second );
checkduration.is_neg = false;
checkduration.weeks = checkduration.days = checkduration.minutes = checkduration.seconds = 0;
checkduration.hours = 24;
checkend = icaltime_add( check, checkduration );
printf( "CHECKEND: %d-%d-%d %d:%d:%d\n", checkend.year, checkend.month, checkend.day, checkend.hour, checkend.minute, checkend.second );
stream = icalfileset_new(serveraddr);
assert(stream != 0);
icalcomponent *comp;
for( comp = icalfileset_get_first_component( stream );
comp != 0;
comp = icalfileset_get_next_component( stream ) ) {
icalcomponent *vevent = icalcomponent_get_first_component( comp, ICAL_VEVENT_COMPONENT );
assert( vevent != 0);
icalcomponent *valarm = icalcomponent_get_first_component( vevent, ICAL_VALARM_COMPONENT );
if( valarm ){
struct icaltimetype start;
//get duration
prop = icalcomponent_get_first_property( valarm, ICAL_TRIGGER_PROPERTY );
assert( prop != 0);
struct icaltriggertype trig;
trig = icalproperty_get_trigger( prop );
prop = icalcomponent_get_first_property( vevent, ICAL_RRULE_PROPERTY );
if ( prop != 0) {
char result[80];
GetNextRecurrence( vevent, check.year, check.month, check.day , trig.duration, result );
start = icaltime_from_string( result );
printf( "RECUR START: %d-%d-%d %d:%d:%d\n", start.year, start.month, start.day, start.hour, start.minute, start.second );
} else {
//get dtstart
prop = icalcomponent_get_first_property( vevent, ICAL_DTSTART_PROPERTY );
assert( prop != 0);
start = icalproperty_get_dtstart( prop );
printf( "START: %d-%d-%d %d:%d:%d\n", start.year, start.month, start.day, start.hour, start.minute, start.second );
}
start = icaltime_add( start, trig.duration );
printf( "TRIGGER: %d-%d-%d %d:%d:%d\n", start.year, start.month, start.day, start.hour, start.minute, start.second );
if( icaltime_compare( start, check ) >= 0 && icaltime_compare( start, checkend ) < 0 ) {
prop = icalcomponent_get_first_property( vevent, ICAL_UID_PROPERTY );
assert( prop != 0);
cc_searched( atol( icalproperty_get_value_as_string( prop ) ) );
}
}
}
*resultstr = idliststr;
icalfileset_free(stream);
return NS_OK;
}

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

@ -0,0 +1,72 @@
/*
* 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 Corporation.
*
* The Initial Developer of the Original Code is
* OEone Corporation.
* Portions created by OEone Corporation are Copyright (C) 2001
* OEone Corporation. All Rights Reserved.
*
* Contributor(s): Mostafa Hosseini (mostafah@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.
*
*
*/
#include "oeIICal.h"
#define OE_ICAL_CID \
{ 0x0a8c5de7, 0x0d19, 0x4b95, { 0x82, 0xf4, 0xe0, 0xaf, 0x92, 0x45, 0x32, 0x27 } }
#define OE_ICAL_CONTRACTID "@mozilla.org/ical;1"
class oeICalImpl : public oeIICal
{
public:
oeICalImpl();
virtual ~oeICalImpl();
/**
* This macro expands into a declaration of the nsISupports interface.
* Every XPCOM component needs to implement nsISupports, as it acts
* as the gateway to other interfaces this component implements. You
* could manually declare QueryInterface, AddRef, and Release instead
* of using this macro, but why?
*/
// nsISupports interface
NS_DECL_ISUPPORTS
/**
* This macro is defined in the nsISample.h file, and is generated
* automatically by the xpidl compiler. It expands to
* declarations of all of the methods required to implement the
* interface. xpidl will generate a NS_DECL_[INTERFACENAME] macro
* for each interface that it processes.
*
* The methods of nsISample are discussed individually below, but
* commented out (because this macro already defines them.)
*/
NS_DECL_OEIICAL
};

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

@ -0,0 +1,107 @@
/*
* 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 Corporation.
*
* The Initial Developer of the Original Code is
* OEone Corporation.
* Portions created by OEone Corporation are Copyright (C) 2001
* OEone Corporation. All Rights Reserved.
*
* Contributor(s): Mostafa Hosseini (mostafah@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.
*
*
*/
#include "nsISupports.idl"
/**
* The uuid is a unique number identifying the interface normally
* called IID. It can be generated as follows:
*
* Windows: guidgen.exe
* Unix: uuidgen which comes with e2fsprogs package
* Mac: ???
* All platform: Using irc, connect to irc.mozilla.org and type in
* /join #mozilla
* /msg mozbot uuid
*
*/
[scriptable, uuid(89c5cd5a-af2d-45e6-83c7-2f2420a13626)]
interface oeIICalEvent : nsISupports
{
attribute unsigned long Id;
attribute string Title;
attribute string Description;
attribute string Location;
attribute string Category;
attribute boolean PrivateEvent;
attribute boolean AllDay;
attribute boolean Alarm;
// attribute boolean AlarmWentOff;
attribute unsigned long AlarmLength;
attribute string AlarmEmailAddress;
attribute string InviteEmailAddress;
attribute string SnoozeTime;
attribute short RecurType;
attribute unsigned long RecurInterval;
attribute string RepeatUnits;
attribute boolean RepeatForever;
void SetStartDate( in short year, in short month, in short day, in short hour, in short min);
void SetEndDate( in short year, in short month, in short day, in short hour, in short min);
void SetRecurInfo( in short type, in unsigned long interval, in short endyear, in short endmonth, in short endday);
string GetNextRecurrence( in short year, in short month, in short day );
string GetRecurEndDate();
string GetStartDate();
string GetEndDate();
// void SetAlarm(in short year, in short month, in short day, in short hour, in short min);
};
[scriptable, uuid(981ab93d-ad51-45bb-a4a2-e158c2cfdeb4)]
interface oeIICal : nsISupports
{
void Test();
long AddEvent( in oeIICalEvent icalevent );
void DeleteEvent( in long id );
oeIICalEvent FetchEvent( in long id );
void SnoozeEvent( in long id );
string SearchAlarm( in short year, in short month, in short day,
in short hour, in short min );
string SearchEvent( in short styear, in short stmonth, in short stday,
in short sthour, in short stmin,
in short endyear, in short endmonth, in short endday,
in short endhour, in short endmin );
void SetServer( in string str );
long UpdateEvent( in oeIICalEvent icalevent );
string SearchForEvent( in string sqlstr );
};
%{ C++
extern nsresult
NS_NewICal(oeIICal** inst);
extern nsresult
NS_NewICalEvent(oeIICalEvent** inst);
%}

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

@ -0,0 +1,18 @@
Easy Install Instructions:
1) Install a clean copy of Mozilla 0.9.5.
1b) If you have a copy of Mozilla 0.9.5, ensure you last had the modern skin running. Or, if you've just installed it, run with Modern.
If you can install RPMS:
2) Install the libical RPM as root.
Otherwise:
2) Download http://www.softwarestudio.org/download/libical-0.23.tar.gz , untar and run make / make install
3) Unzip the calendar zip somewhere sensible. You'll need to keep the files around wherever you put them.
4) Edit the MOZ_PATH variable in the "calendar" and "setupcalendar" scripts to point to your 0.9.5 directory.
5) From the calendar directory, run ./setupcalendar.
6) Edit the file content/penglobal/penroot.js and change "/home/mikep" to your home directory.
7) Run ./calendar to run the calendar.
Head to irc.mozilla.org #calendar to talk about any problems you encounter.

24
calendar/resources/README Normal file
Просмотреть файл

@ -0,0 +1,24 @@
Mozilla Calendar README
-----------------------
This file is meant to inform you about the status of files in this calendar tarball.
This calendar, although functional, should not be considered fully functional and instead should be thought of only as an idea of what the calendar can do.
Directory Explanation:
content/ - This directory contains all the XUL and JS files needed for the calendar.
/penglobal - This directory contains files that are needed to run the calendar. It is hoped that these files will all be removed at some point, once the calendar is integrated with Mozilla.
/test - Test files for the calendar. These are not needed to run it.
docs/ - A start on documentation for the calendar.
libxpical/ - An XPCOM interface to the libical library. This is needed to retreive and write calendar information to a file.
locale/ - Where the text for the calendar should end up, as well as definitions for dates and date formats.
en-US/
penglobal/ - Contains text for items not related to the calendar directly. The files in this directory should be integrated into the calendar or removed once we have integrated with Mozilla.
skin/ - Graphics and CSS files defining the look of the calendar.
modern/
ca-event-dialog/ - Graphics and CSS files for the dialog which adds and edits events.
penglobal/ - Graphics and CSS files for items in the calendar which will be integrated into Mozilla later.

49
calendar/resources/calendar Executable file
Просмотреть файл

@ -0,0 +1,49 @@
#!/bin/sh
#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 OEone Corporation are Copyright (C) 2001
#OEone Corporation. All Rights Reserved.
#
#Contributor(s): 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.
MOZ_PATH=/usr/local/mozilla0.9.5
CHROME_PATH=chrome://calendar/content/calendar.xul
CUR_USER=`whoami`;
# Check for a valid user (Root is not allowed to run this script)
if [ "$CUR_USER" = "root" ]; then
# logger -s "This script cannot be run as root"
echo "This script cannot be run as root"
exit 0
fi
$MOZ_PATH/mozilla -jsconsole -chrome $CHROME_PATH

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

@ -0,0 +1,116 @@
/*
* 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 Corporation.
*
* The Initial Developer of the Original Code is
* OEone Corporation.
* Portions created by OEone Corporation are Copyright (C) 2001
* OEone Corporation. All Rights Reserved.
*
* Contributor(s): Garth Smedley (garths@oeone.com) , Mike Potter (mikep@oeone.com)
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
*
*/
var gCalendarEvent = null;
function onLoad()
{
gCalendarEvent = window.arguments[0];
createAlarmText( gCalendarEvent );
setupOkCancelButtons( onOkButton, 0 );
window.resizeTo( 455, 150 );
}
function createAlarmText( )
{
var Text = opener.penapplication.username+" has an event titled "+gCalendarEvent.title;
var TextBox = document.getElementById( "event-message-box" );
var HtmlInBox = document.createElement( "html" );
var TextInBox = document.createTextNode( Text );
HtmlInBox.appendChild( TextInBox );
TextBox.appendChild( HtmlInBox );
var Text = " at "+gCalendarEvent.start;
var TextBox = document.getElementById( "event-message-time-box" );
var HtmlInBox = document.createElement( "html" );
var TextInBox = document.createTextNode( Text );
HtmlInBox.appendChild( TextInBox );
TextBox.appendChild( HtmlInBox );
}
function onOkButton( )
{
var RemindCheckbox = document.getElementById( "remind-again-checkbox" );
if ( RemindCheckbox.getAttribute( "checked" ) == "true" )
{
snoozeAlarm();
}
else
{
acknowledgeAlarm();
}
return( true );
}
function acknowledgeAlarm( )
{
gCalendarEvent.alarmWentOff = true;
gCalendarEvent.snoozeTime = false;
//opener.gEventSource.modifyEvent( gCalendarEvent );
pendialog.getRoot().Root.gCalendarEventDataSource.respondAcknowledgeAlarm( gCalendarEvent );
return( true );
}
function snoozeAlarm( )
{
gCalendarEvent.alarmWentOff = true;
var nowMS = new Date().getTime();
var minutesToSnooze = document.getElementById( "dialog-alarm-minutes" ).getAttribute( "value" );
var snoozeTime = nowMS + ( 1000 * minutesToSnooze * 60 );
snoozeTime = parseInt( snoozeTime );
//alert( snoozeTime );
gCalendarEvent.snoozeTime = snoozeTime;
gCalendarEvent.setUpAlarmTimer( this );
//opener.gEventSource.modifyEvent( gCalendarEvent );
pendialog.getRoot().Root.gCalendarEventDataSource.respondAcknowledgeAlarm( gCalendarEvent );
return( true );
}

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

@ -0,0 +1,123 @@
<?xml version="1.0"?>
<!--
- 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 OEone Corporation are Copyright (C) 2001
- OEone Corporation. All Rights Reserved.
-
- Contributor(s): Garth Smedley (garths@oeone.com), Mike Potter (mikep@oeone.com)
-
- Alternatively, the contents of this file may be used under the terms of
- either the GNU General Public License Version 2 or later (the "GPL"), or
- the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- in which case the provisions of the GPL or the LGPL are applicable instead
- of those above. If you wish to allow use of your version of this file only
- under the terms of either the GPL or the LGPL, and not to allow others to
- use your version of this file under the terms of the MPL, indicate your
- decision by deleting the provisions above and replace them with the notice
- and other provisions required by the 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.
-
- -->
<?xml-stylesheet href="chrome://global/skin/global.css" type="text/css"?>
<?xul-overlay href="chrome://penglobal/content/dialogOverlay.xul"?>
<?xul-overlay href="chrome://penglobal/content/datepicker-overlay.xul"?>
<?xul-overlay href="chrome://penglobal/content/timepicker-overlay.xul"?>
<!-- CSS File with all styles specific to the dialog -->
<?xml-stylesheet href="chrome://calendar/skin/ca-event-dialog.css" ?>
<!-- DTD File with all strings specific to the calendar -->
<!DOCTYPE window
[
<!ENTITY % dtd1 SYSTEM "chrome://penglobal/locale/global.dtd" > %dtd1;
<!ENTITY % dtd2 SYSTEM "chrome://calendar/locale/calendar.dtd" > %dtd2;
]>
<window
id="calendar-new-eventwindow"
title="Internet Appliance Dialog - Calendar Alarm"
orient="vertical"
onload="onLoad()"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<!-- Javascript includes -->
<script type="application/x-javascript" src="chrome://global/content/strres.js"/>
<script type="application/x-javascript" src="chrome://penglobal/content/dateUtils.js"/>
<script type="application/x-javascript" src="chrome://calendar/content/ca-event-alert-dialog.js"/>
<!-- Picker popups -->
<popupset>
<popup id="oe-date-picker-popup" popupalign="topleft" oncommand="onDatePick( this )" label="">
</popup>
<popup id="oe-time-picker-popup" popupalign="topleft" oncommand="onTimePick( this )" label="">
</popup>
</popupset>
<!-- The dialog -->
<!-- dialog-box: from dialogOverlay.xul -->
<vbox id="dialog-box">
<!-- standard-dialog-title: from dialogOverlay.xul -->
<box id="standard-dialog-title">
<spring flex="1"/>
<image id="standar-dialog-title-icon"/>
<box id="standard-dialog-title-text-box">
<label id="standard-dialog-title-text" value="&event.title.alarm;"/>
</box>
<spring flex="1"/>
</box>
<!-- standard-dialog-tips: from dialogOverlay.xul Proper tip is shown in on load code-->
<box id="standard-dialog-tips">
<html id="tip-new">&event.tip.alert;</html>
</box>
<!-- standard-dialog-content: from dialogOverlay.xul -->
<vbox id="standard-dialog-content">
<box flex="1" id="event-message-box"/>
<box flex="1" id="event-message-time-box"/>
<!-- <spring flex="1"/> -->
<box id="alarm-dialog-content" collapsed="true">
<checkbox id="remind-again-checkbox"/>
<html>&event.alarm.checkbox.label;</html>
<textbox id="dialog-alarm-minutes" value="5" size="4" maxlength="2"/>
<label for="dialog-alarm-minutes" value="Minutes"/>
</box>
<box>
<spring flex="1"/>
<button id="dialog-btn-yes" label="Ok" default="true" oncommand="doOKButton();"/>
</box>
</vbox>
<!-- standard-dialog-content -->
</vbox> <!-- dialog-box -->
</window>

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

@ -0,0 +1,867 @@
/*
* 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 Corporation.
*
* The Initial Developer of the Original Code is
* OEone Corporation.
* Portions created by OEone Corporation are Copyright (C) 2001
* OEone Corporation. All Rights Reserved.
*
* Contributor(s): Garth Smedley (garths@oeone.com) , Mike Potter (mikep@oeone.com)
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
*
*/
/***** calendar/ca-event-dialog
* AUTHOR
* Garth Smedley
* REQUIRED INCLUDES
* <script type="application/x-javascript" src="chrome://penglobal/content/dateUtils.js"/>
* <script type="application/x-javascript" src="chrome://penglobal/content/calendarEvent.js"/>
*
* NOTES
* Code for the calendar's new/edit event dialog.
*
* Invoke this dialog to create a new event as follows:
var args = new Object();
args.mode = "new"; // "new" or "edit"
args.onOk = <function>; // funtion to call when OK is clicked
args.calendarEvent = calendarEvent; // newly creatd calendar event to be editted
calendar.openDialog("caNewEvent", "chrome://calendar/content/ca-event-dialog.xul", true, args );
*
* Invoke this dialog to edit an existing event as follows:
*
var args = new Object();
args.mode = "edit"; // "new" or "edit"
args.onOk = <function>; // funtion to call when OK is clicked
args.calendarEvent = calendarEvent; // javascript object containin the event to be editted
calendar.openDialog("caEditEvent", "chrome://calendar/content/ca-event-dialog.xul", true, args );
* 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 gDateFormatter = new DateFormater(); // used to format dates and times
var gEvent; // event being edited
var gOnOkFunction; // function to be called when user clicks OK
var gChangeEndTime = true; //
var gTimeDifference = 3600000; //when editing an event, we change the end time if the start time is changing. This is the difference for the event time.
var 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 loadCalendarEventDialog()
{
// Get arguments, see description at top of file
var args = window.arguments[0];
gMode = args.mode;
gCategoryManager = args.CategoryManager;
// remember function to call when OK is clicked
gOnOkFunction = args.onOk;
gEvent = args.calendarEvent;
// mode is "new or "edit"
// show proper header
if( "new" == args.mode )
{
var titleDataItem = document.getElementById( "data-event-title-new" );
}
else
{
var titleDataItem = document.getElementById( "data-event-title-edit" );
}
var titleString = titleDataItem.getAttribute( "value" );
var headerTitleItem = document.getElementById( "standard-dialog-title-text" );
headerTitleItem.setAttribute( "value" , titleString );
// show proper tip
var tipNewItem = document.getElementById( "tip-new" );
var tipEditItem = document.getElementById( "tip-edit" );
if( "new" == args.mode )
{
tipNewItem.setAttribute( "collapsed", "false" );
tipEditItem.setAttribute( "collapsed", "true" );
}
else
{
tipNewItem.setAttribute( "collapsed", "true" );
tipEditItem.setAttribute( "collapsed", "false" );
}
//create the category drop down
//if( !gCategoryManager )
// Categories = opener.gCategoryManager.getAllCategories();
//else
// Categories = gCategoryManager.getAllCategories();
Categories = new Array();
var MenuPopup = document.getElementById( "category-field-menupopup" );
for ( i in Categories )
{
var MenuItem = document.createElement( "menuitem" );
MenuItem.setAttribute( "value", Categories[i].id );
MenuItem.setAttribute( "label", Categories[i].name );
MenuPopup.appendChild( MenuItem );
}
// fill in fields from the event
setDateFieldValue( "start-date-text", gEvent.start );
setTimeFieldValue( "start-time-text", gEvent.start );
setTimeFieldValue( "end-time-text", gEvent.end );
gTimeDifference = gEvent.end - gEvent.start; //the time difference in ms
if ( gEvent.repeatForever )
{
gEvent.recurEnd = new Date();
}
setDateFieldValue( "repeat-end-date-text", gEvent.recurEnd );
setFieldValue( "title-field", gEvent.title );
setFieldValue( "description-field", gEvent.description );
setFieldValue( "location-field", gEvent.location );
setFieldValue( "category-field", gEvent.category );
setFieldValue( "all-day-event-checkbox", gEvent.allDay, "checked" );
setFieldValue( "private-checkbox", gEvent.privateEvent, "checked" );
setFieldValue( "alarm-checkbox", gEvent.alarm, "checked" );
setFieldValue( "alarm-length-field", gEvent.alarmLength );
setFieldValue( "alarm-length-units", gEvent.alarmUnits, "data" );
if ( gEvent.alarmEmailAddress && gEvent.alarmEmailAddress != "" )
{
setFieldValue( "alarm-email-checkbox", true, "checked" );
setFieldValue( "alarm-email-field", gEvent.alarmEmailAddress );
}
else
{
setFieldValue( "invite-checkbox", false, "checked" );
}
if ( gEvent.inviteEmailAddress != undefined && gEvent.inviteEmailAddress != "" )
{
setFieldValue( "invite-checkbox", true, "checked" );
setFieldValue( "invite-email-field", gEvent.inviteEmailAddress );
}
else
{
setFieldValue( "invite-checkbox", false, "checked" );
}
setFieldValue( "repeat-checkbox", gEvent.repeat, "checked");
setFieldValue( "repeat-length-field", gEvent.recurInterval );
setFieldValue( "repeat-length-units", gEvent.repeatUnits, "value" );
setFieldValue( "repeat-forever-radio", (gEvent.repeatForever != undefined && gEvent.repeatForever != false), "checked" );
setFieldValue( "repeat-until-radio", (gEvent.repeatForever == undefined || gEvent.repeatForever == false), "checked" );
// update enabling and disabling
updateRepeatItemEnabled();
updateStartEndItemEnabled();
updateAlarmItemEnabled();
updateInviteItemEnabled();
// set up OK, Cancel
doSetOKCancel( onOKCommand, 0 );
// start focus on title
var firstFocus = document.getElementById( "title-field" );
firstFocus.focus();
}
/**
* Called when the OK button is clicked.
*/
function onOKCommand()
{
// get values from the form and put them into the event
gEvent.title = getFieldValue( "title-field" );
gEvent.description = getFieldValue( "description-field" );
gEvent.location = getFieldValue( "location-field" );
gEvent.category = getFieldValue( "category-field" );
gEvent.allDay = getFieldValue( "all-day-event-checkbox", "checked" );
gEvent.start = getDateTimeFieldValue( "start-date-text" );
var startTime = getDateTimeFieldValue( "start-time-text" );
gEvent.start.setHours( startTime.getHours() );
gEvent.start.setMinutes( startTime.getMinutes() );
gEvent.start.setSeconds( 0 );
gEvent.end = getDateTimeFieldValue( "end-time-text" );
//do this because the end date is always the same as the start date.
gEvent.end.setDate( gEvent.start.getDate() );
gEvent.end.setMonth( gEvent.start.getMonth() );
gEvent.end.setYear( gEvent.start.getFullYear() );
gEvent.privateEvent = getFieldValue( "private-checkbox", "checked" );
if( getFieldValue( "invite-checkbox", "checked" ) )
{
gEvent.inviteEmailAddress = getFieldValue( "invite-email-field", "value" );
}
else
{
gEvent.inviteEmailAddress = "";
}
gEvent.alarm = getFieldValue( "alarm-checkbox", "checked" );
gEvent.alarmLength = getFieldValue( "alarm-length-field" );
gEvent.alarmUnits = getFieldValue( "alarm-length-units", "value" );
debug( "!!!-->in ca-event-dialog.js, alarmUnits is "+gEvent.alarmUnits );
if ( getFieldValue( "alarm-email-checkbox", "checked" ) )
{
gEvent.alarmEmailAddress = getFieldValue( "alarm-email-field", "value" );
debug( "!!!-->in ca-event-dialog.js, alarmEmailAddress is "+gEvent.alarmEmailAddress );
}
else
{
gEvent.alarmEmailAddress = "";
}
gEvent.repeat = getFieldValue( "repeat-checkbox", "checked" );
gEvent.repeatUnits = getFieldValue( "repeat-length-units", "value" );
gEvent.repeatForever = getFieldValue( "repeat-forever-radio", "checked" );
gEvent.recurInterval = getFieldValue( "repeat-length-field" );
if( gEvent.recurInterval == 0 )
gEvent.repeat = false;
gEvent.recurEnd = getDateTimeFieldValue( "repeat-end-date-text" );
gEvent.recurEnd = new Date( gEvent.recurEnd.getFullYear(), gEvent.recurEnd.getMonth(), gEvent.recurEnd.getDate(), gEvent.start.getHours(), gEvent.start.getMinutes() );
// :TODO: REALLY only do this if the alarm or start settings change.?
gEvent.alarmWentOff = false;
//if the end time is later than the start time... alert the user using text from the dtd.
if ( gEvent.end < gEvent.start && !gEvent.allDay )
{
alert( neStartTimeErrorAlertMessage );
return( false );
}
else
{
// call caller's on OK function
gOnOkFunction( gEvent );
// tell standard dialog stuff to close the dialog
return true;
}
}
/**
* Called when an item with a datepicker is clicked, BEFORE the picker is shown.
*/
function prepareDatePicker( dateFieldName )
{
// get the popup and the field we are editing
var datePickerPopup = document.getElementById( "oe-date-picker-popup" );
var dateField = document.getElementById( dateFieldName );
// tell the date picker the date to edit.
datePickerPopup.setAttribute( "value", dateField.editDate );
// remember the date field that is to be updated by adding a
// property "dateField" to the popup.
datePickerPopup.dateField = dateField;
}
/**
* Called when a datepicker is finished, and a date was picked.
*/
function onDatePick( datepopup )
{
// display the new date in the textbox
datepopup.dateField.value = formatDate( datepopup.value );
// remember the new date in a property, "editDate". we created on the date textbox
datepopup.dateField.editDate = datepopup.value;
//change the end date of repeating events to today, if the new date is after today.
var Now = new Date();
if ( datepopup.value > Now )
{
document.getElementById( "repeat-end-date-text" ).value = formatDate( datepopup.value );
}
}
/**
* Called when an item with a time picker is clicked, BEFORE the picker is shown.
*/
function prepareTimePicker( timeFieldName )
{
// get the popup and the field we are editing
var timePickerPopup = document.getElementById( "oe-time-picker-popup" );
var timeField = document.getElementById( timeFieldName );
// tell the time picker the time to edit.
timePickerPopup.setAttribute( "value", timeField.editDate );
// remember the time field that is to be updated by adding a
// property "timeField" to the popup.
timePickerPopup.timeField = timeField;
}
/**
* Called when a timepicker is finished, and a time was picked.
*/
function onTimePick( timepopup )
{
//get the new end time by adding on the time difference to the start time.
newEndDate = timepopup.value.getTime() + gTimeDifference;
newEndDate = new Date( newEndDate );
if ( newEndDate.getDate() != timepopup.value.getDate() ) //if this moves us to tomorrow...
{
//put us back at today, with a time of 11:55 PM.
newEndDate = new Date( timepopup.value.getFullYear(),
timepopup.value.getMonth(),
timepopup.value.getDate(),
23,
55,
0);
}
formattedEndTime = formatTime( newEndDate );
if( timepopup.timeField.id != "end-time-text" )
{
document.getElementById( "end-time-text" ).value = formattedEndTime;
document.getElementById( "end-time-text" ).editDate = newEndDate;
}
if ( ( timepopup.timeField.id == "end-time-text" ) )
{
//if we are changing the end time, change the global duration.
var EndTime = new Date( timepopup.value.getTime() );
var StartTimeElement = document.getElementById( "start-time-text" );
var StartTime = StartTimeElement.editDate;
gTimeDifference = EndTime - StartTime; //the time difference in ms
if ( gTimeDifference < 0 )
{
gTimeDifference = 0;
}
}
// display the new time in the textbox
timepopup.timeField.value = formatTime( timepopup.value );
// remember the new date in a property, "editDate". we created on the time textbox
timepopup.timeField.editDate = timepopup.value;
}
/**
* Called when the repeat checkbox is clicked.
*/
function commandRepeat()
{
updateRepeatItemEnabled();
}
/**
* Called when the until radio is clicked.
*/
function commandUntil()
{
updateUntilItemEnabled();
}
/**
* Called when the all day checkbox is clicked.
*/
function commandAllDay()
{
updateStartEndItemEnabled();
}
/**
* Called when the alarm checkbox is clicked.
*/
function commandAlarm()
{
updateAlarmItemEnabled();
}
/**
* Enable/Disable Alarm items
*/
function updateAlarmItemEnabled()
{
var alarmCheckBox = document.getElementById( "alarm-checkbox" );
var alarmField = document.getElementById( "alarm-length-field" );
var alarmMenu = document.getElementById( "alarm-length-units" );
var alarmLabel = document.getElementById( "alarm-length-text" );
var alarmEmailCheckbox = document.getElementById( "alarm-email-checkbox" );
var alarmEmailField = document.getElementById( "alarm-email-field" );
if( alarmCheckBox.checked )
{
// call remove attribute beacuse some widget code checks for the presense of a
// disabled attribute, not the value.
alarmField.removeAttribute( "disabled" );
alarmMenu.removeAttribute( "disabled" );
alarmLabel.removeAttribute( "disabled" );
alarmEmailCheckbox.removeAttribute( "disabled" );
}
else
{
alarmField.setAttribute( "disabled", "true" );
alarmMenu.setAttribute( "disabled", "true" );
alarmLabel.setAttribute( "disabled", "true" );
alarmEmailField.setAttribute( "disabled", "true" );
alarmEmailCheckbox.setAttribute( "disabled", "true" );
alarmEmailCheckbox.setAttribute( "checked", false );
}
}
/**
* Called when the alarm checkbox is clicked.
*/
function commandAlarmEmail()
{
updateAlarmEmailItemEnabled();
}
/**
* Enable/Disable Alarm items
*/
function updateAlarmEmailItemEnabled()
{
var alarmCheckBox = document.getElementById( "alarm-email-checkbox" );
var alarmEmailField = document.getElementById( "alarm-email-field" );
if( alarmCheckBox.checked )
{
// call remove attribute beacuse some widget code checks for the presense of a
// disabled attribute, not the value.
alarmEmailField.removeAttribute( "disabled" );
}
else
{
alarmEmailField.setAttribute( "disabled", "true" );
}
}
/**
* Called when the alarm checkbox is clicked.
*/
function commandInvite()
{
updateInviteItemEnabled();
}
/**
* Enable/Disable Alarm items
*/
function updateInviteItemEnabled()
{
var inviteCheckBox = document.getElementById( "invite-checkbox" );
var inviteField = document.getElementById( "invite-email-field" );
if( inviteCheckBox.checked )
{
// call remove attribute beacuse some widget code checks for the presense of a
// disabled attribute, not the value.
inviteField.removeAttribute( "disabled" );
}
else
{
inviteField.setAttribute( "disabled", "true" );
}
}
/**
* Enable/Disable Repeat items
*/
function updateRepeatItemEnabled()
{
var repeatCheckBox = document.getElementById( "repeat-checkbox" );
var repeatField = document.getElementById( "repeat-length-field" );
var repeatMenu = document.getElementById( "repeat-length-units" );
var repeatGroup = document.getElementById( "repeat-until-group" );
var repeatForever = document.getElementById( "repeat-forever-radio" );
var repeatUntil = document.getElementById( "repeat-until-radio" );
if( repeatCheckBox.checked )
{
// call remove attribute beacuse some widget code checks for the presense of a
// disabled attribute, not the value.
repeatField.removeAttribute( "disabled" );
repeatMenu.removeAttribute( "disabled" );
repeatGroup.removeAttribute( "disabled" );
repeatForever.removeAttribute( "disabled" );
repeatUntil.removeAttribute( "disabled" );
}
else
{
repeatField.setAttribute( "disabled", "true" );
repeatMenu.setAttribute( "disabled", "true" );
repeatGroup.setAttribute( "disabled", "true" );
repeatForever.setAttribute( "disabled", "true" );
repeatUntil.setAttribute( "disabled", "true" );
}
// update until items whenever repeat changes
updateUntilItemEnabled();
}
/**
* Enable/Disable Until items
*/
function updateUntilItemEnabled()
{
var repeatUntilRadio = document.getElementById( "repeat-until-radio" );
var repeatCheckBox = document.getElementById( "repeat-checkbox" );
var repeatEndText = document.getElementById( "repeat-end-date-text" );
var repeatEndPicker = document.getElementById( "repeat-end-date-button" );
if( repeatCheckBox.checked && repeatUntilRadio.checked )
{
repeatEndText.removeAttribute( "disabled" );
repeatEndText.setAttribute( "popup", "oe-date-picker-popup" );
repeatEndPicker.removeAttribute( "disabled" );
repeatEndPicker.setAttribute( "popup", "oe-date-picker-popup" );
}
else
{
repeatEndText.setAttribute( "disabled", "true" );
repeatEndText.removeAttribute( "popup" );
repeatEndPicker.setAttribute( "disabled", "true" );
repeatEndPicker.removeAttribute( "popup" );
}
}
/**
* Enable/Disable Start/End items
*/
function updateStartEndItemEnabled()
{
var allDayCheckBox = document.getElementById( "all-day-event-checkbox" );
var startTimeLabel = document.getElementById( "start-time-label" );
var startTimePicker = document.getElementById( "start-time-button" );
var startTimeText = document.getElementById( "start-time-text" );
var endTimeLabel = document.getElementById( "end-time-label" );
var endTimePicker = document.getElementById( "end-time-button" );
var endTimeText = document.getElementById( "end-time-text" );
if( allDayCheckBox.checked )
{
// disable popups by removing the popup attribute
startTimeLabel.setAttribute( "disabled", "true" );
startTimeText.setAttribute( "disabled", "true" );
startTimeText.removeAttribute( "popup" );
startTimePicker.setAttribute( "disabled", "true" );
startTimePicker.removeAttribute( "popup" );
endTimeLabel.setAttribute( "disabled", "true" );
endTimeText.setAttribute( "disabled", "true" );
endTimeText.removeAttribute( "popup" );
endTimePicker.setAttribute( "disabled", "true" );
endTimePicker.removeAttribute( "popup" );
}
else
{
// enable popups by setting the popup attribute
startTimeLabel.removeAttribute( "disabled" );
startTimeText.removeAttribute( "disabled" );
startTimeText.setAttribute( "popup", "oe-time-picker-popup" );
startTimePicker.removeAttribute( "disabled" );
startTimePicker.setAttribute( "popup", "oe-time-picker-popup" );
endTimeLabel.removeAttribute( "disabled" );
endTimeText.removeAttribute( "disabled" );
endTimeText.setAttribute( "popup", "oe-time-picker-popup" );
endTimePicker.removeAttribute( "disabled" );
endTimePicker.setAttribute( "popup", "oe-time-picker-popup" );
}
}
/**
* Helper function for filling the form, set the value of a property of a XUL element
*
* PARAMETERS
* elementId - ID of XUL element to set
* newValue - value to set property to ( if undefined no change is made )
* propertyName - OPTIONAL name of property to set, default is "value", use "checked" for
* radios & checkboxes, "data" for drop-downs
*/
function setFieldValue( elementId, newValue, propertyName )
{
var undefined;
if( newValue !== undefined )
{
var field = document.getElementById( elementId );
if( propertyName )
{
field[ propertyName ] = newValue;
}
else
{
field.value = newValue;
}
}
}
/**
* Helper function for getting data from the form,
* Get the value of a property of a XUL element
*
* PARAMETERS
* elementId - ID of XUL element to get from
* propertyName - OPTIONAL name of property to set, default is "value", use "checked" for
* radios & checkboxes, "data" for drop-downs
* RETURN
* newValue - value of property
*/
function getFieldValue( elementId, propertyName )
{
var field = document.getElementById( elementId );
if( propertyName )
{
return field[ propertyName ];
}
else
{
return field.value;
}
}
/**
* Helper function for getting a date/time from the form.
* The element must have been set up with setDateFieldValue or setTimeFieldValue.
*
* PARAMETERS
* elementId - ID of XUL element to get from
* RETURN
* newValue - Date value of element
*/
function getDateTimeFieldValue( elementId )
{
var field = document.getElementById( elementId );
return field.editDate;
}
/**
* Helper function for filling the form, set the value of a date field
*
* PARAMETERS
* elementId - ID of time textbox to set
* newDate - Date Object to use
*/
function setDateFieldValue( elementId, newDate )
{
// set the value to a formatted date string
var field = document.getElementById( elementId );
field.value = formatDate( newDate );
// add an editDate property to the item to hold the Date object
// used in onDatePick to update the date from the date picker.
// used in getDateTimeFieldValue to get the Date back out.
// we clone the date object so changes made in place do not propagte
field.editDate = new Date( newDate );
}
/**
* Helper function for filling the form, set the value of a time field
*
* PARAMETERS
* elementId - ID of time textbox to set
* newDate - Date Object to use
*/
function setTimeFieldValue( elementId, newDate )
{
// set the value to a formatted time string
var field = document.getElementById( elementId );
field.value = formatTime( newDate );
// add an editDate property to the item to hold the Date object
// used in onTimePick to update the date from the time picker.
// used in getDateTimeFieldValue to get the Date back out.
// we clone the date object so changes made in place do not propagte
field.editDate = new Date( newDate );
}
/**
* Take a Date object and return a displayable date string i.e.: May 5, 1959
* :TODO: This should be moved into DateFormater and made to use some kind of
* locale or user date format preference.
*/
function formatDate( date )
{
var monthDayString = gDateFormatter.getFormatedDate( date );
return monthDayString + ", " + date.getFullYear();
}
/**
* Take a Date object and return a displayable time string i.e.: 12:30 PM
*/
function formatTime( time )
{
var timeString = gDateFormatter.getFormatedTime( time );
return timeString;
}
function debug( Text )
{
dump( "\n"+ Text + "\n");
}

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

@ -0,0 +1,315 @@
<?xml version="1.0"?>
<!--
- 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 OEone Corporation are Copyright (C) 2001
- OEone Corporation. All Rights Reserved.
-
- Contributor(s): Garth Smedley (garths@oeone.com), Mike Potter (mikep@oeone.com)
-
- Alternatively, the contents of this file may be used under the terms of
- either the GNU General Public License Version 2 or later (the "GPL"), or
- the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- in which case the provisions of the GPL or the LGPL are applicable instead
- of those above. If you wish to allow use of your version of this file only
- under the terms of either the GPL or the LGPL, and not to allow others to
- use your version of this file under the terms of the MPL, indicate your
- decision by deleting the provisions above and replace them with the notice
- and other provisions required by the 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.
-
- -->
<?xml-stylesheet href="chrome://global/skin/global.css" type="text/css"?>
<?xul-overlay href="chrome://global/content/dialogOverlay.xul"?>
<?xul-overlay href="chrome://penglobal/content/datepicker-overlay.xul"?>
<?xul-overlay href="chrome://penglobal/content/timepicker-overlay.xul"?>
<!-- CSS File with all styles specific to the dialog -->
<?xml-stylesheet href="chrome://calendar/skin/ca-event-dialog.css" ?>
<?xml-stylesheet href="chrome://penglobal/skin/dialogOverlay.css" type="text/css"?>
<!-- DTD File with all strings specific to the calendar -->
<!DOCTYPE window
[
<!ENTITY % dtd1 SYSTEM "chrome://penglobal/locale/global.dtd" > %dtd1;
<!ENTITY % dtd2 SYSTEM "chrome://calendar/locale/calendar.dtd" > %dtd2;
]>
<window
id="calendar-new-eventwindow"
title="Internet Appliance Dialog - Calendar Event"
orient="vertical"
onload="loadCalendarEventDialog()"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
>
<!-- Javascript DTD To Variable -->
<script type="application/x-javascript">
var neStartTimeErrorAlertMessage = "&newevent.starttimeerror.alertmessage;";
</script>
<!-- Javascript includes -->
<script type="application/x-javascript" src="chrome://global/content/strres.js"/>
<script type="application/x-javascript" src="chrome://penglobal/content/dateUtils.js"/>
<script type="application/x-javascript" src="chrome://calendar/content/ca-event-dialog.js"/>
<!-- Data used in JS from dtd -->
<dataset>
<data id="data-event-title-new" value="&event.title.new;" />
<data id="data-event-title-edit" value="&event.title.edit;" />
<data id="neStartTimeErrorAlertMessage" value="&newevent.starttimeerror.alertmessage;" />
</dataset>
<!-- Picker popups -->
<popupset>
<popup id="oe-date-picker-popup" popupalign="topleft" oncommand="onDatePick( this )" value="">
</popup>
<popup id="oe-time-picker-popup" popupalign="topleft" oncommand="onTimePick( this )" value="">
</popup>
</popupset>
<!-- The dialog -->
<!-- dialog-box: from dialogOverlay.xul -->
<vbox id="dialog-box" flex="1">
<!-- standard-dialog-title: from dialogOverlay.xul -->
<box id="standard-dialog-title">
<image id="standard-dialog-title-icon" insertbefore="standard-dialog-title-text-box"/>
<spring flex="1" insertafter="standard-dialog-title-icon"/>
<box id="standard-dialog-title-text-box" valign="middle" autostretch="never">
<text id="standard-dialog-title-text"/>
</box>
<spring id="second-title-spring" flex="1" insertafter="standard-dialog-title-text-box"/>
</box>
<!-- standard-dialog-tips: from dialogOverlay.xul Proper tip is shown in on load code-->
<box id="standard-dialog-tips">
<html id="tip-new" collapsed ="true" >&event.tip.new;</html>
<html id="tip-edit" collapsed ="false">&event.tip.edit;</html>
</box>
<!-- standard-dialog-content: from dialogOverlay.xul -->
<vbox id="standard-dialog-content" flex="1">
<!-- Form elements -->
<grid autostretch="never" flex="1">
<columns>
<column />
<column flex="1"/>
</columns>
<rows>
<!-- Title -->
<row autostretch="never">
<hbox class="field-label-box-class">
<text for="title-field" value="&newevent.title.label;"/>
</hbox>
<textbox id="title-field"/>
</row>
<!-- Location -->
<row autostretch="never">
<hbox class="field-label-box-class" >
<text for="location-field" value="&newevent.location.label;"/>
</hbox>
<textbox id="location-field"/>
</row>
<!-- Category -->
<row autostretch="never">
<hbox class="field-label-box-class" >
<text for="category-field" value="&newevent.category.label;"/>
</hbox>
<menulist id="category-field" label="&newevent.choosecategory.label;" value="" >
<menupopup id="category-field-menupopup">
<menuitem label="&newevent.nocategory.label;" value=""/>
</menupopup>
</menulist>
</row>
<!-- Date -->
<row autostretch="never" >
<hbox class="field-label-box-class" >
<text value="&newevent.date.label;"/>
</hbox>
<hbox id="start-date-box" autostretch="never" >
<textbox id="start-date-text" readonly="true" onmousedown="prepareDatePicker('start-date-text')" popup="oe-date-picker-popup" popupanchor="bottomleft"/>
<image class="four-state-image-button" id="start-date-button" onmousedown="prepareDatePicker('start-date-text')" popup="oe-date-picker-popup" popupanchor="bottomleft" />
</hbox>
</row>
<!-- All Day -->
<row autostretch="never">
<spring />
<hbox>
<checkbox id="all-day-event-checkbox" label="&newevent.alldayevent.label;" checked="true" oncommand="commandAllDay()"/>
</hbox>
</row>
<!-- Start -->
<row autostretch="never">
<hbox class="field-label-box-class" >
<text id="start-time-label" value="&newevent.start.label;"/>
</hbox>
<hbox id="start-event-time-box" autostretch="never" >
<textbox id="start-time-text" readonly="true" value="" onmousedown="prepareTimePicker('start-time-text')" popup="oe-time-picker-popup" popupanchor="bottomleft"/>
<image class="four-state-image-button" id="start-time-button" onmousedown="prepareTimePicker('start-time-text')" popup="oe-time-picker-popup" popupanchor="bottomleft"/>
</hbox>
</row>
<!-- End -->
<row autostretch="never">
<hbox class="field-label-box-class" >
<text id="end-time-label" value="&newevent.end.label;"/>
</hbox>
<hbox id="end-event-time-box" autostretch="never" >
<textbox id="end-time-text" readonly="true" value="" onmousedown="prepareTimePicker('end-time-text')" popup="oe-time-picker-popup" popupanchor="bottomleft"/>
<image class="four-state-image-button" id="end-time-button" onmousedown="prepareTimePicker('end-time-text')" popup="oe-time-picker-popup" popupanchor="bottomleft"/>
</hbox>
</row>
<!-- Description -->
<row flex="1">
<hbox class="field-label-box-class" >
<text for="description-field" value="&newevent.description.label;"/>
</hbox>
<textbox id="description-field" multiline="true" rows="3" cols="30" />
</row>
<!-- Private -->
<row autostretch="never" >
<spring />
<hbox>
<checkbox id="private-checkbox" checked="false" label="&newevent.private.label;"/>
</hbox>
</row>
<!-- Alarm -->
<row autostretch="never">
<spring />
<vbox>
<hbox id="alarm-box" autostretch="never">
<checkbox id="alarm-checkbox" label="&newevent.alarm.label;" checked="false" oncommand="commandAlarm()"/>
<spring id="alarm-spacer" />
<textbox id="alarm-length-field" value="15" />
<menulist id="alarm-length-units" label="&alarm.units.minutes;" value="minutes" >
<menupopup >
<menuitem label="&alarm.units.minutes;" value="minutes"/>
<menuitem label="&alarm.units.hours;" value="hours"/>
<menuitem label="&alarm.units.days;" value="days"/>
</menupopup>
</menulist>
<label id="alarm-length-text" for="alarm-length-field" value="&newevent.beforealarm.label;"/>
</hbox>
<hbox id="alarm-box-email">
<checkbox id="alarm-email-checkbox" label="&newevent.email.label;" checked="false" oncommand="commandAlarmEmail()"/>
<textbox id="alarm-email-field" disabled="true" size="39" value="" />
</hbox>
</vbox>
</row>
<!-- Invite -->
<row autostretch="never">
<spring />
<vbox>
<hbox id="invite-box">
<checkbox id="invite-checkbox" label="&newevent.invite.label;" checked="false" oncommand="commandInvite()"/>
<spring id="invite-spacer" />
<textbox id="invite-email-field" size="39" disabled="true"/>
</hbox>
</vbox>
</row>
<!-- Repeat -->
<!-- STARTING TO BE IMPLEMENTED -->
<row autostretch="never" collapsed="false">
<spring />
<vbox>
<hbox id="repeat-box" autostretch="never">
<checkbox id="repeat-checkbox" label="&newevent.repeat.label;" checked="false" oncommand="commandRepeat()"/>
<textbox id="repeat-length-field" value="1" />
<menulist id="repeat-length-units" label="&repeat.units.days;" value="days" >
<menupopup>
<menuitem label="&repeat.units.days;" value="days" />
<menuitem label="&repeat.units.weeks;" value="weeks" />
<menuitem label="&repeat.units.months;" value="months" />
<menuitem label="&repeat.units.years;" value="years" />
</menupopup>
</menulist>
</hbox>
<hbox>
<spring id="radio-spacer" />
<radiogroup id="repeat-until-group" orient="vertical">
<hbox>
<radio group="repeat-until-group" id="repeat-forever-radio" checked="false" label="&newevent.forever.label;" oncommand="commandUntil()"/>
</hbox>
<hbox id="repeat-end-box" autostretch="never">
<radio group="repeat-until-group" id="repeat-until-radio" checked="true" label="&newevent.until.label;" oncommand="commandUntil()"/>
<spring id="until-spacer"/>
<textbox id="repeat-end-date-text" readonly="true" value="" onmousedown="prepareDatePicker('repeat-end-date-text')" popup="oe-date-picker-popup" popupanchor="bottomleft"/>
<image class="four-state-image-button" id="repeat-end-date-button" onmousedown="prepareDatePicker('repeat-end-date-text')" popup="oe-date-picker-popup" popupanchor="bottomleft"/>
</hbox>
</radiogroup>
</hbox>
</vbox>
</row>
<!-- Repeat -->
</rows>
</grid>
</vbox> <!-- standard-dialog-content -->
<!-- Bottom Box -->
<box id="okCancelButtonsRight"/>
</vbox> <!-- dialog-box -->
</window>

Разница между файлами не показана из-за своего большого размера Загрузить разницу

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

@ -0,0 +1,203 @@
<?xml version="1.0"?>
<!--
- 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 OEone Corporation are Copyright (C) 2001
- OEone Corporation. All Rights Reserved.
-
- Contributor(s): Garth Smedley (garths@oeone.com), Mike Potter (mikep@oeone.com),
- Colin Phillips (colinp@oeone.com)
-
- Alternatively, the contents of this file may be used under the terms of
- either the GNU General Public License Version 2 or later (the "GPL"), or
- the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- in which case the provisions of the GPL or the LGPL are applicable instead
- of those above. If you wish to allow use of your version of this file only
- under the terms of either the GPL or the LGPL, and not to allow others to
- use your version of this file under the terms of the MPL, indicate your
- decision by deleting the provisions above and replace them with the notice
- and other provisions required by the LGPL or the GPL. If you do not delete
- the provisions above, a recipient may use your version of this file under
- the terms of any one of the MPL, the GPL or the LGPL.
-
- -->
<!-- Style sheets -->
<?xml-stylesheet href="chrome://global/skin/global.css" type="text/css"?>
<?xml-stylesheet href="chrome://calendar/skin/calendar.css" type="text/css"?>
<!-- Overlays -->
<?xul-overlay href="chrome://penglobal/content/penRootOverlay.xul"?>
<?xul-overlay href="chrome://penglobal/content/penApplicationOverlay.xul"?>
<?xul-overlay href="chrome://global/content/globalOverlay.xul"?>
<?xul-overlay href="chrome://global/content/globalOverlay.xul"?>
<?xul-overlay href="chrome://penglobal/content/datepicker-overlay.xul"?>
<?xul-overlay href="chrome://calendar/content/unifinder-overlay.xul"?>
<?xul-overlay href="chrome://calendar/content/calendarDayView.xul"?>
<?xul-overlay href="chrome://calendar/content/calendarWeekView.xul"?>
<?xul-overlay href="chrome://calendar/content/calendarMonthView.xul"?>
<!-- DTDs -->
<!-- DTD File with all strings specific to the calendar -->
<!DOCTYPE window
[
<!ENTITY % dtd1 SYSTEM "chrome://penglobal/locale/global.dtd" > %dtd1;
<!ENTITY % dtd2 SYSTEM "chrome://calendar/locale/calendar.dtd" > %dtd2;
<!ENTITY % dtd3 SYSTEM "chrome://penglobal/locale/unifinder.dtd" > %dtd3;
]>
<!-- The Window -->
<window
id="calendar-window"
title="Mozilla Calendar"
onload="calendarInit()"
onunload="calendarFinish()"
xmlns:html="http://www.w3.org/1999/xhtml"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
>
<!-- Javascript DTD To Variable -->
<script type="application/x-javascript">
var confirmDeleteEvent = "&calendar.confirm.deleteevent;";
</script>
<!-- Javascript includes -->
<!-- NEEDED FOR DATE UTILS -->
<script type="application/x-javascript" src="chrome://global/content/strres.js"/>
<script type="application/x-javascript" src="chrome://penglobal/content/dateUtils.js"/>
<script type="application/x-javascript" src="chrome://penglobal/content/unifinder.js"/>
<script type="application/x-javascript" src="chrome://calendar/content/calendar.js"/>
<script type="application/x-javascript" src="chrome://calendar/content/unifinder.js"/>
<script type="application/x-javascript" src="chrome://penglobal/content/calendarEvent.js"/>
<!-- ALL THIS IS NEEDED FOR CATEGORIES
<script type="application/x-javascript" src="chrome://calendar/content/categories.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/file.js"/>
<script type="application/x-javascript" src="chrome://penglobal/content/jslib/libraries/io/dir.js"/>
<script type="application/x-javascript" src="chrome://penglobal/content/penFileUtils.js"/>
<script type="application/x-javascript" src="chrome://penglobal/content/penCategoryManager.js"/>
-->
<!-- Pop up menus -->
<popupset id="aTooltipSet"/>
<popup id="debug-menu">
<menuitem label="Reload" oncommand="window.location = 'chrome://calendar/content/calendar.xul';"/>
</popup>
<popup id="oe-date-picker-popup" popupalign="topleft" oncommand="gCalendarWindow.goToDay( date )" value=""/>
<popup id="unifinder-options-menu">
<menuitem label="&calendar.menu.options.newcategory;" oncommand="unifinderNewCategoryCommand()" />
<menuitem label="&calendar.menu.options.modify;" oncommand="unifinderModifyCommand()" />
<menuitem label="&calendar.menu.options.remove;" oncommand="unifinderRemoveCommand()" />
</popup>
<!-- V I S I B L E C O N T E N T -->
<vbox id="calendar-top-box" flex="1" context="debug-menu">
<!-- Calendar Controls-->
<hbox id="calendar-controls-box" flex="1" >
<spring flex="1" />
<button class="calendar-management-button" id="calendar-new-event-button" tooltip="aTooltip" tooltiptext="&calendar.newevent.button.tooltip;" label="&calendar.newevent.button.label;" oncommand="newEventCommand()"/>
<image class="calendar-control-divider" />
<button class="calendar-management-button" id="calendar-go-to-today-button" tooltip="aTooltip" tooltiptext="&calendar.gototoday.button.tooltip;" label="&calendar.gototoday.button.label;" oncommand="gCalendarWindow.goToToday()"/>
<button class="calendar-management-button" id="calendar-choose-date-button" tooltip="aTooltip" tooltiptext="&calendar.choosedate.button.tooltip;" label="&calendar.choosedate.button.label;" onmousedown="prepareChooseDate()" popup="oe-date-picker-popup" />
<image class="calendar-control-divider" />
<button class="calendar-management-button" id="calendar-day-view-button" tooltip="aTooltip" tooltiptext="&calendar.dayview.button.tooltip;" label="&calendar.dayview.button.label;" oncommand="gCalendarWindow.switchToDayView()"/>
<button class="calendar-management-button" id="calendar-week-view-button" tooltip="aTooltip" tooltiptext="&calendar.weekview.button.tooltip;" label="&calendar.weekview.button.label;" oncommand="gCalendarWindow.switchToWeekView()"/>
<button class="calendar-management-button" id="calendar-month-view-button" tooltip="aTooltip" tooltiptext="&calendar.monthview.button.tooltip;" label="&calendar.monthview.button.label;" oncommand="gCalendarWindow.switchToMonthView()"/>
</hbox>
<hbox id="calendar-content-box" flex="1">
<!-- UNIFINDER OVERLAY -->
<unifinder id="calendar-unifinder-overlay" menu-popup="unifinder-options-menu" flex="1"/>
<splitter id="unifinder-splitter" />
<popupset>
<popup id="savetip" style="background-color: #FFFFC0;">
<text id="popuptooltiptext" value=" "/>
<!--
<html id="popuptooltiptext"/>
-->
</popup>
</popupset>
<spring flex="1"/>
<!-- Begin Day/Month/Week Deck -->
<deck id="calendar-deck" flex="1" index="3" >
<!-- Calendar Month View -->
<vbox id="month-view-box" flex="1"/>
<!-- End: Calendar Month View -->
<!-- Calendar Week View -->
<vbox id="week-view-box" flex="1" orient="vertical"/>
<!-- End: Calendar Week View -->
<!-- Calendar Day View -->
<vbox id="day-view-box" flex="1"/>
<!-- End: Calendar Day View -->
<!-- Calendar Empty View -->
<vbox/>
</deck> <!-- End: Day/Month/Week Deck -->
<spring flex="1"/>
</hbox> <!-- End: box with unifinder on left, calendar on right -->
</vbox>
</window>

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

@ -0,0 +1,572 @@
/*
* 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 Corporation.
*
* The Initial Developer of the Original Code is
* OEone Corporation.
* Portions created by OEone Corporation are Copyright (C) 2001
* OEone Corporation. All Rights Reserved.
*
* Contributor(s): Garth Smedley (garths@oeone.com) , Mike Potter (mikep@oeone.com)
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
*
*/
/*-----------------------------------------------------------------
* DayView Class subclass of CalendarView
*
* Calendar day view class
*
* PROPERTIES
* dayEvents - Event text is displayed in the hour items of the view. The items that currently
* have an event are stored here. The hour items have a calendarEvent property
* added so we know which event is displayed for the day.
*
* 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 );
this.selectedEventBoxes = new Array();
// set up dayEvents array
this.dayEvents = new Array();
}
/** PUBLIC
*
* Redraw the events for the current month
*
*/
DayView.prototype.refreshEvents = function( )
{
this.kungFooDeathGripOnEventBoxes = new Array();
// remove old event boxes
var eventBoxList = document.getElementsByAttribute( "eventbox", "dayview" );
for( var eventBoxIndex = 0; eventBoxIndex < eventBoxList.length; ++eventBoxIndex )
{
var eventBox = eventBoxList[ eventBoxIndex ];
eventBox.parentNode.removeChild( eventBox );
}
//get the all day box.
var AllDayBox = document.getElementById( "all-day-content-box" );
AllDayBox.setAttribute( "collapsed", "true" );
//remove all the text from the all day content box.
while( AllDayBox.hasChildNodes() )
{
AllDayBox.removeChild( AllDayBox.firstChild );
}
//shrink the day's content box.
document.getElementById( "day-view-content-box" ).setAttribute( "allday", "false" );
//make the text node that will contain the text for the all day box.
//var TextNode = document.getElementById( "all-day-content-box-text" );
//if ( TextNode == null )
//{
HtmlNode = document.createElement( "html" );
HtmlNode.setAttribute( "id", "all-day-content-box-text" );
TextNode = document.createTextNode( "All-Day Events: " );
HtmlNode.appendChild( TextNode );
document.getElementById( "all-day-content-box" ).appendChild( HtmlNode );
//}
//TextNode.setAttribute( "value", "All-Day Events: " );
//set the seperator to nothing. After the first one, we'll change it to ", " so that we add commas between text.
var Seperator = " ";
// get the events for the day and loop through them
var dayEventList = this.calendarWindow.eventSource.getEventsForDay( this.calendarWindow.getSelectedDate() );
//refresh the array and the current spot.
for ( i = 0; i < dayEventList.length; i++ )
{
dayEventList[i].OtherSpotArray = new Array('0');
dayEventList[i].CurrentSpot = 0;
dayEventList[i].NumberOfSameTimeEvents = 0;
}
for ( i = 0; i < dayEventList.length; i++ )
{
var calendarEvent = dayEventList[i];
//check to make sure that the event is not an all day event...
if ( calendarEvent.allDay != true )
{
//see if there's another event at the same start time.
for ( j = 0; j < dayEventList.length; j++ )
{
//thisCalendarEvent = dayEventList[j];
calendarEventToMatch = dayEventList[j];
calendarEventToMatchHours = calendarEventToMatch.displayDate.getHours();
calendarEventToMatchMinutes = calendarEventToMatch.displayDate.getMinutes();
calendarEventDisplayHours = calendarEvent.displayDate.getHours();
calendarEventDisplayMinutes = calendarEvent.displayDate.getMinutes();
calendarEventEndHours = calendarEvent.end.getHours();
calendarEventEndMinutes = calendarEvent.end.getMinutes();
calendarEventToMatch.displayDateTime = new Date( 2000, 1, 1, calendarEventToMatchHours, calendarEventToMatchMinutes, 0 );
calendarEvent.displayDateTime = new Date( 2000, 1, 1, calendarEventDisplayHours, calendarEventDisplayMinutes, 0 );
calendarEventToMatch.endTime = new Date( 2000, 1, 1, calendarEventToMatchHours, calendarEventToMatchMinutes, 0 );
//if this event overlaps with another event...
if ( ( ( calendarEventToMatch.displayDateTime >= calendarEvent.displayDateTime &&
calendarEventToMatch.displayDateTime < calendarEvent.endTime ) ||
( calendarEvent.displayDateTime >= calendarEventToMatch.displayDateTime &&
calendarEvent.displayDateTime < calendarEventToMatch.endTime ) ) &&
calendarEvent.id != calendarEventToMatch.id )
{
//get the spot that this event will go in.
var ThisSpot = calendarEventToMatch.CurrentSpot;
calendarEvent.OtherSpotArray.push( ThisSpot );
ThisSpot++;
if ( ThisSpot > calendarEvent.CurrentSpot )
{
calendarEvent.CurrentSpot = ThisSpot;
}
}
}
SortedOtherSpotArray = new Array();
SortedOtherSpotArray = calendarEvent.OtherSpotArray.sort( gCalendarWindow.compareNumbers );
LowestNumber = this.calendarWindow.getLowestElementNotInArray( SortedOtherSpotArray );
//this is the actual spot (0 -> n) that the event will go in on the day view.
calendarEvent.CurrentSpot = LowestNumber;
calendarEvent.NumberOfSameTimeEvents = SortedOtherSpotArray.length;
}
}
for ( var eventIndex = 0; eventIndex < dayEventList.length; ++eventIndex )
{
var calendarEvent = dayEventList[ eventIndex ];
//if its an all day event, don't show it in the hours bulletin board.
if ( calendarEvent.allDay == true )
{
// build up the text to show for this event
var eventText = calendarEvent.title;
if( calendarEvent.location )
{
eventText += " " + calendarEvent.location;
}
if( calendarEvent.description )
{
eventText += " " + calendarEvent.description;
}
//show the all day box
AllDayBox.setAttribute( "collapsed", "false" );
//shrink the day's content box.
document.getElementById( "day-view-content-box" ).setAttribute( "allday", "true" );
//note the use of the AllDayText Attribute.
//This is used to remove the text when the day is changed.
SeperatorNode = document.createElement( "label" );
SeperatorNode.setAttribute( "value", Seperator );
//SeperatorNode.setAttribute( "AllDayText", "true" );
newTextNode = document.createElement( "label" );
newTextNode.setAttribute( "value", eventText );
//newTextNode.setAttribute( "AllDayText", "true" );
newImage = document.createElement("image");
newImage.setAttribute( "src", "chrome://calendar/skin/all_day_event.png" );
//newImage.setAttribute( "AllDayText", "true" );
AllDayBox.appendChild( SeperatorNode );
AllDayBox.appendChild( newImage );
AllDayBox.appendChild( newTextNode );
//change the seperator to add commas after the text.
Seperator = ", ";
}
else
{
eventBox = this.createEventBox( calendarEvent );
//add the box to the bulletin board.
document.getElementById( "day-view-content-board" ).appendChild( eventBox );
}
}
// select the hour of the selected item, if there is an item whose date matches
var selectedEvent = this.calendarWindow.getSelectedEvent();
//if the selected event is today, highlight it. Otherwise, don't highlight anything.
if ( selectedEvent )
{
this.selectEvent( selectedEvent );
}
}
/** PRIVATE
*
* This creates an event box for the day view
*/
DayView.prototype.createEventBox = function ( calendarEvent )
{
// build up the text to show for this event
var eventText = calendarEvent.title;
var eventStartDate = calendarEvent.displayDate;
var startHour = eventStartDate.getHours();
var startMinutes = eventStartDate.getMinutes();
var eventEndDate = calendarEvent.end;
var endHour = eventEndDate.getHours();
var eventEndDateTime = new Date( 2000, 1, 1, eventEndDate.getHours(), eventEndDate.getMinutes(), 0 );
var eventStartDateTime = new Date( 2000, 1, 1, eventStartDate.getHours(), eventStartDate.getMinutes(), 0 );
var eventDuration = new Date( eventEndDateTime - eventStartDateTime );
var hourDuration = eventDuration / (3600000);
/*if( calendarEvent.location )
{
eventText += "\n" + calendarEvent.location;
}
if( calendarEvent.description )
{
eventText += "\n" + calendarEvent.description;
}
*/
var eventBox = document.createElement( "hbox" );
top = eval( ( startHour*kDayViewHourHeight ) + ( ( startMinutes/60 ) * kDayViewHourHeight ) );
eventBox.setAttribute( "top", top );
eventBox.setAttribute( "height", ( hourDuration*kDayViewHourHeight ) - 2 );
eventBox.setAttribute( "width", 500 / calendarEvent.NumberOfSameTimeEvents );
left = eval( ( ( calendarEvent.CurrentSpot - 1 ) * eventBox.getAttribute( "width" ) ) + kDayViewHourLeftStart );
eventBox.setAttribute( "left", left );
eventBox.setAttribute( "class", "day-view-event-class" );
eventBox.setAttribute( "flex", "1" );
eventBox.setAttribute( "eventbox", "dayview" );
eventBox.setAttribute( "onclick", "dayEventItemClick( this, event )" );
eventBox.setAttribute( "ondblclick", "dayEventItemDoubleClick( this, event )" );
eventBox.setAttribute( "onmouseover", "gCalendarWindow.mouseOverInfo( calendarEvent, event )" );
eventBox.setAttribute( "tooltip", "savetip" );
eventBox.setAttribute( "id", "day-view-event-box-"+calendarEvent.id );
eventBox.setAttribute( "name", "day-view-event-box-"+calendarEvent.id );
var eventHTMLElement = document.createElement( "html" );
eventHTMLElement.setAttribute( "id", "day-view-event-html"+calendarEvent.id );
var eventTextElement = document.createTextNode( eventText );
eventHTMLElement.setAttribute( "class", "day-view-event-text-class" );
eventHTMLElement.setAttribute( "width", eventBox.getAttribute( "width" ) );
eventHTMLElement.setAttribute( "style", "max-width: "+eventBox.getAttribute( "width" )+";"+";max-height: "+eventBox.getAttribute( "height" )+";overflow: never;" );
eventBox.setAttribute( "style", "max-width: "+eventBox.getAttribute( "width" )+";max-height: "+eventBox.getAttribute( "height" )+";overflow: never;" );
eventHTMLElement.setAttribute( "autostretch", "never" );
eventHTMLElement.appendChild( eventTextElement );
eventBox.appendChild( eventHTMLElement );
// add a property to the event box that holds the calendarEvent that the
// box represents
eventBox.calendarEvent = calendarEvent;
this.kungFooDeathGripOnEventBoxes.push( eventBox );
return( eventBox );
}
/** PUBLIC
*
* Called when the user switches from a different view
*/
DayView.prototype.switchFrom = function( )
{
}
/** PUBLIC
*
* Called when the user switches to the day view
*/
DayView.prototype.switchTo = function( )
{
// disable/enable view switching buttons
var weekViewButton = document.getElementById( "calendar-week-view-button" );
var monthViewButton = document.getElementById( "calendar-month-view-button" );
var dayViewButton = document.getElementById( "calendar-day-view-button" );
monthViewButton.setAttribute( "disabled", "false" );
weekViewButton.setAttribute( "disabled", "false" );
dayViewButton.setAttribute( "disabled", "true" );
// switch views in the deck
var calendarDeckItem = document.getElementById( "calendar-deck" );
calendarDeckItem.setAttribute( "index", 2 );
}
/** PUBLIC
*
* Redraw the display, but not the events
*/
DayView.prototype.refreshDisplay = function( )
{
// update the title
var dayName = this.calendarWindow.dateFormater.getDayName( this.calendarWindow.getSelectedDate().getDay() );
var monthName = this.calendarWindow.dateFormater.getMonthName( this.calendarWindow.getSelectedDate().getMonth() );
var dateString = dayName + ", " + monthName + " " + this.calendarWindow.getSelectedDate().getDate() + " " + this.calendarWindow.getSelectedDate().getFullYear();
var dayTextItem = document.getElementById( "day-title-text" );
dayTextItem.setAttribute( "value" , dateString );
}
/** PUBLIC
*
* Get the selected event and delete it.
*/
DayView.prototype.deletedSelectedEvent = function( )
{
// :TODO:
}
/** PUBLIC -- monthview only
*
* Called when an event box item is single clicked
*/
DayView.prototype.clickEventBox = function( eventBox, event )
{
// clear the old selected box
for ( i = 0; i < this.selectedEventBoxes.length; i++ )
{
this.selectedEventBoxes[i].setAttribute( "selected", false );
}
this.selectedEventBoxes = Array();
if( eventBox )
{
// select the event
this.selectEvent( eventBox.calendarEvent );
selectEventInUnifinder( eventBox.calendarEvent );
}
// Do not let the click go through, suppress default selection
if ( event )
{
event.stopPropagation();
}
}
/** 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( )
{
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()
{
var 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()
{
var prevDay = new Date( this.calendarWindow.selectedDate.getFullYear(), this.calendarWindow.selectedDate.getMonth(), this.calendarWindow.selectedDate.getDate() - 1 );
this.goToDay( prevDay );
}
/** PUBLIC
*
* select an event.
*/
DayView.prototype.selectEvent = function( calendarEvent )
{
//clear the selected event
gCalendarWindow.clearSelectedEvent( );
gCalendarWindow.setSelectedEvent( calendarEvent );
EventBoxes = document.getElementsByAttribute( "name", "day-view-event-box-"+calendarEvent.id );
for ( i = 0; i < EventBoxes.length; i++ )
{
EventBoxes[i].setAttribute( "selected", "true" );
this.selectedEventBoxes[ this.selectedEventBoxes.length ] = EventBoxes[i];
}
selectEventInUnifinder( calendarEvent );
}
/** PUBLIC
*
* clear the selected event by taking off the selected attribute.
*/
DayView.prototype.clearSelectedEvent = function( )
{
//Event = gCalendarWindow.getSelectedEvent();
//if there is an event, and if the event is in the current view.
//var SelectedBoxes = document.getElementsByAttribute( "name", "day-view-event-box-"+Event.id );
for ( i = 0; i < this.selectedEventBoxes.length; i++ )
{
this.selectedEventBoxes[i].setAttribute( "selected", false );
}
this.selectedEventBoxes = Array();
//clear the selection in the unifinder
deselectEventInUnifinder( );
}
DayView.prototype.clearSelectedDate = function( )
{
return;
}
DayView.prototype.getVisibleEvent = function( calendarEvent )
{
eventBox = document.getElementById( "day-view-event-box-"+calendarEvent.id );
if ( eventBox )
{
return eventBox;
}
else
return null;
}
/*
** This function is needed because it may be called after the end of each day.
*/
DayView.prototype.hiliteTodaysDate = function( )
{
return;
}

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

@ -0,0 +1,237 @@
<?xml version="1.0"?>
<!--
- 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 OEone Corporation are Copyright (C) 2001
- OEone Corporation. All Rights Reserved.
-
- Contributor(s): Garth Smedley (garths@oeone.com), Mike Potter (mikep@oeone.com)
-
- Alternatively, the contents of this file may be used under the terms of
- either the GNU General Public License Version 2 or later (the "GPL"), or
- the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- in which case the provisions of the GPL or the LGPL are applicable instead
- of those above. If you wish to allow use of your version of this file only
- under the terms of either the GPL or the LGPL, and not to allow others to
- use your version of this file under the terms of the MPL, indicate your
- decision by deleting the provisions above and replace them with the notice
- and other provisions required by the 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.
-
- -->
<!-- Style sheets -->
<?xml-stylesheet href="chrome://global/skin/global.css" type="text/css"?>
<?xml-stylesheet href="chrome://calendar/skin/calendar.css" ?>
<!-- DTDs -->
<!-- DTD File with all strings specific to the calendar -->
<!DOCTYPE window
[
<!ENTITY % dtd1 SYSTEM "chrome://penglobal/locale/global.dtd" > %dtd1;
<!ENTITY % dtd2 SYSTEM "chrome://calendar/locale/calendar.dtd" > %dtd2;
]>
<!-- The Window -->
<overlay
xmlns:html="http://www.w3.org/1999/xhtml"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
>
<script type="application/x-javascript" src="chrome://calendar/content/calendarDayView.js"/>
<vbox id="day-view-box" flex="1">
<!-- Day View: Controls-->
<hbox id="day-controls-box">
<image flex="1" id="day-previous-button" onclick="gCalendarWindow.goToPrevious()"/>
<label id="day-title-text" value="" />
<box flex="1" id="day-next-button-box">
<image id="day-next-button" onclick="gCalendarWindow.goToNext()"/>
</box>
</hbox>
<!-- Day View: -->
<box id="all-day-content-box" collapsed="true" flex="1">
<label id="all-day-content-box-text" value="All-Day Events: "/>
</box>
<!-- This is an overlay being included from above -->
<box id="day-view-content-box" autostretch="true" flex="1">
<stack id="day-view-content-board" flex="1" height="1200">
<image src="chrome://calendar/skin/day_left_gradient.png" left="1" top="1" width="30" height="1199"/>
<hbox top="0" left="31" class="day-view-hour-box-class" id="day-tree-item-0" onclick="dayViewHourClick( 0, event )" ondblclick="dayViewHourDoubleClick( 0, event )" >
<box class="day-time-class" flex="1">
<label class="day-time-class" id="day-view-hour" value="&time.midnight; " />
</box>
</hbox>
<box top="50" left="31" class="day-view-hour-box-class" id="day-tree-item-1" onclick="dayViewHourClick( 1, event )" ondblclick="dayViewHourDoubleClick( 1, event )" >
<box class="day-time-class">
<label class="day-time-class" id="day-view-hour" value="&time.1; " />
</box>
</box>
<box top="100" left="31" class="day-view-hour-box-class" id="day-tree-item-2" onclick="dayViewHourClick( 2, event )" ondblclick="dayViewHourDoubleClick( 2, event )" >
<box class="day-time-class">
<label class="day-time-class" id="day-view-hour" value="&time.2; " />
</box>
</box>
<box top="150" left="31" class="day-view-hour-box-class" id="day-tree-item-3" onclick="dayViewHourClick( 3, event )" ondblclick="dayViewHourDoubleClick( 3, event )" >
<box class="day-time-class">
<label class="day-time-class" id="day-view-hour" value="&time.3; " />
</box>
</box>
<box top="200" left="31" class="day-view-hour-box-class" id="day-tree-item-4" onclick="dayViewHourClick( 4, event )" ondblclick="dayViewHourDoubleClick( 4, event )" >
<box class="day-time-class">
<label class="day-time-class" id="day-view-hour" value="&time.4; " />
</box>
</box>
<box top="250" left="31" class="day-view-hour-box-class" id="day-tree-item-5" onclick="dayViewHourClick( 5, event )" ondblclick="dayViewHourDoubleClick( 5, event )" >
<box class="day-time-class">
<label class="day-time-class" id="day-view-hour" value="&time.5; " />
</box>
</box>
<box top="300" left="31" class="day-view-hour-box-class" id="day-tree-item-6" onclick="dayViewHourClick( 6, event )" ondblclick="dayViewHourDoubleClick( 6, event )" >
<box class="day-time-class">
<label class="day-time-class" id="day-view-hour" value="&time.6; " />
</box>
</box>
<box top="350" left="31" class="day-view-hour-box-class" id="day-tree-item-7" onclick="dayViewHourClick( 7, event )" ondblclick="dayViewHourDoubleClick( 7, event )" >
<box class="day-time-class">
<label class="day-time-class" id="day-view-hour" value="&time.7; " />
</box>
</box>
<box top="400" left="31" class="day-view-hour-box-class" id="day-tree-item-8" onclick="dayViewHourClick( 8, event )" ondblclick="dayViewHourDoubleClick( 8, event )" >
<box class="day-time-class">
<label class="day-time-class" id="day-view-hour" value="&time.8; " />
</box>
</box>
<box top="450" left="31" class="day-view-hour-box-class" id="day-tree-item-9" onclick="dayViewHourClick( 9, event )" ondblclick="dayViewHourDoubleClick( 9, event )" >
<box class="day-time-class">
<label class="day-time-class" id="day-view-hour" value="&time.9; " />
</box>
</box>
<box top="500" left="31" class="day-view-hour-box-class" id="day-tree-item-10" onclick="dayViewHourClick( 10, event )" ondblclick="dayViewHourDoubleClick( 10, event )" >
<box class="day-time-class">
<label class="day-time-class" id="day-view-hour" value="&time.10; " />
</box>
</box>
<box top="550" left="31" class="day-view-hour-box-class" id="day-tree-item-11" onclick="dayViewHourClick( 11, event )" ondblclick="dayViewHourDoubleClick( 11, event )" >
<box class="day-time-class">
<label class="day-time-class" id="day-view-hour" value="&time.11; " />
</box>
</box>
<box top="600" left="31" class="day-view-hour-box-class" id="day-tree-item-12" onclick="dayViewHourClick( 12, event )" ondblclick="dayViewHourDoubleClick( 12, event )" >
<box class="day-time-class">
<label class="day-time-class" id="day-view-hour" value="&time.noon; " />
</box>
</box>
<box top="650" left="31" class="day-view-hour-box-class" id="day-tree-item-13" onclick="dayViewHourClick( 13, event )" ondblclick="dayViewHourDoubleClick( 13, event )" >
<box class="day-time-class">
<label class="day-time-class" id="day-view-hour" value="&time.13; " />
</box>
</box>
<box top="700" left="31" class="day-view-hour-box-class" id="day-tree-item-14" onclick="dayViewHourClick( 14, event )" ondblclick="dayViewHourDoubleClick( 14, event )" >
<box class="day-time-class">
<label class="day-time-class" id="day-view-hour" value="&time.14; " />
</box>
</box>
<box top="750" left="31" class="day-view-hour-box-class" id="day-tree-item-15" onclick="dayViewHourClick( 15, event )" ondblclick="dayViewHourDoubleClick( 15, event )" >
<box class="day-time-class">
<label class="day-time-class" id="day-view-hour" value="&time.15; " />
</box>
</box>
<box top="800" left="31" class="day-view-hour-box-class" id="day-tree-item-16" onclick="dayViewHourClick( 16, event )" ondblclick="dayViewHourDoubleClick( 16, event )" >
<box class="day-time-class">
<label class="day-time-class" id="day-view-hour" value="&time.16; " />
</box>
</box>
<box top="850" left="31" class="day-view-hour-box-class" id="day-tree-item-17" onclick="dayViewHourClick( 17, event )" ondblclick="dayViewHourDoubleClick( 17, event )" >
<box class="day-time-class">
<label class="day-time-class" id="day-view-hour" value="&time.17; " />
</box>
</box>
<box top="900" left="31" class="day-view-hour-box-class" id="day-tree-item-18" onclick="dayViewHourClick( 18, event )" ondblclick="dayViewHourDoubleClick( 18, event )" >
<box class="day-time-class">
<label class="day-time-class" id="day-view-hour" value="&time.18; " />
</box>
</box>
<box top="950" left="31" class="day-view-hour-box-class" id="day-tree-item-19" onclick="dayViewHourClick( 19, event )" ondblclick="dayViewHourDoubleClick( 19, event )" >
<box class="day-time-class">
<label class="day-time-class" id="day-view-hour" value="&time.19; " />
</box>
</box>
<box top="1000" left="31" class="day-view-hour-box-class" id="day-tree-item-20" onclick="dayViewHourClick( 20, event )" ondblclick="dayViewHourDoubleClick( 20, event )" >
<box class="day-time-class">
<label class="day-time-class" id="day-view-hour" value="&time.20; " />
</box>
</box>
<box top="1050" left="31" class="day-view-hour-box-class" id="day-tree-item-21" onclick="dayViewHourClick( 21, event )" ondblclick="dayViewHourDoubleClick( 21, event )" >
<box class="day-time-class">
<label class="day-time-class" id="day-view-hour" value="&time.21; " />
</box>
</box>
<box top="1100" left="31" class="day-view-hour-box-class" id="day-tree-item-22" onclick="dayViewHourClick( 22, event )" ondblclick="dayViewHourDoubleClick( 22, event )" >
<box class="day-time-class">
<label class="day-time-class" id="day-view-hour" value="&time.22; " />
</box>
</box>
<box top="1150" left="31" class="day-view-hour-box-class" id="day-tree-item-23" onclick="dayViewHourClick( 23, event )" ondblclick="dayViewHourDoubleClick( 23, event )" >
<box class="day-time-class">
<label class="day-time-class" id="day-view-hour" value="&time.23; " />
</box>
</box>
</stack>
</box> <!-- End: day-tree-content-box -->
</vbox> <!-- End: Calendar Day View -->
</overlay>

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

@ -0,0 +1,84 @@
/*
* 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 Corporation.
*
* The Initial Developer of the Original Code is
* OEone Corporation.
* Portions created by OEone Corporation are Copyright (C) 2001
* OEone Corporation. All Rights Reserved.
*
* Contributor(s): Garth Smedley (garths@oeone.com) , Mike Potter (mikep@oeone.com)
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
*
*/
var gCategory = null;
var gOnOkFunction;
function calendarFolderDialogInit()
{
var args = window.arguments[0];
gCategory = args.Category;
gOnOkFunction = args.onOk;
if( args.mode == "edit" )
{
var Title = EditCalendarFolderTitle;
var Name = gCategory.name;
document.getElementById( "name" ).value = Name;
}
else
{
document.getElementById( "name" ).value = DefaultFolderName;
var Title = NewCalendarFolderTitle;
}
document.getElementById( "standard-dialog-title-text" ).setAttribute( "value", Title );
setupOkCancelButtons( onOKCommand, 0 );
document.getElementById( "name" ).select();
document.getElementById( "name" ).focus();
}
function onOKCommand()
{
//get the name and the location
gCategory.name = document.getElementById( "name" ).value;
gOnOkFunction( gCategory );
return( true );
}

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

@ -0,0 +1,112 @@
<?xml version="1.0"?>
<!--
- 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 OEone Corporation are Copyright (C) 2001
- OEone Corporation. All Rights Reserved.
-
- Contributor(s): Garth Smedley (garths@oeone.com), Mike Potter (mikep@oeone.com)
-
- Alternatively, the contents of this file may be used under the terms of
- either the GNU General Public License Version 2 or later (the "GPL"), or
- the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- in which case the provisions of the GPL or the LGPL are applicable instead
- of those above. If you wish to allow use of your version of this file only
- under the terms of either the GPL or the LGPL, and not to allow others to
- use your version of this file under the terms of the MPL, indicate your
- decision by deleting the provisions above and replace them with the notice
- and other provisions required by the 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.
-
- -->
<?xml-stylesheet href="chrome://global/skin/global.css" type="text/css"?>
<?xul-overlay href="chrome://penglobal/content/dialogOverlay.xul"?>
<!-- CSS File with all styles specific to the dialog -->
<?xml-stylesheet href="chrome://calendar/skin/ca-category-dialog.css" ?>
<!DOCTYPE window [
<!ENTITY % dtd1 SYSTEM "chrome://calendar/locale/calendarFolder.dtd" > %dtd1;
<!ENTITY % dtd2 SYSTEM "chrome://penglobal/locale/global.dtd" > %dtd2;
]>
<window id="newBookmarkWindow"
title="Internet Appliance Dialog - Calendar Folder"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
orient="vertical"
onload="calendarFolderDialogInit()">
<script type="application/x-javascript" src="chrome://calendar/content/calendarFolderDialog.js"/>
<!-- Javascript DTD To Variable -->
<script type="application/x-javascript">
var EditCalendarFolderTitle = "&editCalendarFolder.title.label;";
var NewCalendarFolderTitle = "&addCalendarFolder.title.label;";
var DefaultFolderName = "&addCalendarFolder.default.label;";
</script>
<vbox id="dialog-box">
<hbox id="standard-dialog-title">
<image id="standard-dialog-title-icon"/>
<spring flex="1"/>
<box id="standard-dialog-title-text-box" flex="1">
<label id="standard-dialog-title-text"/>
</box>
<spring flex="1"/>
</hbox>
<box id="standard-dialog-content">
<separator class="thin"/>
<grid id="calendarnamegrid">
<columns>
<column/>
<column flex="1"/>
</columns>
<rows>
<row autostretch="never">
<spacer/>
</row>
<row autostretch="never">
<text class="label" value="&addCalendarFolder.name.label;" for="name"/>
<box>
<textbox size="40" id="name"/>
<spring flex="1"/>
</box>
</row>
<row autostretch="never">
<spacer/>
</row>
</rows>
</grid>
</box>
<!-- Bottom Box -->
<box id="standard-dialog-command">
<box id="standard-dialog-commands-standard"/>
</box>
</vbox>
</window>

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

@ -0,0 +1,774 @@
/*
* 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 Corporation.
*
* The Initial Developer of the Original Code is
* OEone Corporation.
* Portions created by OEone Corporation are Copyright (C) 2001
* OEone Corporation. All Rights Reserved.
*
* Contributor(s): Garth Smedley (garths@oeone.com) , Mike Potter (mikep@oeone.com)
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
*
*/
/*-----------------------------------------------------------------
* MonthView Class subclass of CalendarView
*
* Calendar month view class
*
* PROPERTIES
* selectedEventBox - Events are displayed in dynamically created event boxes
* this is the selected box, or null
*
* showingLastDay - When the user changes to a new month we select
* the same day in the new month that was selected in the original month. If the
* new month does not have that day ( i.e. 31 was selected and the new month has
* only 30 days ) we move the selection to the last day. When this happens we turn on
* the 'showingLastDay' flag. Now we will always select the last day when the month
* is changed so that if they go back to the original month, 31 is selected again.
* 'showingLastDay' is turned off when the user selects a new day or changes the view.
*
*
* dayNumberItemArray - An array [ 0 to 41 ] of text boxes that hold the day numbers in the month view.
* We set the value attribute to the day number, or "" for boxes that are not in the month.
* In the XUL they have id's of the form month-week-<row_number>-day-<column_number>
* where row_number is 1 - 6 and column_number is 1 - 7.
*
* dayBoxItemArray - An array [ 0 to 41 ] of boxes, one for each day in the month view. These boxes
* are selected when a day is selected. They contain a dayNumberItem and event boxes.
* In the XUL they have id's of the form month-week-<row_number>-day-<column_number>-box
* where row_number is 1 - 6 and column_number is 1 - 7.
*
* dayBoxItemByDateArray - This array is reconstructed whenever the month changes ( and probably more
* often than that ) It contains day box items, just like the dayBoxItemArray above,
* except this array contains only those boxes that belong to the current month
* and is indexed by date. So for a 30 day month that starts on a Wednesday,
* dayBoxItemByDateArray[0] === dayBoxItemArray[3] and
* dayBoxItemByDateArray[29] === dayBoxItemArray[36]
*
* kungFooDeathGripOnEventBoxes - This is to keep the event box javascript objects around so when we get
* them back they still have the calendar event property on them.
*
*
* NOTES
*
* Events are displayed in dynamically created event boxes. these boxes have a property added to them
* called "calendarEvent" which contains the event represented by the box.
*
* There is one day box item for every day box in the month grid. These have an attribute
* called "empty" which is set to "true", like so:
*
* dayBoxItem.setAttribute( "empty" , "true" );
*
* when the day box is not in the month. This allows the display to be controlled from css.
*
* The day boxes also have a couple of properties added to them:
*
* dayBoxItem.dayNumber - null when day is not in month.
* - the date, 1 to 31, otherwise,
*
* dayBoxItem.numEvents - The number of events for the day, used to limit the number displayed
* since there is only room for 3.
*
*/
// Make MonthView inherit from CalendarView
MonthView.prototype = new CalendarView();
MonthView.prototype.constructor = MonthView;
/**
* MonthView Constructor.
*
* PARAMETERS
* calendarWindow - the owning instance of CalendarWindow.
*
*/
function MonthView( calendarWindow )
{
// call the super constructor
this.superConstructor( calendarWindow );
// set up, see notes above
this.selectedEventBoxes = new Array();
this.selectedTodayBox = null;
this.showingLastDay = false;
// set up month day box's and day number text items, see notes above
this.dayNumberItemArray = new Array();
this.dayBoxItemArray = new Array();
var dayItemIndex = 0;
for( var weekIndex = 1; weekIndex <= 6; ++weekIndex )
{
for( var dayIndex = 1; dayIndex <= 7; ++dayIndex )
{
// add the day text item to an array[0..41]
var dayNumberItem = document.getElementById( "month-week-" + weekIndex + "-day-" + dayIndex );
this.dayNumberItemArray[ dayItemIndex ] = dayNumberItem;
// add the day box to an array[0..41]
var dayBoxItem = document.getElementById( "month-week-" + weekIndex + "-day-" + dayIndex + "-box" );
this.dayBoxItemArray[ dayItemIndex ] = dayBoxItem;
// set on click of day boxes
dayBoxItem.setAttribute( "onclick", "gCalendarWindow.monthView.clickDay( this )" );
//set the double click of day boxes
dayBoxItem.setAttribute( "ondblclick", "gCalendarWindow.monthView.doubleClickDay( this )" );
// array index
++dayItemIndex;
}
}
}
/** PUBLIC
*
* Redraw the events for the current month
*
* We create XUL boxes dynamically and insert them into the XUL.
* To refresh the display we remove all the old boxes and make new ones.
*/
MonthView.prototype.refreshEvents = function( )
{
// get this month's events and display them
var monthEventList = this.calendarWindow.eventSource.getEventsForMonth( this.calendarWindow.getSelectedDate() );
// remove old event boxes
var eventBoxList = document.getElementsByAttribute( "eventbox", "monthview" );
for( var eventBoxIndex = 0; eventBoxIndex < eventBoxList.length; ++eventBoxIndex )
{
var eventBox = eventBoxList[ eventBoxIndex ];
eventBox.parentNode.removeChild( eventBox );
}
// clear calendarEvent counts, we only display 3 events per day
// so to count them by adding a property to the dayItem, which is zeroed here
for( var dayItemIndex = 0; dayItemIndex < this.dayBoxItemArray.length; ++dayItemIndex )
{
var dayItem = this.dayBoxItemArray[ dayItemIndex ];
dayItem.numEvents = 0;
}
// remove the old selection
this.selectedEventBoxes = Array();
// add each calendarEvent
this.kungFooDeathGripOnEventBoxes = new Array();
for( var eventIndex = 0; eventIndex < monthEventList.length; ++eventIndex )
{
var calendarEvent = monthEventList[ eventIndex ];
var eventDate = calendarEvent.displayDate;
// get the day box for the calendarEvent's day
var eventDayInMonth = eventDate.getDate();
var dayBoxItem = this.dayBoxItemByDateArray[ eventDayInMonth ];
// Display no more than three, show dots for the events > 3
dayBoxItem.numEvents += 1;
if( dayBoxItem.numEvents < 4 )
{
// Make a text item to show the event title
var eventBoxText = document.createElement( "text" );
eventBoxText.setAttribute( "crop", "right" );
eventBoxText.setAttribute( "class", "month-day-event-text-class" );
eventBoxText.setAttribute( "value", calendarEvent.title );
// Make a box item to hold the text item
var eventBox = document.createElement( "vbox" );
eventBox.setAttribute( "id", "month-view-event-box-"+calendarEvent.id );
eventBox.setAttribute( "name", "month-view-event-box-"+calendarEvent.id );
eventBox.setAttribute( "event"+calendarEvent.id, true );
eventBox.setAttribute( "class", "month-day-event-box-class" );
eventBox.setAttribute( "eventbox", "monthview" );
eventBox.setAttribute( "onclick", "monthEventBoxClickEvent( this, event )" );
eventBox.setAttribute( "ondblclick", "monthEventBoxDoubleClickEvent( this, event )" );
// add a property to the event box that holds the calendarEvent that the
// box represents
eventBox.calendarEvent = calendarEvent;
this.kungFooDeathGripOnEventBoxes.push( eventBox );
eventBox.setAttribute( "onmouseover", "gCalendarWindow.mouseOverInfo( calendarEvent, event )" );
eventBox.setAttribute( "tooltip", "savetip" );
// add the text to the event box and the event box to the day box
eventBox.appendChild( eventBoxText );
dayBoxItem.appendChild( eventBox );
}
else
{
//if there is not a box to hold the little dots for this day...
if ( !document.getElementById( "dotboxholder"+calendarEvent.start.getDate() ) )
{
//make one
dotBoxHolder = document.createElement( "hbox" );
dotBoxHolder.setAttribute( "id", "dotboxholder"+calendarEvent.start.getDate() );
dotBoxHolder.setAttribute( "eventbox", "monthview" );
//add the box to the day.
dayBoxItem.appendChild( dotBoxHolder );
}
else
{
//otherwise, get the box
dotBoxHolder = document.getElementById( "dotboxholder"+calendarEvent.start.getDate() );
}
if( dotBoxHolder.childNodes.length < kMAX_NUMBER_OF_DOTS_IN_MONTH_VIEW )
{
eventDotBox = document.createElement( "box" );
eventDotBox.setAttribute( "eventbox", "monthview" );
//show a dot representing an event.
//NOTE: This variable is named eventBox because it needs the same name as
// the regular boxes, for the next part of the function!
eventBox = document.createElement( "image" );
eventBox.setAttribute( "class", "month-view-event-dot-class" );
eventBox.setAttribute( "id", "month-view-event-box-"+calendarEvent.id );
eventBox.setAttribute( "name", "month-view-event-box-"+calendarEvent.id );
eventBox.calendarEvent = calendarEvent;
this.kungFooDeathGripOnEventBoxes.push( eventBox );
eventBox.setAttribute( "onmouseover", "gCalendarWindow.mouseOverInfo( calendarEvent, event )" );
eventBox.setAttribute( "onclick", "monthEventBoxClickEvent( this, event )" );
eventBox.setAttribute( "ondblclick", "monthEventBoxDoubleClickEvent( this, event )" );
eventBox.setAttribute( "tooltip", "savetip" );
//add the dot to the extra box.
eventDotBox.appendChild( eventBox );
dotBoxHolder.appendChild( eventDotBox );
}
}
// mark the box as selected, if the event is
if( this.calendarWindow.getSelectedEvent() === calendarEvent )
{
var eventBox = gCalendarWindow.currentView.getVisibleEvent( calendarEvent );
gCalendarWindow.currentView.clickEventBox( eventBox );
selectEventInUnifinder( calendarEvent );
}
}
}
/** PUBLIC
*
* Called when the user switches to a different view
*/
MonthView.prototype.switchFrom = function( )
{
this.selectedEventBoxes = Array();
}
/** PUBLIC
*
* Called when the user switches to the month view
*/
MonthView.prototype.switchTo = function( )
{
// see showingLastDay notes above
this.showingLastDay = false;
// disable/enable view switching buttons
var weekViewButton = document.getElementById( "calendar-week-view-button" );
var monthViewButton = document.getElementById( "calendar-month-view-button" );
var dayViewButton = document.getElementById( "calendar-day-view-button" );
monthViewButton.setAttribute( "disabled", "true" );
weekViewButton.setAttribute( "disabled", "false" );
dayViewButton.setAttribute( "disabled", "false" );
// switch views in the deck
var calendarDeckItem = document.getElementById( "calendar-deck" );
calendarDeckItem.setAttribute( "index", 0 );
}
/** PUBLIC
*
* Redraw the display, but not the events
*/
MonthView.prototype.refreshDisplay = function( ShowEvent )
{
// set the month/year in the header
var newMonth = this.calendarWindow.getSelectedDate().getMonth();
var newYear = this.calendarWindow.getSelectedDate().getFullYear();
var monthName = this.calendarWindow.dateFormater.getMonthName( newMonth );
monthTextItem = document.getElementById( "month-title-text" );
monthTextItem.setAttribute( "value" , monthName + " " + newYear );
// Write in all the day numbers and create the dayBoxItemByDateArray, see notes above
// figure out first and last days of the month
var firstDate = new Date( newYear, newMonth, 1 );
var firstDayOfWeek = firstDate.getDay();
var lastDayOfMonth = DateUtils.getLastDayOfMonth( newYear, newMonth );
// prepare the dayBoxItemByDateArray, we will be filling this in
this.dayBoxItemByDateArray = new Array();
// loop through all the day boxes
var dayNumber = 1;
for( var dayIndex = 0; dayIndex < this.dayNumberItemArray.length; ++dayIndex )
{
var dayNumberItem = this.dayNumberItemArray[ dayIndex ];
var dayBoxItem = this.dayBoxItemArray[ dayIndex ];
if( dayIndex < firstDayOfWeek || dayNumber > lastDayOfMonth )
{
// this day box is NOT in the month,
dayNumberItem.setAttribute( "value" , "" );
dayBoxItem.setAttribute( "empty" , "true" );
dayBoxItem.dayNumber = null;
}
else
{
dayNumberItem.setAttribute( "value" , dayNumber );
dayBoxItem.setAttribute( "empty" , "false" );
dayBoxItem.dayNumber = dayNumber;
this.dayBoxItemByDateArray[ dayNumber ] = dayBoxItem;
++dayNumber;
}
}
// if we aren't showing an event, highlite the selected date.
if ( !ShowEvent )
{
//debug("\n\n-->>>>Im' going to be highlightin the date from refresh display!!!");
this.hiliteSelectedDate( );
}
//always highlight today's date.
this.hiliteTodaysDate( );
}
/** PRIVATE
*
* Mark the selected date, also unmark the old selection if there was one
*/
MonthView.prototype.hiliteSelectedDate = function( )
{
// Clear the old selection if there was one
if( this.selectedBox )
{
this.selectedBox.setAttribute( "selected" , "false" );
this.selectedBox = null;
}
// Set the background for selection
this.selectedBox = this.dayBoxItemByDateArray[ this.calendarWindow.getSelectedDate().getDate() ];
this.selectedBox.setAttribute( "selected" , "true" );
}
/** PUBLIC
*
* Unmark the selected date if there is one.
*/
MonthView.prototype.clearSelectedDate = function( )
{
if ( this.selectedBox )
{
this.selectedBox.setAttribute( "selected", "false" );
this.selectedBox = null;
}
}
/** PRIVATE
*
* Mark today as selected, also unmark the old today if there was one.
*/
MonthView.prototype.hiliteTodaysDate = function( )
{
var Month = this.calendarWindow.getSelectedDate().getMonth();
var Year = this.calendarWindow.getSelectedDate().getFullYear();
// Clear the old selection if there was one
if ( this.selectedTodayBox )
{
this.selectedTodayBox.setAttribute( "today", "false" );
this.selectedTodayBox = null;
}
//highlight today.
var Today = new Date( );
if ( Year == Today.getFullYear() && Month == Today.getMonth() )
{
this.selectedTodayBox = this.dayBoxItemByDateArray[ Today.getDate() ];
this.selectedTodayBox.setAttribute( "today", "true" );
}
else
this.selectedTodayBox = null;
}
/** PUBLIC
*
* Get the selected event and delete it.
*/
MonthView.prototype.deletedSelectedEvent = function( )
{
if( this.selectedEventBoxes.length > 0 )
{
for ( i = 0; i < this.selectedEventBoxes.length; i++ )
{
var calendarEvent = this.selectedEventBoxes[i].calendarEvent;
// tell the event source to delete it, the observers will be called
// back into to update the display
}
this.calendarWindow.eventSource.deleteEvent( calendarEvent );
}
}
/** PUBLIC
*
* This is called when we are about the make a new event
* and we want to know what the default start date should be for the event.
*/
MonthView.prototype.getNewEventDate = function( )
{
// use the selected year, month and day
// and the current hours and minutes
var now = new Date();
var start = new Date( this.calendarWindow.getSelectedDate() );
start.setHours( now.getHours() );
start.setMinutes( Math.ceil( now.getMinutes() / 5 ) * 5 );
start.setSeconds( 0 );
return start;
}
/** PUBLIC
*
* Go to the next month.
*/
MonthView.prototype.goToNext = function()
{
var nextMonth = new Date( this.calendarWindow.selectedDate.getFullYear(), this.calendarWindow.selectedDate.getMonth() + 1, 1 );
this.adjustNewMonth( nextMonth );
// move to new date
this.goToDay( nextMonth );
}
/** PUBLIC
*
* Go to the previous month.
*/
MonthView.prototype.goToPrevious = function()
{
var prevMonth = new Date( this.calendarWindow.selectedDate.getFullYear(), this.calendarWindow.selectedDate.getMonth() - 1, 1 );
this.adjustNewMonth( prevMonth );
this.goToDay( prevMonth );
}
/** PRIVATE
*
* Helper function for goToNext and goToPrevious
*
* When the user changes to a new month the new month may not have the selected day in it.
* ( i.e. 31 was selected and the new month has only 30 days ).
* In that case our addition, or subtraction, in goToNext or goToPrevious will cause the
* date to jump a month. ( Say the date starts at May 31, we add 1 to the month, Now the
* date would be June 31, but the Date object knows there is no June 31, so it sets itself
* to July 1. )
*
* In goToNext or goToPrevious we set the date to be 1, so the month will be correct. Here
* we set the date to be the selected date, making adjustments if the selected date is not in the month.
*/
MonthView.prototype.adjustNewMonth = function( newMonth )
{
// Don't let a date beyond the end of the month make us jump
// too many or too few months
var lastDayOfMonth = DateUtils.getLastDayOfMonth( newMonth.getFullYear(), newMonth.getMonth() );
if( this.calendarWindow.selectedDate.getDate() > lastDayOfMonth )
{
// The selected date is NOT in the month
// set it to the last day of the month and turn on showingLastDay, see notes in MonthView class
newMonth.setDate( lastDayOfMonth )
this.showingLastDay = true;
}
else if( this.showingLastDay )
{
// showingLastDay is on so select the last day of the month, see notes in MonthView class
newMonth.setDate( lastDayOfMonth )
}
else
{
// date is NOT beyond the last.
newMonth.setDate( this.calendarWindow.selectedDate.getDate() )
}
}
/** PUBLIC -- monthview only
*
* Called when a day box item is single clicked
*/
MonthView.prototype.clickDay = function( dayBoxItem )
{
if( dayBoxItem.dayNumber != null )
{
// turn off showingLastDay - see notes in MonthView class
this.showingLastDay = false;
// change the selected date and redraw it
this.calendarWindow.selectedDate.setDate( dayBoxItem.dayNumber );
this.hiliteSelectedDate( );
this.clearSelectedEvent( );
}
}
MonthView.prototype.doubleClickDay = function( dayBoxItem )
{
if ( dayBoxItem.dayNumber != null )
{
// change the selected date and redraw it
gCalendarWindow.selectedDate.setDate( dayBoxItem.dayNumber );
this.hiliteSelectedDate( );
this.clearSelectedEvent( );
var startDate = this.getNewEventDate();
newEvent( startDate, false );
}
}
/** PUBLIC -- monthview only
*
* Called when an event box item is single clicked
*/
MonthView.prototype.clickEventBox = function( eventBox, event )
{
//deselect the selected day in the month view
this.clearSelectedDate( );
//set the selected date to the start date of this event.
if( eventBox)
{
this.calendarWindow.selectedDate.setDate( eventBox.calendarEvent.start.getDate() );
// clear the old selected box
this.clearSelectedEvent( );
// select the event
this.calendarWindow.setSelectedEvent( eventBox.calendarEvent );
// mark new box as selected
var ArrayOfBoxes = document.getElementsByAttribute( "name", "month-view-event-box-"+eventBox.calendarEvent.id );
for ( i = 0; i < ArrayOfBoxes.length; i++ )
{
ArrayOfBoxes[i].setAttribute( "selected", "true" );
this.selectedEventBoxes[ this.selectedEventBoxes.length ] = ArrayOfBoxes[i];
}
// Do not let the click go through, suppress default selection
if ( event )
{
event.stopPropagation();
}
//select the event in the unifinder
selectEventInUnifinder( eventBox.calendarEvent );
}
}
MonthView.prototype.selectEvent = function( calendarEvent )
{
//clear the selected event
gCalendarWindow.clearSelectedEvent( );
gCalendarWindow.setSelectedEvent( calendarEvent );
var EventBoxes = document.getElementsByAttribute( "name", "week-view-event-box-"+calendarEvent.id );
for ( i = 0; i < EventBoxes.length; i++ )
{
EventBoxes[i].setAttribute( "selected", "true" );
this.selectedEventBoxes[ this.selectedEventBoxes.length ] = EventBoxes[i];
}
selectEventInUnifinder( calendarEvent );
}
MonthView.prototype.clearSelectedEvent = function ( )
{
Event = gCalendarWindow.getSelectedEvent();
//if ( Event && document.getElementById( "month-view-event-box-"+Event.id ) )
if ( Event && document.getElementsByAttribute( "name", "month-view-event-box-"+Event.id ).length > 0 )
{
ArrayOfElements = document.getElementsByAttribute( "id", "month-view-event-box-"+Event.id );
for ( i = 0; i < ArrayOfElements.length; i++ )
{
ArrayOfElements[i].setAttribute( "selected", false );
}
}
this.selectedEventBoxes = Array();
//clear the selection in the unifinder
deselectEventInUnifinder( );
}
MonthView.prototype.getVisibleEvent = function( calendarEvent )
{
eventBox = document.getElementById( "month-view-event-box-"+calendarEvent.id );
if ( eventBox )
{
return eventBox;
}
else
return null;
}

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

@ -0,0 +1,369 @@
<?xml version="1.0"?>
<!--
- 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 OEone Corporation are Copyright (C) 2001
- OEone Corporation. All Rights Reserved.
-
- Contributor(s): Garth Smedley (garths@oeone.com), Mike Potter (mikep@oeone.com)
-
- Alternatively, the contents of this file may be used under the terms of
- either the GNU General Public License Version 2 or later (the "GPL"), or
- the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- in which case the provisions of the GPL or the LGPL are applicable instead
- of those above. If you wish to allow use of your version of this file only
- under the terms of either the GPL or the LGPL, and not to allow others to
- use your version of this file under the terms of the MPL, indicate your
- decision by deleting the provisions above and replace them with the notice
- and other provisions required by the 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.
-
- -->
<!-- Style sheets -->
<?xml-stylesheet href="chrome://global/skin/global.css" type="text/css"?>
<?xml-stylesheet href="chrome://calendar/skin/calendar.css" ?>
<!-- DTDs -->
<!-- DTD File with all strings specific to the calendar -->
<!DOCTYPE window
[
<!ENTITY % dtd1 SYSTEM "chrome://penglobal/locale/global.dtd" > %dtd1;
<!ENTITY % dtd2 SYSTEM "chrome://calendar/locale/calendar.dtd" > %dtd2;
]>
<!-- The Window -->
<overlay
xmlns:html="http://www.w3.org/1999/xhtml"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
>
<script type="application/x-javascript" src="chrome://calendar/content/calendarMonthView.js"/>
<vbox id="month-view-box" flex="1">
<!-- Month View: Controls-->
<hbox id="month-controls-box">
<image flex="1" id="month-previous-button" onclick="gCalendarWindow.goToPrevious()"/>
<label id="month-title-text" value="" />
<box flex="1" id="month-next-button-box">
<image id="month-next-button" onclick="gCalendarWindow.goToNext()"/>
</box>
</hbox>
<vbox id="month-content-box">
<!-- Month View: Day name header -->
<hbox id="month-header-box" flex="1" >
<image class="month-header-image-class" id="month-header-day-1" />
<image class="month-header-image-class" id="month-header-day-2" />
<image class="month-header-image-class" id="month-header-day-3" />
<image class="month-header-image-class" id="month-header-day-4" />
<image class="month-header-image-class" id="month-header-day-5" />
<image class="month-header-image-class" id="month-header-day-6" />
<image class="month-header-image-class" id="month-header-day-7" />
</hbox>
<!-- Month View: Calendar Grid -->
<box id="month-grid-box" flex="1">
<grid id="month-grid" flex="1">
<columns>
<column class="month-column-class" flex="1"/>
<column class="month-column-class" flex="1"/>
<column class="month-column-class" flex="1"/>
<column class="month-column-class" flex="1"/>
<column class="month-column-class" flex="1"/>
<column class="month-column-class" flex="1"/>
<column class="month-column-class" flex="1"/>
</columns>
<rows >
<row flex="1" >
<vbox class="month-day-box-class weekend" flex="1" id="month-week-1-day-1-box" weekend="true">
<hbox>
<label class="month-day-number-class" id="month-week-1-day-1" value="" />
</hbox>
</vbox>
<vbox class="month-day-box-class" flex="1" id="month-week-1-day-2-box" >
<hbox>
<label class="month-day-number-class" id="month-week-1-day-2" value="" />
</hbox>
</vbox>
<vbox class="month-day-box-class" flex="1" id="month-week-1-day-3-box" >
<hbox>
<label class="month-day-number-class" id="month-week-1-day-3" value="" />
</hbox>
</vbox>
<vbox class="month-day-box-class" flex="1" id="month-week-1-day-4-box" >
<hbox>
<label class="month-day-number-class" id="month-week-1-day-4" value="" />
</hbox>
</vbox>
<vbox class="month-day-box-class" flex="1" id="month-week-1-day-5-box" >
<hbox>
<label class="month-day-number-class" id="month-week-1-day-5" value="" />
</hbox>
</vbox>
<vbox class="month-day-box-class" flex="1" id="month-week-1-day-6-box" >
<hbox>
<label class="month-day-number-class" id="month-week-1-day-6" value="" />
</hbox>
</vbox>
<vbox class="month-day-box-class weekend saturday" flex="1" id="month-week-1-day-7-box" weekend="true" >
<hbox>
<label class="month-day-number-class" id="month-week-1-day-7" value="" />
</hbox>
</vbox>
</row>
<row flex="1" >
<vbox class="month-day-box-class weekend" flex="1" id="month-week-2-day-1-box" weekend="true">
<hbox>
<label class="month-day-number-class" id="month-week-2-day-1" value="" />
</hbox>
</vbox>
<vbox class="month-day-box-class" flex="1" id="month-week-2-day-2-box" >
<hbox>
<label class="month-day-number-class" id="month-week-2-day-2" value="" />
</hbox>
</vbox>
<vbox class="month-day-box-class" flex="1" id="month-week-2-day-3-box" >
<hbox>
<label class="month-day-number-class" id="month-week-2-day-3" value="" />
</hbox>
</vbox>
<vbox class="month-day-box-class" flex="1" id="month-week-2-day-4-box" >
<hbox>
<label class="month-day-number-class" id="month-week-2-day-4" value="" />
</hbox>
</vbox>
<vbox class="month-day-box-class" flex="1" id="month-week-2-day-5-box" >
<hbox>
<label class="month-day-number-class" id="month-week-2-day-5" value="" />
</hbox>
</vbox>
<vbox class="month-day-box-class" flex="1" id="month-week-2-day-6-box" >
<hbox>
<label class="month-day-number-class" id="month-week-2-day-6" value="" />
</hbox>
</vbox>
<vbox class="month-day-box-class weekend saturday" flex="1" id="month-week-2-day-7-box" weekend="true" >
<hbox>
<label class="month-day-number-class" id="month-week-2-day-7" value="" />
</hbox>
</vbox>
</row>
<row flex="1" >
<vbox class="month-day-box-class weekend" flex="1" id="month-week-3-day-1-box" weekend="true" >
<hbox>
<label class="month-day-number-class" id="month-week-3-day-1" value="" />
</hbox>
</vbox>
<vbox class="month-day-box-class" flex="1" id="month-week-3-day-2-box" >
<hbox>
<label class="month-day-number-class" id="month-week-3-day-2" value="" />
</hbox>
</vbox>
<vbox class="month-day-box-class" flex="1" id="month-week-3-day-3-box" >
<hbox>
<label class="month-day-number-class" id="month-week-3-day-3" value="" />
</hbox>
</vbox>
<vbox class="month-day-box-class" flex="1" id="month-week-3-day-4-box" >
<hbox>
<label class="month-day-number-class" id="month-week-3-day-4" value="" />
</hbox>
</vbox>
<vbox class="month-day-box-class" flex="1" id="month-week-3-day-5-box" >
<hbox>
<label class="month-day-number-class" id="month-week-3-day-5" value="" />
</hbox>
</vbox>
<vbox class="month-day-box-class" flex="1" id="month-week-3-day-6-box" >
<hbox>
<label class="month-day-number-class" id="month-week-3-day-6" value="" />
</hbox>
</vbox>
<vbox class="month-day-box-class weekend saturday" flex="1" id="month-week-3-day-7-box" weekend="true" >
<hbox>
<label class="month-day-number-class" id="month-week-3-day-7" value="" />
</hbox>
</vbox>
</row>
<row flex="1" >
<vbox class="month-day-box-class weekend" flex="1" id="month-week-4-day-1-box" weekend="true" >
<hbox>
<label class="month-day-number-class" id="month-week-4-day-1" value="" />
</hbox>
</vbox>
<vbox class="month-day-box-class" flex="1" id="month-week-4-day-2-box">
<hbox>
<label class="month-day-number-class" id="month-week-4-day-2" value="" />
</hbox>
</vbox>
<vbox class="month-day-box-class" flex="1" id="month-week-4-day-3-box" >
<hbox>
<label class="month-day-number-class" id="month-week-4-day-3" value="" />
</hbox>
</vbox>
<vbox class="month-day-box-class" flex="1" id="month-week-4-day-4-box">
<hbox>
<label class="month-day-number-class" id="month-week-4-day-4" value="" />
</hbox>
</vbox>
<vbox class="month-day-box-class" flex="1" id="month-week-4-day-5-box" >
<hbox>
<label class="month-day-number-class" id="month-week-4-day-5" value="" />
</hbox>
</vbox>
<vbox class="month-day-box-class" flex="1" id="month-week-4-day-6-box" >
<hbox>
<label class="month-day-number-class" id="month-week-4-day-6" value="" />
</hbox>
</vbox>
<vbox class="month-day-box-class weekend saturday" flex="1" id="month-week-4-day-7-box" weekend="true" >
<hbox>
<label class="month-day-number-class" id="month-week-4-day-7" value="" />
</hbox>
</vbox>
</row>
<row flex="1" >
<vbox class="month-day-box-class weekend" flex="1" id="month-week-5-day-1-box" weekend="true" >
<hbox>
<label class="month-day-number-class" id="month-week-5-day-1" value="" />
</hbox>
</vbox>
<vbox class="month-day-box-class" flex="1" id="month-week-5-day-2-box" >
<hbox>
<label class="month-day-number-class" id="month-week-5-day-2" value="" />
</hbox>
</vbox>
<vbox class="month-day-box-class" flex="1" id="month-week-5-day-3-box" >
<hbox>
<label class="month-day-number-class" id="month-week-5-day-3" value="" />
</hbox>
</vbox>
<vbox class="month-day-box-class" flex="1" id="month-week-5-day-4-box" >
<hbox>
<label class="month-day-number-class" id="month-week-5-day-4" value="" />
</hbox>
</vbox>
<vbox class="month-day-box-class" flex="1" id="month-week-5-day-5-box" >
<hbox>
<label class="month-day-number-class" id="month-week-5-day-5" value="" />
</hbox>
</vbox>
<vbox class="month-day-box-class" flex="1" id="month-week-5-day-6-box" >
<hbox>
<label class="month-day-number-class" id="month-week-5-day-6" value="" />
</hbox>
</vbox>
<vbox class="month-day-box-class weekend saturday" flex="1" id="month-week-5-day-7-box" weekend="true" >
<hbox>
<label class="month-day-number-class" id="month-week-5-day-7" value="" />
</hbox>
</vbox>
</row>
<row flex="1" >
<vbox class="month-day-box-class weekend" flex="1" id="month-week-6-day-1-box" weekend="true" >
<hbox>
<label class="month-day-number-class" id="month-week-6-day-1" value="" />
</hbox>
</vbox>
<vbox class="month-day-box-class" flex="1" id="month-week-6-day-2-box" >
<hbox>
<label class="month-day-number-class" id="month-week-6-day-2" value="" />
</hbox>
</vbox>
<vbox class="month-day-box-class" flex="1" id="month-week-6-day-3-box" >
<hbox>
<label class="month-day-number-class" id="month-week-6-day-3" value="" />
</hbox>
</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" value="" />
</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" value="" />
</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" value="" />
</vbox>
<vbox class="month-day-box-class weekend saturday" flex="1" id="month-week-6-day-7-box" weekend="true" >
<label class="month-day-number-class" id="month-week-6-day-7" value="" />
</vbox>
</row>
</rows>
</grid>
</box> <!-- End: Month grid box -->
</vbox> <!-- End: Month content box -->
</vbox>
</overlay>

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

@ -0,0 +1,700 @@
/*
* 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 Corporation.
*
* The Initial Developer of the Original Code is
* OEone Corporation.
* Portions created by OEone Corporation are Copyright (C) 2001
* OEone Corporation. All Rights Reserved.
*
* Contributor(s): Garth Smedley (garths@oeone.com) , Mike Potter (mikep@oeone.com)
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
*
*/
/*-----------------------------------------------------------------
* WeekView Class subclass of CalendarView
*
* Calendar week view class :TODO: display of events has not been started
*
* PROPERTIES
* gHeaderDateItemArray - Array of text boxes used to display the dates of the currently displayed
* week.
*
*
*/
// Make WeekView inherit from CalendarView
WeekView.prototype = new CalendarView();
WeekView.prototype.constructor = WeekView;
/**
* WeekView Constructor.
*
* PARAMETERS
* calendarWindow - the owning instance of CalendarWindow.
*
*/
function WeekView( calendarWindow )
{
// call super
this.superConstructor( calendarWindow );
// get week view header items
gHeaderDateItemArray = new Array();
this.selectedEventBoxes = new Array();
for( var dayIndex = 1; dayIndex <= 7; ++dayIndex )
{
var headerDateItem = document.getElementById( "week-header-date-" + dayIndex );
gHeaderDateItemArray[ dayIndex ] = headerDateItem;
}
}
/** PUBLIC
*
* Redraw the events for the current week
*/
WeekView.prototype.refreshEvents = function( )
{
this.kungFooDeathGripOnEventBoxes = new Array();
var eventBoxList = document.getElementsByAttribute( "eventbox", "weekview" );
for( var eventBoxIndex = 0; eventBoxIndex < eventBoxList.length; ++eventBoxIndex )
{
var eventBox = eventBoxList[ eventBoxIndex ];
eventBox.parentNode.removeChild( eventBox );
}
for( var dayIndex = 1; dayIndex <= 7; ++dayIndex )
{
var headerDateItem = document.getElementById( "week-header-date-" + dayIndex );
headerDateItem.numEvents = 0;
}
//get the all day box.
var AllDayBox = document.getElementById( "week-view-all-day-content-box" );
AllDayBox.setAttribute( "collapsed", "true" );
//expand the day's content box by setting allday to false..
document.getElementById( "week-view-content-box" ).setAttribute( "allday", "false" );
//START FOR LOOP FOR DAYS--->
for ( dayIndex = 1; dayIndex <= 7; ++dayIndex )
{
//make the text node that will contain the text for the all day box.
var TextNode = document.getElementById( "all-day-content-box-text-week-"+dayIndex );
//set the seperator to nothing. After the first one, we'll change it to ", " so that we add commas between text.
var Seperator = "";
// get the events for the day and loop through them
dayToGet = new Date( gHeaderDateItemArray[dayIndex].getAttribute( "date" ) );
var dayEventList = new Array();
dayEventList = this.calendarWindow.eventSource.getEventsForDay( dayToGet );
//refresh the array and the current spot.
for ( i = 0; i < dayEventList.length; i++ )
{
dayEventList[i].OtherSpotArray = new Array('0');
dayEventList[i].CurrentSpot = 0;
dayEventList[i].NumberOfSameTimeEvents = 0;
}
for ( i = 0; i < dayEventList.length; i++ )
{
var calendarEvent = dayEventList[i];
//check to make sure that the event is not an all day event...
if ( calendarEvent.allDay != true )
{
//see if there's another event at the same start time.
for ( j = 0; j < dayEventList.length; j++ )
{
thisCalendarEvent = dayEventList[j];
//if this event overlaps with another event...
if ( ( ( thisCalendarEvent.displayDate >= calendarEvent.displayDate &&
thisCalendarEvent.displayDate < calendarEvent.end ) ||
( calendarEvent.displayDate >= thisCalendarEvent.displayDate &&
calendarEvent.displayDate < thisCalendarEvent.end ) ) &&
calendarEvent.id != thisCalendarEvent.id )
{
//get the spot that this event will go in.
var ThisSpot = thisCalendarEvent.CurrentSpot;
calendarEvent.OtherSpotArray.push( ThisSpot );
ThisSpot++;
if ( ThisSpot > calendarEvent.CurrentSpot )
{
calendarEvent.CurrentSpot = ThisSpot;
}
}
}
SortedOtherSpotArray = new Array();
SortedOtherSpotArray = calendarEvent.OtherSpotArray.sort( gCalendarWindow.compareNumbers);
LowestNumber = this.calendarWindow.getLowestElementNotInArray( SortedOtherSpotArray );
//this is the actual spot (0 -> n) that the event will go in on the day view.
calendarEvent.CurrentSpot = LowestNumber;
if ( SortedOtherSpotArray.length > 4 )
{
calendarEvent.NumberOfSameTimeEvents = 4;
}
else
{
calendarEvent.NumberOfSameTimeEvents = SortedOtherSpotArray.length;
}
dayEventList[i] = calendarEvent;
}
}
var ThisDayAllDayBox = document.getElementById( "all-day-content-box-week-"+dayIndex );
while ( ThisDayAllDayBox.hasChildNodes() )
{
ThisDayAllDayBox.removeChild( ThisDayAllDayBox.firstChild );
}
for ( var eventIndex = 0; eventIndex < dayEventList.length; ++eventIndex )
{
var calendarEvent = dayEventList[ eventIndex ];
var eventDate = calendarEvent.start;
// get the day box for the calendarEvent's day
var eventDayInMonth = eventDate.getDate();
var weekBoxItem = gHeaderDateItemArray[ dayIndex ];
// Display no more than three, show dots for the events > 3
if ( calendarEvent.allDay != true )
{
weekBoxItem.numEvents += 1;
}
//if its an all day event, don't show it in the hours bulletin board.
if ( calendarEvent.allDay == true )
{
// build up the text to show for this event
var eventText = calendarEvent.title;
if( calendarEvent.location )
{
eventText += " " + calendarEvent.location;
}
if( calendarEvent.description )
{
eventText += " " + calendarEvent.description;
}
//show the all day box
AllDayBox.setAttribute( "collapsed", "false" );
//shrink the day's content box.
document.getElementById( "week-view-content-box" ).setAttribute( "allday", "true" );
//note the use of the WeekViewAllDayText Attribute.
//This is used to remove the text when the day is changed.
SeperatorNode = document.createElement( "text" );
SeperatorNode.setAttribute( "value", Seperator );
SeperatorNode.setAttribute( "WeekViewAllDayText", "true" );
newHTMLNode = document.createElement( "html" );
newTextNode = document.createTextNode( eventText );
//newTextNode.setAttribute( "value", eventText );
newHTMLNode.appendChild( newTextNode );
newHTMLNode.setAttribute( "WeekViewAllDayText", "true" );
newImage = document.createElement("image");
newImage.setAttribute( "src", "chrome://calendar/skin/all_day_event.png" );
newImage.setAttribute( "WeekViewAllDayText", "true" );
newImage.calendarEvent = calendarEvent;
newImage.setAttribute( "onmouseover", "gCalendarWindow.mouseOverInfo( calendarEvent, event )" );
newImage.setAttribute( "tooltip", "savetip" );
//ThisDayAllDayBox.appendChild( SeperatorNode );
ThisDayAllDayBox.appendChild( newImage );
//ThisDayAllDayBox.appendChild( newHTMLNode );
//change the seperator to add commas after the text.
Seperator = ", ";
}
else if ( calendarEvent.CurrentSpot <= 4 )
{
eventBox = this.createEventBox( calendarEvent, dayIndex );
//add the box to the bulletin board.
document.getElementById( "week-view-content-board" ).appendChild( eventBox );
}
}
}
//--> END THE FOR LOOP FOR THE WEEK VIEW
var selectedEvent = this.calendarWindow.getSelectedEvent();
//if the selected event is today, highlight it. Otherwise, don't highlight anything.
if ( selectedEvent )
{
this.selectEvent( selectedEvent );
}
}
/** PRIVATE
*
* This creates an event box for the day view
*/
WeekView.prototype.createEventBox = function ( calendarEvent, dayIndex )
{
// build up the text to show for this event
var eventText = calendarEvent.title;
var eventStartDate = calendarEvent.displayDate;
var startHour = eventStartDate.getHours();
var startMinutes = eventStartDate.getMinutes();
var eventEndDate = calendarEvent.end;
var endHour = eventEndDate.getHours();
var eventEndDateTime = new Date( 2000, 1, 1, eventEndDate.getHours(), eventEndDate.getMinutes(), 0 );
var eventStartDateTime = new Date( 2000, 1, 1, eventStartDate.getHours(), eventStartDate.getMinutes(), 0 );
var eventDuration = new Date( eventEndDateTime - eventStartDateTime );
var hourDuration = eventDuration / (3600000);
var eventBox = document.createElement( "vbox" );
eventBox.calendarEvent = calendarEvent;
var Height = ( hourDuration * kWeekViewHourHeight ) + 1;
var Width = ( 80 / calendarEvent.NumberOfSameTimeEvents ) - 1;
eventBox.setAttribute( "height", Height );
eventBox.setAttribute( "width", Width );
top = eval( ( startHour*kWeekViewHourHeight ) + ( ( startMinutes/60 ) * kWeekViewHourHeight ) - kWeekViewHourHeightDifference );
eventBox.setAttribute( "top", top );
left = eval( kWeekViewHourLeftStart + ( kWeekViewHourWidth * ( dayIndex - 1 ) ) + ( ( calendarEvent.CurrentSpot - 1 ) * eventBox.getAttribute( "width" ) ) + 1 );
eventBox.setAttribute( "left", left );
eventBox.setAttribute( "class", "week-view-event-class" );
eventBox.setAttribute( "style", "max-width: "+Width+"; max-height: "+Height+";" );
eventBox.setAttribute( "flex", "0" );
eventBox.setAttribute( "eventbox", "weekview" );
eventBox.setAttribute( "onclick", "weekEventItemClick( this, event )" );
eventBox.setAttribute( "ondblclick", "weekEventItemDoubleClick( this, event )" );
eventBox.setAttribute( "id", "week-view-event-box-"+calendarEvent.id );
eventBox.setAttribute( "name", "week-view-event-box-"+calendarEvent.id );
eventBox.setAttribute( "onmouseover", "gCalendarWindow.mouseOverInfo( calendarEvent, event )" );
eventBox.setAttribute( "tooltip", "savetip" );
/*
** REMOVE THE EVENT TEXT FOR NOW
**
** THIS REQUIRES THE DESCRIPTION XUL ELEMENT, WHICH WE MISSED BY 9 DAYS FOR BETA
*/
var eventDescriptionElement = document.createElement( "description" );
eventDescriptionElement.value = "This is my new text";
var DescriptionText = document.createTextNode( "This is my new text" );
eventDescriptionElement.appendChild( DescriptionText );
//eventDescriptionElement.setAttribute( "style", "border: 1px solid red; min-height: "+Height+"; max-height: "+Height+"; overflow: never;" );
eventDescriptionElement.crop = "end";
eventBox.appendChild( eventDescriptionElement );
// add a property to the event box that holds the calendarEvent that the
// box represents
this.kungFooDeathGripOnEventBoxes.push( eventBox );
return( eventBox );
}
/** PUBLIC
*
* Called when the user switches to a different view
*/
WeekView.prototype.switchFrom = function( )
{
}
/** PUBLIC
*
* Called when the user switches to the week view
*/
WeekView.prototype.switchTo = function( )
{
// disable/enable view switching buttons
var weekViewButton = document.getElementById( "calendar-week-view-button" );
var monthViewButton = document.getElementById( "calendar-month-view-button" );
var dayViewButton = document.getElementById( "calendar-day-view-button" );
monthViewButton.setAttribute( "disabled", "false" );
weekViewButton.setAttribute( "disabled", "true" );
dayViewButton.setAttribute( "disabled", "false" );
// switch views in the deck
var calendarDeckItem = document.getElementById( "calendar-deck" );
calendarDeckItem.setAttribute( "index", 1 );
}
/** PUBLIC
*
* Redraw the display, but not the events
*/
WeekView.prototype.refreshDisplay = function( )
{
// Set the from-to title string, based on the selected date
var viewDay = this.calendarWindow.getSelectedDate().getDay();
var viewDayOfMonth = this.calendarWindow.getSelectedDate().getDate();
var viewMonth = this.calendarWindow.getSelectedDate().getMonth();
var viewYear = this.calendarWindow.getSelectedDate().getFullYear();
var daysLeftInWeek = 6 - viewDay;
var dateOfLastDayInWeek = viewDayOfMonth + daysLeftInWeek;
var dateOfFirstDayInWeek = viewDayOfMonth - viewDay;
var firstDayOfWeek = new Date( viewYear, viewMonth, dateOfFirstDayInWeek );
var lastDayOfWeek = new Date( viewYear, viewMonth, dateOfLastDayInWeek );
var firstDayMonthName = this.calendarWindow.dateFormater.getMonthName( firstDayOfWeek.getMonth() );
var lastDayMonthName = this.calendarWindow.dateFormater.getMonthName( lastDayOfWeek.getMonth() );
var dateString = firstDayMonthName + " " + firstDayOfWeek.getDate() + " - " +
lastDayMonthName + " " + lastDayOfWeek.getDate();
var weekTextItem = document.getElementById( "week-title-text" );
weekTextItem.setAttribute( "value" , dateString );
// Set the dates in the header
var weekDate = new Date( viewYear, viewMonth, dateOfFirstDayInWeek );
for( var dayIndex = 1; dayIndex < gHeaderDateItemArray.length; ++dayIndex )
{
var dateOfDay = weekDate.getDate();
var headerDateItem = gHeaderDateItemArray[ dayIndex ];
headerDateItem.setAttribute( "value" , dateOfDay );
headerDateItem.setAttribute( "date", weekDate );
headerDateItem.numEvents = 0;
// advance to next day
weekDate.setDate( dateOfDay + 1 );
}
this.hiliteTodaysDate( );
}
/** PUBLIC
*
* Get the selected event and delete it.
*/
WeekView.prototype.deletedSelectedEvent = function( )
{
// :TODO:
}
/** PUBLIC
*
* This is called when we are about the make a new event
* and we want to know what the default start date should be for the event.
*/
WeekView.prototype.getNewEventDate = function( )
{
return this.calendarWindow.getSelectedDate();
}
/** PUBLIC
*
* Go to the next week.
*/
WeekView.prototype.goToNext = function()
{
var nextWeek = new Date( this.calendarWindow.selectedDate.getFullYear(), this.calendarWindow.selectedDate.getMonth(), this.calendarWindow.selectedDate.getDate() + 7 );
this.goToDay( nextWeek );
}
/** PUBLIC
*
* Go to the previous week.
*/
WeekView.prototype.goToPrevious = function()
{
var prevWeek = new Date( this.calendarWindow.selectedDate.getFullYear(), this.calendarWindow.selectedDate.getMonth(), this.calendarWindow.selectedDate.getDate() - 7 );
this.goToDay( prevWeek );
}
WeekView.prototype.getVisibleEvent = function( calendarEvent )
{
eventBox = document.getElementById( "week-view-event-box-"+calendarEvent.id );
if ( eventBox )
{
return eventBox;
}
else
return null;
}
/** PRIVATE
*
* Mark today as selected, also unmark the old today if there was one.
*/
WeekView.prototype.hiliteTodaysDate = function( )
{
//clear out the old today boxes.
var OldTodayArray = document.getElementsByAttribute( "today", "true" );
for ( i = 0; i < OldTodayArray.length; i++ )
{
OldTodayArray[i].setAttribute( "today", "false" );
}
// 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() )
{
//today is visible, get the day index for today
for ( dayIndex = 1; dayIndex <= 7; ++dayIndex )
{
ThisDate = new Date( gHeaderDateItemArray[dayIndex].getAttribute( "date" ) );
if ( ThisDate.getFullYear() == Today.getFullYear()
&& ThisDate.getMonth() == Today.getMonth()
&& ThisDate.getDay() == Today.getDay() )
{
break;
}
}
//dayIndex now contains the box numbers that we need.
for ( i = 0; i < 24; i++ )
{
document.getElementById( "week-tree-day-"+(dayIndex-1)+"-item-"+i ).setAttribute( "today", "true" );
}
}
}
/** PUBLIC
*
* clear the selected event by taking off the selected attribute.
*/
WeekView.prototype.clearSelectedEvent = function( )
{
Event = gCalendarWindow.getSelectedEvent();
//if there is an event, and if the event is in the current view.
if ( Event && document.getElementsByAttribute( "name", "week-view-event-box-"+Event.id ).length > 0 )
{
for ( i = 0; i < this.selectedEventBoxes.length; i++ )
{
this.selectedEventBoxes[i].setAttribute( "selected", "false" );
}
//document.getElementById( "week-view-event-box-"+Event.id ).setAttribute( "selected", false );
}
this.selectedEventBoxes = Array();
//clear the selection in the unifinder
deselectEventInUnifinder( );
}
/** PUBLIC -- monthview only
*
* Called when an event box item is single clicked
*/
WeekView.prototype.clickEventBox = function( eventBox, event )
{
// clear the old selected box
if( this.selectedEventBoxes.length > 0 )
{
this.clearSelectedEvent();
}
if( eventBox )
{
// select the event
this.selectEvent( eventBox.calendarEvent );
//set the selected date to the start date of this event.
this.calendarWindow.selectedDate.setDate( eventBox.calendarEvent.start.getDate() );
// mark new box as selected
var ArrayOfBoxes = document.getElementsByAttribute( "name", "week-view-event-box-"+eventBox.calendarEvent.id );
for ( i = 0; i < ArrayOfBoxes.length; i++ )
{
ArrayOfBoxes[i].setAttribute( "selected", "true" );
this.selectedEventBoxes[ this.selectedEventBoxes.length ] = ArrayOfBoxes[i];
}
//select the event in the unifinder
selectEventInUnifinder( eventBox.calendarEvent );
}
// Do not let the click go through, suppress default selection
if ( event )
{
event.stopPropagation();
}
}
/** 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
*
* select an event.
*/
WeekView.prototype.selectEvent = function( calendarEvent )
{
//clear the selected event
gCalendarWindow.clearSelectedEvent( );
gCalendarWindow.setSelectedEvent( calendarEvent );
var EventBoxes = document.getElementsByAttribute( "name", "week-view-event-box-"+calendarEvent.id );
for ( i = 0; i < EventBoxes.length; i++ )
{
EventBoxes[i].setAttribute( "selected", "true" );
this.selectedEventBoxes[ this.selectedEventBoxes.length ] = EventBoxes[i];
}
selectEventInUnifinder( calendarEvent );
}
/** PUBLIC
*
* Unmark the selected date if there is one.
*/
WeekView.prototype.clearSelectedDate = function( )
{
if ( this.selectedBox )
{
this.selectedBox.setAttribute( "selected", "false" );
this.selectedBox = null;
}
}

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

@ -0,0 +1,506 @@
<?xml version="1.0"?>
<!--
- 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 OEone Corporation are Copyright (C) 2001
- OEone Corporation. All Rights Reserved.
-
- Contributor(s): Garth Smedley (garths@oeone.com), Mike Potter (mikep@oeone.com)
-
- Alternatively, the contents of this file may be used under the terms of
- either the GNU General Public License Version 2 or later (the "GPL"), or
- the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- in which case the provisions of the GPL or the LGPL are applicable instead
- of those above. If you wish to allow use of your version of this file only
- under the terms of either the GPL or the LGPL, and not to allow others to
- use your version of this file under the terms of the MPL, indicate your
- decision by deleting the provisions above and replace them with the notice
- and other provisions required by the 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.
-
- -->
<!-- Style sheets -->
<?xml-stylesheet href="chrome://global/skin/global.css" type="text/css"?>
<?xml-stylesheet href="chrome://calendar/skin/calendar.css" ?>
<!-- DTDs -->
<!-- DTD File with all strings specific to the calendar -->
<!DOCTYPE window
[
<!ENTITY % dtd1 SYSTEM "chrome://penglobal/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/calendarWeekView.js"/>
<vbox id="week-view-box" flex="1">
<!-- Week View: Controls-->
<hbox id="week-controls-box">
<image flex="1" id="week-previous-button" onclick="gCalendarWindow.goToPrevious()"/>
<text id="week-title-text" value="" />
<box flex="1" id="week-next-button-box" >
<image id="week-next-button" onclick="gCalendarWindow.goToNext()"/>
</box>
</hbox>
<!-- Week View: All Day Boxes -->
<vbox id="inner-week-view-box" flex="1">
<box id="week-view-header">
<vbox id="weekview-daynumber-spacer-left"/>
<vbox flex="1" class="weekview-daynumber-class" autostretch="never">
<label id="week-header-date-1" value="" />
<label value="&day.1.DDD;"/>
</vbox>
<vbox flex="1" class="weekview-daynumber-class" autostretch="never">
<label id="week-header-date-2" value="" />
<label value="&day.2.DDD;" />
</vbox>
<vbox flex="1" class="weekview-daynumber-class" autostretch="never">
<label id="week-header-date-3" value="" />
<label value="&day.3.DDD;" />
</vbox>
<vbox flex="1" class="weekview-daynumber-class" autostretch="never">
<label id="week-header-date-4" value="" />
<label value="&day.4.DDD;" />
</vbox>
<vbox flex="1" class="weekview-daynumber-class" autostretch="never">
<label id="week-header-date-5" value="" />
<label value="&day.5.DDD;" />
</vbox>
<vbox flex="1" class="weekview-daynumber-class" autostretch="never">
<label id="week-header-date-6" value="" />
<label value="&day.6.DDD;" />
</vbox>
<vbox flex="1" class="weekview-daynumber-class" autostretch="never">
<label id="week-header-date-7" value="" />
<label value="&day.7.DDD;" />
</vbox>
<vbox flex="1" autostretch="never" width="8"/>
</box>
<box id="week-view-all-day-content-box" debug="false">
<vbox id="weekview-daynumber-spacer-left" flex="1">
<label id="all-day-content-box-text-title" value="All Day Events"/>
</vbox>
<hbox autostretch="never" class="all-day-content-box-week" id="all-day-content-box-week-1"/>
<hbox autostretch="never" class="all-day-content-box-week" id="all-day-content-box-week-2"/>
<hbox autostretch="never" class="all-day-content-box-week" id="all-day-content-box-week-3"/>
<hbox autostretch="never" class="all-day-content-box-week" id="all-day-content-box-week-4"/>
<hbox autostretch="never" class="all-day-content-box-week" id="all-day-content-box-week-5"/>
<hbox autostretch="never" class="all-day-content-box-week" id="all-day-content-box-week-6"/>
<hbox autostretch="never" class="all-day-content-box-week" id="all-day-content-box-week-7"/>
<vbox autostretch="never" id="all-day-content-spacer"/>
</box>
<box id="week-view-content-box" flex="1">
<stack id="week-view-content-board" flex="1">
<image id="week-view-day-gradient" left="1" top="1" width="30" height="1199"/>
<vbox id="week-view-top-left-box" top="0" left="21">
<!-- HOURS -->
<box class="week-view-hours-only-box-class" id="week-tree-hour-0">
<box class="week-time-class" flex="1">
<label class="week-time-class-text" id="week-view-hour" value="&time.midnight; " />
</box>
</box>
<box class="week-view-hours-only-box-class" id="week-tree-hour-1">
<box class="week-time-class" flex="1">
<label class="week-time-class-text" id="week-view-hour" value="&time.1; " />
</box>
</box>
<box class="week-view-hours-only-box-class" id="week-tree-hour-2">
<box class="week-time-class" flex="1">
<label class="week-time-class-text" id="week-view-hour" value="&time.2; " />
</box>
</box>
<box class="week-view-hours-only-box-class" id="week-tree-hour-3">
<box class="week-time-class" flex="1">
<label class="week-time-class-text" id="week-view-hour" value="&time.3; " />
</box>
</box>
<box class="week-view-hours-only-box-class" id="week-tree-hour-4">
<box class="week-time-class" flex="1">
<label class="week-time-class-text" id="week-view-hour" value="&time.4; " />
</box>
</box>
<box class="week-view-hours-only-box-class" id="week-tree-hour-5">
<box class="week-time-class" flex="1">
<label class="week-time-class-text" id="week-view-hour" value="&time.5; " />
</box>
</box>
<box class="week-view-hours-only-box-class" id="week-tree-hour-6">
<box class="week-time-class" flex="1">
<label class="week-time-class-text" id="week-view-hour" value="&time.6; " />
</box>
</box>
<box class="week-view-hours-only-box-class" id="week-tree-hour-7">
<box class="week-time-class" flex="1">
<label class="week-time-class-text" id="week-view-hour" value="&time.7; " />
</box>
</box>
<box class="week-view-hours-only-box-class" id="week-tree-hour-8">
<box class="week-time-class" flex="1">
<label class="week-time-class-text" id="week-view-hour" value="&time.8; " />
</box>
</box>
<box class="week-view-hours-only-box-class" id="week-tree-hour-9">
<box class="week-time-class" flex="1">
<label class="week-time-class-text" id="week-view-hour" value="&time.9; " />
</box>
</box>
<box class="week-view-hours-only-box-class" id="week-tree-hour-10">
<box class="week-time-class" flex="1">
<label class="week-time-class-text" id="week-view-hour" value="&time.10; " />
</box>
</box>
<box class="week-view-hours-only-box-class" id="week-tree-hour-11">
<box class="week-time-class" flex="1">
<label class="week-time-class-text" id="week-view-hour" value="&time.11; " />
</box>
</box>
<box class="week-view-hours-only-box-class" id="week-tree-hour-12">
<box class="week-time-class" flex="1">
<label class="week-time-class-text" id="week-view-hour" value="&time.noon; " />
</box>
</box>
<box class="week-view-hours-only-box-class" id="week-tree-hour-13">
<box class="week-time-class" flex="1">
<label class="week-time-class-text" id="week-view-hour" value="&time.13; " />
</box>
</box>
<box class="week-view-hours-only-box-class" id="week-tree-hour-14">
<box class="week-time-class" flex="1">
<label class="week-time-class-text" id="week-view-hour" value="&time.14; " />
</box>
</box>
<box class="week-view-hours-only-box-class" id="week-tree-hour-15">
<box class="week-time-class" flex="1">
<label class="week-time-class-text" id="week-view-hour" value="&time.15; " />
</box>
</box>
<box class="week-view-hours-only-box-class" id="week-tree-hour-16">
<box class="week-time-class" flex="1">
<label class="week-time-class-text" id="week-view-hour" value="&time.16; " />
</box>
</box>
<box class="week-view-hours-only-box-class" id="week-tree-hour-17">
<box class="week-time-class" flex="1">
<label class="week-time-class-text" id="week-view-hour" value="&time.17; " />
</box>
</box>
<box class="week-view-hours-only-box-class" id="week-tree-hour-18">
<box class="week-time-class" flex="1">
<label class="week-time-class-text" id="week-view-hour" value="&time.18; " />
</box>
</box>
<box class="week-view-hours-only-box-class" id="week-tree-hour-19">
<box class="week-time-class" flex="1">
<label class="week-time-class-text" id="week-view-hour" value="&time.19; " />
</box>
</box>
<box class="week-view-hours-only-box-class" id="week-tree-hour-20">
<box class="week-time-class" flex="1">
<label class="week-time-class-text" id="week-view-hour" value="&time.20; " />
</box>
</box>
<box class="week-view-hours-only-box-class" id="week-tree-hour-21">
<box class="week-time-class" flex="1">
<label class="week-time-class-text" id="week-view-hour" value="&time.21; " />
</box>
</box>
<box class="week-view-hours-only-box-class" id="week-tree-hour-22">
<box class="week-time-class" flex="1">
<label class="week-time-class-text" id="week-view-hour" value="&time.22; " />
</box>
</box>
<box class="week-view-hours-only-box-class" id="week-tree-hour-23">
<box class="week-time-class" flex="1">
<label class="week-time-class-text" id="week-view-hour" value="&time.23; " />
</box>
</box>
<!-- / HOURS -->
</vbox>
<!-- DAY 0 -->
<vbox class="week-view-day-container-box" id="week-view-hour-0" left="98" top="0">
<box class="week-view-hour-box-class weekend" id="week-tree-day-0-item-0" onclick="weekViewHourClick( 1, 0, event )" ondblclick="weekViewHourDoubleClick( 1, 0, event )"/>
<box class="week-view-hour-box-class weekend" id="week-tree-day-0-item-1" onclick="weekViewHourClick( 1, 1, event )" ondblclick="weekViewHourDoubleClick( 1, 1, event )" />
<box class="week-view-hour-box-class weekend" id="week-tree-day-0-item-2" onclick="weekViewHourClick( 1, 2, event )" ondblclick="weekViewHourDoubleClick( 1, 2, event )" />
<box class="week-view-hour-box-class weekend" id="week-tree-day-0-item-3" onclick="weekViewHourClick( 1, 3, event )" ondblclick="weekViewHourDoubleClick( 1, 3, event )" />
<box class="week-view-hour-box-class weekend" id="week-tree-day-0-item-4" onclick="weekViewHourClick( 1, 4, event )" ondblclick="weekViewHourDoubleClick( 1, 4, event )" />
<box class="week-view-hour-box-class weekend" id="week-tree-day-0-item-5" onclick="weekViewHourClick( 1, 5, event )" ondblclick="weekViewHourDoubleClick( 1, 5, event )" />
<box class="week-view-hour-box-class weekend" id="week-tree-day-0-item-6" onclick="weekViewHourClick( 1, 6, event )" ondblclick="weekViewHourDoubleClick( 1, 6, event )" />
<box class="week-view-hour-box-class weekend" id="week-tree-day-0-item-7" onclick="weekViewHourClick( 1, 7, event )" ondblclick="weekViewHourDoubleClick( 1, 7, event )" />
<box class="week-view-hour-box-class weekend" id="week-tree-day-0-item-8" onclick="weekViewHourClick( 1, 8, event )" ondblclick="weekViewHourDoubleClick( 1, 8, event )" />
<box class="week-view-hour-box-class weekend" id="week-tree-day-0-item-9" onclick="weekViewHourClick( 1, 9, event )" ondblclick="weekViewHourDoubleClick( 1, 9, event )" />
<box class="week-view-hour-box-class weekend" id="week-tree-day-0-item-10" onclick="weekViewHourClick( 1, 10, event )" ondblclick="weekViewHourDoubleClick( 1, 10, event )" />
<box class="week-view-hour-box-class weekend" id="week-tree-day-0-item-11" onclick="weekViewHourClick( 1, 11, event )" ondblclick="weekViewHourDoubleClick( 1, 11, event )" />
<box class="week-view-hour-box-class weekend" id="week-tree-day-0-item-12" onclick="weekViewHourClick( 1, 12, event )" ondblclick="weekViewHourDoubleClick( 1, 12, event )" />
<box class="week-view-hour-box-class weekend" id="week-tree-day-0-item-13" onclick="weekViewHourClick( 1, 13, event )" ondblclick="weekViewHourDoubleClick( 1, 13, event )" />
<box class="week-view-hour-box-class weekend" id="week-tree-day-0-item-14" onclick="weekViewHourClick( 1, 14, event )" ondblclick="weekViewHourDoubleClick( 1, 14, event )" />
<box class="week-view-hour-box-class weekend" id="week-tree-day-0-item-15" onclick="weekViewHourClick( 1, 15, event )" ondblclick="weekViewHourDoubleClick( 1, 15, event )" />
<box class="week-view-hour-box-class weekend" id="week-tree-day-0-item-16" onclick="weekViewHourClick( 1, 16, event )" ondblclick="weekViewHourDoubleClick( 1, 16, event )" />
<box class="week-view-hour-box-class weekend" id="week-tree-day-0-item-17" onclick="weekViewHourClick( 1, 17, event )" ondblclick="weekViewHourDoubleClick( 1, 17, event )" />
<box class="week-view-hour-box-class weekend" id="week-tree-day-0-item-18" onclick="weekViewHourClick( 1, 18, event )" ondblclick="weekViewHourDoubleClick( 1, 18, event )" />
<box class="week-view-hour-box-class weekend" id="week-tree-day-0-item-19" onclick="weekViewHourClick( 1, 19, event )" ondblclick="weekViewHourDoubleClick( 1, 19, event )" />
<box class="week-view-hour-box-class weekend" id="week-tree-day-0-item-20" onclick="weekViewHourClick( 1, 20, event )" ondblclick="weekViewHourDoubleClick( 1, 20, event )"/>
<box class="week-view-hour-box-class weekend" id="week-tree-day-0-item-21" onclick="weekViewHourClick( 1, 21, event )" ondblclick="weekViewHourDoubleClick( 1, 21, event )"/>
<box class="week-view-hour-box-class weekend" id="week-tree-day-0-item-22" onclick="weekViewHourClick( 1, 22, event )" ondblclick="weekViewHourDoubleClick( 1, 22, event )"/>
<box class="week-view-hour-box-class weekend" id="week-tree-day-0-item-23" onclick="weekViewHourClick( 1, 23, event )" ondblclick="weekViewHourDoubleClick( 1, 23, event )"/>
</vbox>
<!-- / DAY 0 -->
<!-- DAY 1 -->
<vbox class="week-view-day-container-box" left="176" top="0">
<box class="week-view-hour-box-class" id="week-tree-day-1-item-0" onclick="weekViewHourClick( 2, 0, event )" ondblclick="weekViewHourDoubleClick( 2, 0, event )" />
<box class="week-view-hour-box-class" id="week-tree-day-1-item-1" onclick="weekViewHourClick( 2, 1, event )" ondblclick="weekViewHourDoubleClick( 2, 1, event )"/>
<box class="week-view-hour-box-class" id="week-tree-day-1-item-2" onclick="weekViewHourClick( 2, 2, event )" ondblclick="weekViewHourDoubleClick( 2, 2, event )" />
<box class="week-view-hour-box-class" id="week-tree-day-1-item-3" onclick="weekViewHourClick( 2, 3, event )" ondblclick="weekViewHourDoubleClick( 2, 3, event )" />
<box class="week-view-hour-box-class" id="week-tree-day-1-item-4" onclick="weekViewHourClick( 2, 4, event )" ondblclick="weekViewHourDoubleClick( 2, 4, event )" />
<box class="week-view-hour-box-class" id="week-tree-day-1-item-5" onclick="weekViewHourClick( 2, 5, event )" ondblclick="weekViewHourDoubleClick( 2, 5, event )" />
<box class="week-view-hour-box-class" id="week-tree-day-1-item-6" onclick="weekViewHourClick( 2, 6, event )" ondblclick="weekViewHourDoubleClick( 2, 6, event )" />
<box class="week-view-hour-box-class" id="week-tree-day-1-item-7" onclick="weekViewHourClick( 2, 7, event )" ondblclick="weekViewHourDoubleClick( 2, 7, event )" />
<box class="week-view-hour-box-class" id="week-tree-day-1-item-8" onclick="weekViewHourClick( 2, 8, event )" ondblclick="weekViewHourDoubleClick( 2, 8, event )" />
<box class="week-view-hour-box-class" id="week-tree-day-1-item-9" onclick="weekViewHourClick( 2, 9, event )" ondblclick="weekViewHourDoubleClick( 2, 9, event )" />
<box class="week-view-hour-box-class" id="week-tree-day-1-item-10" onclick="weekViewHourClick( 2, 10, event )" ondblclick="weekViewHourDoubleClick( 2, 10, event )" />
<box class="week-view-hour-box-class" id="week-tree-day-1-item-11" onclick="weekViewHourClick( 2, 11, event )" ondblclick="weekViewHourDoubleClick( 2, 11, event )" />
<box class="week-view-hour-box-class" id="week-tree-day-1-item-12" onclick="weekViewHourClick( 2, 12, event )" ondblclick="weekViewHourDoubleClick( 2, 12, event )" />
<box class="week-view-hour-box-class" id="week-tree-day-1-item-13" onclick="weekViewHourClick( 2, 13, event )" ondblclick="weekViewHourDoubleClick( 2, 13, event )" />
<box class="week-view-hour-box-class" id="week-tree-day-1-item-14" onclick="weekViewHourClick( 2, 14, event )" ondblclick="weekViewHourDoubleClick( 2, 14, event )" />
<box class="week-view-hour-box-class" id="week-tree-day-1-item-15" onclick="weekViewHourClick( 2, 15, event )" ondblclick="weekViewHourDoubleClick( 2, 15, event )" />
<box class="week-view-hour-box-class" id="week-tree-day-1-item-16" onclick="weekViewHourClick( 2, 16, event )" ondblclick="weekViewHourDoubleClick( 2, 16, event )" />
<box class="week-view-hour-box-class" id="week-tree-day-1-item-17" onclick="weekViewHourClick( 2, 17, event )" ondblclick="weekViewHourDoubleClick( 2, 17, event )" />
<box class="week-view-hour-box-class" id="week-tree-day-1-item-18" onclick="weekViewHourClick( 2, 18, event )" ondblclick="weekViewHourDoubleClick( 2, 18, event )" />
<box class="week-view-hour-box-class" id="week-tree-day-1-item-19" onclick="weekViewHourClick( 2, 19, event )" ondblclick="weekViewHourDoubleClick( 2, 19, event )" />
<box class="week-view-hour-box-class" id="week-tree-day-1-item-20" onclick="weekViewHourClick( 2, 20, event )" ondblclick="weekViewHourDoubleClick( 2, 20, event )"/>
<box class="week-view-hour-box-class" id="week-tree-day-1-item-21" onclick="weekViewHourClick( 2, 21, event )" ondblclick="weekViewHourDoubleClick( 2, 21, event )"/>
<box class="week-view-hour-box-class" id="week-tree-day-1-item-22" onclick="weekViewHourClick( 2, 22, event )" ondblclick="weekViewHourDoubleClick( 2, 22, event )"/>
<box class="week-view-hour-box-class" id="week-tree-day-1-item-23" onclick="weekViewHourClick( 2, 23, event )" ondblclick="weekViewHourDoubleClick( 2, 23, event )"/>
</vbox>
<!-- / DAY 1 -->
<!-- DAY 2 -->
<vbox class="week-view-day-container-box" left="254" top="0">
<box class="week-view-hour-box-class" id="week-tree-day-2-item-0" onclick="weekViewHourClick( 3, 0, event )" ondblclick="weekViewHourDoubleClick( 3, 0, event )" />
<box class="week-view-hour-box-class" id="week-tree-day-2-item-1" onclick="weekViewHourClick( 3, 1, event )" ondblclick="weekViewHourDoubleClick( 3, 1, event )"/>
<box class="week-view-hour-box-class" id="week-tree-day-2-item-2" onclick="weekViewHourClick( 3, 2, event )" ondblclick="weekViewHourDoubleClick( 3, 2, event )" />
<box class="week-view-hour-box-class" id="week-tree-day-2-item-3" onclick="weekViewHourClick( 3, 3, event )" ondblclick="weekViewHourDoubleClick( 3, 3, event )" />
<box class="week-view-hour-box-class" id="week-tree-day-2-item-4" onclick="weekViewHourClick( 3, 4, event )" ondblclick="weekViewHourDoubleClick( 3, 4, event )" />
<box class="week-view-hour-box-class" id="week-tree-day-2-item-5" onclick="weekViewHourClick( 3, 5, event )" ondblclick="weekViewHourDoubleClick( 3, 5, event )" />
<box class="week-view-hour-box-class" id="week-tree-day-2-item-6" onclick="weekViewHourClick( 3, 6, event )" ondblclick="weekViewHourDoubleClick( 3, 6, event )" />
<box class="week-view-hour-box-class" id="week-tree-day-2-item-7" onclick="weekViewHourClick( 3, 7, event )" ondblclick="weekViewHourDoubleClick( 3, 7, event )" />
<box class="week-view-hour-box-class" id="week-tree-day-2-item-8" onclick="weekViewHourClick( 3, 8, event )" ondblclick="weekViewHourDoubleClick( 3, 8, event )" />
<box class="week-view-hour-box-class" id="week-tree-day-2-item-9" onclick="weekViewHourClick( 3, 9, event )" ondblclick="weekViewHourDoubleClick( 3, 9, event )" />
<box class="week-view-hour-box-class" id="week-tree-day-2-item-10" onclick="weekViewHourClick( 3, 10, event )" ondblclick="weekViewHourDoubleClick( 3, 10, event )" />
<box class="week-view-hour-box-class" id="week-tree-day-2-item-11" onclick="weekViewHourClick( 3, 11, event )" ondblclick="weekViewHourDoubleClick( 3, 11, event )" />
<box class="week-view-hour-box-class" id="week-tree-day-2-item-12" onclick="weekViewHourClick( 3, 12, event )" ondblclick="weekViewHourDoubleClick( 3, 12, event )" />
<box class="week-view-hour-box-class" id="week-tree-day-2-item-13" onclick="weekViewHourClick( 3, 13, event )" ondblclick="weekViewHourDoubleClick( 3, 13, event )" />
<box class="week-view-hour-box-class" id="week-tree-day-2-item-14" onclick="weekViewHourClick( 3, 14, event )" ondblclick="weekViewHourDoubleClick( 3, 14, event )" />
<box class="week-view-hour-box-class" id="week-tree-day-2-item-15" onclick="weekViewHourClick( 3, 15, event )" ondblclick="weekViewHourDoubleClick( 3, 15, event )" />
<box class="week-view-hour-box-class" id="week-tree-day-2-item-16" onclick="weekViewHourClick( 3, 16, event )" ondblclick="weekViewHourDoubleClick( 3, 16, event )" />
<box class="week-view-hour-box-class" id="week-tree-day-2-item-17" onclick="weekViewHourClick( 3, 17, event )" ondblclick="weekViewHourDoubleClick( 3, 17, event )" />
<box class="week-view-hour-box-class" id="week-tree-day-2-item-18" onclick="weekViewHourClick( 3, 18, event )" ondblclick="weekViewHourDoubleClick( 3, 18, event )" />
<box class="week-view-hour-box-class" id="week-tree-day-2-item-19" onclick="weekViewHourClick( 3, 19, event )" ondblclick="weekViewHourDoubleClick( 3, 19, event )" />
<box class="week-view-hour-box-class" id="week-tree-day-2-item-20" onclick="weekViewHourClick( 3, 20, event )" ondblclick="weekViewHourDoubleClick( 3, 20, event )"/>
<box class="week-view-hour-box-class" id="week-tree-day-2-item-21" onclick="weekViewHourClick( 3, 21, event )" ondblclick="weekViewHourDoubleClick( 3, 21, event )"/>
<box class="week-view-hour-box-class" id="week-tree-day-2-item-22" onclick="weekViewHourClick( 3, 22, event )" ondblclick="weekViewHourDoubleClick( 3, 22, event )"/>
<box class="week-view-hour-box-class" id="week-tree-day-2-item-23" onclick="weekViewHourClick( 3, 23, event )" ondblclick="weekViewHourDoubleClick( 3, 23, event )"/>
</vbox>
<!-- / DAY 2 -->
<!-- DAY 3 -->
<vbox class="week-view-day-container-box" left="332" top="0">
<box class="week-view-hour-box-class" id="week-tree-day-3-item-0" onclick="weekViewHourClick( 4, 0, event )" ondblclick="weekViewHourDoubleClick( 4 ,0, event )" />
<box class="week-view-hour-box-class" id="week-tree-day-3-item-1" onclick="weekViewHourClick( 4, 1, event )" ondblclick="weekViewHourDoubleClick( 4, 1, event )"/>
<box class="week-view-hour-box-class" id="week-tree-day-3-item-2" onclick="weekViewHourClick( 4, 2, event )" ondblclick="weekViewHourDoubleClick( 4, 2, event )" />
<box class="week-view-hour-box-class" id="week-tree-day-3-item-3" onclick="weekViewHourClick( 4, 3, event )" ondblclick="weekViewHourDoubleClick( 4, 3, event )" />
<box class="week-view-hour-box-class" id="week-tree-day-3-item-4" onclick="weekViewHourClick( 4, 4, event )" ondblclick="weekViewHourDoubleClick( 4, 4, event )" />
<box class="week-view-hour-box-class" id="week-tree-day-3-item-5" onclick="weekViewHourClick( 4, 5, event )" ondblclick="weekViewHourDoubleClick( 4, 5, event )" />
<box class="week-view-hour-box-class" id="week-tree-day-3-item-6" onclick="weekViewHourClick( 4, 6, event )" ondblclick="weekViewHourDoubleClick( 4, 6, event )" />
<box class="week-view-hour-box-class" id="week-tree-day-3-item-7" onclick="weekViewHourClick( 4, 7, event )" ondblclick="weekViewHourDoubleClick( 4, 7, event )" />
<box class="week-view-hour-box-class" id="week-tree-day-3-item-8" onclick="weekViewHourClick( 4, 8, event )" ondblclick="weekViewHourDoubleClick( 4, 8, event )" />
<box class="week-view-hour-box-class" id="week-tree-day-3-item-9" onclick="weekViewHourClick( 4, 9, event )" ondblclick="weekViewHourDoubleClick( 4, 9, event )" />
<box class="week-view-hour-box-class" id="week-tree-day-3-item-10" onclick="weekViewHourClick( 4, 10, event )" ondblclick="weekViewHourDoubleClick( 4, 10, event )" />
<box class="week-view-hour-box-class" id="week-tree-day-3-item-11" onclick="weekViewHourClick( 4, 11, event )" ondblclick="weekViewHourDoubleClick( 4, 11, event )" />
<box class="week-view-hour-box-class" id="week-tree-day-3-item-12" onclick="weekViewHourClick( 4, 12, event )" ondblclick="weekViewHourDoubleClick( 4, 12, event )" />
<box class="week-view-hour-box-class" id="week-tree-day-3-item-13" onclick="weekViewHourClick( 4, 13, event )" ondblclick="weekViewHourDoubleClick( 4, 13, event )" />
<box class="week-view-hour-box-class" id="week-tree-day-3-item-14" onclick="weekViewHourClick( 4, 14, event )" ondblclick="weekViewHourDoubleClick( 4, 14, event )" />
<box class="week-view-hour-box-class" id="week-tree-day-3-item-15" onclick="weekViewHourClick( 4, 15, event )" ondblclick="weekViewHourDoubleClick( 4, 15, event )" />
<box class="week-view-hour-box-class" id="week-tree-day-3-item-16" onclick="weekViewHourClick( 4, 16, event )" ondblclick="weekViewHourDoubleClick( 4, 16, event )" />
<box class="week-view-hour-box-class" id="week-tree-day-3-item-17" onclick="weekViewHourClick( 4, 17, event )" ondblclick="weekViewHourDoubleClick( 4, 17, event )" />
<box class="week-view-hour-box-class" id="week-tree-day-3-item-18" onclick="weekViewHourClick( 4, 18, event )" ondblclick="weekViewHourDoubleClick( 4, 18, event )" />
<box class="week-view-hour-box-class" id="week-tree-day-3-item-19" onclick="weekViewHourClick( 4, 19, event )" ondblclick="weekViewHourDoubleClick( 4, 19, event )" />
<box class="week-view-hour-box-class" id="week-tree-day-3-item-20" onclick="weekViewHourClick( 4, 20, event )" ondblclick="weekViewHourDoubleClick( 4, 20, event )"/>
<box class="week-view-hour-box-class" id="week-tree-day-3-item-21" onclick="weekViewHourClick( 4, 21, event )" ondblclick="weekViewHourDoubleClick( 4, 21, event )"/>
<box class="week-view-hour-box-class" id="week-tree-day-3-item-22" onclick="weekViewHourClick( 4, 22, event )" ondblclick="weekViewHourDoubleClick( 4, 22, event )"/>
<box class="week-view-hour-box-class" id="week-tree-day-3-item-23" onclick="weekViewHourClick( 4, 23, event )" ondblclick="weekViewHourDoubleClick( 4, 23, event )"/>
</vbox>
<!-- / DAY 3 -->
<!-- DAY 4 -->
<vbox class="week-view-day-container-box" left="410" top="0">
<box class="week-view-hour-box-class" id="week-tree-day-4-item-0" onclick="weekViewHourClick( 5, 0, event )" ondblclick="weekViewHourDoubleClick( 5, 0, event )" />
<box class="week-view-hour-box-class" id="week-tree-day-4-item-1" onclick="weekViewHourClick( 5, 1, event )" ondblclick="weekViewHourDoubleClick( 5, 1, event )"/>
<box class="week-view-hour-box-class" id="week-tree-day-4-item-2" onclick="weekViewHourClick( 5, 2, event )" ondblclick="weekViewHourDoubleClick( 5, 2, event )" />
<box class="week-view-hour-box-class" id="week-tree-day-4-item-3" onclick="weekViewHourClick( 5, 3, event )" ondblclick="weekViewHourDoubleClick( 5, 3, event )" />
<box class="week-view-hour-box-class" id="week-tree-day-4-item-4" onclick="weekViewHourClick( 5, 4, event )" ondblclick="weekViewHourDoubleClick( 5, 4, event )" />
<box class="week-view-hour-box-class" id="week-tree-day-4-item-5" onclick="weekViewHourClick( 5, 5, event )" ondblclick="weekViewHourDoubleClick( 5, 5, event )" />
<box class="week-view-hour-box-class" id="week-tree-day-4-item-6" onclick="weekViewHourClick( 5, 6, event )" ondblclick="weekViewHourDoubleClick( 5, 6, event )" />
<box class="week-view-hour-box-class" id="week-tree-day-4-item-7" onclick="weekViewHourClick( 5, 7, event )" ondblclick="weekViewHourDoubleClick( 5, 7, event )" />
<box class="week-view-hour-box-class" id="week-tree-day-4-item-8" onclick="weekViewHourClick( 5, 8, event )" ondblclick="weekViewHourDoubleClick( 5, 8, event )" />
<box class="week-view-hour-box-class" id="week-tree-day-4-item-9" onclick="weekViewHourClick( 5, 9, event )" ondblclick="weekViewHourDoubleClick( 5, 9, event )" />
<box class="week-view-hour-box-class" id="week-tree-day-4-item-10" onclick="weekViewHourClick( 5, 10, event )" ondblclick="weekViewHourDoubleClick( 5, 10, event )" />
<box class="week-view-hour-box-class" id="week-tree-day-4-item-11" onclick="weekViewHourClick( 5, 11, event )" ondblclick="weekViewHourDoubleClick( 5, 11, event )" />
<box class="week-view-hour-box-class" id="week-tree-day-4-item-12" onclick="weekViewHourClick( 5, 12, event )" ondblclick="weekViewHourDoubleClick( 5, 12, event )" />
<box class="week-view-hour-box-class" id="week-tree-day-4-item-13" onclick="weekViewHourClick( 5, 13, event )" ondblclick="weekViewHourDoubleClick( 5, 13, event )" />
<box class="week-view-hour-box-class" id="week-tree-day-4-item-14" onclick="weekViewHourClick( 5, 14, event )" ondblclick="weekViewHourDoubleClick( 5, 14, event )" />
<box class="week-view-hour-box-class" id="week-tree-day-4-item-15" onclick="weekViewHourClick( 5, 15, event )" ondblclick="weekViewHourDoubleClick( 5, 15, event )" />
<box class="week-view-hour-box-class" id="week-tree-day-4-item-16" onclick="weekViewHourClick( 5, 16, event )" ondblclick="weekViewHourDoubleClick( 5, 16, event )" />
<box class="week-view-hour-box-class" id="week-tree-day-4-item-17" onclick="weekViewHourClick( 5, 17, event )" ondblclick="weekViewHourDoubleClick( 5, 17, event )" />
<box class="week-view-hour-box-class" id="week-tree-day-4-item-18" onclick="weekViewHourClick( 5, 18, event )" ondblclick="weekViewHourDoubleClick( 5, 18, event )" />
<box class="week-view-hour-box-class" id="week-tree-day-4-item-19" onclick="weekViewHourClick( 5, 19, event )" ondblclick="weekViewHourDoubleClick( 5, 19, event )" />
<box class="week-view-hour-box-class" id="week-tree-day-4-item-20" onclick="weekViewHourClick( 5, 20, event )" ondblclick="weekViewHourDoubleClick( 5, 20, event )"/>
<box class="week-view-hour-box-class" id="week-tree-day-4-item-21" onclick="weekViewHourClick( 5, 21, event )" ondblclick="weekViewHourDoubleClick( 5, 21, event )"/>
<box class="week-view-hour-box-class" id="week-tree-day-4-item-22" onclick="weekViewHourClick( 5, 22, event )" ondblclick="weekViewHourDoubleClick( 5, 22, event )"/>
<box class="week-view-hour-box-class" id="week-tree-day-4-item-23" onclick="weekViewHourClick( 5, 23, event )" ondblclick="weekViewHourDoubleClick( 5, 23, event )"/>
</vbox>
<!-- / DAY 4 -->
<!-- DAY 5 -->
<vbox class="week-view-day-container-box" left="488" top="0">
<box class="week-view-hour-box-class" id="week-tree-day-5-item-0" onclick="weekViewHourClick( 6, 0, event )" ondblclick="weekViewHourDoubleClick( 6, 0, event )" />
<box class="week-view-hour-box-class" id="week-tree-day-5-item-1" onclick="weekViewHourClick( 6, 1, event )" ondblclick="weekViewHourDoubleClick( 6, 1, event )"/>
<box class="week-view-hour-box-class" id="week-tree-day-5-item-2" onclick="weekViewHourClick( 6, 2, event )" ondblclick="weekViewHourDoubleClick( 6, 2, event )" />
<box class="week-view-hour-box-class" id="week-tree-day-5-item-3" onclick="weekViewHourClick( 6, 3, event )" ondblclick="weekViewHourDoubleClick( 6, 3, event )" />
<box class="week-view-hour-box-class" id="week-tree-day-5-item-4" onclick="weekViewHourClick( 6, 4, event )" ondblclick="weekViewHourDoubleClick( 6, 4, event )" />
<box class="week-view-hour-box-class" id="week-tree-day-5-item-5" onclick="weekViewHourClick( 6, 5, event )" ondblclick="weekViewHourDoubleClick( 6, 5, event )" />
<box class="week-view-hour-box-class" id="week-tree-day-5-item-6" onclick="weekViewHourClick( 6, 6, event )" ondblclick="weekViewHourDoubleClick( 6, 6, event )" />
<box class="week-view-hour-box-class" id="week-tree-day-5-item-7" onclick="weekViewHourClick( 6, 7, event )" ondblclick="weekViewHourDoubleClick( 6, 7, event )" />
<box class="week-view-hour-box-class" id="week-tree-day-5-item-8" onclick="weekViewHourClick( 6, 8, event )" ondblclick="weekViewHourDoubleClick( 6, 8, event )" />
<box class="week-view-hour-box-class" id="week-tree-day-5-item-9" onclick="weekViewHourClick( 6, 9, event )" ondblclick="weekViewHourDoubleClick( 6, 9, event )" />
<box class="week-view-hour-box-class" id="week-tree-day-5-item-10" onclick="weekViewHourClick( 6, 10, event )" ondblclick="weekViewHourDoubleClick( 6, 10, event )" />
<box class="week-view-hour-box-class" id="week-tree-day-5-item-11" onclick="weekViewHourClick( 6, 11, event )" ondblclick="weekViewHourDoubleClick( 6, 11, event )" />
<box class="week-view-hour-box-class" id="week-tree-day-5-item-12" onclick="weekViewHourClick( 6, 12, event )" ondblclick="weekViewHourDoubleClick( 6, 12, event )" />
<box class="week-view-hour-box-class" id="week-tree-day-5-item-13" onclick="weekViewHourClick( 6, 13, event )" ondblclick="weekViewHourDoubleClick( 6, 13, event )" />
<box class="week-view-hour-box-class" id="week-tree-day-5-item-14" onclick="weekViewHourClick( 6, 14, event )" ondblclick="weekViewHourDoubleClick( 6, 14, event )" />
<box class="week-view-hour-box-class" id="week-tree-day-5-item-15" onclick="weekViewHourClick( 6, 15, event )" ondblclick="weekViewHourDoubleClick( 6, 15, event )" />
<box class="week-view-hour-box-class" id="week-tree-day-5-item-16" onclick="weekViewHourClick( 6, 16, event )" ondblclick="weekViewHourDoubleClick( 6, 16, event )" />
<box class="week-view-hour-box-class" id="week-tree-day-5-item-17" onclick="weekViewHourClick( 6, 17, event )" ondblclick="weekViewHourDoubleClick( 6, 17, event )" />
<box class="week-view-hour-box-class" id="week-tree-day-5-item-18" onclick="weekViewHourClick( 6, 18, event )" ondblclick="weekViewHourDoubleClick( 6, 18, event )" />
<box class="week-view-hour-box-class" id="week-tree-day-5-item-19" onclick="weekViewHourClick( 6, 19, event )" ondblclick="weekViewHourDoubleClick( 6, 19, event )" />
<box class="week-view-hour-box-class" id="week-tree-day-5-item-20" onclick="weekViewHourClick( 6, 20, event )" ondblclick="weekViewHourDoubleClick( 6, 20, event )"/>
<box class="week-view-hour-box-class" id="week-tree-day-5-item-21" onclick="weekViewHourClick( 6, 21, event )" ondblclick="weekViewHourDoubleClick( 6, 21, event )"/>
<box class="week-view-hour-box-class" id="week-tree-day-5-item-22" onclick="weekViewHourClick( 6, 22, event )" ondblclick="weekViewHourDoubleClick( 6, 22, event )"/>
<box class="week-view-hour-box-class" id="week-tree-day-5-item-23" onclick="weekViewHourClick( 6, 23, event )" ondblclick="weekViewHourDoubleClick( 6, 23, event )"/>
</vbox>
<!-- / DAY 5 -->
<!-- DAY 6 -->
<vbox class="week-view-day-container-box" left="566" top="0">
<box class="week-view-hour-box-class week-view-hour-box-class-last-day weekend" id="week-tree-day-6-item-0" onclick="weekViewHourClick( 7, 0, event )" ondblclick="weekViewHourDoubleClick( 7, 0, event )" />
<box class="week-view-hour-box-class week-view-hour-box-class-last-day weekend" id="week-tree-day-6-item-1" onclick="weekViewHourClick( 7, 1, event )" ondblclick="weekViewHourDoubleClick( 7, 1, event )"/>
<box class="week-view-hour-box-class week-view-hour-box-class-last-day weekend" id="week-tree-day-6-item-2" onclick="weekViewHourClick( 7, 2, event )" ondblclick="weekViewHourDoubleClick( 7, 2, event )" />
<box class="week-view-hour-box-class week-view-hour-box-class-last-day weekend" id="week-tree-day-6-item-3" onclick="weekViewHourClick( 7, 3, event )" ondblclick="weekViewHourDoubleClick( 7, 3, event )" />
<box class="week-view-hour-box-class week-view-hour-box-class-last-day weekend" id="week-tree-day-6-item-4" onclick="weekViewHourClick( 7, 4, event )" ondblclick="weekViewHourDoubleClick( 7, 4, event )" />
<box class="week-view-hour-box-class week-view-hour-box-class-last-day weekend" id="week-tree-day-6-item-5" onclick="weekViewHourClick( 7, 5, event )" ondblclick="weekViewHourDoubleClick( 7, 5, event )" />
<box class="week-view-hour-box-class week-view-hour-box-class-last-day weekend" id="week-tree-day-6-item-6" onclick="weekViewHourClick( 7, 6, event )" ondblclick="weekViewHourDoubleClick( 7, 6, event )" />
<box class="week-view-hour-box-class week-view-hour-box-class-last-day weekend" id="week-tree-day-6-item-7" onclick="weekViewHourClick( 7, 7, event )" ondblclick="weekViewHourDoubleClick( 7, 7, event )" />
<box class="week-view-hour-box-class week-view-hour-box-class-last-day weekend" id="week-tree-day-6-item-8" onclick="weekViewHourClick( 7, 8, event )" ondblclick="weekViewHourDoubleClick( 7, 8, event )" />
<box class="week-view-hour-box-class week-view-hour-box-class-last-day weekend" id="week-tree-day-6-item-9" onclick="weekViewHourClick( 7, 9, event )" ondblclick="weekViewHourDoubleClick( 7, 9, event )" />
<box class="week-view-hour-box-class week-view-hour-box-class-last-day weekend" id="week-tree-day-6-item-10" onclick="weekViewHourClick( 7, 10, event )" ondblclick="weekViewHourDoubleClick( 7, 10, event )" />
<box class="week-view-hour-box-class week-view-hour-box-class-last-day weekend" id="week-tree-day-6-item-11" onclick="weekViewHourClick( 7, 11, event )" ondblclick="weekViewHourDoubleClick( 7, 11, event )" />
<box class="week-view-hour-box-class week-view-hour-box-class-last-day weekend" id="week-tree-day-6-item-12" onclick="weekViewHourClick( 7, 12, event )" ondblclick="weekViewHourDoubleClick( 7, 12, event )" />
<box class="week-view-hour-box-class week-view-hour-box-class-last-day weekend" id="week-tree-day-6-item-13" onclick="weekViewHourClick( 7, 13, event )" ondblclick="weekViewHourDoubleClick( 7, 13, event )" />
<box class="week-view-hour-box-class week-view-hour-box-class-last-day weekend" id="week-tree-day-6-item-14" onclick="weekViewHourClick( 7, 14, event )" ondblclick="weekViewHourDoubleClick( 7, 14, event )" />
<box class="week-view-hour-box-class week-view-hour-box-class-last-day weekend" id="week-tree-day-6-item-15" onclick="weekViewHourClick( 7, 15, event )" ondblclick="weekViewHourDoubleClick( 7, 15, event )" />
<box class="week-view-hour-box-class week-view-hour-box-class-last-day weekend" id="week-tree-day-6-item-16" onclick="weekViewHourClick( 7, 16, event )" ondblclick="weekViewHourDoubleClick( 7, 16, event )" />
<box class="week-view-hour-box-class week-view-hour-box-class-last-day weekend" id="week-tree-day-6-item-17" onclick="weekViewHourClick( 7, 17, event )" ondblclick="weekViewHourDoubleClick( 7, 17, event )" />
<box class="week-view-hour-box-class week-view-hour-box-class-last-day weekend" id="week-tree-day-6-item-18" onclick="weekViewHourClick( 7, 18, event )" ondblclick="weekViewHourDoubleClick( 7, 18, event )" />
<box class="week-view-hour-box-class week-view-hour-box-class-last-day weekend" id="week-tree-day-6-item-19" onclick="weekViewHourClick( 7, 19, event )" ondblclick="weekViewHourDoubleClick( 7, 19, event )" />
<box class="week-view-hour-box-class week-view-hour-box-class-last-day weekend" id="week-tree-day-6-item-20" onclick="weekViewHourClick( 7, 20, event )" ondblclick="weekViewHourDoubleClick( 7, 20, event )"/>
<box class="week-view-hour-box-class week-view-hour-box-class-last-day weekend" id="week-tree-day-6-item-21" onclick="weekViewHourClick( 7, 21, event )" ondblclick="weekViewHourDoubleClick( 7, 21, event )"/>
<box class="week-view-hour-box-class week-view-hour-box-class-last-day weekend" id="week-tree-day-6-item-22" onclick="weekViewHourClick( 7, 22, event )" ondblclick="weekViewHourDoubleClick( 7, 22, event )"/>
<box class="week-view-hour-box-class week-view-hour-box-class-last-day weekend" id="week-tree-day-6-item-23" onclick="weekViewHourClick( 7, 23, event )" ondblclick="weekViewHourDoubleClick( 7, 23, event )"/>
</vbox>
<!-- / DAY 6 -->
</stack>
</box>
</vbox>
</vbox>
</overlay>

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

@ -0,0 +1,130 @@
/*
* 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 Corporation.
*
* The Initial Developer of the Original Code is
* OEone Corporation.
* Portions created by OEone Corporation are Copyright (C) 2001
* OEone Corporation. All Rights Reserved.
*
* Contributor(s): Garth Smedley (garths@oeone.com) , Mike Potter (mikep@oeone.com)
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
*
*/
/**
* This is called from the unifinder when they need a new category
*/
function unifinderNewCategoryCommand( )
{
var args = new Object();
args.mode = "new";
args.Category = gCategoryManager.getNewCategory();
args.onOk = respondNewCategoryCommand;
calendar.openDialog( "caNewFolder", "chrome://calendar/content/calendarFolderDialog.xul", true, args );
}
/**
* This is called from the unifinder when they need a new category
*/
function respondNewCategoryCommand( Category )
{
gCategoryManager.addCategory( Category.name );
}
/*
** launches the add catgory dialog.
*/
function launchEditCategoryDialog( Category )
{
var args = new Object();
args.mode = "edit";
args.Category = Category;
args.onOk = editCategoryDialogResponse;
calendar.openDialog( "caNewFolder", "chrome://calendar/content/calendarFolderDialog.xul", true, args );
}
/*
** Function that actually adds the category.
*/
function editCategoryDialogResponse( Category )
{
gCategoryManager.modifyCategory( Category );
}
/**
* Called when the calendar is loaded.
* Sets up the category observers
*/
function prepareCalendarCategories()
{
gCategoryManager.addObserver( calendarCategoryObserver );
}
function finishCalendarCategories()
{
gCategoryManager.removeObserver( calendarCategoryObserver );
}
var calendarCategoryObserver =
{
onAddItem : function( calendarCategory )
{
refreshEventTree( gEventSource.getAllEvents(), "unifinder-categories-tree-children" );
},
onModifyItem : function( calendarCategory )
{
refreshEventTree( gEventSource.getAllEvents(), "unifinder-categories-tree-children" );
},
onDeleteItem : function( calendarCategory )
{
refreshEventTree( gEventSource.getAllEvents(), "unifinder-categories-tree-children" );
}
}

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

@ -0,0 +1,50 @@
<?xml version="1.0"?>
<!--
- 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 OEone Corporation are Copyright (C) 2001
- OEone Corporation. All Rights Reserved.
-
- Contributor(s): 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.
-
- -->
<RDF:RDF xmlns:RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:chrome="http://www.mozilla.org/rdf/chrome#">
<RDF:Seq about="urn:mozilla:package:root">
<RDF:li resource="urn:mozilla:package:calendar"/>
</RDF:Seq>
<RDF:Description about="urn:mozilla:package:calendar"
chrome:displayName="Calendar"
chrome:author="OEOne Corp."
chrome:name="calendar">
</RDF:Description>
</RDF:RDF>

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

@ -0,0 +1,572 @@
/*
* 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 Corporation.
*
* The Initial Developer of the Original Code is
* OEone Corporation.
* Portions created by OEone Corporation are Copyright (C) 2001
* OEone Corporation. All Rights Reserved.
*
* Contributor(s): Garth Smedley (garths@oeone.com) , Mike Potter (mikep@oeone.com)
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
*
*/
/*-----------------------------------------------------------------
* DayView Class subclass of CalendarView
*
* Calendar day view class
*
* PROPERTIES
* dayEvents - Event text is displayed in the hour items of the view. The items that currently
* have an event are stored here. The hour items have a calendarEvent property
* added so we know which event is displayed for the day.
*
* 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 );
this.selectedEventBoxes = new Array();
// set up dayEvents array
this.dayEvents = new Array();
}
/** PUBLIC
*
* Redraw the events for the current month
*
*/
DayView.prototype.refreshEvents = function( )
{
this.kungFooDeathGripOnEventBoxes = new Array();
// remove old event boxes
var eventBoxList = document.getElementsByAttribute( "eventbox", "dayview" );
for( var eventBoxIndex = 0; eventBoxIndex < eventBoxList.length; ++eventBoxIndex )
{
var eventBox = eventBoxList[ eventBoxIndex ];
eventBox.parentNode.removeChild( eventBox );
}
//get the all day box.
var AllDayBox = document.getElementById( "all-day-content-box" );
AllDayBox.setAttribute( "collapsed", "true" );
//remove all the text from the all day content box.
while( AllDayBox.hasChildNodes() )
{
AllDayBox.removeChild( AllDayBox.firstChild );
}
//shrink the day's content box.
document.getElementById( "day-view-content-box" ).setAttribute( "allday", "false" );
//make the text node that will contain the text for the all day box.
//var TextNode = document.getElementById( "all-day-content-box-text" );
//if ( TextNode == null )
//{
HtmlNode = document.createElement( "html" );
HtmlNode.setAttribute( "id", "all-day-content-box-text" );
TextNode = document.createTextNode( "All-Day Events: " );
HtmlNode.appendChild( TextNode );
document.getElementById( "all-day-content-box" ).appendChild( HtmlNode );
//}
//TextNode.setAttribute( "value", "All-Day Events: " );
//set the seperator to nothing. After the first one, we'll change it to ", " so that we add commas between text.
var Seperator = " ";
// get the events for the day and loop through them
var dayEventList = this.calendarWindow.eventSource.getEventsForDay( this.calendarWindow.getSelectedDate() );
//refresh the array and the current spot.
for ( i = 0; i < dayEventList.length; i++ )
{
dayEventList[i].OtherSpotArray = new Array('0');
dayEventList[i].CurrentSpot = 0;
dayEventList[i].NumberOfSameTimeEvents = 0;
}
for ( i = 0; i < dayEventList.length; i++ )
{
var calendarEvent = dayEventList[i];
//check to make sure that the event is not an all day event...
if ( calendarEvent.allDay != true )
{
//see if there's another event at the same start time.
for ( j = 0; j < dayEventList.length; j++ )
{
//thisCalendarEvent = dayEventList[j];
calendarEventToMatch = dayEventList[j];
calendarEventToMatchHours = calendarEventToMatch.displayDate.getHours();
calendarEventToMatchMinutes = calendarEventToMatch.displayDate.getMinutes();
calendarEventDisplayHours = calendarEvent.displayDate.getHours();
calendarEventDisplayMinutes = calendarEvent.displayDate.getMinutes();
calendarEventEndHours = calendarEvent.end.getHours();
calendarEventEndMinutes = calendarEvent.end.getMinutes();
calendarEventToMatch.displayDateTime = new Date( 2000, 1, 1, calendarEventToMatchHours, calendarEventToMatchMinutes, 0 );
calendarEvent.displayDateTime = new Date( 2000, 1, 1, calendarEventDisplayHours, calendarEventDisplayMinutes, 0 );
calendarEventToMatch.endTime = new Date( 2000, 1, 1, calendarEventToMatchHours, calendarEventToMatchMinutes, 0 );
//if this event overlaps with another event...
if ( ( ( calendarEventToMatch.displayDateTime >= calendarEvent.displayDateTime &&
calendarEventToMatch.displayDateTime < calendarEvent.endTime ) ||
( calendarEvent.displayDateTime >= calendarEventToMatch.displayDateTime &&
calendarEvent.displayDateTime < calendarEventToMatch.endTime ) ) &&
calendarEvent.id != calendarEventToMatch.id )
{
//get the spot that this event will go in.
var ThisSpot = calendarEventToMatch.CurrentSpot;
calendarEvent.OtherSpotArray.push( ThisSpot );
ThisSpot++;
if ( ThisSpot > calendarEvent.CurrentSpot )
{
calendarEvent.CurrentSpot = ThisSpot;
}
}
}
SortedOtherSpotArray = new Array();
SortedOtherSpotArray = calendarEvent.OtherSpotArray.sort( gCalendarWindow.compareNumbers );
LowestNumber = this.calendarWindow.getLowestElementNotInArray( SortedOtherSpotArray );
//this is the actual spot (0 -> n) that the event will go in on the day view.
calendarEvent.CurrentSpot = LowestNumber;
calendarEvent.NumberOfSameTimeEvents = SortedOtherSpotArray.length;
}
}
for ( var eventIndex = 0; eventIndex < dayEventList.length; ++eventIndex )
{
var calendarEvent = dayEventList[ eventIndex ];
//if its an all day event, don't show it in the hours bulletin board.
if ( calendarEvent.allDay == true )
{
// build up the text to show for this event
var eventText = calendarEvent.title;
if( calendarEvent.location )
{
eventText += " " + calendarEvent.location;
}
if( calendarEvent.description )
{
eventText += " " + calendarEvent.description;
}
//show the all day box
AllDayBox.setAttribute( "collapsed", "false" );
//shrink the day's content box.
document.getElementById( "day-view-content-box" ).setAttribute( "allday", "true" );
//note the use of the AllDayText Attribute.
//This is used to remove the text when the day is changed.
SeperatorNode = document.createElement( "label" );
SeperatorNode.setAttribute( "value", Seperator );
//SeperatorNode.setAttribute( "AllDayText", "true" );
newTextNode = document.createElement( "label" );
newTextNode.setAttribute( "value", eventText );
//newTextNode.setAttribute( "AllDayText", "true" );
newImage = document.createElement("image");
newImage.setAttribute( "src", "chrome://calendar/skin/all_day_event.png" );
//newImage.setAttribute( "AllDayText", "true" );
AllDayBox.appendChild( SeperatorNode );
AllDayBox.appendChild( newImage );
AllDayBox.appendChild( newTextNode );
//change the seperator to add commas after the text.
Seperator = ", ";
}
else
{
eventBox = this.createEventBox( calendarEvent );
//add the box to the bulletin board.
document.getElementById( "day-view-content-board" ).appendChild( eventBox );
}
}
// select the hour of the selected item, if there is an item whose date matches
var selectedEvent = this.calendarWindow.getSelectedEvent();
//if the selected event is today, highlight it. Otherwise, don't highlight anything.
if ( selectedEvent )
{
this.selectEvent( selectedEvent );
}
}
/** PRIVATE
*
* This creates an event box for the day view
*/
DayView.prototype.createEventBox = function ( calendarEvent )
{
// build up the text to show for this event
var eventText = calendarEvent.title;
var eventStartDate = calendarEvent.displayDate;
var startHour = eventStartDate.getHours();
var startMinutes = eventStartDate.getMinutes();
var eventEndDate = calendarEvent.end;
var endHour = eventEndDate.getHours();
var eventEndDateTime = new Date( 2000, 1, 1, eventEndDate.getHours(), eventEndDate.getMinutes(), 0 );
var eventStartDateTime = new Date( 2000, 1, 1, eventStartDate.getHours(), eventStartDate.getMinutes(), 0 );
var eventDuration = new Date( eventEndDateTime - eventStartDateTime );
var hourDuration = eventDuration / (3600000);
/*if( calendarEvent.location )
{
eventText += "\n" + calendarEvent.location;
}
if( calendarEvent.description )
{
eventText += "\n" + calendarEvent.description;
}
*/
var eventBox = document.createElement( "hbox" );
top = eval( ( startHour*kDayViewHourHeight ) + ( ( startMinutes/60 ) * kDayViewHourHeight ) );
eventBox.setAttribute( "top", top );
eventBox.setAttribute( "height", ( hourDuration*kDayViewHourHeight ) - 2 );
eventBox.setAttribute( "width", 500 / calendarEvent.NumberOfSameTimeEvents );
left = eval( ( ( calendarEvent.CurrentSpot - 1 ) * eventBox.getAttribute( "width" ) ) + kDayViewHourLeftStart );
eventBox.setAttribute( "left", left );
eventBox.setAttribute( "class", "day-view-event-class" );
eventBox.setAttribute( "flex", "1" );
eventBox.setAttribute( "eventbox", "dayview" );
eventBox.setAttribute( "onclick", "dayEventItemClick( this, event )" );
eventBox.setAttribute( "ondblclick", "dayEventItemDoubleClick( this, event )" );
eventBox.setAttribute( "onmouseover", "gCalendarWindow.mouseOverInfo( calendarEvent, event )" );
eventBox.setAttribute( "tooltip", "savetip" );
eventBox.setAttribute( "id", "day-view-event-box-"+calendarEvent.id );
eventBox.setAttribute( "name", "day-view-event-box-"+calendarEvent.id );
var eventHTMLElement = document.createElement( "html" );
eventHTMLElement.setAttribute( "id", "day-view-event-html"+calendarEvent.id );
var eventTextElement = document.createTextNode( eventText );
eventHTMLElement.setAttribute( "class", "day-view-event-text-class" );
eventHTMLElement.setAttribute( "width", eventBox.getAttribute( "width" ) );
eventHTMLElement.setAttribute( "style", "max-width: "+eventBox.getAttribute( "width" )+";"+";max-height: "+eventBox.getAttribute( "height" )+";overflow: never;" );
eventBox.setAttribute( "style", "max-width: "+eventBox.getAttribute( "width" )+";max-height: "+eventBox.getAttribute( "height" )+";overflow: never;" );
eventHTMLElement.setAttribute( "autostretch", "never" );
eventHTMLElement.appendChild( eventTextElement );
eventBox.appendChild( eventHTMLElement );
// add a property to the event box that holds the calendarEvent that the
// box represents
eventBox.calendarEvent = calendarEvent;
this.kungFooDeathGripOnEventBoxes.push( eventBox );
return( eventBox );
}
/** PUBLIC
*
* Called when the user switches from a different view
*/
DayView.prototype.switchFrom = function( )
{
}
/** PUBLIC
*
* Called when the user switches to the day view
*/
DayView.prototype.switchTo = function( )
{
// disable/enable view switching buttons
var weekViewButton = document.getElementById( "calendar-week-view-button" );
var monthViewButton = document.getElementById( "calendar-month-view-button" );
var dayViewButton = document.getElementById( "calendar-day-view-button" );
monthViewButton.setAttribute( "disabled", "false" );
weekViewButton.setAttribute( "disabled", "false" );
dayViewButton.setAttribute( "disabled", "true" );
// switch views in the deck
var calendarDeckItem = document.getElementById( "calendar-deck" );
calendarDeckItem.setAttribute( "index", 2 );
}
/** PUBLIC
*
* Redraw the display, but not the events
*/
DayView.prototype.refreshDisplay = function( )
{
// update the title
var dayName = this.calendarWindow.dateFormater.getDayName( this.calendarWindow.getSelectedDate().getDay() );
var monthName = this.calendarWindow.dateFormater.getMonthName( this.calendarWindow.getSelectedDate().getMonth() );
var dateString = dayName + ", " + monthName + " " + this.calendarWindow.getSelectedDate().getDate() + " " + this.calendarWindow.getSelectedDate().getFullYear();
var dayTextItem = document.getElementById( "day-title-text" );
dayTextItem.setAttribute( "value" , dateString );
}
/** PUBLIC
*
* Get the selected event and delete it.
*/
DayView.prototype.deletedSelectedEvent = function( )
{
// :TODO:
}
/** PUBLIC -- monthview only
*
* Called when an event box item is single clicked
*/
DayView.prototype.clickEventBox = function( eventBox, event )
{
// clear the old selected box
for ( i = 0; i < this.selectedEventBoxes.length; i++ )
{
this.selectedEventBoxes[i].setAttribute( "selected", false );
}
this.selectedEventBoxes = Array();
if( eventBox )
{
// select the event
this.selectEvent( eventBox.calendarEvent );
selectEventInUnifinder( eventBox.calendarEvent );
}
// Do not let the click go through, suppress default selection
if ( event )
{
event.stopPropagation();
}
}
/** 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( )
{
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()
{
var 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()
{
var prevDay = new Date( this.calendarWindow.selectedDate.getFullYear(), this.calendarWindow.selectedDate.getMonth(), this.calendarWindow.selectedDate.getDate() - 1 );
this.goToDay( prevDay );
}
/** PUBLIC
*
* select an event.
*/
DayView.prototype.selectEvent = function( calendarEvent )
{
//clear the selected event
gCalendarWindow.clearSelectedEvent( );
gCalendarWindow.setSelectedEvent( calendarEvent );
EventBoxes = document.getElementsByAttribute( "name", "day-view-event-box-"+calendarEvent.id );
for ( i = 0; i < EventBoxes.length; i++ )
{
EventBoxes[i].setAttribute( "selected", "true" );
this.selectedEventBoxes[ this.selectedEventBoxes.length ] = EventBoxes[i];
}
selectEventInUnifinder( calendarEvent );
}
/** PUBLIC
*
* clear the selected event by taking off the selected attribute.
*/
DayView.prototype.clearSelectedEvent = function( )
{
//Event = gCalendarWindow.getSelectedEvent();
//if there is an event, and if the event is in the current view.
//var SelectedBoxes = document.getElementsByAttribute( "name", "day-view-event-box-"+Event.id );
for ( i = 0; i < this.selectedEventBoxes.length; i++ )
{
this.selectedEventBoxes[i].setAttribute( "selected", false );
}
this.selectedEventBoxes = Array();
//clear the selection in the unifinder
deselectEventInUnifinder( );
}
DayView.prototype.clearSelectedDate = function( )
{
return;
}
DayView.prototype.getVisibleEvent = function( calendarEvent )
{
eventBox = document.getElementById( "day-view-event-box-"+calendarEvent.id );
if ( eventBox )
{
return eventBox;
}
else
return null;
}
/*
** This function is needed because it may be called after the end of each day.
*/
DayView.prototype.hiliteTodaysDate = function( )
{
return;
}

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

@ -0,0 +1,237 @@
<?xml version="1.0"?>
<!--
- 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 OEone Corporation are Copyright (C) 2001
- OEone Corporation. All Rights Reserved.
-
- Contributor(s): Garth Smedley (garths@oeone.com), Mike Potter (mikep@oeone.com)
-
- Alternatively, the contents of this file may be used under the terms of
- either the GNU General Public License Version 2 or later (the "GPL"), or
- the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- in which case the provisions of the GPL or the LGPL are applicable instead
- of those above. If you wish to allow use of your version of this file only
- under the terms of either the GPL or the LGPL, and not to allow others to
- use your version of this file under the terms of the MPL, indicate your
- decision by deleting the provisions above and replace them with the notice
- and other provisions required by the 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.
-
- -->
<!-- Style sheets -->
<?xml-stylesheet href="chrome://global/skin/global.css" type="text/css"?>
<?xml-stylesheet href="chrome://calendar/skin/calendar.css" ?>
<!-- DTDs -->
<!-- DTD File with all strings specific to the calendar -->
<!DOCTYPE window
[
<!ENTITY % dtd1 SYSTEM "chrome://penglobal/locale/global.dtd" > %dtd1;
<!ENTITY % dtd2 SYSTEM "chrome://calendar/locale/calendar.dtd" > %dtd2;
]>
<!-- The Window -->
<overlay
xmlns:html="http://www.w3.org/1999/xhtml"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
>
<script type="application/x-javascript" src="chrome://calendar/content/calendarDayView.js"/>
<vbox id="day-view-box" flex="1">
<!-- Day View: Controls-->
<hbox id="day-controls-box">
<image flex="1" id="day-previous-button" onclick="gCalendarWindow.goToPrevious()"/>
<label id="day-title-text" value="" />
<box flex="1" id="day-next-button-box">
<image id="day-next-button" onclick="gCalendarWindow.goToNext()"/>
</box>
</hbox>
<!-- Day View: -->
<box id="all-day-content-box" collapsed="true" flex="1">
<label id="all-day-content-box-text" value="All-Day Events: "/>
</box>
<!-- This is an overlay being included from above -->
<box id="day-view-content-box" autostretch="true" flex="1">
<stack id="day-view-content-board" flex="1" height="1200">
<image src="chrome://calendar/skin/day_left_gradient.png" left="1" top="1" width="30" height="1199"/>
<hbox top="0" left="31" class="day-view-hour-box-class" id="day-tree-item-0" onclick="dayViewHourClick( 0, event )" ondblclick="dayViewHourDoubleClick( 0, event )" >
<box class="day-time-class" flex="1">
<label class="day-time-class" id="day-view-hour" value="&time.midnight; " />
</box>
</hbox>
<box top="50" left="31" class="day-view-hour-box-class" id="day-tree-item-1" onclick="dayViewHourClick( 1, event )" ondblclick="dayViewHourDoubleClick( 1, event )" >
<box class="day-time-class">
<label class="day-time-class" id="day-view-hour" value="&time.1; " />
</box>
</box>
<box top="100" left="31" class="day-view-hour-box-class" id="day-tree-item-2" onclick="dayViewHourClick( 2, event )" ondblclick="dayViewHourDoubleClick( 2, event )" >
<box class="day-time-class">
<label class="day-time-class" id="day-view-hour" value="&time.2; " />
</box>
</box>
<box top="150" left="31" class="day-view-hour-box-class" id="day-tree-item-3" onclick="dayViewHourClick( 3, event )" ondblclick="dayViewHourDoubleClick( 3, event )" >
<box class="day-time-class">
<label class="day-time-class" id="day-view-hour" value="&time.3; " />
</box>
</box>
<box top="200" left="31" class="day-view-hour-box-class" id="day-tree-item-4" onclick="dayViewHourClick( 4, event )" ondblclick="dayViewHourDoubleClick( 4, event )" >
<box class="day-time-class">
<label class="day-time-class" id="day-view-hour" value="&time.4; " />
</box>
</box>
<box top="250" left="31" class="day-view-hour-box-class" id="day-tree-item-5" onclick="dayViewHourClick( 5, event )" ondblclick="dayViewHourDoubleClick( 5, event )" >
<box class="day-time-class">
<label class="day-time-class" id="day-view-hour" value="&time.5; " />
</box>
</box>
<box top="300" left="31" class="day-view-hour-box-class" id="day-tree-item-6" onclick="dayViewHourClick( 6, event )" ondblclick="dayViewHourDoubleClick( 6, event )" >
<box class="day-time-class">
<label class="day-time-class" id="day-view-hour" value="&time.6; " />
</box>
</box>
<box top="350" left="31" class="day-view-hour-box-class" id="day-tree-item-7" onclick="dayViewHourClick( 7, event )" ondblclick="dayViewHourDoubleClick( 7, event )" >
<box class="day-time-class">
<label class="day-time-class" id="day-view-hour" value="&time.7; " />
</box>
</box>
<box top="400" left="31" class="day-view-hour-box-class" id="day-tree-item-8" onclick="dayViewHourClick( 8, event )" ondblclick="dayViewHourDoubleClick( 8, event )" >
<box class="day-time-class">
<label class="day-time-class" id="day-view-hour" value="&time.8; " />
</box>
</box>
<box top="450" left="31" class="day-view-hour-box-class" id="day-tree-item-9" onclick="dayViewHourClick( 9, event )" ondblclick="dayViewHourDoubleClick( 9, event )" >
<box class="day-time-class">
<label class="day-time-class" id="day-view-hour" value="&time.9; " />
</box>
</box>
<box top="500" left="31" class="day-view-hour-box-class" id="day-tree-item-10" onclick="dayViewHourClick( 10, event )" ondblclick="dayViewHourDoubleClick( 10, event )" >
<box class="day-time-class">
<label class="day-time-class" id="day-view-hour" value="&time.10; " />
</box>
</box>
<box top="550" left="31" class="day-view-hour-box-class" id="day-tree-item-11" onclick="dayViewHourClick( 11, event )" ondblclick="dayViewHourDoubleClick( 11, event )" >
<box class="day-time-class">
<label class="day-time-class" id="day-view-hour" value="&time.11; " />
</box>
</box>
<box top="600" left="31" class="day-view-hour-box-class" id="day-tree-item-12" onclick="dayViewHourClick( 12, event )" ondblclick="dayViewHourDoubleClick( 12, event )" >
<box class="day-time-class">
<label class="day-time-class" id="day-view-hour" value="&time.noon; " />
</box>
</box>
<box top="650" left="31" class="day-view-hour-box-class" id="day-tree-item-13" onclick="dayViewHourClick( 13, event )" ondblclick="dayViewHourDoubleClick( 13, event )" >
<box class="day-time-class">
<label class="day-time-class" id="day-view-hour" value="&time.13; " />
</box>
</box>
<box top="700" left="31" class="day-view-hour-box-class" id="day-tree-item-14" onclick="dayViewHourClick( 14, event )" ondblclick="dayViewHourDoubleClick( 14, event )" >
<box class="day-time-class">
<label class="day-time-class" id="day-view-hour" value="&time.14; " />
</box>
</box>
<box top="750" left="31" class="day-view-hour-box-class" id="day-tree-item-15" onclick="dayViewHourClick( 15, event )" ondblclick="dayViewHourDoubleClick( 15, event )" >
<box class="day-time-class">
<label class="day-time-class" id="day-view-hour" value="&time.15; " />
</box>
</box>
<box top="800" left="31" class="day-view-hour-box-class" id="day-tree-item-16" onclick="dayViewHourClick( 16, event )" ondblclick="dayViewHourDoubleClick( 16, event )" >
<box class="day-time-class">
<label class="day-time-class" id="day-view-hour" value="&time.16; " />
</box>
</box>
<box top="850" left="31" class="day-view-hour-box-class" id="day-tree-item-17" onclick="dayViewHourClick( 17, event )" ondblclick="dayViewHourDoubleClick( 17, event )" >
<box class="day-time-class">
<label class="day-time-class" id="day-view-hour" value="&time.17; " />
</box>
</box>
<box top="900" left="31" class="day-view-hour-box-class" id="day-tree-item-18" onclick="dayViewHourClick( 18, event )" ondblclick="dayViewHourDoubleClick( 18, event )" >
<box class="day-time-class">
<label class="day-time-class" id="day-view-hour" value="&time.18; " />
</box>
</box>
<box top="950" left="31" class="day-view-hour-box-class" id="day-tree-item-19" onclick="dayViewHourClick( 19, event )" ondblclick="dayViewHourDoubleClick( 19, event )" >
<box class="day-time-class">
<label class="day-time-class" id="day-view-hour" value="&time.19; " />
</box>
</box>
<box top="1000" left="31" class="day-view-hour-box-class" id="day-tree-item-20" onclick="dayViewHourClick( 20, event )" ondblclick="dayViewHourDoubleClick( 20, event )" >
<box class="day-time-class">
<label class="day-time-class" id="day-view-hour" value="&time.20; " />
</box>
</box>
<box top="1050" left="31" class="day-view-hour-box-class" id="day-tree-item-21" onclick="dayViewHourClick( 21, event )" ondblclick="dayViewHourDoubleClick( 21, event )" >
<box class="day-time-class">
<label class="day-time-class" id="day-view-hour" value="&time.21; " />
</box>
</box>
<box top="1100" left="31" class="day-view-hour-box-class" id="day-tree-item-22" onclick="dayViewHourClick( 22, event )" ondblclick="dayViewHourDoubleClick( 22, event )" >
<box class="day-time-class">
<label class="day-time-class" id="day-view-hour" value="&time.22; " />
</box>
</box>
<box top="1150" left="31" class="day-view-hour-box-class" id="day-tree-item-23" onclick="dayViewHourClick( 23, event )" ondblclick="dayViewHourDoubleClick( 23, event )" >
<box class="day-time-class">
<label class="day-time-class" id="day-view-hour" value="&time.23; " />
</box>
</box>
</stack>
</box> <!-- End: day-tree-content-box -->
</vbox> <!-- End: Calendar Day View -->
</overlay>

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

@ -0,0 +1,774 @@
/*
* 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 Corporation.
*
* The Initial Developer of the Original Code is
* OEone Corporation.
* Portions created by OEone Corporation are Copyright (C) 2001
* OEone Corporation. All Rights Reserved.
*
* Contributor(s): Garth Smedley (garths@oeone.com) , Mike Potter (mikep@oeone.com)
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
*
*/
/*-----------------------------------------------------------------
* MonthView Class subclass of CalendarView
*
* Calendar month view class
*
* PROPERTIES
* selectedEventBox - Events are displayed in dynamically created event boxes
* this is the selected box, or null
*
* showingLastDay - When the user changes to a new month we select
* the same day in the new month that was selected in the original month. If the
* new month does not have that day ( i.e. 31 was selected and the new month has
* only 30 days ) we move the selection to the last day. When this happens we turn on
* the 'showingLastDay' flag. Now we will always select the last day when the month
* is changed so that if they go back to the original month, 31 is selected again.
* 'showingLastDay' is turned off when the user selects a new day or changes the view.
*
*
* dayNumberItemArray - An array [ 0 to 41 ] of text boxes that hold the day numbers in the month view.
* We set the value attribute to the day number, or "" for boxes that are not in the month.
* In the XUL they have id's of the form month-week-<row_number>-day-<column_number>
* where row_number is 1 - 6 and column_number is 1 - 7.
*
* dayBoxItemArray - An array [ 0 to 41 ] of boxes, one for each day in the month view. These boxes
* are selected when a day is selected. They contain a dayNumberItem and event boxes.
* In the XUL they have id's of the form month-week-<row_number>-day-<column_number>-box
* where row_number is 1 - 6 and column_number is 1 - 7.
*
* dayBoxItemByDateArray - This array is reconstructed whenever the month changes ( and probably more
* often than that ) It contains day box items, just like the dayBoxItemArray above,
* except this array contains only those boxes that belong to the current month
* and is indexed by date. So for a 30 day month that starts on a Wednesday,
* dayBoxItemByDateArray[0] === dayBoxItemArray[3] and
* dayBoxItemByDateArray[29] === dayBoxItemArray[36]
*
* kungFooDeathGripOnEventBoxes - This is to keep the event box javascript objects around so when we get
* them back they still have the calendar event property on them.
*
*
* NOTES
*
* Events are displayed in dynamically created event boxes. these boxes have a property added to them
* called "calendarEvent" which contains the event represented by the box.
*
* There is one day box item for every day box in the month grid. These have an attribute
* called "empty" which is set to "true", like so:
*
* dayBoxItem.setAttribute( "empty" , "true" );
*
* when the day box is not in the month. This allows the display to be controlled from css.
*
* The day boxes also have a couple of properties added to them:
*
* dayBoxItem.dayNumber - null when day is not in month.
* - the date, 1 to 31, otherwise,
*
* dayBoxItem.numEvents - The number of events for the day, used to limit the number displayed
* since there is only room for 3.
*
*/
// Make MonthView inherit from CalendarView
MonthView.prototype = new CalendarView();
MonthView.prototype.constructor = MonthView;
/**
* MonthView Constructor.
*
* PARAMETERS
* calendarWindow - the owning instance of CalendarWindow.
*
*/
function MonthView( calendarWindow )
{
// call the super constructor
this.superConstructor( calendarWindow );
// set up, see notes above
this.selectedEventBoxes = new Array();
this.selectedTodayBox = null;
this.showingLastDay = false;
// set up month day box's and day number text items, see notes above
this.dayNumberItemArray = new Array();
this.dayBoxItemArray = new Array();
var dayItemIndex = 0;
for( var weekIndex = 1; weekIndex <= 6; ++weekIndex )
{
for( var dayIndex = 1; dayIndex <= 7; ++dayIndex )
{
// add the day text item to an array[0..41]
var dayNumberItem = document.getElementById( "month-week-" + weekIndex + "-day-" + dayIndex );
this.dayNumberItemArray[ dayItemIndex ] = dayNumberItem;
// add the day box to an array[0..41]
var dayBoxItem = document.getElementById( "month-week-" + weekIndex + "-day-" + dayIndex + "-box" );
this.dayBoxItemArray[ dayItemIndex ] = dayBoxItem;
// set on click of day boxes
dayBoxItem.setAttribute( "onclick", "gCalendarWindow.monthView.clickDay( this )" );
//set the double click of day boxes
dayBoxItem.setAttribute( "ondblclick", "gCalendarWindow.monthView.doubleClickDay( this )" );
// array index
++dayItemIndex;
}
}
}
/** PUBLIC
*
* Redraw the events for the current month
*
* We create XUL boxes dynamically and insert them into the XUL.
* To refresh the display we remove all the old boxes and make new ones.
*/
MonthView.prototype.refreshEvents = function( )
{
// get this month's events and display them
var monthEventList = this.calendarWindow.eventSource.getEventsForMonth( this.calendarWindow.getSelectedDate() );
// remove old event boxes
var eventBoxList = document.getElementsByAttribute( "eventbox", "monthview" );
for( var eventBoxIndex = 0; eventBoxIndex < eventBoxList.length; ++eventBoxIndex )
{
var eventBox = eventBoxList[ eventBoxIndex ];
eventBox.parentNode.removeChild( eventBox );
}
// clear calendarEvent counts, we only display 3 events per day
// so to count them by adding a property to the dayItem, which is zeroed here
for( var dayItemIndex = 0; dayItemIndex < this.dayBoxItemArray.length; ++dayItemIndex )
{
var dayItem = this.dayBoxItemArray[ dayItemIndex ];
dayItem.numEvents = 0;
}
// remove the old selection
this.selectedEventBoxes = Array();
// add each calendarEvent
this.kungFooDeathGripOnEventBoxes = new Array();
for( var eventIndex = 0; eventIndex < monthEventList.length; ++eventIndex )
{
var calendarEvent = monthEventList[ eventIndex ];
var eventDate = calendarEvent.displayDate;
// get the day box for the calendarEvent's day
var eventDayInMonth = eventDate.getDate();
var dayBoxItem = this.dayBoxItemByDateArray[ eventDayInMonth ];
// Display no more than three, show dots for the events > 3
dayBoxItem.numEvents += 1;
if( dayBoxItem.numEvents < 4 )
{
// Make a text item to show the event title
var eventBoxText = document.createElement( "text" );
eventBoxText.setAttribute( "crop", "right" );
eventBoxText.setAttribute( "class", "month-day-event-text-class" );
eventBoxText.setAttribute( "value", calendarEvent.title );
// Make a box item to hold the text item
var eventBox = document.createElement( "vbox" );
eventBox.setAttribute( "id", "month-view-event-box-"+calendarEvent.id );
eventBox.setAttribute( "name", "month-view-event-box-"+calendarEvent.id );
eventBox.setAttribute( "event"+calendarEvent.id, true );
eventBox.setAttribute( "class", "month-day-event-box-class" );
eventBox.setAttribute( "eventbox", "monthview" );
eventBox.setAttribute( "onclick", "monthEventBoxClickEvent( this, event )" );
eventBox.setAttribute( "ondblclick", "monthEventBoxDoubleClickEvent( this, event )" );
// add a property to the event box that holds the calendarEvent that the
// box represents
eventBox.calendarEvent = calendarEvent;
this.kungFooDeathGripOnEventBoxes.push( eventBox );
eventBox.setAttribute( "onmouseover", "gCalendarWindow.mouseOverInfo( calendarEvent, event )" );
eventBox.setAttribute( "tooltip", "savetip" );
// add the text to the event box and the event box to the day box
eventBox.appendChild( eventBoxText );
dayBoxItem.appendChild( eventBox );
}
else
{
//if there is not a box to hold the little dots for this day...
if ( !document.getElementById( "dotboxholder"+calendarEvent.start.getDate() ) )
{
//make one
dotBoxHolder = document.createElement( "hbox" );
dotBoxHolder.setAttribute( "id", "dotboxholder"+calendarEvent.start.getDate() );
dotBoxHolder.setAttribute( "eventbox", "monthview" );
//add the box to the day.
dayBoxItem.appendChild( dotBoxHolder );
}
else
{
//otherwise, get the box
dotBoxHolder = document.getElementById( "dotboxholder"+calendarEvent.start.getDate() );
}
if( dotBoxHolder.childNodes.length < kMAX_NUMBER_OF_DOTS_IN_MONTH_VIEW )
{
eventDotBox = document.createElement( "box" );
eventDotBox.setAttribute( "eventbox", "monthview" );
//show a dot representing an event.
//NOTE: This variable is named eventBox because it needs the same name as
// the regular boxes, for the next part of the function!
eventBox = document.createElement( "image" );
eventBox.setAttribute( "class", "month-view-event-dot-class" );
eventBox.setAttribute( "id", "month-view-event-box-"+calendarEvent.id );
eventBox.setAttribute( "name", "month-view-event-box-"+calendarEvent.id );
eventBox.calendarEvent = calendarEvent;
this.kungFooDeathGripOnEventBoxes.push( eventBox );
eventBox.setAttribute( "onmouseover", "gCalendarWindow.mouseOverInfo( calendarEvent, event )" );
eventBox.setAttribute( "onclick", "monthEventBoxClickEvent( this, event )" );
eventBox.setAttribute( "ondblclick", "monthEventBoxDoubleClickEvent( this, event )" );
eventBox.setAttribute( "tooltip", "savetip" );
//add the dot to the extra box.
eventDotBox.appendChild( eventBox );
dotBoxHolder.appendChild( eventDotBox );
}
}
// mark the box as selected, if the event is
if( this.calendarWindow.getSelectedEvent() === calendarEvent )
{
var eventBox = gCalendarWindow.currentView.getVisibleEvent( calendarEvent );
gCalendarWindow.currentView.clickEventBox( eventBox );
selectEventInUnifinder( calendarEvent );
}
}
}
/** PUBLIC
*
* Called when the user switches to a different view
*/
MonthView.prototype.switchFrom = function( )
{
this.selectedEventBoxes = Array();
}
/** PUBLIC
*
* Called when the user switches to the month view
*/
MonthView.prototype.switchTo = function( )
{
// see showingLastDay notes above
this.showingLastDay = false;
// disable/enable view switching buttons
var weekViewButton = document.getElementById( "calendar-week-view-button" );
var monthViewButton = document.getElementById( "calendar-month-view-button" );
var dayViewButton = document.getElementById( "calendar-day-view-button" );
monthViewButton.setAttribute( "disabled", "true" );
weekViewButton.setAttribute( "disabled", "false" );
dayViewButton.setAttribute( "disabled", "false" );
// switch views in the deck
var calendarDeckItem = document.getElementById( "calendar-deck" );
calendarDeckItem.setAttribute( "index", 0 );
}
/** PUBLIC
*
* Redraw the display, but not the events
*/
MonthView.prototype.refreshDisplay = function( ShowEvent )
{
// set the month/year in the header
var newMonth = this.calendarWindow.getSelectedDate().getMonth();
var newYear = this.calendarWindow.getSelectedDate().getFullYear();
var monthName = this.calendarWindow.dateFormater.getMonthName( newMonth );
monthTextItem = document.getElementById( "month-title-text" );
monthTextItem.setAttribute( "value" , monthName + " " + newYear );
// Write in all the day numbers and create the dayBoxItemByDateArray, see notes above
// figure out first and last days of the month
var firstDate = new Date( newYear, newMonth, 1 );
var firstDayOfWeek = firstDate.getDay();
var lastDayOfMonth = DateUtils.getLastDayOfMonth( newYear, newMonth );
// prepare the dayBoxItemByDateArray, we will be filling this in
this.dayBoxItemByDateArray = new Array();
// loop through all the day boxes
var dayNumber = 1;
for( var dayIndex = 0; dayIndex < this.dayNumberItemArray.length; ++dayIndex )
{
var dayNumberItem = this.dayNumberItemArray[ dayIndex ];
var dayBoxItem = this.dayBoxItemArray[ dayIndex ];
if( dayIndex < firstDayOfWeek || dayNumber > lastDayOfMonth )
{
// this day box is NOT in the month,
dayNumberItem.setAttribute( "value" , "" );
dayBoxItem.setAttribute( "empty" , "true" );
dayBoxItem.dayNumber = null;
}
else
{
dayNumberItem.setAttribute( "value" , dayNumber );
dayBoxItem.setAttribute( "empty" , "false" );
dayBoxItem.dayNumber = dayNumber;
this.dayBoxItemByDateArray[ dayNumber ] = dayBoxItem;
++dayNumber;
}
}
// if we aren't showing an event, highlite the selected date.
if ( !ShowEvent )
{
//debug("\n\n-->>>>Im' going to be highlightin the date from refresh display!!!");
this.hiliteSelectedDate( );
}
//always highlight today's date.
this.hiliteTodaysDate( );
}
/** PRIVATE
*
* Mark the selected date, also unmark the old selection if there was one
*/
MonthView.prototype.hiliteSelectedDate = function( )
{
// Clear the old selection if there was one
if( this.selectedBox )
{
this.selectedBox.setAttribute( "selected" , "false" );
this.selectedBox = null;
}
// Set the background for selection
this.selectedBox = this.dayBoxItemByDateArray[ this.calendarWindow.getSelectedDate().getDate() ];
this.selectedBox.setAttribute( "selected" , "true" );
}
/** PUBLIC
*
* Unmark the selected date if there is one.
*/
MonthView.prototype.clearSelectedDate = function( )
{
if ( this.selectedBox )
{
this.selectedBox.setAttribute( "selected", "false" );
this.selectedBox = null;
}
}
/** PRIVATE
*
* Mark today as selected, also unmark the old today if there was one.
*/
MonthView.prototype.hiliteTodaysDate = function( )
{
var Month = this.calendarWindow.getSelectedDate().getMonth();
var Year = this.calendarWindow.getSelectedDate().getFullYear();
// Clear the old selection if there was one
if ( this.selectedTodayBox )
{
this.selectedTodayBox.setAttribute( "today", "false" );
this.selectedTodayBox = null;
}
//highlight today.
var Today = new Date( );
if ( Year == Today.getFullYear() && Month == Today.getMonth() )
{
this.selectedTodayBox = this.dayBoxItemByDateArray[ Today.getDate() ];
this.selectedTodayBox.setAttribute( "today", "true" );
}
else
this.selectedTodayBox = null;
}
/** PUBLIC
*
* Get the selected event and delete it.
*/
MonthView.prototype.deletedSelectedEvent = function( )
{
if( this.selectedEventBoxes.length > 0 )
{
for ( i = 0; i < this.selectedEventBoxes.length; i++ )
{
var calendarEvent = this.selectedEventBoxes[i].calendarEvent;
// tell the event source to delete it, the observers will be called
// back into to update the display
}
this.calendarWindow.eventSource.deleteEvent( calendarEvent );
}
}
/** PUBLIC
*
* This is called when we are about the make a new event
* and we want to know what the default start date should be for the event.
*/
MonthView.prototype.getNewEventDate = function( )
{
// use the selected year, month and day
// and the current hours and minutes
var now = new Date();
var start = new Date( this.calendarWindow.getSelectedDate() );
start.setHours( now.getHours() );
start.setMinutes( Math.ceil( now.getMinutes() / 5 ) * 5 );
start.setSeconds( 0 );
return start;
}
/** PUBLIC
*
* Go to the next month.
*/
MonthView.prototype.goToNext = function()
{
var nextMonth = new Date( this.calendarWindow.selectedDate.getFullYear(), this.calendarWindow.selectedDate.getMonth() + 1, 1 );
this.adjustNewMonth( nextMonth );
// move to new date
this.goToDay( nextMonth );
}
/** PUBLIC
*
* Go to the previous month.
*/
MonthView.prototype.goToPrevious = function()
{
var prevMonth = new Date( this.calendarWindow.selectedDate.getFullYear(), this.calendarWindow.selectedDate.getMonth() - 1, 1 );
this.adjustNewMonth( prevMonth );
this.goToDay( prevMonth );
}
/** PRIVATE
*
* Helper function for goToNext and goToPrevious
*
* When the user changes to a new month the new month may not have the selected day in it.
* ( i.e. 31 was selected and the new month has only 30 days ).
* In that case our addition, or subtraction, in goToNext or goToPrevious will cause the
* date to jump a month. ( Say the date starts at May 31, we add 1 to the month, Now the
* date would be June 31, but the Date object knows there is no June 31, so it sets itself
* to July 1. )
*
* In goToNext or goToPrevious we set the date to be 1, so the month will be correct. Here
* we set the date to be the selected date, making adjustments if the selected date is not in the month.
*/
MonthView.prototype.adjustNewMonth = function( newMonth )
{
// Don't let a date beyond the end of the month make us jump
// too many or too few months
var lastDayOfMonth = DateUtils.getLastDayOfMonth( newMonth.getFullYear(), newMonth.getMonth() );
if( this.calendarWindow.selectedDate.getDate() > lastDayOfMonth )
{
// The selected date is NOT in the month
// set it to the last day of the month and turn on showingLastDay, see notes in MonthView class
newMonth.setDate( lastDayOfMonth )
this.showingLastDay = true;
}
else if( this.showingLastDay )
{
// showingLastDay is on so select the last day of the month, see notes in MonthView class
newMonth.setDate( lastDayOfMonth )
}
else
{
// date is NOT beyond the last.
newMonth.setDate( this.calendarWindow.selectedDate.getDate() )
}
}
/** PUBLIC -- monthview only
*
* Called when a day box item is single clicked
*/
MonthView.prototype.clickDay = function( dayBoxItem )
{
if( dayBoxItem.dayNumber != null )
{
// turn off showingLastDay - see notes in MonthView class
this.showingLastDay = false;
// change the selected date and redraw it
this.calendarWindow.selectedDate.setDate( dayBoxItem.dayNumber );
this.hiliteSelectedDate( );
this.clearSelectedEvent( );
}
}
MonthView.prototype.doubleClickDay = function( dayBoxItem )
{
if ( dayBoxItem.dayNumber != null )
{
// change the selected date and redraw it
gCalendarWindow.selectedDate.setDate( dayBoxItem.dayNumber );
this.hiliteSelectedDate( );
this.clearSelectedEvent( );
var startDate = this.getNewEventDate();
newEvent( startDate, false );
}
}
/** PUBLIC -- monthview only
*
* Called when an event box item is single clicked
*/
MonthView.prototype.clickEventBox = function( eventBox, event )
{
//deselect the selected day in the month view
this.clearSelectedDate( );
//set the selected date to the start date of this event.
if( eventBox)
{
this.calendarWindow.selectedDate.setDate( eventBox.calendarEvent.start.getDate() );
// clear the old selected box
this.clearSelectedEvent( );
// select the event
this.calendarWindow.setSelectedEvent( eventBox.calendarEvent );
// mark new box as selected
var ArrayOfBoxes = document.getElementsByAttribute( "name", "month-view-event-box-"+eventBox.calendarEvent.id );
for ( i = 0; i < ArrayOfBoxes.length; i++ )
{
ArrayOfBoxes[i].setAttribute( "selected", "true" );
this.selectedEventBoxes[ this.selectedEventBoxes.length ] = ArrayOfBoxes[i];
}
// Do not let the click go through, suppress default selection
if ( event )
{
event.stopPropagation();
}
//select the event in the unifinder
selectEventInUnifinder( eventBox.calendarEvent );
}
}
MonthView.prototype.selectEvent = function( calendarEvent )
{
//clear the selected event
gCalendarWindow.clearSelectedEvent( );
gCalendarWindow.setSelectedEvent( calendarEvent );
var EventBoxes = document.getElementsByAttribute( "name", "week-view-event-box-"+calendarEvent.id );
for ( i = 0; i < EventBoxes.length; i++ )
{
EventBoxes[i].setAttribute( "selected", "true" );
this.selectedEventBoxes[ this.selectedEventBoxes.length ] = EventBoxes[i];
}
selectEventInUnifinder( calendarEvent );
}
MonthView.prototype.clearSelectedEvent = function ( )
{
Event = gCalendarWindow.getSelectedEvent();
//if ( Event && document.getElementById( "month-view-event-box-"+Event.id ) )
if ( Event && document.getElementsByAttribute( "name", "month-view-event-box-"+Event.id ).length > 0 )
{
ArrayOfElements = document.getElementsByAttribute( "id", "month-view-event-box-"+Event.id );
for ( i = 0; i < ArrayOfElements.length; i++ )
{
ArrayOfElements[i].setAttribute( "selected", false );
}
}
this.selectedEventBoxes = Array();
//clear the selection in the unifinder
deselectEventInUnifinder( );
}
MonthView.prototype.getVisibleEvent = function( calendarEvent )
{
eventBox = document.getElementById( "month-view-event-box-"+calendarEvent.id );
if ( eventBox )
{
return eventBox;
}
else
return null;
}

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

@ -0,0 +1,369 @@
<?xml version="1.0"?>
<!--
- 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 OEone Corporation are Copyright (C) 2001
- OEone Corporation. All Rights Reserved.
-
- Contributor(s): Garth Smedley (garths@oeone.com), Mike Potter (mikep@oeone.com)
-
- Alternatively, the contents of this file may be used under the terms of
- either the GNU General Public License Version 2 or later (the "GPL"), or
- the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- in which case the provisions of the GPL or the LGPL are applicable instead
- of those above. If you wish to allow use of your version of this file only
- under the terms of either the GPL or the LGPL, and not to allow others to
- use your version of this file under the terms of the MPL, indicate your
- decision by deleting the provisions above and replace them with the notice
- and other provisions required by the 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.
-
- -->
<!-- Style sheets -->
<?xml-stylesheet href="chrome://global/skin/global.css" type="text/css"?>
<?xml-stylesheet href="chrome://calendar/skin/calendar.css" ?>
<!-- DTDs -->
<!-- DTD File with all strings specific to the calendar -->
<!DOCTYPE window
[
<!ENTITY % dtd1 SYSTEM "chrome://penglobal/locale/global.dtd" > %dtd1;
<!ENTITY % dtd2 SYSTEM "chrome://calendar/locale/calendar.dtd" > %dtd2;
]>
<!-- The Window -->
<overlay
xmlns:html="http://www.w3.org/1999/xhtml"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
>
<script type="application/x-javascript" src="chrome://calendar/content/calendarMonthView.js"/>
<vbox id="month-view-box" flex="1">
<!-- Month View: Controls-->
<hbox id="month-controls-box">
<image flex="1" id="month-previous-button" onclick="gCalendarWindow.goToPrevious()"/>
<label id="month-title-text" value="" />
<box flex="1" id="month-next-button-box">
<image id="month-next-button" onclick="gCalendarWindow.goToNext()"/>
</box>
</hbox>
<vbox id="month-content-box">
<!-- Month View: Day name header -->
<hbox id="month-header-box" flex="1" >
<image class="month-header-image-class" id="month-header-day-1" />
<image class="month-header-image-class" id="month-header-day-2" />
<image class="month-header-image-class" id="month-header-day-3" />
<image class="month-header-image-class" id="month-header-day-4" />
<image class="month-header-image-class" id="month-header-day-5" />
<image class="month-header-image-class" id="month-header-day-6" />
<image class="month-header-image-class" id="month-header-day-7" />
</hbox>
<!-- Month View: Calendar Grid -->
<box id="month-grid-box" flex="1">
<grid id="month-grid" flex="1">
<columns>
<column class="month-column-class" flex="1"/>
<column class="month-column-class" flex="1"/>
<column class="month-column-class" flex="1"/>
<column class="month-column-class" flex="1"/>
<column class="month-column-class" flex="1"/>
<column class="month-column-class" flex="1"/>
<column class="month-column-class" flex="1"/>
</columns>
<rows >
<row flex="1" >
<vbox class="month-day-box-class weekend" flex="1" id="month-week-1-day-1-box" weekend="true">
<hbox>
<label class="month-day-number-class" id="month-week-1-day-1" value="" />
</hbox>
</vbox>
<vbox class="month-day-box-class" flex="1" id="month-week-1-day-2-box" >
<hbox>
<label class="month-day-number-class" id="month-week-1-day-2" value="" />
</hbox>
</vbox>
<vbox class="month-day-box-class" flex="1" id="month-week-1-day-3-box" >
<hbox>
<label class="month-day-number-class" id="month-week-1-day-3" value="" />
</hbox>
</vbox>
<vbox class="month-day-box-class" flex="1" id="month-week-1-day-4-box" >
<hbox>
<label class="month-day-number-class" id="month-week-1-day-4" value="" />
</hbox>
</vbox>
<vbox class="month-day-box-class" flex="1" id="month-week-1-day-5-box" >
<hbox>
<label class="month-day-number-class" id="month-week-1-day-5" value="" />
</hbox>
</vbox>
<vbox class="month-day-box-class" flex="1" id="month-week-1-day-6-box" >
<hbox>
<label class="month-day-number-class" id="month-week-1-day-6" value="" />
</hbox>
</vbox>
<vbox class="month-day-box-class weekend saturday" flex="1" id="month-week-1-day-7-box" weekend="true" >
<hbox>
<label class="month-day-number-class" id="month-week-1-day-7" value="" />
</hbox>
</vbox>
</row>
<row flex="1" >
<vbox class="month-day-box-class weekend" flex="1" id="month-week-2-day-1-box" weekend="true">
<hbox>
<label class="month-day-number-class" id="month-week-2-day-1" value="" />
</hbox>
</vbox>
<vbox class="month-day-box-class" flex="1" id="month-week-2-day-2-box" >
<hbox>
<label class="month-day-number-class" id="month-week-2-day-2" value="" />
</hbox>
</vbox>
<vbox class="month-day-box-class" flex="1" id="month-week-2-day-3-box" >
<hbox>
<label class="month-day-number-class" id="month-week-2-day-3" value="" />
</hbox>
</vbox>
<vbox class="month-day-box-class" flex="1" id="month-week-2-day-4-box" >
<hbox>
<label class="month-day-number-class" id="month-week-2-day-4" value="" />
</hbox>
</vbox>
<vbox class="month-day-box-class" flex="1" id="month-week-2-day-5-box" >
<hbox>
<label class="month-day-number-class" id="month-week-2-day-5" value="" />
</hbox>
</vbox>
<vbox class="month-day-box-class" flex="1" id="month-week-2-day-6-box" >
<hbox>
<label class="month-day-number-class" id="month-week-2-day-6" value="" />
</hbox>
</vbox>
<vbox class="month-day-box-class weekend saturday" flex="1" id="month-week-2-day-7-box" weekend="true" >
<hbox>
<label class="month-day-number-class" id="month-week-2-day-7" value="" />
</hbox>
</vbox>
</row>
<row flex="1" >
<vbox class="month-day-box-class weekend" flex="1" id="month-week-3-day-1-box" weekend="true" >
<hbox>
<label class="month-day-number-class" id="month-week-3-day-1" value="" />
</hbox>
</vbox>
<vbox class="month-day-box-class" flex="1" id="month-week-3-day-2-box" >
<hbox>
<label class="month-day-number-class" id="month-week-3-day-2" value="" />
</hbox>
</vbox>
<vbox class="month-day-box-class" flex="1" id="month-week-3-day-3-box" >
<hbox>
<label class="month-day-number-class" id="month-week-3-day-3" value="" />
</hbox>
</vbox>
<vbox class="month-day-box-class" flex="1" id="month-week-3-day-4-box" >
<hbox>
<label class="month-day-number-class" id="month-week-3-day-4" value="" />
</hbox>
</vbox>
<vbox class="month-day-box-class" flex="1" id="month-week-3-day-5-box" >
<hbox>
<label class="month-day-number-class" id="month-week-3-day-5" value="" />
</hbox>
</vbox>
<vbox class="month-day-box-class" flex="1" id="month-week-3-day-6-box" >
<hbox>
<label class="month-day-number-class" id="month-week-3-day-6" value="" />
</hbox>
</vbox>
<vbox class="month-day-box-class weekend saturday" flex="1" id="month-week-3-day-7-box" weekend="true" >
<hbox>
<label class="month-day-number-class" id="month-week-3-day-7" value="" />
</hbox>
</vbox>
</row>
<row flex="1" >
<vbox class="month-day-box-class weekend" flex="1" id="month-week-4-day-1-box" weekend="true" >
<hbox>
<label class="month-day-number-class" id="month-week-4-day-1" value="" />
</hbox>
</vbox>
<vbox class="month-day-box-class" flex="1" id="month-week-4-day-2-box">
<hbox>
<label class="month-day-number-class" id="month-week-4-day-2" value="" />
</hbox>
</vbox>
<vbox class="month-day-box-class" flex="1" id="month-week-4-day-3-box" >
<hbox>
<label class="month-day-number-class" id="month-week-4-day-3" value="" />
</hbox>
</vbox>
<vbox class="month-day-box-class" flex="1" id="month-week-4-day-4-box">
<hbox>
<label class="month-day-number-class" id="month-week-4-day-4" value="" />
</hbox>
</vbox>
<vbox class="month-day-box-class" flex="1" id="month-week-4-day-5-box" >
<hbox>
<label class="month-day-number-class" id="month-week-4-day-5" value="" />
</hbox>
</vbox>
<vbox class="month-day-box-class" flex="1" id="month-week-4-day-6-box" >
<hbox>
<label class="month-day-number-class" id="month-week-4-day-6" value="" />
</hbox>
</vbox>
<vbox class="month-day-box-class weekend saturday" flex="1" id="month-week-4-day-7-box" weekend="true" >
<hbox>
<label class="month-day-number-class" id="month-week-4-day-7" value="" />
</hbox>
</vbox>
</row>
<row flex="1" >
<vbox class="month-day-box-class weekend" flex="1" id="month-week-5-day-1-box" weekend="true" >
<hbox>
<label class="month-day-number-class" id="month-week-5-day-1" value="" />
</hbox>
</vbox>
<vbox class="month-day-box-class" flex="1" id="month-week-5-day-2-box" >
<hbox>
<label class="month-day-number-class" id="month-week-5-day-2" value="" />
</hbox>
</vbox>
<vbox class="month-day-box-class" flex="1" id="month-week-5-day-3-box" >
<hbox>
<label class="month-day-number-class" id="month-week-5-day-3" value="" />
</hbox>
</vbox>
<vbox class="month-day-box-class" flex="1" id="month-week-5-day-4-box" >
<hbox>
<label class="month-day-number-class" id="month-week-5-day-4" value="" />
</hbox>
</vbox>
<vbox class="month-day-box-class" flex="1" id="month-week-5-day-5-box" >
<hbox>
<label class="month-day-number-class" id="month-week-5-day-5" value="" />
</hbox>
</vbox>
<vbox class="month-day-box-class" flex="1" id="month-week-5-day-6-box" >
<hbox>
<label class="month-day-number-class" id="month-week-5-day-6" value="" />
</hbox>
</vbox>
<vbox class="month-day-box-class weekend saturday" flex="1" id="month-week-5-day-7-box" weekend="true" >
<hbox>
<label class="month-day-number-class" id="month-week-5-day-7" value="" />
</hbox>
</vbox>
</row>
<row flex="1" >
<vbox class="month-day-box-class weekend" flex="1" id="month-week-6-day-1-box" weekend="true" >
<hbox>
<label class="month-day-number-class" id="month-week-6-day-1" value="" />
</hbox>
</vbox>
<vbox class="month-day-box-class" flex="1" id="month-week-6-day-2-box" >
<hbox>
<label class="month-day-number-class" id="month-week-6-day-2" value="" />
</hbox>
</vbox>
<vbox class="month-day-box-class" flex="1" id="month-week-6-day-3-box" >
<hbox>
<label class="month-day-number-class" id="month-week-6-day-3" value="" />
</hbox>
</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" value="" />
</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" value="" />
</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" value="" />
</vbox>
<vbox class="month-day-box-class weekend saturday" flex="1" id="month-week-6-day-7-box" weekend="true" >
<label class="month-day-number-class" id="month-week-6-day-7" value="" />
</vbox>
</row>
</rows>
</grid>
</box> <!-- End: Month grid box -->
</vbox> <!-- End: Month content box -->
</vbox>
</overlay>

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

@ -0,0 +1,74 @@
<?xml version="1.0"?>
<!--
- 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 OEone Corporation are Copyright (C) 2001
- OEone Corporation. All Rights Reserved.
-
- Contributor(s): 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.
-
- -->
<bindings id="penBindings"
xmlns="http://www.mozilla.org/xbl"
xmlns:html="http://www.w3.org/1999/xhtml"
xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<binding id="buttontop" extends="chrome://global/content/bindings/button.xml#button-base">
<content>
<xul:box class="button-internal-box" orient="vertical" flex="1">
<xul:image class="button-icon" inherits="src"/>
<xul:box orient="vertical" class="button-text-container" flex="1">
<xul:text class="button-text" inherits="value=label,accesskey,crop,dragover-top"/>
</xul:box>
</xul:box>
</content>
</binding>
<binding id="penButton" extends="chrome://global/content/bindings/button.xml#button-base">
<content>
<xul:box class="button-internal-box" orient="vertical" flex="1" style="-moz-box-align:center;">
<xul:spring flex="1"/>
<xul:image class="button-icon" inherits="src"/>
<xul:spring flex="1"/>
</xul:box>
</content>
</binding>
<binding id="penButton-labelRight" extends="chrome://global/content/bindings/button.xml#button-base">
<content>
<xul:box class="button-internal-box" flex="1" style="-moz-box-align:center;">
<xul:image class="button-icon" inherits="src"/>
<xul:spring flex="1"/>
<xul:text class="button-text" inherits="value=label,accesskey,crop,dragover-top"/>
<xul:spring flex="1"/>
</xul:box>
</content>
</binding>
</bindings>

Разница между файлами не показана из-за своего большого размера Загрузить разницу

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

@ -0,0 +1,51 @@
<?xml version="1.0"?>
<!--
- 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 OEone Corporation are Copyright (C) 2001
- OEone Corporation. All Rights Reserved.
-
- Contributor(s): 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.
-
- -->
<RDF:RDF xmlns:RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:chrome="http://www.mozilla.org/rdf/chrome#">
<RDF:Seq about="urn:mozilla:package:root">
<RDF:li resource="urn:mozilla:package:penglobal"/>
</RDF:Seq>
<RDF:Description about="urn:mozilla:package:penglobal"
chrome:displayName="penglobal"
chrome:author="OEOne Corp."
chrome:name="penglobal">
</RDF:Description>
</RDF:RDF>

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

@ -0,0 +1,210 @@
/*
* 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 Corporation.
*
* The Initial Developer of the Original Code is
* OEone Corporation.
* Portions created by OEone Corporation are Copyright (C) 2001
* OEone Corporation. 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.
*
*
*/
var kDate_MillisecondsInSecond = 1000;
var kDate_SecondsInMinute = 60;
var kDate_MinutesInHour = 60;
var kDate_HoursInDay = 24;
var kDate_DaysInWeek = 7;
var kDate_SecondsInHour = 3600;
var kDate_SecondsInDay = 86400
var kDate_SecondsInWeek = 604800
var kDate_MinutesInDay = 1440;
var kDate_MinutesInWeek = 10080;
var kDate_MillisecondsInMinute = 60000;
var kDate_MillisecondsInHour = 3600000;
var kDate_MillisecondsInDay = 86400000;
var kDate_MillisecondsInWeek = 604800000;
// required includes: "chrome://global/content/strres.js" - String Bundle Code
function DateUtils()
{
}
DateUtils.getLastDayOfMonth = function( year, month )
{
var pastLastDate = new Date( year, month, 32 );
var lastDayOfMonth = 32 - pastLastDate.getDate();
return lastDayOfMonth;
}
function DateFormater()
{
// we get the date bundle in case the locale changes, can
// we be notified of a locale change instead, then we could
// get the bundle once.
this.dateStringBundle = srGetStrBundle("chrome://penglobal/locale/dateFormat.properties");
}
DateFormater.prototype.getFormatedTime = function( date )
{
// Format the time using a hardcoded format for now, since everything
// that displays the time uses this function we will be able to
// make a user settable time format and use it here.
var hour = date.getHours();
var min = date.getMinutes();
// compute am and pm
if( hour < 12 )
{
var ampm = this.dateStringBundle.GetStringFromName( "am-string" );
}
else
{
var ampm = this.dateStringBundle.GetStringFromName( "pm-string" );
}
// convert to 12 hour clock
if( hour > 12 )
{
hour -= 12;
}
// make 0 be midnight
if( hour == 0 )
{
hour = 12;
}
// put two zeros in the minute
var minString = min.toString();
if( min < 10 )
{
minString = "0" + min;
}
// Make the time to display
var timeString = hour + ":" + minString + " " + ampm;
return timeString;
}
DateFormater.prototype.getFormatedDate = function( date )
{
// Format the date using a hardcoded format for now, since everything
// that displays the date uses this function we will be able to
// make a user settable date format and use it here.
var oneBasedMonthNum = date.getMonth() + 1;
var monthString = this.dateStringBundle.GetStringFromName("month." + oneBasedMonthNum + ".Mmm" );
var dateString = monthString + " " + date.getDate();
return dateString;
}
// 0-11 Month Index
DateFormater.prototype.getMonthName = function( monthIndex )
{
var oneBasedMonthNum = monthIndex + 1;
var monthName = this.dateStringBundle.GetStringFromName("month." + oneBasedMonthNum + ".name" );
return monthName;
}
// 0-11 Month Index
DateFormater.prototype.getShortMonthName = function( monthIndex )
{
var oneBasedMonthNum = monthIndex + 1;
var monthName = this.dateStringBundle.GetStringFromName("month." + oneBasedMonthNum + ".Mmm" );
return monthName;
}
// 0-6 Day index ( starts at Sun )
DateFormater.prototype.getDayName = function( dayIndex )
{
var oneBasedDayNum = dayIndex + 1;
var dayName = this.dateStringBundle.GetStringFromName("day." + oneBasedDayNum + ".name" );
return dayName;
}
// 0-6 Day index ( starts at Sun )
DateFormater.prototype.getShortDayName = function( dayIndex )
{
var oneBasedDayNum = dayIndex + 1;
var dayName = this.dateStringBundle.GetStringFromName("day." + oneBasedDayNum + ".Mmm" );
return dayName;
}

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

@ -0,0 +1,341 @@
<?xml version="1.0"?>
<!--
- 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 OEone Corporation are Copyright (C) 2001
- OEone Corporation. 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.
-
- -->
<!-- CSS Files -->
<?xml-stylesheet href="chrome://global/skin/global.css" type="text/css"?>
<?xml-stylesheet href="chrome://penglobal/skin/datepicker/datepicker.css" ?>
<!-- DTD Files -->
<!DOCTYPE window
[
<!ENTITY % dtd1 SYSTEM "chrome://penglobal/locale/global.dtd" > %dtd1;
<!ENTITY % dtd2 SYSTEM "chrome://calendar/locale/calendar.dtd" > %dtd2;
]>
<!-- Overlay -->
<overlay
id="oe-date-picker-overlay"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<!-- Javascript includes -->
<script type="application/x-javascript" src="chrome://global/content/strres.js"/>
<script type="application/x-javascript" src="chrome://penglobal/content/dateUtils.js"/>
<script type="application/x-javascript" src="chrome://penglobal/content/datepicker.js"/>
<!-- Popup that holds the picker -->
<popup onpopupshowing="oeDatePicker.onpopupshowing(this)" id="oe-date-picker-popup" >
<vbox id="oe-date-picker-overlay-box" flex="1"/>
</popup>
<!-- Box with insides of the picker -->
<vbox id="oe-date-picker-overlay-box" >
<!-- Year controls -->
<hbox id="oe-date-picker-year-controls-box" >
<image flex="1" id="oe-date-picker-year-previous-button" onclick="oeDatePicker.previousYearCommand()"/>
<text id="oe-date-picker-year-title-text" value="" />
<box flex="1" id="oe-date-picker-year-next-button-box" >
<image id="oe-date-picker-year-next-button" onclick="oeDatePicker.nextYearCommand()"/>
</box>
</hbox>
<!-- Year Grid -->
<grid id="oe-date-picker-year-grid" flex="1">
<columns>
<column class="oe-date-picker-year-column-class" flex="1"/>
<column class="oe-date-picker-year-column-class" flex="1"/>
<column class="oe-date-picker-year-column-class" flex="1"/>
<column class="oe-date-picker-year-column-class" flex="1"/>
</columns>
<rows >
<row flex="1" >
<vbox class="oe-date-picker-year-month-box-class" id="oe-date-picker-year-month-1-box" onclick="oeDatePicker.clickMonth(this, 1)" >
<spring flex="1" />
<box ><text class="oe-date-picker-year-month-name-class" value="&month.1.MMM;" /></box>
<spring flex="1" />
</vbox>
<vbox class="oe-date-picker-year-month-box-class" id="oe-date-picker-year-month-2-box" onclick="oeDatePicker.clickMonth(this, 2)" >
<spring flex="1" />
<box><text class="oe-date-picker-year-month-name-class" value="&month.2.MMM;" /></box>
<spring flex="1" />
</vbox>
<vbox class="oe-date-picker-year-month-box-class" id="oe-date-picker-year-month-3-box" onclick="oeDatePicker.clickMonth(this, 3)" >
<spring flex="1" />
<box><text class="oe-date-picker-year-month-name-class" value="&month.3.MMM;" /></box>
<spring flex="1" />
</vbox>
<vbox class="oe-date-picker-year-month-box-class" id="oe-date-picker-year-month-4-box" onclick="oeDatePicker.clickMonth(this, 4)" >
<spring flex="1" />
<box><text class="oe-date-picker-year-month-name-class" value="&month.4.MMM;" /></box>
<spring flex="1" />
</vbox>
</row>
<row flex="1" >
<vbox class="oe-date-picker-year-month-box-class" id="oe-date-picker-year-month-5-box" onclick="oeDatePicker.clickMonth(this, 5)" >
<spring flex="1" />
<box><text class="oe-date-picker-year-month-name-class" value="&month.5.MMM;" /></box>
<spring flex="1" />
</vbox>
<vbox class="oe-date-picker-year-month-box-class" id="oe-date-picker-year-month-6-box" onclick="oeDatePicker.clickMonth(this, 6)" >
<spring flex="1" />
<box><text class="oe-date-picker-year-month-name-class" value="&month.6.MMM;" /></box>
<spring flex="1" />
</vbox>
<vbox class="oe-date-picker-year-month-box-class" id="oe-date-picker-year-month-7-box" onclick="oeDatePicker.clickMonth(this, 7)" >
<spring flex="1" />
<box><text class="oe-date-picker-year-month-name-class" value="&month.7.MMM;" /></box>
<spring flex="1" />
</vbox>
<vbox class="oe-date-picker-year-month-box-class" id="oe-date-picker-year-month-8-box" onclick="oeDatePicker.clickMonth(this, 8)" >
<spring flex="1" />
<box><text class="oe-date-picker-year-month-name-class" value="&month.8.MMM;" /></box>
<spring flex="1" />
</vbox>
</row>
<row flex="1" >
<vbox class="oe-date-picker-year-month-box-class" id="oe-date-picker-year-month-9-box" onclick="oeDatePicker.clickMonth(this, 9)" >
<spring flex="1" />
<box><text class="oe-date-picker-year-month-name-class" value="&month.9.MMM;" /></box>
<spring flex="1" />
</vbox>
<vbox class="oe-date-picker-year-month-box-class" id="oe-date-picker-year-month-10-box" onclick="oeDatePicker.clickMonth(this, 10)" >
<spring flex="1" />
<box><text class="oe-date-picker-year-month-name-class" value="&month.10.MMM;" /></box>
<spring flex="1" />
</vbox>
<vbox class="oe-date-picker-year-month-box-class" id="oe-date-picker-year-month-11-box" onclick="oeDatePicker.clickMonth(this, 11)" >
<spring flex="1" />
<box><text class="oe-date-picker-year-month-name-class" value="&month.11.MMM;" /></box>
<spring flex="1" />
</vbox>
<vbox class="oe-date-picker-year-month-box-class" id="oe-date-picker-year-month-12-box" onclick="oeDatePicker.clickMonth(this, 12)" >
<spring flex="1" />
<box><text class="oe-date-picker-year-month-name-class" value="&month.12.MMM;" /></box>
<spring flex="1" />
</vbox>
</row>
</rows>
</grid> <!-- Year Grid -->
<!-- Month Grid -->
<box id="oe-date-picker-month-grid-box" flex="1">
<grid id="oe-date-picker-month-grid" flex="1">
<columns>
<column class="oe-date-picker-month-column-class" flex="1"/>
<column class="oe-date-picker-month-column-class" flex="1"/>
<column class="oe-date-picker-month-column-class" flex="1"/>
<column class="oe-date-picker-month-column-class" flex="1"/>
<column class="oe-date-picker-month-column-class" flex="1"/>
<column class="oe-date-picker-month-column-class" flex="1"/>
<column class="oe-date-picker-month-column-class" flex="1"/>
</columns>
<rows >
<row flex="1" >
<vbox class="oe-date-picker-month-day-box-class" id="oe-date-picker-month-day-1-box" onclick="oeDatePicker.clickDay(1)">
<box><text class="oe-date-picker-month-day-number-class" id="oe-date-picker-month-day-text-1" value="" /></box>
</vbox>
<vbox class="oe-date-picker-month-day-box-class" id="oe-date-picker-month-day-2-box" onclick="oeDatePicker.clickDay(2)">
<box><text class="oe-date-picker-month-day-number-class" id="oe-date-picker-month-day-text-2" value="" /></box>
</vbox>
<vbox class="oe-date-picker-month-day-box-class" id="oe-date-picker-month-day-3-box" onclick="oeDatePicker.clickDay(3)">
<box><text class="oe-date-picker-month-day-number-class" id="oe-date-picker-month-day-text-3" value="" /></box>
</vbox>
<vbox class="oe-date-picker-month-day-box-class" id="oe-date-picker-month-day-4-box" onclick="oeDatePicker.clickDay(4)">
<box><text class="oe-date-picker-month-day-number-class" id="oe-date-picker-month-day-text-4" value="" /></box>
</vbox>
<vbox class="oe-date-picker-month-day-box-class" id="oe-date-picker-month-day-5-box" onclick="oeDatePicker.clickDay(5)">
<box><text class="oe-date-picker-month-day-number-class" id="oe-date-picker-month-day-text-5" value="" /></box>
</vbox>
<vbox class="oe-date-picker-month-day-box-class" id="oe-date-picker-month-day-6-box" onclick="oeDatePicker.clickDay(6)">
<box><text class="oe-date-picker-month-day-number-class" id="oe-date-picker-month-day-text-6" value="" /></box>
</vbox>
<vbox class="oe-date-picker-month-day-box-class" id="oe-date-picker-month-day-7-box" onclick="oeDatePicker.clickDay(7)">
<box><text class="oe-date-picker-month-day-number-class" id="oe-date-picker-month-day-text-7" value="" /></box>
</vbox>
</row>
<row flex="1" >
<vbox class="oe-date-picker-month-day-box-class" id="oe-date-picker-month-day-8-box" onclick="oeDatePicker.clickDay(8)">
<box><text class="oe-date-picker-month-day-number-class" id="oe-date-picker-month-day-text-8" value="" /></box>
</vbox>
<vbox class="oe-date-picker-month-day-box-class" id="oe-date-picker-month-day-9-box" onclick="oeDatePicker.clickDay(9)">
<box><text class="oe-date-picker-month-day-number-class" id="oe-date-picker-month-day-text-9" value="" /></box>
</vbox>
<vbox class="oe-date-picker-month-day-box-class" id="oe-date-picker-month-day-10-box" onclick="oeDatePicker.clickDay(10)">
<box><text class="oe-date-picker-month-day-number-class" id="oe-date-picker-month-day-text-10" value="" /></box>
</vbox>
<vbox class="oe-date-picker-month-day-box-class" id="oe-date-picker-month-day-11-box" onclick="oeDatePicker.clickDay(11)">
<box><text class="oe-date-picker-month-day-number-class" id="oe-date-picker-month-day-text-11" value="" /></box>
</vbox>
<vbox class="oe-date-picker-month-day-box-class" id="oe-date-picker-month-day-12-box" onclick="oeDatePicker.clickDay(12)">
<box><text class="oe-date-picker-month-day-number-class" id="oe-date-picker-month-day-text-12" value="" /></box>
</vbox>
<vbox class="oe-date-picker-month-day-box-class" id="oe-date-picker-month-day-13-box" onclick="oeDatePicker.clickDay(13)">
<box><text class="oe-date-picker-month-day-number-class" id="oe-date-picker-month-day-text-13" value="" /></box>
</vbox>
<vbox class="oe-date-picker-month-day-box-class" id="oe-date-picker-month-day-14-box" onclick="oeDatePicker.clickDay(14)">
<box><text class="oe-date-picker-month-day-number-class" id="oe-date-picker-month-day-text-14" value="" /></box>
</vbox>
</row>
<row flex="1" >
<vbox class="oe-date-picker-month-day-box-class" id="oe-date-picker-month-day-15-box" onclick="oeDatePicker.clickDay(15)">
<box><text class="oe-date-picker-month-day-number-class" id="oe-date-picker-month-day-text-15" value="" /></box>
</vbox>
<vbox class="oe-date-picker-month-day-box-class" id="oe-date-picker-month-day-16-box" onclick="oeDatePicker.clickDay(16)">
<box><text class="oe-date-picker-month-day-number-class" id="oe-date-picker-month-day-text-16" value="" /></box>
</vbox>
<vbox class="oe-date-picker-month-day-box-class" id="oe-date-picker-month-day-17-box" onclick="oeDatePicker.clickDay(17)">
<box><text class="oe-date-picker-month-day-number-class" id="oe-date-picker-month-day-text-17" value="" /></box>
</vbox>
<vbox class="oe-date-picker-month-day-box-class" id="oe-date-picker-month-day-18-box" onclick="oeDatePicker.clickDay(18)">
<box><text class="oe-date-picker-month-day-number-class" id="oe-date-picker-month-day-text-18" value="" /></box>
</vbox>
<vbox class="oe-date-picker-month-day-box-class" id="oe-date-picker-month-day-19-box" onclick="oeDatePicker.clickDay(19)">
<box><text class="oe-date-picker-month-day-number-class" id="oe-date-picker-month-day-text-19" value="" /></box>
</vbox>
<vbox class="oe-date-picker-month-day-box-class" id="oe-date-picker-month-day-20-box" onclick="oeDatePicker.clickDay(20)">
<box><text class="oe-date-picker-month-day-number-class" id="oe-date-picker-month-day-text-20" value="" /></box>
</vbox>
<vbox class="oe-date-picker-month-day-box-class" id="oe-date-picker-month-day-21-box" onclick="oeDatePicker.clickDay(21)">
<box><text class="oe-date-picker-month-day-number-class" id="oe-date-picker-month-day-text-21" value="" /></box>
</vbox>
</row>
<row flex="1" >
<vbox class="oe-date-picker-month-day-box-class" id="oe-date-picker-month-day-22-box" onclick="oeDatePicker.clickDay(22)">
<box><text class="oe-date-picker-month-day-number-class" id="oe-date-picker-month-day-text-22" value="" /></box>
</vbox>
<vbox class="oe-date-picker-month-day-box-class" id="oe-date-picker-month-day-23-box" onclick="oeDatePicker.clickDay(23)">
<box><text class="oe-date-picker-month-day-number-class" id="oe-date-picker-month-day-text-23" value="" /></box>
</vbox>
<vbox class="oe-date-picker-month-day-box-class" id="oe-date-picker-month-day-24-box" onclick="oeDatePicker.clickDay(24)">
<box><text class="oe-date-picker-month-day-number-class" id="oe-date-picker-month-day-text-24" value="" /></box>
</vbox>
<vbox class="oe-date-picker-month-day-box-class" id="oe-date-picker-month-day-25-box" onclick="oeDatePicker.clickDay(25)">
<box><text class="oe-date-picker-month-day-number-class" id="oe-date-picker-month-day-text-25" value="" /></box>
</vbox>
<vbox class="oe-date-picker-month-day-box-class" id="oe-date-picker-month-day-26-box" onclick="oeDatePicker.clickDay(26)">
<box><text class="oe-date-picker-month-day-number-class" id="oe-date-picker-month-day-text-26" value="" /></box>
</vbox>
<vbox class="oe-date-picker-month-day-box-class" id="oe-date-picker-month-day-27-box" onclick="oeDatePicker.clickDay(27)">
<box><text class="oe-date-picker-month-day-number-class" id="oe-date-picker-month-day-text-27" value="" /></box>
</vbox>
<vbox class="oe-date-picker-month-day-box-class" id="oe-date-picker-month-day-28-box" onclick="oeDatePicker.clickDay(28)">
<box><text class="oe-date-picker-month-day-number-class" id="oe-date-picker-month-day-text-28" value="" /></box>
</vbox>
</row>
<row flex="1" >
<vbox class="oe-date-picker-month-day-box-class" id="oe-date-picker-month-day-29-box" onclick="oeDatePicker.clickDay(29)">
<box><text class="oe-date-picker-month-day-number-class" id="oe-date-picker-month-day-text-29" value="" /></box>
</vbox>
<vbox class="oe-date-picker-month-day-box-class" id="oe-date-picker-month-day-30-box" onclick="oeDatePicker.clickDay(30)">
<box><text class="oe-date-picker-month-day-number-class" id="oe-date-picker-month-day-text-30" value="" /></box>
</vbox>
<vbox class="oe-date-picker-month-day-box-class" id="oe-date-picker-month-day-31-box" onclick="oeDatePicker.clickDay(31)">
<box><text class="oe-date-picker-month-day-number-class" id="oe-date-picker-month-day-text-31" value="" /></box>
</vbox>
<vbox class="oe-date-picker-month-day-box-class" id="oe-date-picker-month-day-32-box" onclick="oeDatePicker.clickDay(32)">
<box><text class="oe-date-picker-month-day-number-class" id="oe-date-picker-month-day-text-32" value="" /></box>
</vbox>
<vbox class="oe-date-picker-month-day-box-class" id="oe-date-picker-month-day-33-box" onclick="oeDatePicker.clickDay(33)">
<box><text class="oe-date-picker-month-day-number-class" id="oe-date-picker-month-day-text-33" value="" /></box>
</vbox>
<vbox class="oe-date-picker-month-day-box-class" id="oe-date-picker-month-day-34-box" onclick="oeDatePicker.clickDay(34)">
<box><text class="oe-date-picker-month-day-number-class" id="oe-date-picker-month-day-text-34" value="" /></box>
</vbox>
<vbox class="oe-date-picker-month-day-box-class" id="oe-date-picker-month-day-35-box" onclick="oeDatePicker.clickDay(35)">
<box><text class="oe-date-picker-month-day-number-class" id="oe-date-picker-month-day-text-35" value="" /></box>
</vbox>
</row>
<row flex="1" >
<vbox class="oe-date-picker-month-day-box-class" id="oe-date-picker-month-day-36-box" onclick="oeDatePicker.clickDay(36)">
<box><text class="oe-date-picker-month-day-number-class" id="oe-date-picker-month-day-text-36" value="" /></box>
</vbox>
<vbox class="oe-date-picker-month-day-box-class" id="oe-date-picker-month-day-37-box" onclick="oeDatePicker.clickDay(37)">
<box><text class="oe-date-picker-month-day-number-class" id="oe-date-picker-month-day-text-37" value="" /></box>
</vbox>
<vbox class="oe-date-picker-month-day-box-class" id="oe-date-picker-month-day-38-box" onclick="oeDatePicker.clickDay(38)">
<box><text class="oe-date-picker-month-day-number-class" id="oe-date-picker-month-day-text-38" value="" /></box>
</vbox>
<vbox class="oe-date-picker-month-day-box-class" id="oe-date-picker-month-day-39-box" onclick="oeDatePicker.clickDay(39)">
<box><text class="oe-date-picker-month-day-number-class" id="oe-date-picker-month-day-text-39" value="" /></box>
</vbox>
<vbox class="oe-date-picker-month-day-box-class" id="oe-date-picker-month-day-40-box" onclick="oeDatePicker.clickDay(40)">
<box><text class="oe-date-picker-month-day-number-class" id="oe-date-picker-month-day-text-40" value="" /></box>
</vbox>
<vbox class="oe-date-picker-month-day-box-class" id="oe-date-picker-month-day-41-box" onclick="oeDatePicker.clickDay(41)">
<box><text class="oe-date-picker-month-day-number-class" id="oe-date-picker-month-day-text-41" value="" /></box>
</vbox>
<vbox class="oe-date-picker-month-day-box-class" id="oe-date-picker-month-day-42-box" onclick="oeDatePicker.clickDay(42)">
<box><text class="oe-date-picker-month-day-number-class" id="oe-date-picker-month-day-text-42" value="" /></box>
</vbox>
</row>
</rows>
</grid> <!-- Month Grid -->
</box> <!-- Month Grid Box -->
</vbox> <!-- Box with insides of the picker -->
</overlay>

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

@ -0,0 +1,413 @@
/*
* 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 Corporation.
*
* The Initial Developer of the Original Code is
* OEone Corporation.
* Portions created by OEone Corporation are Copyright (C) 2001
* OEone Corporation. All Rights Reserved.
*
* Contributor(s): Garth Smedley (garths@oeone.com) , Mike Potter (mikep@oeone.com)
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
*
*/
/***** oe-datepicker
* AUTHOR
* Garth Smedley
*
* NOTES
* Date picker popup.
* Closes when a day is clicked, and passes the picked date into your oncommand function.
*
* To use the datepicker include the overlay in your XUL, this .js file is included from there
<?xul-overlay href="chrome://penglobal/content/datepicker-overlay.xul"?>
*
* Make a popupset in your XUL that includes the picker popup from the overlay
*
<popupset>
<popup id="oe-date-picker-popup" oncommand="yourCommandFunction( this )" >
</popup>
</popupset>
*
* Attach the date picker to an item using the popup attribute, an image for example:
*
<image class="four-state-image-button" popup="oe-date-picker-popup" onmousedown="yourPrepareDatePickerFunction()" />
*
* In your .js, initialize the picker with the inital date when the user clicks, set to now in this example:
*
function yourPrepareDatePickerFunction( )
{
var datePickerPopup = document.getElementById( "oe-date-picker-popup" );
datePickerPopup.setAttribute( "value", new Date() );
}
*
* In your .js, respond to the user picking a date, this function will not be called if they just click
* out of the picker
*
function yourCommandFunction( datepopup )
{
var newDate = datepopup.value;
// datepopup.value is a Date object with
// the year, month, day set to the user selection
}
* IMPLEMENTATION NOTES
*
* In order to prevent name space pollution, all of the date picker methods
* are static members of the oeDatePicker class.
*
**********
*/
/**
* Date picker class, has static members only.
*/
function oeDatePicker()
{
}
/**
* Static variables
*/
/** The popup window containing the picker */
oeDatePicker.gPopup = null;
/** The original starting date and currently selected date */
oeDatePicker.gOriginalDate = null;
oeDatePicker.gSelectedDate = null;
/* selected items */
oeDatePicker.gSelectedMonthItem = null;
oeDatePicker.gSelectedDayItem = null;
/**
* Set up the picker, called when the popup pops
*/
oeDatePicker.onpopupshowing = function( popup )
{
// remember the popup item so we can close it when we are done
oeDatePicker.gPopup = popup;
// get the start date from the popup value attribute and select it
var startDate = popup.getAttribute( "value" );
oeDatePicker.gOriginalDate = new Date( startDate );
oeDatePicker.gSelectedDate = new Date( startDate );
// Avoid problems when changing months if the date is at the end of the month
// i.e. if date is 31 march and you do a setmonth to april, the month would
// actually be set to may, beacause april only has 30 days.
// This is why we keep the original date around.
oeDatePicker.gSelectedDate.setDate( 1 );
// draw the year based on the selected date
oeDatePicker.redrawYear();
// draw the month based on the selected date
var month = oeDatePicker.gSelectedDate.getMonth() + 1;
var selectedMonthBoxItem = document.getElementById( "oe-date-picker-year-month-" + month + "-box" );
oeDatePicker.selectMonthItem( selectedMonthBoxItem );
// draw in the days for the selected date
oeDatePicker.redrawDays();
}
/**
* Called when a day is clicked, close the picker and call the client's oncommand
*/
oeDatePicker.clickDay = function( newDayItemNumber )
{
// get the clicked day
var dayNumberItem = document.getElementById( "oe-date-picker-month-day-text-" + newDayItemNumber );
var dayNumber = dayNumberItem.getAttribute( "value" );
// they may have clicked an unfilled day, if so ignore it and leave the picker up
if( dayNumber != "" )
{
// set the selected date to what they cliked on
oeDatePicker.gSelectedDate.setDate( dayNumber );
oeDatePicker.selectDate();
oeDatePicker.gPopup.closePopup();
}
}
oeDatePicker.selectDate = function()
{
// We copy the picked date to avoid problems with changing the Date object in place
var pickedDate = new Date( oeDatePicker.gSelectedDate );
// put the selected date in the popup item's value property
oeDatePicker.gPopup.value = pickedDate;
// get the client oncommand function, call it if there is one
var commandEventMethod = oeDatePicker.gPopup.getAttribute( "oncommand" );
if( commandEventMethod != null )
{
// set up a variable date, that will be avaialable from within the
// client method
var date = pickedDate;
// Make the function a member of the popup before calling it so that
// 'this' will be the popup
oeDatePicker.gPopup.oeDatePickerFunction = function() { eval( commandEventMethod ); };
oeDatePicker.gPopup.oeDatePickerFunction();
}
// close the popup
//oeDatePicker.gPopup.closePopup ();
}
/**
* Called when a month box is clicked
*/
oeDatePicker.clickMonth = function( newMonthItem, newMonthNumber )
{
// already selected, return
if( oeDatePicker.gSelectedMonthItem == newMonthItem )
{
return;
}
// update the selected date
oeDatePicker.gSelectedDate.setMonth( newMonthNumber - 1 );
// select Month
oeDatePicker.selectMonthItem( newMonthItem );
// redraw days
oeDatePicker.redrawDays();
oeDatePicker.selectDate();
}
/**
* Called when previous Year button is clicked
*/
oeDatePicker.previousYearCommand = function()
{
// update the selected date
var oldYear = oeDatePicker.gSelectedDate.getFullYear();
oeDatePicker.gSelectedDate.setFullYear( oldYear - 1 );
// redraw the year and the days
oeDatePicker.redrawYear();
oeDatePicker.redrawDays();
oeDatePicker.selectDate();
}
/**
* Called when next Year button is clicked
*/
oeDatePicker.nextYearCommand = function()
{
// update the selected date
var oldYear = oeDatePicker.gSelectedDate.getFullYear();
oeDatePicker.gSelectedDate.setFullYear( oldYear + 1 );
// redraw the year and the days
oeDatePicker.redrawYear();
oeDatePicker.redrawDays();
oeDatePicker.selectDate();
}
/**
* Draw the year based in the selected date
*/
oeDatePicker.redrawYear = function()
{
var yearTitleItem = document.getElementById( "oe-date-picker-year-title-text" );
yearTitleItem.setAttribute( "value", oeDatePicker.gSelectedDate.getFullYear() );
}
/**
* Select a month box
*/
oeDatePicker.selectMonthItem = function( newMonthItem )
{
// clear old selection, if there is one
if( oeDatePicker.gSelectedMonthItem != null )
{
oeDatePicker.gSelectedMonthItem.setAttribute( "selected" , false );
}
// Set the selected attribute, used to give it a different style
newMonthItem.setAttribute( "selected" , true );
// Remember new selection
oeDatePicker.gSelectedMonthItem = newMonthItem;
}
/**
* Select a day box
*/
oeDatePicker.selectDayItem = function( newDayItem )
{
// clear old selection, if there is one
if( oeDatePicker.gSelectedDayItem != null )
{
oeDatePicker.gSelectedDayItem.setAttribute( "selected" , false );
}
if( newDayItem != null )
{
// Set the selected attribute, used to give it a different style
newDayItem.setAttribute( "selected" , true );
}
// Remember new selection
oeDatePicker.gSelectedDayItem = newDayItem;
}
/**
* Redraw day numbers based on the selected date
*/
oeDatePicker.redrawDays = function( )
{
// Write in all the day numbers
var firstDate = new Date( oeDatePicker.gSelectedDate.getFullYear(), oeDatePicker.gSelectedDate.getMonth(), 1 );
var firstDayOfWeek = firstDate.getDay();
var lastDayOfMonth = DateUtils.getLastDayOfMonth( oeDatePicker.gSelectedDate.getFullYear(), oeDatePicker.gSelectedDate.getMonth() )
// clear the selected day item
oeDatePicker.selectDayItem( null );
// redraw each day bax in the 7 x 6 grid
var dayNumber = 1;
for( var dayIndex = 0; dayIndex < 42; ++dayIndex )
{
// get the day text box
var dayNumberItem = document.getElementById( "oe-date-picker-month-day-text-" + (dayIndex + 1) );
// if it is an unfilled day ( before first or after last ), just set its value to "",
// and don't increment the day number.
if( dayIndex < firstDayOfWeek || dayNumber > lastDayOfMonth )
{
dayNumberItem.setAttribute( "value" , "" );
}
else
{
// set the value to the day number
dayNumberItem.setAttribute( "value" , dayNumber );
// draw the day as selected, if the Original Day is visible
if( dayNumber == oeDatePicker.gOriginalDate.getDate() &&
oeDatePicker.gSelectedDate.getYear() == oeDatePicker.gOriginalDate.getYear() &&
oeDatePicker.gSelectedDate.getMonth() == oeDatePicker.gOriginalDate.getMonth() )
{
var dayNumberBoxItem = document.getElementById( "oe-date-picker-month-day-" + (dayIndex + 1) + "-box" );
oeDatePicker.selectDayItem( dayNumberBoxItem );
}
// advance the day number
++dayNumber;
}
}
}

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

@ -0,0 +1,49 @@
<?xml version="1.0"?>
<!--
- 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 OEone Corporation are Copyright (C) 2001
- OEone Corporation. All Rights Reserved.
-
- Contributor(s): 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.
-
- -->
<overlay id="penglobal-overlay"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<popupset id="aTooltipSet"/>
<script type="application/x-javascript" src="chrome://penglobal/content/penglobalclasses.js"/>
<script type="application/x-javascript">
var penapplication = new penapplication();
</script>
</overlay>

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

@ -0,0 +1,48 @@
<?xml version="1.0"?>
<!--
- 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 OEone Corporation are Copyright (C) 2001
- OEone Corporation. All Rights Reserved.
-
- Contributor(s): 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.
-
- -->
<overlay id="penglobal-overlay"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<script type="application/x-javascript" src="chrome://penglobal/content/penroot.js"/>
<script type="application/x-javascript">
var Root = new penroot();
self.name = "rootwindow";
</script>
</overlay>

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

@ -0,0 +1,318 @@
/*
* 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 Corporation.
*
* The Initial Developer of the Original Code is
* OEone Corporation.
* Portions created by OEone Corporation are Copyright (C) 2001
* OEone Corporation. All Rights Reserved.
*
* Contributor(s): Colin Phillips (colinp@oeone.com), 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.
*
*
*/
var MEDIATOR_CONTRACTID = "@mozilla.org/rdf/datasource;1?name=window-mediator";
var nsIWindowMediator = Components.interfaces.nsIWindowMediator;
var rootwindowID = "rootwindow";
function pencontrols()
{
this.root = rootwindowID;
}
function penapplication()
{
this.application = "calendar";
this.appnum = this.getRoot().Root.getAppNum(this.application);
this.penDialogModalWindow = null;
this.penDialogWindows = new Array();
this.penDialogArray = new Array();
}
penapplication.prototype = new pencontrols;
function pendialog()
{
this.dialog = null;
this.sticky = false;
this.xcoord = null;
this.ycoord = null;
if (opener)
{
this.application = opener.penapplication.application;
this.appnum = opener.penapplication.appnum;
}
else
{
this.application = rootwindowID;
this.appnum = -1;
}
}
pendialog.prototype = new pencontrols;
/*--------------------------------------------------
* Supporting functions for each of the above
*-------------------------------------------------*/
//--controls--------------------------------------------
pencontrols.prototype.getRoot = function ()
{
var windowManager = Components.classes[MEDIATOR_CONTRACTID].getService();
var windowManagerInterface = windowManager.QueryInterface(nsIWindowMediator);
var enumerator = windowManagerInterface.getEnumerator( null );
while ( enumerator.hasMoreElements() )
{
var nextWindow = enumerator.getNext();
var domWindow = windowManagerInterface.convertISupportsToDOMWindow( nextWindow );
if (domWindow.name == rootwindowID)
{
return domWindow;
}
}
return self;
}
pencontrols.prototype.getAppPath = function (AppName)
{
var windowManager = Components.classes[MEDIATOR_CONTRACTID].getService();
var windowManagerInterface = windowManager.QueryInterface(nsIWindowMediator);
var enumerator = windowManagerInterface.getEnumerator( null );
var RootWin = null;
while ( enumerator.hasMoreElements() )
{
var nextWindow = enumerator.getNext();
var domWindow = windowManagerInterface.convertISupportsToDOMWindow( nextWindow );
if (domWindow.penapplication)
{
if (domWindow.penapplication.application == AppName)
{
return domWindow;
}
}
else if (domWindow.name == rootwindowID)
{
RootWin = domWindow;
}
}
if (RootWin != null)
{
existsInRoot = RootWin.Root.getRootWindowAppPath(AppName);
if (existsInRoot != null)
{
return existsInRoot;
}
}
return null;
}
pencontrols.prototype.getDialogWindow = function (DialogName)
{
var windowManager = Components.classes[MEDIATOR_CONTRACTID].getService();
var windowManagerInterface = windowManager.QueryInterface(nsIWindowMediator);
var enumerator = windowManagerInterface.getEnumerator( null );
DialogName = "dialogWindow" + DialogName;
while ( enumerator.hasMoreElements() )
{
var nextWindow = enumerator.getNext();
var domWindow = windowManagerInterface.convertISupportsToDOMWindow( nextWindow );
if (domWindow.pendialog)
{
if (domWindow.pendialog.dialog == DialogName)
{
return domWindow;
}
}
}
return null;
}
//--application--------------------------------------------
penapplication.prototype.getApp = function ()
{
return self;
}
penapplication.prototype.getDialogEntry = function (id)
{
for (NumDialogsOpen = 0; NumDialogsOpen < this.penDialogWindows.length; NumDialogsOpen++)
{
if (id == this.penDialogWindows[NumDialogsOpen])
{
return NumDialogsOpen;
}
}
return null;
}
penapplication.prototype.getOpenDialogEntry = function ()
{
for (NumDialogsOpen = 0; NumDialogsOpen < this.penDialogWindows.length; NumDialogsOpen++)
{
if (this.penDialogWindows[NumDialogsOpen] == null)
{
return NumDialogsOpen;
}
}
return this.penDialogWindows.length;
}
penapplication.prototype.closeDialogEntry = function (id)
{
closeSlot = this.getDialogEntry(id);
if (closeSlot == null)
{
dump("id '" + id + "' is invalid");
return;
}
this.penDialogWindows[closeSlot] = null;
this.penDialogArray[closeSlot] = null;
}
penapplication.prototype.openDialog = function (id, file, modal, penarguments)
{
id = "dialogWindow" + id;
if ((modal)&&(this.penDialogModalWindow != null))
{
return;
}
else if (this.getDialogEntry(id) != null)
{
return;
}
if (modal)
{
if (penarguments)
{
this.penDialogModalWindow = true;
window.openDialog(file, id, "chrome,centerscreen,alwaysRaised,modal", id, penarguments);
}
else
{
this.penDialogModalWindow = true;
window.openDialog(file, id, "chrome,centerscreen,alwaysRaised,modal", id);
}
}
else
{
nextOpenSlot = this.getOpenDialogEntry();
this.penDialogWindows[nextOpenSlot] = id;
if (penarguments)
{
this.penDialogArray[nextOpenSlot] = window.openDialog(file, id, "chrome,centerscreen,alwaysRaised", id, penarguments);
}
else
{
this.penDialogArray[nextOpenSlot] = window.openDialog(file, id, "chrome,centerscreen,alwaysRaised", id);
}
}
}
penapplication.prototype.closeDialog = function (id)
{
if (this.penDialogModalWindow)
{
this.penDialogModalWindow = null;
}
else
{
this.closeDialogEntry(id)
}
}
penapplication.prototype.showThisDialog = function (dialogHandle)
{
userDialogs = penapplication.mozuserpath + "/userDialogs.xml";
listOfNeverShowDialogs = penFileUtils.loadFromXML( userDialogs, "dialog" );
if ((listOfNeverShowDialogs != "")&&(listOfNeverShowDialogs.length > 0))
{
for (neverShowLength = 0; neverShowLength < listOfNeverShowDialogs.length; neverShowLength++)
{
if (listOfNeverShowDialogs[neverShowLength].name == dialogHandle)
{
return false;
}
}
}
return true;
}
penapplication.prototype.getDialogPath = function (id)
{
if (this.penDialogModalWindow)
{
return this.penDialogModalWindow;
}
else
{
id = "dialogWindow" + id;
return this.getInternalDialogPath(id);
}
}
penapplication.prototype.getInternalDialogPath = function (id)
{
if (this.penDialogModalWindow)
{
return this.penDialogModalWindow;
}
else
{
Slot = this.getDialogEntry(id)
if (Slot == null)
{
return null;
}
return this.penDialogArray[Slot];
}
}
//--dialog-------------------------------------------------
pendialog.prototype.getApp = function ()
{
return opener;
}
pendialog.prototype.closeDialog = function (id)
{
if ((this.getApp())&&(this.getApp().penapplication))
{
this.getApp().penapplication.closeDialog(id);
}
}
//--other functions----------------------------------------
function debug( Text )
{
dump( "\n"+ Text + "\n");
}

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

@ -0,0 +1,87 @@
/*
* 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 Corporation.
*
* The Initial Developer of the Original Code is
* OEone Corporation.
* Portions created by OEone Corporation are Copyright (C) 2001
* OEone Corporation. All Rights Reserved.
*
* Contributor(s): Colin Phillips (colinp@oeone.com), 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.
*
*
*/
function penroot()
{
//setup the arrays to keep track of the current open applications
this.OpenWindows = new Array();
// global calendar
this.gCalendarEventDataSource = new CalendarEventDataSource( null, "/home/mikep" );
}
penroot.prototype.getAppNum = function (AppName)
{
for (NumApps = 0; NumApps < this.OpenWindows.length; NumApps++)
{
if ((this.OpenWindows[NumApps])&&(this.OpenWindows[NumApps].AppName == AppName))
{
return NumApps;
}
}
return null;
}
penroot.prototype.getRootWindowAppPath = function (AppName)
{
for (AppCount = 0; AppCount < this.OpenWindows.length; AppCount++)
{
if ((this.OpenWindows[AppCount])&&(this.OpenWindows[AppCount].AppName == AppName))
{
return (this.OpenWindows[AppCount].iframeReference);
}
}
return null;
}
function penApp()
{
this.reference = null;
this.iframeReference = null;
this.left = null;
this.width = null;
this.top = null;
this.height = null;
this.floating = false;
this.id = false;
this.src = false;
this.AppName = null;
this.Arguments = null;
}

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

@ -0,0 +1,636 @@
<?xml version="1.0"?>
<!--
- 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 OEone Corporation are Copyright (C) 2001
- OEone Corporation. 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.
-
- -->
<!-- CSS Files -->
<?xml-stylesheet href="chrome://global/skin/global.css" type="text/css"?>
<?xml-stylesheet href="chrome://penglobal/skin/timepicker/timepicker.css" ?>
<!-- DTD Files -->
<!DOCTYPE window
[
<!ENTITY % dtd1 SYSTEM "chrome://penglobal/locale/global.dtd" > %dtd1;
<!ENTITY % dtd2 SYSTEM "chrome://calendar/locale/calendar.dtd" > %dtd2;
]>
<!-- Overlay -->
<overlay
id="oe-time-picker-overlay"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<!-- Javascript includes -->
<script type="application/x-javascript" src="chrome://global/content/strres.js"/>
<script type="application/x-javascript" src="chrome://penglobal/content/dateUtils.js"/>
<script type="application/x-javascript" src="chrome://penglobal/content/timepicker.js"/>
<!-- Popup to hold time picker-->
<popup onpopupshowing="oeTimePicker.onpopupshowing(this)" id="oe-time-picker-popup" >
<vbox id="oe-time-picker-overlay-box" flex="1"/>
</popup>
<!-- Box to hold time picker internals -->
<vbox id="oe-time-picker-overlay-box" >
<!-- AM/PM controls -->
<hbox id="oe-time-picker-ampm-controls-box" >
<box class="oe-time-picker-am-pm-box-class" id="oe-time-picker-am-box" autostretch="never" align="center" flex="1" onclick="oeTimePicker.clickAm( this )">
<text id="oe-time-picker-year-title-text" value="&time.AM;" />
</box>
<box class="oe-time-picker-am-pm-box-class" id="oe-time-picker-pm-box" autostretch="never" align="center" flex="1" onclick="oeTimePicker.clickPm( this )" >
<text id="oe-time-picker-year-title-text" value="&time.PM;" />
</box>
</hbox>
<!-- Hour Grid -->
<grid id="oe-time-picker-hour-grid">
<columns>
<column class="oe-time-picker-hour-column-class" flex="1"/>
<column class="oe-time-picker-hour-column-class" flex="1"/>
<column class="oe-time-picker-hour-column-class" flex="1"/>
<column class="oe-time-picker-hour-column-class" flex="1"/>
<column class="oe-time-picker-hour-column-class" flex="1"/>
<column class="oe-time-picker-hour-column-class" flex="1"/>
<column class="oe-time-picker-hour-column-class" flex="1"/>
<column class="oe-time-picker-hour-column-class" flex="1"/>
<column class="oe-time-picker-hour-column-class" flex="1"/>
<column class="oe-time-picker-hour-column-class" flex="1"/>
<column class="oe-time-picker-hour-column-class" flex="1"/>
<column class="oe-time-picker-hour-column-class" flex="1"/>
</columns>
<rows >
<row flex="1" >
<vbox class="oe-time-picker-hour-box-class" id="oe-time-picker-hour-box-0" onclick="oeTimePicker.clickHour(this, 0)" >
<spring flex="1" />
<box ><text class="oe-time-picker-hour-name-class" value="12" /></box>
<spring flex="1" />
</vbox>
<vbox class="oe-time-picker-hour-box-class" id="oe-time-picker-hour-box-1" onclick="oeTimePicker.clickHour(this, 1)" >
<spring flex="1" />
<box ><text class="oe-time-picker-hour-name-class" value="1" /></box>
<spring flex="1" />
</vbox>
<vbox class="oe-time-picker-hour-box-class" id="oe-time-picker-hour-box-2" onclick="oeTimePicker.clickHour(this, 2)" >
<spring flex="1" />
<box ><text class="oe-time-picker-hour-name-class" value="2" /></box>
<spring flex="1" />
</vbox>
<vbox class="oe-time-picker-hour-box-class" id="oe-time-picker-hour-box-3" onclick="oeTimePicker.clickHour(this, 3)" >
<spring flex="1" />
<box ><text class="oe-time-picker-hour-name-class" value="3" /></box>
<spring flex="1" />
</vbox>
<vbox class="oe-time-picker-hour-box-class" id="oe-time-picker-hour-box-4" onclick="oeTimePicker.clickHour(this, 4)" >
<spring flex="1" />
<box ><text class="oe-time-picker-hour-name-class" value="4" /></box>
<spring flex="1" />
</vbox>
<vbox class="oe-time-picker-hour-box-class" id="oe-time-picker-hour-box-5" onclick="oeTimePicker.clickHour(this, 5)" >
<spring flex="1" />
<box ><text class="oe-time-picker-hour-name-class" value="5" /></box>
<spring flex="1" />
</vbox>
<vbox class="oe-time-picker-hour-box-class" id="oe-time-picker-hour-box-6" onclick="oeTimePicker.clickHour(this, 6)" >
<spring flex="1" />
<box ><text class="oe-time-picker-hour-name-class" value="6" /></box>
<spring flex="1" />
</vbox>
<vbox class="oe-time-picker-hour-box-class" id="oe-time-picker-hour-box-7" onclick="oeTimePicker.clickHour(this, 7)" >
<spring flex="1" />
<box ><text class="oe-time-picker-hour-name-class" value="7" /></box>
<spring flex="1" />
</vbox>
<vbox class="oe-time-picker-hour-box-class" id="oe-time-picker-hour-box-8" onclick="oeTimePicker.clickHour(this, 8)" >
<spring flex="1" />
<box ><text class="oe-time-picker-hour-name-class" value="8" /></box>
<spring flex="1" />
</vbox>
<vbox class="oe-time-picker-hour-box-class" id="oe-time-picker-hour-box-9" onclick="oeTimePicker.clickHour(this, 9)" >
<spring flex="1" />
<box ><text class="oe-time-picker-hour-name-class" value="9" /></box>
<spring flex="1" />
</vbox>
<vbox class="oe-time-picker-hour-box-class" id="oe-time-picker-hour-box-10" onclick="oeTimePicker.clickHour(this, 10)" >
<spring flex="1" />
<box ><text class="oe-time-picker-hour-name-class" value="10" /></box>
<spring flex="1" />
</vbox>
<vbox class="oe-time-picker-hour-box-class" id="oe-time-picker-hour-box-11" onclick="oeTimePicker.clickHour(this, 11)" >
<spring flex="1" />
<box ><text class="oe-time-picker-hour-name-class" value="11" /></box>
<spring flex="1" />
</vbox>
</row>
</rows>
</grid> <!-- Hour Grid -->
<!-- Five Minute Grid -->
<vbox id="oe-time-picker-five-minute-grid-box" flex="1">
<grid id="oe-time-picker-five-minute-grid" flex="1">
<columns>
<column class="oe-time-picker-five-minute-column-class" flex="1"/>
<column class="oe-time-picker-five-minute-column-class" flex="1"/>
<column class="oe-time-picker-five-minute-column-class" flex="1"/>
<column class="oe-time-picker-five-minute-column-class" flex="1"/>
<column class="oe-time-picker-five-minute-column-class" flex="1"/>
<column class="oe-time-picker-five-minute-column-class" flex="1"/>
</columns>
<rows >
<row flex="1" >
<vbox class="oe-time-picker-five-minute-box-class" id="oe-time-picker-five-minute-box-0" onclick="oeTimePicker.clickMinute(this, 0)">
<spring flex="1" />
<box><text class="oe-time-picker-five-minute-number-class" value=":00" /></box>
<spring flex="1" />
</vbox>
<vbox class="oe-time-picker-five-minute-box-class" id="oe-time-picker-five-minute-box-5" onclick="oeTimePicker.clickMinute(this, 5)">
<spring flex="1" />
<box><text class="oe-time-picker-five-minute-number-class" value=":05" /></box>
<spring flex="1" />
</vbox>
<vbox class="oe-time-picker-five-minute-box-class" id="oe-time-picker-five-minute-box-10" onclick="oeTimePicker.clickMinute(this, 10)">
<spring flex="1" />
<box><text class="oe-time-picker-five-minute-number-class" value=":10" /></box>
<spring flex="1" />
</vbox>
<vbox class="oe-time-picker-five-minute-box-class" id="oe-time-picker-five-minute-box-15" onclick="oeTimePicker.clickMinute(this, 15)">
<spring flex="1" />
<box><text class="oe-time-picker-five-minute-number-class" value=":15" /></box>
<spring flex="1" />
</vbox>
<vbox class="oe-time-picker-five-minute-box-class" id="oe-time-picker-five-minute-box-20" onclick="oeTimePicker.clickMinute(this, 20)">
<spring flex="1" />
<box><text class="oe-time-picker-five-minute-number-class" value=":20" /></box>
<spring flex="1" />
</vbox>
<vbox class="oe-time-picker-five-minute-box-class" id="oe-time-picker-five-minute-box-25" onclick="oeTimePicker.clickMinute(this, 25)">
<spring flex="1" />
<box><text class="oe-time-picker-five-minute-number-class" value=":25" /></box>
<spring flex="1" />
</vbox>
</row>
<row flex="1" >
<vbox class="oe-time-picker-five-minute-box-class" id="oe-time-picker-five-minute-box-30" onclick="oeTimePicker.clickMinute(this, 30)">
<spring flex="1" />
<box><text class="oe-time-picker-five-minute-number-class" value=":30" /></box>
<spring flex="1" />
</vbox>
<vbox class="oe-time-picker-five-minute-box-class" id="oe-time-picker-five-minute-box-35" onclick="oeTimePicker.clickMinute(this, 35)">
<spring flex="1" />
<box><text class="oe-time-picker-five-minute-number-class" value=":35" /></box>
<spring flex="1" />
</vbox>
<vbox class="oe-time-picker-five-minute-box-class" id="oe-time-picker-five-minute-box-40" onclick="oeTimePicker.clickMinute(this, 40)">
<spring flex="1" />
<box><text class="oe-time-picker-five-minute-number-class" value=":40" /></box>
<spring flex="1" />
</vbox>
<vbox class="oe-time-picker-five-minute-box-class" id="oe-time-picker-five-minute-box-45" onclick="oeTimePicker.clickMinute(this, 45)">
<spring flex="1" />
<box><text class="oe-time-picker-five-minute-number-class" value=":45" /></box>
<spring flex="1" />
</vbox>
<vbox class="oe-time-picker-five-minute-box-class" id="oe-time-picker-five-minute-box-50" onclick="oeTimePicker.clickMinute(this, 50)">
<spring flex="1" />
<box><text class="oe-time-picker-five-minute-number-class" value=":50" /></box>
<spring flex="1" />
</vbox>
<vbox class="oe-time-picker-five-minute-box-class" id="oe-time-picker-five-minute-box-55" onclick="oeTimePicker.clickMinute(this, 55)">
<spring flex="1" />
<box><text class="oe-time-picker-five-minute-number-class" value=":55" /></box>
<spring flex="1" />
</vbox>
</row>
</rows>
</grid> <!-- Five Minute Grid -->
<hbox>
<image id="oe-time-picker-more-control-image" onclick="oeTimePicker.clickMore()" />
<image id="oe-time-picker-minutes-bottom-image" />
</hbox>
</vbox> <!-- Five Minute Grid Box -->
<!-- One Minute Grid -->
<vbox id="oe-time-picker-one-minute-grid-box" flex="1" collapsed="true">
<grid id="oe-time-picker-one-minute-grid" flex="1">
<columns>
<column class="oe-time-picker-one-minute-column-class" flex="1"/>
<column class="oe-time-picker-one-minute-column-class" flex="1"/>
<column class="oe-time-picker-one-minute-column-class" flex="1"/>
<column class="oe-time-picker-one-minute-column-class" flex="1"/>
<column class="oe-time-picker-one-minute-column-class" flex="1"/>
</columns>
<rows >
<row flex="1" >
<vbox class="oe-time-picker-one-minute-box-class" id="oe-time-picker-one-minute-box-0" onclick="oeTimePicker.clickMinute(this, 0)">
<spring flex="1" />
<box><text class="oe-time-picker-one-minute-number-class" value=":00" /></box>
<spring flex="1" />
</vbox>
<vbox class="oe-time-picker-one-minute-box-class" id="oe-time-picker-one-minute-box-1" onclick="oeTimePicker.clickMinute(this, 1)">
<spring flex="1" />
<box><text class="oe-time-picker-one-minute-number-class" value=":01" /></box>
<spring flex="1" />
</vbox>
<vbox class="oe-time-picker-one-minute-box-class" id="oe-time-picker-one-minute-box-2" onclick="oeTimePicker.clickMinute(this, 2)">
<spring flex="1" />
<box><text class="oe-time-picker-one-minute-number-class" value=":02" /></box>
<spring flex="1" />
</vbox>
<vbox class="oe-time-picker-one-minute-box-class" id="oe-time-picker-one-minute-box-3" onclick="oeTimePicker.clickMinute(this, 3)">
<spring flex="1" />
<box><text class="oe-time-picker-one-minute-number-class" value=":03" /></box>
<spring flex="1" />
</vbox>
<vbox class="oe-time-picker-one-minute-box-class" id="oe-time-picker-one-minute-box-4" onclick="oeTimePicker.clickMinute(this, 4)">
<spring flex="1" />
<box><text class="oe-time-picker-one-minute-number-class" value=":04" /></box>
<spring flex="1" />
</vbox>
</row>
<row flex="1" >
<vbox class="oe-time-picker-one-minute-box-class" id="oe-time-picker-one-minute-box-5" onclick="oeTimePicker.clickMinute(this, 5)">
<spring flex="1" />
<box><text class="oe-time-picker-one-minute-number-class" value=":05" /></box>
<spring flex="1" />
</vbox>
<vbox class="oe-time-picker-one-minute-box-class" id="oe-time-picker-one-minute-box-6" onclick="oeTimePicker.clickMinute(this, 6)">
<spring flex="1" />
<box><text class="oe-time-picker-one-minute-number-class" value=":06" /></box>
<spring flex="1" />
</vbox>
<vbox class="oe-time-picker-one-minute-box-class" id="oe-time-picker-one-minute-box-7" onclick="oeTimePicker.clickMinute(this, 7)">
<spring flex="1" />
<box><text class="oe-time-picker-one-minute-number-class" value=":07" /></box>
<spring flex="1" />
</vbox>
<vbox class="oe-time-picker-one-minute-box-class" id="oe-time-picker-one-minute-box-8" onclick="oeTimePicker.clickMinute(this, 8)">
<spring flex="1" />
<box><text class="oe-time-picker-one-minute-number-class" value=":08" /></box>
<spring flex="1" />
</vbox>
<vbox class="oe-time-picker-one-minute-box-class" id="oe-time-picker-one-minute-box-9" onclick="oeTimePicker.clickMinute(this, 9)">
<spring flex="1" />
<box><text class="oe-time-picker-one-minute-number-class" value=":09" /></box>
<spring flex="1" />
</vbox>
</row>
<row flex="1" >
<vbox class="oe-time-picker-one-minute-box-class" id="oe-time-picker-one-minute-box-10" onclick="oeTimePicker.clickMinute(this, 10)">
<spring flex="1" />
<box><text class="oe-time-picker-one-minute-number-class" value=":10" /></box>
<spring flex="1" />
</vbox>
<vbox class="oe-time-picker-one-minute-box-class" id="oe-time-picker-one-minute-box-11" onclick="oeTimePicker.clickMinute(this, 11)">
<spring flex="1" />
<box><text class="oe-time-picker-one-minute-number-class" value=":11" /></box>
<spring flex="1" />
</vbox>
<vbox class="oe-time-picker-one-minute-box-class" id="oe-time-picker-one-minute-box-12" onclick="oeTimePicker.clickMinute(this, 12)">
<spring flex="1" />
<box><text class="oe-time-picker-one-minute-number-class" value=":12" /></box>
<spring flex="1" />
</vbox>
<vbox class="oe-time-picker-one-minute-box-class" id="oe-time-picker-one-minute-box-13" onclick="oeTimePicker.clickMinute(this, 13)">
<spring flex="1" />
<box><text class="oe-time-picker-one-minute-number-class" value=":13" /></box>
<spring flex="1" />
</vbox>
<vbox class="oe-time-picker-one-minute-box-class" id="oe-time-picker-one-minute-box-14" onclick="oeTimePicker.clickMinute(this, 14)">
<spring flex="1" />
<box><text class="oe-time-picker-one-minute-number-class" value=":14" /></box>
<spring flex="1" />
</vbox>
</row>
<row flex="1" >
<vbox class="oe-time-picker-one-minute-box-class" id="oe-time-picker-one-minute-box-15" onclick="oeTimePicker.clickMinute(this, 15)">
<spring flex="1" />
<box><text class="oe-time-picker-one-minute-number-class" value=":15" /></box>
<spring flex="1" />
</vbox>
<vbox class="oe-time-picker-one-minute-box-class" id="oe-time-picker-one-minute-box-16" onclick="oeTimePicker.clickMinute(this, 16)">
<spring flex="1" />
<box><text class="oe-time-picker-one-minute-number-class" value=":16" /></box>
<spring flex="1" />
</vbox>
<vbox class="oe-time-picker-one-minute-box-class" id="oe-time-picker-one-minute-box-17" onclick="oeTimePicker.clickMinute(this, 17)">
<spring flex="1" />
<box><text class="oe-time-picker-one-minute-number-class" value=":17" /></box>
<spring flex="1" />
</vbox>
<vbox class="oe-time-picker-one-minute-box-class" id="oe-time-picker-one-minute-box-18" onclick="oeTimePicker.clickMinute(this, 18)">
<spring flex="1" />
<box><text class="oe-time-picker-one-minute-number-class" value=":18" /></box>
<spring flex="1" />
</vbox>
<vbox class="oe-time-picker-one-minute-box-class" id="oe-time-picker-one-minute-box-19" onclick="oeTimePicker.clickMinute(this, 19)">
<spring flex="1" />
<box><text class="oe-time-picker-one-minute-number-class" value=":19" /></box>
<spring flex="1" />
</vbox>
</row>
<row flex="1" >
<vbox class="oe-time-picker-one-minute-box-class" id="oe-time-picker-one-minute-box-20" onclick="oeTimePicker.clickMinute(this, 20)">
<spring flex="1" />
<box><text class="oe-time-picker-one-minute-number-class" value=":20" /></box>
<spring flex="1" />
</vbox>
<vbox class="oe-time-picker-one-minute-box-class" id="oe-time-picker-one-minute-box-21" onclick="oeTimePicker.clickMinute(this, 21)">
<spring flex="1" />
<box><text class="oe-time-picker-one-minute-number-class" value=":21" /></box>
<spring flex="1" />
</vbox>
<vbox class="oe-time-picker-one-minute-box-class" id="oe-time-picker-one-minute-box-22" onclick="oeTimePicker.clickMinute(this, 22)">
<spring flex="1" />
<box><text class="oe-time-picker-one-minute-number-class" value=":22" /></box>
<spring flex="1" />
</vbox>
<vbox class="oe-time-picker-one-minute-box-class" id="oe-time-picker-one-minute-box-23" onclick="oeTimePicker.clickMinute(this, 23)">
<spring flex="1" />
<box><text class="oe-time-picker-one-minute-number-class" value=":23" /></box>
<spring flex="1" />
</vbox>
<vbox class="oe-time-picker-one-minute-box-class" id="oe-time-picker-one-minute-box-24" onclick="oeTimePicker.clickMinute(this, 24)">
<spring flex="1" />
<box><text class="oe-time-picker-one-minute-number-class" value=":24" /></box>
<spring flex="1" />
</vbox>
</row>
<row flex="1" >
<vbox class="oe-time-picker-one-minute-box-class" id="oe-time-picker-one-minute-box-25" onclick="oeTimePicker.clickMinute(this, 25)">
<spring flex="1" />
<box><text class="oe-time-picker-one-minute-number-class" value=":25" /></box>
<spring flex="1" />
</vbox>
<vbox class="oe-time-picker-one-minute-box-class" id="oe-time-picker-one-minute-box-26" onclick="oeTimePicker.clickMinute(this, 26)">
<spring flex="1" />
<box><text class="oe-time-picker-one-minute-number-class" value=":26" /></box>
<spring flex="1" />
</vbox>
<vbox class="oe-time-picker-one-minute-box-class" id="oe-time-picker-one-minute-box-27" onclick="oeTimePicker.clickMinute(this, 27)">
<spring flex="1" />
<box><text class="oe-time-picker-one-minute-number-class" value=":27" /></box>
<spring flex="1" />
</vbox>
<vbox class="oe-time-picker-one-minute-box-class" id="oe-time-picker-one-minute-box-28" onclick="oeTimePicker.clickMinute(this, 28)">
<spring flex="1" />
<box><text class="oe-time-picker-one-minute-number-class" value=":28" /></box>
<spring flex="1" />
</vbox>
<vbox class="oe-time-picker-one-minute-box-class" id="oe-time-picker-one-minute-box-29" onclick="oeTimePicker.clickMinute(this, 29)">
<spring flex="1" />
<box><text class="oe-time-picker-one-minute-number-class" value=":29" /></box>
<spring flex="1" />
</vbox>
</row>
<row flex="1" >
<vbox class="oe-time-picker-one-minute-box-class" id="oe-time-picker-one-minute-box-30" onclick="oeTimePicker.clickMinute(this, 30)">
<spring flex="1" />
<box><text class="oe-time-picker-one-minute-number-class" value=":30" /></box>
<spring flex="1" />
</vbox>
<vbox class="oe-time-picker-one-minute-box-class" id="oe-time-picker-one-minute-box-31" onclick="oeTimePicker.clickMinute(this, 31)">
<spring flex="1" />
<box><text class="oe-time-picker-one-minute-number-class" value=":31" /></box>
<spring flex="1" />
</vbox>
<vbox class="oe-time-picker-one-minute-box-class" id="oe-time-picker-one-minute-box-32" onclick="oeTimePicker.clickMinute(this, 32)">
<spring flex="1" />
<box><text class="oe-time-picker-one-minute-number-class" value=":32" /></box>
<spring flex="1" />
</vbox>
<vbox class="oe-time-picker-one-minute-box-class" id="oe-time-picker-one-minute-box-33" onclick="oeTimePicker.clickMinute(this, 33)">
<spring flex="1" />
<box><text class="oe-time-picker-one-minute-number-class" value=":33" /></box>
<spring flex="1" />
</vbox>
<vbox class="oe-time-picker-one-minute-box-class" id="oe-time-picker-one-minute-box-34" onclick="oeTimePicker.clickMinute(this, 34)">
<spring flex="1" />
<box><text class="oe-time-picker-one-minute-number-class" value=":34" /></box>
<spring flex="1" />
</vbox>
</row>
<row flex="1" >
<vbox class="oe-time-picker-one-minute-box-class" id="oe-time-picker-one-minute-box-35" onclick="oeTimePicker.clickMinute(this, 35)">
<spring flex="1" />
<box><text class="oe-time-picker-one-minute-number-class" value=":35" /></box>
<spring flex="1" />
</vbox>
<vbox class="oe-time-picker-one-minute-box-class" id="oe-time-picker-one-minute-box-36" onclick="oeTimePicker.clickMinute(this, 36)">
<spring flex="1" />
<box><text class="oe-time-picker-one-minute-number-class" value=":36" /></box>
<spring flex="1" />
</vbox>
<vbox class="oe-time-picker-one-minute-box-class" id="oe-time-picker-one-minute-box-37" onclick="oeTimePicker.clickMinute(this, 37)">
<spring flex="1" />
<box><text class="oe-time-picker-one-minute-number-class" value=":37" /></box>
<spring flex="1" />
</vbox>
<vbox class="oe-time-picker-one-minute-box-class" id="oe-time-picker-one-minute-box-38" onclick="oeTimePicker.clickMinute(this, 38)">
<spring flex="1" />
<box><text class="oe-time-picker-one-minute-number-class" value=":38" /></box>
<spring flex="1" />
</vbox>
<vbox class="oe-time-picker-one-minute-box-class" id="oe-time-picker-one-minute-box-39" onclick="oeTimePicker.clickMinute(this, 39)">
<spring flex="1" />
<box><text class="oe-time-picker-one-minute-number-class" value=":39" /></box>
<spring flex="1" />
</vbox>
</row>
<row flex="1" >
<vbox class="oe-time-picker-one-minute-box-class" id="oe-time-picker-one-minute-box-40" onclick="oeTimePicker.clickMinute(this, 40)">
<spring flex="1" />
<box><text class="oe-time-picker-one-minute-number-class" value=":40" /></box>
<spring flex="1" />
</vbox>
<vbox class="oe-time-picker-one-minute-box-class" id="oe-time-picker-one-minute-box-41" onclick="oeTimePicker.clickMinute(this, 41)">
<spring flex="1" />
<box><text class="oe-time-picker-one-minute-number-class" value=":41" /></box>
<spring flex="1" />
</vbox>
<vbox class="oe-time-picker-one-minute-box-class" id="oe-time-picker-one-minute-box-42" onclick="oeTimePicker.clickMinute(this, 42)">
<spring flex="1" />
<box><text class="oe-time-picker-one-minute-number-class" value=":42" /></box>
<spring flex="1" />
</vbox>
<vbox class="oe-time-picker-one-minute-box-class" id="oe-time-picker-one-minute-box-43" onclick="oeTimePicker.clickMinute(this, 43)">
<spring flex="1" />
<box><text class="oe-time-picker-one-minute-number-class" value=":43" /></box>
<spring flex="1" />
</vbox>
<vbox class="oe-time-picker-one-minute-box-class" id="oe-time-picker-one-minute-box-44" onclick="oeTimePicker.clickMinute(this, 44)">
<spring flex="1" />
<box><text class="oe-time-picker-one-minute-number-class" value=":44" /></box>
<spring flex="1" />
</vbox>
</row>
<row flex="1" >
<vbox class="oe-time-picker-one-minute-box-class" id="oe-time-picker-one-minute-box-45" onclick="oeTimePicker.clickMinute(this, 45)">
<spring flex="1" />
<box><text class="oe-time-picker-one-minute-number-class" value=":45" /></box>
<spring flex="1" />
</vbox>
<vbox class="oe-time-picker-one-minute-box-class" id="oe-time-picker-one-minute-box-46" onclick="oeTimePicker.clickMinute(this, 46)">
<spring flex="1" />
<box><text class="oe-time-picker-one-minute-number-class" value=":46" /></box>
<spring flex="1" />
</vbox>
<vbox class="oe-time-picker-one-minute-box-class" id="oe-time-picker-one-minute-box-47" onclick="oeTimePicker.clickMinute(this, 47)">
<spring flex="1" />
<box><text class="oe-time-picker-one-minute-number-class" value=":47" /></box>
<spring flex="1" />
</vbox>
<vbox class="oe-time-picker-one-minute-box-class" id="oe-time-picker-one-minute-box-48" onclick="oeTimePicker.clickMinute(this, 48)">
<spring flex="1" />
<box><text class="oe-time-picker-one-minute-number-class" value=":48" /></box>
<spring flex="1" />
</vbox>
<vbox class="oe-time-picker-one-minute-box-class" id="oe-time-picker-one-minute-box-49" onclick="oeTimePicker.clickMinute(this, 49)">
<spring flex="1" />
<box><text class="oe-time-picker-one-minute-number-class" value=":49" /></box>
<spring flex="1" />
</vbox>
</row>
<row flex="1" >
<vbox class="oe-time-picker-one-minute-box-class" id="oe-time-picker-one-minute-box-50" onclick="oeTimePicker.clickMinute(this, 50)">
<spring flex="1" />
<box><text class="oe-time-picker-one-minute-number-class" value=":50" /></box>
<spring flex="1" />
</vbox>
<vbox class="oe-time-picker-one-minute-box-class" id="oe-time-picker-one-minute-box-51" onclick="oeTimePicker.clickMinute(this, 51)">
<spring flex="1" />
<box><text class="oe-time-picker-one-minute-number-class" value=":51" /></box>
<spring flex="1" />
</vbox>
<vbox class="oe-time-picker-one-minute-box-class" id="oe-time-picker-one-minute-box-52" onclick="oeTimePicker.clickMinute(this, 52)">
<spring flex="1" />
<box><text class="oe-time-picker-one-minute-number-class" value=":52" /></box>
<spring flex="1" />
</vbox>
<vbox class="oe-time-picker-one-minute-box-class" id="oe-time-picker-one-minute-box-53" onclick="oeTimePicker.clickMinute(this, 53)">
<spring flex="1" />
<box><text class="oe-time-picker-one-minute-number-class" value=":53" /></box>
<spring flex="1" />
</vbox>
<vbox class="oe-time-picker-one-minute-box-class" id="oe-time-picker-one-minute-box-54" onclick="oeTimePicker.clickMinute(this, 54)">
<spring flex="1" />
<box><text class="oe-time-picker-one-minute-number-class" value=":54" /></box>
<spring flex="1" />
</vbox>
</row>
<row flex="1" >
<vbox class="oe-time-picker-one-minute-box-class" id="oe-time-picker-one-minute-box-55" onclick="oeTimePicker.clickMinute(this, 55)">
<spring flex="1" />
<box><text class="oe-time-picker-one-minute-number-class" value=":55" /></box>
<spring flex="1" />
</vbox>
<vbox class="oe-time-picker-one-minute-box-class" id="oe-time-picker-one-minute-box-56" onclick="oeTimePicker.clickMinute(this, 56)">
<spring flex="1" />
<box><text class="oe-time-picker-one-minute-number-class" value=":56" /></box>
<spring flex="1" />
</vbox>
<vbox class="oe-time-picker-one-minute-box-class" id="oe-time-picker-one-minute-box-57" onclick="oeTimePicker.clickMinute(this, 57)">
<spring flex="1" />
<box><text class="oe-time-picker-one-minute-number-class" value=":57" /></box>
<spring flex="1" />
</vbox>
<vbox class="oe-time-picker-one-minute-box-class" id="oe-time-picker-one-minute-box-58" onclick="oeTimePicker.clickMinute(this, 58)">
<spring flex="1" />
<box><text class="oe-time-picker-one-minute-number-class" value=":58" /></box>
<spring flex="1" />
</vbox>
<vbox class="oe-time-picker-one-minute-box-class" id="oe-time-picker-one-minute-box-59" onclick="oeTimePicker.clickMinute(this, 59)">
<spring flex="1" />
<box><text class="oe-time-picker-one-minute-number-class" value=":59" /></box>
<spring flex="1" />
</vbox>
</row>
</rows>
</grid> <!-- One Minute Grid -->
<hbox>
<image id="oe-time-picker-less-control-image" onclick="oeTimePicker.clickLess()" />
<image id="oe-time-picker-minutes-bottom-image" />
</hbox>
</vbox> <!-- One Minute Grid Box -->
</vbox> <!-- Box to hold time picker internals -->
</overlay>

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

@ -0,0 +1,482 @@
/*
* 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 Corporation.
*
* The Initial Developer of the Original Code is
* OEone Corporation.
* Portions created by OEone Corporation are Copyright (C) 2001
* OEone Corporation. All Rights Reserved.
*
* Contributor(s): Garth Smedley (garths@oeone.com), Mike Potter (mikep@oeone.com)
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
*
*/
/***** oe-timepicker
* AUTHOR
* Garth Smedley
*
* NOTES
* Time picker popup.
* Closes when a minute is clicked, and passes the picked time into your oncommand function.
*
* To use the timepicker include the overlay in your XUL, this .js file is included from there
<?xul-overlay href="chrome://penglobal/content/timepicker-overlay.xul"?>
*
* Make a popupset in your XUL that includes the picker popup from the overlay
*
<popupset>
<popup id="oe-time-picker-popup" oncommand="yourCommandFunction( this )" >
</popup>
</popupset>
*
* Attach the time picker to an item using the popup attribute, an image for example:
*
<image class="four-state-image-button" popup="oe-time-picker-popup" onmousedown="yourPrepareTimePickerFunction()" />
*
* In your .js, initialize the picker with the inital time when the user clicks, set to now in this example:
*
function yourPrepareTimePickerFunction( )
{
var timePickerPopup = document.getElementById( "oe-time-picker-popup" );
timePickerPopup.setAttribute( "value", new Date() );
}
*
* In your .js, respond to the user picking a time, this function will not be called if they just click
* out of the picker
*
function yourCommandFunction( timepopup )
{
var newTime = timepopup.value;
// timepopup.value is a Date object with
// the hours, minutes and seconds set to the user selection
}
* IMPLEMENTATION NOTES
*
* In order to prevent name space pollution, all of the time picker methods
* are static members of the oeTimePicker class.
*
**********
*/
/**
* Time picker class, has static members only.
*/
function oeTimePicker()
{
}
/**
* Static variables
*/
/** The popup window containing the picker */
oeTimePicker.gPopup = null;
/** The currently selected time */
oeTimePicker.gSelectedTime = new Date();
/** The selected Am/pm, selected hour and selected minute items */
oeTimePicker.gSelectedAmPmItem = null;
oeTimePicker.gSelectedHourItem = null;
oeTimePicker.gSelectedMinuteItem = null;
/** constants use to specify one anf five minue view */
oeTimePicker.kMinuteView_Five = 5;
oeTimePicker.kMinuteView_One = 1;
/**
* Set up the picker, called when the popup pops
*/
oeTimePicker.onpopupshowing = function( popup )
{
// remember the popup
oeTimePicker.gPopup = popup;
// if there is a Date object in the popup item's value attribute, use it,
// otherwise use Now.
var inputTime = oeTimePicker.gPopup.getAttribute( "value" );
if( inputTime )
{
oeTimePicker.gSelectedTime = new Date( inputTime );
}
else
{
oeTimePicker.gSelectedTime = new Date();
}
// Select the AM or PM item based on whether the hour is 0-11 or 12-23
var hours24 = oeTimePicker.gSelectedTime.getHours();
if( oeTimePicker.isTimeAm( oeTimePicker.gSelectedTime ) )
{
var amPmItem = document.getElementById( "oe-time-picker-am-box" );
var hours12 = hours24;
}
else
{
var amPmItem = document.getElementById( "oe-time-picker-pm-box" );
var hours12 = hours24 - 12;
}
oeTimePicker.selectAmPmItem( amPmItem );
// select the hour item
var hourItem = document.getElementById( "oe-time-picker-hour-box-" + hours12 );
oeTimePicker.selectHourItem( hourItem );
// Show the five minute view if we are an even five minutes, one minute
// otherwise
var minutesByFive = oeTimePicker.calcNearestFiveMinutes( oeTimePicker.gSelectedTime );
if( minutesByFive == oeTimePicker.gSelectedTime.getMinutes() )
{
oeTimePicker.clickLess();
}
else
{
oeTimePicker.clickMore();
}
}
/**
* Called when the AM box is clicked
*/
oeTimePicker.clickAm = function( theItem )
{
// if not already AM, set the selected time to AM ( by subtracting 12 from what must be a PM time )
// and select the AM item
if( !oeTimePicker.isTimeAm( oeTimePicker.gSelectedTime ) )
{
var hours = oeTimePicker.gSelectedTime.getHours();
oeTimePicker.gSelectedTime.setHours( hours - 12 );
oeTimePicker.selectAmPmItem( theItem );
}
}
/**
* Called when the PM box is clicked
*/
oeTimePicker.clickPm = function( theItem )
{
// if not already PM, set the selected time to PM ( by adding 12 to what must be an AM time )
// and select the PM item
if( oeTimePicker.isTimeAm( oeTimePicker.gSelectedTime ) )
{
var hours = oeTimePicker.gSelectedTime.getHours();
oeTimePicker.gSelectedTime.setHours( hours + 12 );
oeTimePicker.selectAmPmItem( theItem );
}
}
/**
* Called when one of the hour boxes is clicked
*/
oeTimePicker.clickHour = function( hourItem, hourNumber )
{
// select the item
oeTimePicker.selectHourItem( hourItem );
// Change the hour in the selected time, add 12 if PM.
if( oeTimePicker.isTimeAm( oeTimePicker.gSelectedTime ) )
{
var hour24 = hourNumber;
}
else
{
var hour24 = hourNumber + 12;
}
oeTimePicker.gSelectedTime.setHours( hour24 );
this.selectTime();
}
/**
* Called when the more tab is clicked, and possibly at startup
*/
oeTimePicker.clickMore = function()
{
// switch to one minute view
oeTimePicker.switchMinuteView( oeTimePicker.kMinuteView_One );
// select minute box corresponding to the time
var minutes = oeTimePicker.gSelectedTime.getMinutes();
var oneMinuteItem = document.getElementById( "oe-time-picker-one-minute-box-" + minutes );
oeTimePicker.selectMinuteItem( oneMinuteItem );
}
/**
* Called when the less tab is clicked, and possibly at startup
*/
oeTimePicker.clickLess = function()
{
// switch to five minute view
oeTimePicker.switchMinuteView( oeTimePicker.kMinuteView_Five );
// select closest five minute box,
// BUT leave the selected time at what may NOT be an even five minutes
// So that If they click more again the proper non-even-five minute box will be selected
var minutesByFive = oeTimePicker.calcNearestFiveMinutes( oeTimePicker.gSelectedTime );
var fiveMinuteItem = document.getElementById( "oe-time-picker-five-minute-box-" + minutesByFive );
oeTimePicker.selectMinuteItem( fiveMinuteItem );
}
/**
* Called when one of the minute boxes is clicked,
* Calls the client's oncommand and Closes the popup
*/
oeTimePicker.clickMinute = function( minuteItem, minuteNumber )
{
// set the minutes in the selected time
oeTimePicker.gSelectedTime.setMinutes( minuteNumber );
oeTimePicker.selectMinuteItem( minuteItem );
oeTimePicker.selectTime();
oeTimePicker.gPopup.closePopup ();
}
/**
* Called when one of the minute boxes is clicked,
* Calls the client's oncommand and Closes the popup
*/
oeTimePicker.selectTime = function()
{
// We copy the picked time to avoid problems with changing the Date object in place
var pickedTime = new Date( oeTimePicker.gSelectedTime )
// put the picked time in the value property of the popup item.
oeTimePicker.gPopup.value = pickedTime;
// get and call the client's oncommand function
var commandEventMethod = oeTimePicker.gPopup.getAttribute( "oncommand" );
if( commandEventMethod )
{
// set up a variable date, that will be avaialable from within the
// client method
var date = pickedTime;
// Make the function a member of the popup before calling it so that
// 'this' will be the popup
oeTimePicker.gPopup.oeTimePickerFunction = function() { eval( commandEventMethod ); };
oeTimePicker.gPopup.oeTimePickerFunction();
}
// close the popup
//oeTimePicker.gPopup.closePopup ();
}
/**
* Helper function to switch between "one" and "five" minute views
*/
oeTimePicker.switchMinuteView = function( view )
{
var fiveMinuteBox = document.getElementById( "oe-time-picker-five-minute-grid-box" );
var oneMinuteBox = document.getElementById( "oe-time-picker-one-minute-grid-box" );
if( view == oeTimePicker.kMinuteView_One )
{
fiveMinuteBox.setAttribute( "collapsed", true );
oneMinuteBox.setAttribute( "collapsed", false );
}
else
{
fiveMinuteBox.setAttribute( "collapsed", false );
oneMinuteBox.setAttribute( "collapsed", true );
}
}
/**
* Helper function to select the AM or PM box
*/
oeTimePicker.selectAmPmItem = function( amPmItem )
{
// clear old selection, if there is one
if( oeTimePicker.gSelectedAmPmItem != null )
{
oeTimePicker.gSelectedAmPmItem.setAttribute( "selected" , "false" );
}
// set selected attribute, to cause the selected style to apply
amPmItem.setAttribute( "selected" , "true" );
// remember the selected item so we can deselect it
oeTimePicker.gSelectedAmPmItem = amPmItem;
this.selectTime();
}
/**
* Helper function to select an hour item
*/
oeTimePicker.selectHourItem = function( hourItem )
{
// clear old selection, if there is one
if( oeTimePicker.gSelectedHourItem != null )
{
oeTimePicker.gSelectedHourItem.setAttribute( "selected" , "false" );
}
// set selected attribute, to cause the selected style to apply
hourItem.setAttribute( "selected" , "true" );
// remember the selected item so we can deselect it
oeTimePicker.gSelectedHourItem = hourItem;
}
/**
* Helper function to select an minute item
*/
oeTimePicker.selectMinuteItem = function( minuteItem )
{
// clear old selection, if there is one
if( oeTimePicker.gSelectedMinuteItem != null )
{
oeTimePicker.gSelectedMinuteItem.setAttribute( "selected" , "false" );
}
// set selected attribute, to cause the selected style to apply
minuteItem.setAttribute( "selected" , "true" );
// remember the selected item so we can deselect it
oeTimePicker.gSelectedMinuteItem = minuteItem;
}
/**
* Helper function to calulate the nearset even five minutes
*/
oeTimePicker.calcNearestFiveMinutes = function( time )
{
var minutes = time.getMinutes();
var minutesByFive = Math.round( minutes / 5 ) * 5;
if( minutesByFive > 59 )
{
minutesByFive = 55;
}
return minutesByFive;
}
/**
* Helper function to work out if the 24-hour time is AM or PM
*/
oeTimePicker.isTimeAm = function( time )
{
var currentHour = time.getHours( );
if( currentHour >= 12 )
{
return false;
}
else
{
return true;
}
}

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

@ -0,0 +1,84 @@
<?xml version="1.0"?>
<!--
- 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 OEone Corporation are Copyright (C) 2001
- OEone Corporation. All Rights Reserved.
-
- Contributor(s): Garth Smedley (garths@oeone.com) , Mike Potter (mikep@oeone.com)
-
- Alternatively, the contents of this file may be used under the terms of
- either the GNU General Public License Version 2 or later (the "GPL"), or
- the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- in which case the provisions of the GPL or the LGPL are applicable instead
- of those above. If you wish to allow use of your version of this file only
- under the terms of either the GPL or the LGPL, and not to allow others to
- use your version of this file under the terms of the MPL, indicate your
- decision by deleting the provisions above and replace them with the notice
- and other provisions required by the 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.
-
- -->
<?xml-stylesheet href="chrome://global/skin/global.css" type="text/css"?>
<!-- CSS File with all styles specific to the unifinder -->
<?xml-stylesheet href="chrome://penglobal/content/unifinderxul.css" type="text/css"?>
<?xml-stylesheet href="chrome://penglobal/skin/unifinder/unifinder.css" type="text/css"?>
<!-- DTD File with all strings specific to the unifinder -->
<!DOCTYPE window
[
<!ENTITY % dtd1 SYSTEM "chrome://penglobal/locale/global.dtd" > %dtd1;
<!ENTITY % dtd2 SYSTEM "chrome://penglobal/locale/unifinder.dtd" > %dtd2;
]>
<overlay
id="unifinder-overlay"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<vbox id="unifinder-categories-box" >
<vbox id="unifinder-categories-content-box" flex="1" >
<tree id="unifinder-categories-tree" class="unifinder-tree-class" flex="1" >
<treechildren id="unifinder-categories-tree-children" flex="1"/>
</tree>
</vbox>
</vbox>
<tree id="unifinder-search-results-tree" class="unifinder-tree-class" >
<treecols>
<treecol flex="1" />
</treecols>
<treechildren id="unifinder-search-results-tree-children" flex="1"/>
</tree>
<splitter id="unifinder-splitter" collapse="before" persist="state hidden collapsed"
class="chromeclass-extrachrome sidebar-splitter" autostretch="never"
orient="vertical">
<grippy class="sidebar-splitter-grippy"/>
</splitter>
</overlay>

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

@ -0,0 +1,63 @@
/*
* 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 Corporation.
*
* The Initial Developer of the Original Code is
* OEone Corporation.
* Portions created by OEone Corporation are Copyright (C) 2001
* OEone Corporation. 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.
*
*
*/
// U N I F I N D E R -------------------------------------
function unifinderInit()
{
}
function unifinderSelectTab( tabid )
{
var unifinderList = document.getElementsByTagName("unifinder");
if( unifinderList.length > 0 )
{
var unifinder = unifinderList[0];
var newTab = document.getElementById( tabid );
if( newTab )
{
unifinder.selectedTab = newTab;
}
}
}

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

@ -0,0 +1,172 @@
<?xml version="1.0"?>
<!--
- 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 OEone Corporation are Copyright (C) 2001
- OEone Corporation. 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.
-
- -->
<!DOCTYPE window [
<!ENTITY % dtd1 SYSTEM "chrome://penglobal/locale/unifinder.dtd" > %dtd1;
]>
<bindings id="unifinderBindings"
xmlns="http://www.mozilla.org/xbl"
xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<binding id="unifinder-base">
<resources>
<stylesheet src="chrome://penglobal/skin/unifinder/unifinder.css"/>
</resources>
</binding>
<binding id="unifinder" extends="chrome://penglobal/content/unifinderBindings.xml#unifinder-base">
<content orient="vertical">
<xul:box orient="vertical" class="unifinder-internal-box" flex="1" >
<xul:box orient="horizontal" class="unifinder-top-box" >
<xul:toolbox class="unifinder-toolbox" flex="1">
<xul:toolbar id="unifinder-toolbar" flex="1">
<xul:box>
<children includes="unifinder-button" />
</xul:box>
<spring flex="1"/>
<xul:unifinder-button class="unifinder-menu-box unifinder-options-button-1" inherits="popup=menu-popup"/>
</xul:toolbar>
</xul:toolbox>
</xul:box>
<xul:tabbox class="unifinder-tab-box" unifinder-tab-box="true" orient="vertical" flex="1" >
<children includes="tabs"/>
<xul:spring class="unifinder-tabs-spacer" />
<children includes="tabpanels"/>
</xul:tabbox>
</xul:box>
</content>
<implementation>
<property name="selectedTab">
<setter>
<![CDATA[
var tabsItem = this.getTabsItem();
if( tabsItem )
{
tabsItem.selectedTab = val;
return val;
}
else
{
return null;
}
]]>
</setter>
<getter>
<![CDATA[
var tabsItem = this.getTabsItem();
if( tabsItem )
{
return tabsItem.selectedTab;
}
else
{
return null;
}
]]>
</getter>
</property>
<method name="getTabsItem">
<body>
<![CDATA[
var tabsList = document.getElementsByTagName( "tabs" );
for( var i = 0; i < tabsList.length; ++i )
{
if( this === tabsList[i].parentNode )
return tabsList[i];
}
return null;
]]>
</body>
</method>
</implementation>
</binding>
<binding id="unifinder-search-controls" extends="chrome://penglobal/content/unifinderBindings.xml#unifinder-base">
<content orient="horizontal">
<xul:hbox valign="middle" align="left" autostretch="never">
<xul:label for="unifinder-search-field" value="&unifinder.search.options.searchfor;" />
<xul:textbox class="dialog-field" id="unifinder-search-field"
inherits="onkeypress=keypressfunction" flex="1"/>
</xul:hbox>
</content>
</binding>
<binding id="unifinder-history-controls" extends="chrome://penglobal/content/unifinderBindings.xml#unifinder-base">
<content orient="horizontal">
<xul:hbox class="unifinder-sub-control-box-class" align="left" valign="middle" autostretch="never">
<xul:label for="unifinder-history-menu" value="&unifinder.history.options.documentsused;"/>
<xul:menulist class="dialog-field" label="&unifinder.history.menu.today;" data="day" >
<xul:menupopup >
<xul:menuitem label="&unifinder.history.menu.today;" value="day"/>
<xul:menuitem label="&unifinder.history.menu.thisweek;" value="week"/>
<xul:menuitem label="&unifinder.history.menu.thismonth;" value="month"/>
<xul:menuitem label="&unifinder.history.menu.thisyear;" value="year"/>
</xul:menupopup>
</xul:menulist>
</xul:hbox>
</content>
</binding>
<binding id="unifinder-button-base" extends="xul:button">
<resources>
<stylesheet src="chrome://penglobal/skin/unifinder/unifinder.css"/>
</resources>
<content orient="vertical">
<xul:unifinder-image-button class="unifinder-button-image" unifinder-button-part="button" />
<xul:unifinder-image-button class="unifinder-button-text" unifinder-button-part="text" />
</content>
</binding>
</bindings>

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

@ -0,0 +1,59 @@
/*
* 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 Corporation.
*
* The Initial Developer of the Original Code is
* OEone Corporation.
* Portions created by OEone Corporation are Copyright (C) 2001
* OEone Corporation. 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.
*
*
*/
/******* unifinder *******/
unifinder {
-moz-binding: url("chrome://penglobal/content/unifinderBindings.xml#unifinder");
}
unifinder-search-controls {
-moz-binding: url("chrome://penglobal/content/unifinderBindings.xml#unifinder-search-controls");
}
unifinder-history-controls {
-moz-binding: url("chrome://penglobal/content/unifinderBindings.xml#unifinder-history-controls");
}
unifinder-button{
-moz-binding: url("chrome://penglobal/content/unifinderBindings.xml#unifinder-button-base");
}
unifinder-image-button{
-moz-binding : url("chrome://calendar/content/penBindings.xml#penButton");
}

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

@ -0,0 +1,49 @@
<!--
- 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 OEone Corporation are Copyright (C) 2001
- OEone Corporation. 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.
-
- -->
<html>
<head>
<title>JsUnit Test Suite</title>
<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://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>

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

@ -0,0 +1,51 @@
/*
* 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 Corporation.
*
* The Initial Developer of the Original Code is
* OEone Corporation.
* Portions created by OEone Corporation are Copyright (C) 2001
* OEone Corporation. 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.
*
*
*/
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;
}

Разница между файлами не показана из-за своего большого размера Загрузить разницу

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

@ -0,0 +1,70 @@
<!--
- 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 OEone Corporation are Copyright (C) 2001
- OEone Corporation. 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.
-
- -->
<?xml version="1.0"?>
<?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://penglobal/content/dateUtils.js"/>
<script type="application/x-javascript" src="chrome://penglobal/content/ParseUtils.js"></script>
<script type="application/x-javascript" src="chrome://penglobal/content/calendarEvent.js"></script>
<script type="application/x-javascript" src="chrome://calendar/content/test/testCalendarEvent.js"></script>
<html> Calendar Event Testing </html>
</window>

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

@ -0,0 +1,97 @@
<?xml version="1.0"?>
<!--
- 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 OEone Corporation are Copyright (C) 2001
- OEone Corporation. All Rights Reserved.
-
- Contributor(s): Garth Smedley (garths@oeone.com), Mike Potter (mikep@oeone.com)
-
- Alternatively, the contents of this file may be used under the terms of
- either the GNU General Public License Version 2 or later (the "GPL"), or
- the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- in which case the provisions of the GPL or the LGPL are applicable instead
- of those above. If you wish to allow use of your version of this file only
- under the terms of either the GPL or the LGPL, and not to allow others to
- use your version of this file under the terms of the MPL, indicate your
- decision by deleting the provisions above and replace them with the notice
- and other provisions required by the 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.
-
- -->
<?xml-stylesheet href="chrome://global/skin/global.css" type="text/css"?>
<!-- CSS File with all styles specific to the unifinder -->
<?xml-stylesheet href="chrome://penglobal/skin/unifinder/unifinder.css" ?>
<!-- DTD File with all strings specific to the unifinder -->
<!DOCTYPE window
[
<!ENTITY % dtd1 SYSTEM "chrome://penglobal/locale/global.dtd" > %dtd1;
<!ENTITY % dtd2 SYSTEM "chrome://penglobal/locale/unifinder.dtd" > %dtd2;
<!ENTITY % dtd3 SYSTEM "chrome://calendar/locale/calendar.dtd" > %dtd3;
]>
<?xul-overlay href="chrome://penglobal/content/unifinder-overlay.xul"?>
<overlay
id="unifinder-overlay"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<!-- Javascript includes -->
<unifinder id="calendar-unifinder-overlay">
<tabbox orient="vertical" flex="1">
<toolbar id="unifinder-toolbar">
<!--
<unifinder-button class="unifinder-new-category-button" tooltip="aTooltip" tooltiptext="&unifinder.toolbar.newfolder.tooltip;" oncommand="unifinderNewCategoryCommand()" />
-->
<unifinder-button class="unifinder-remove-button" tooltip="aTooltip" tooltiptext="&calendar.tools.delete.tooltip;" oncommand="unifinderRemoveCommand()" />
<unifinder-button class="unifinder-modify-button" tooltip="aTooltip" tooltiptext="&calendar.tools.modify.tooltip;" oncommand="unifinderModifyCommand()" />
</toolbar>
<tabs class="unifinder-tab" orient="horizontal" >
<tab label="&calendar.main.tab.label;" />
<tab label="&unifinder.tab.search.label;" />
</tabs>
<tabpanels flex="1">
<box>
<vbox id="unifinder-categories-box" flex="1"/>
</box>
<box flex="1">
<vbox flex="1" >
<unifinder-search-controls keypressfunction="unifinderSearchKeyPress( this, event )" />
<tree id="unifinder-search-results-tree" flex="1" />
</vbox>
</box>
</tabpanels>
</tabbox>
</unifinder>
</overlay>

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

@ -0,0 +1,566 @@
/*
* 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 Corporation.
*
* The Initial Developer of the Original Code is
* OEone Corporation.
* Portions created by OEone Corporation are Copyright (C) 2001
* OEone Corporation. All Rights Reserved.
*
* Contributor(s): Garth Smedley (garths@oeone.com) , Mike Potter (mikep@oeone.com)
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
*
*/
/*-----------------------------------------------------------------
* U N I F I N D E R
*
* This is a hacked in interface to the unifinder. We will need to
* improve this to make it usable in general.
*/
var gSearchEventTable = new Array();
var gDateFormater = new DateFormater();
var gUnifinderSelection = null;
/**
* Observer for the calendar event data source. This keeps the unifinder
* display up to date when the calendar event data is changed
*/
var unifinderEventDataSourceObserver =
{
onLoad : function()
{
unifinderRefesh();
},
onAddItem : function( calendarEvent )
{
if( calendarEvent )
{
unifinderRefesh();
}
},
onModifyItem : function( calendarEvent )
{
if( calendarEvent )
{
unifinderRefesh();
}
},
onDeleteItem : function( calendarEvent )
{
unifinderRefesh();
},
};
/**
* Called when the calendar is loaded
*/
function prepareCalendarUnifinder( eventSource )
{
// tell the unifinder to get ready
unifinderInit();
// set up our calendar event observer
eventSource.addObserver( unifinderEventDataSourceObserver );
}
/**
* Called when the calendar is unloaded
*/
function finishCalendarUnifinder( eventSource )
{
eventSource.removeObserver( unifinderEventDataSourceObserver );
}
/**
* Helper function to display event dates in the unifinder
*/
function formatUnifinderEventDate( date )
{
var monthDayString = gDateFormater.getFormatedDate( date );
return monthDayString + ", " + date.getFullYear();
}
/**
* Helper function to display event times in the unifinder
*/
function formatUnifinderEventTime( time )
{
var timeString = gDateFormater.getFormatedTime( time );
return timeString;
}
/**
* Called by event observers to update the display
*/
function unifinderRefesh()
{
var eventTable = gEventSource.getAllEvents();
refreshCategoriesTree( eventTable );
refreshSearchTree( eventTable );
unifinderSearchKeyPress( document.getElementById( 'unifinder-search-field' ), null );
}
/**
* Redraw the event tree
*/
function refreshCategoriesTree( eventTable )
{
refreshEventTree( eventTable, "unifinder-categories-tree-children" );
}
/**
* Redraw the search tree
*/
function refreshSearchTree( SearchEventTable )
{
gSearchEventTable = SearchEventTable;
refreshSearchEventTree( gSearchEventTable, "unifinder-search-results-tree-children" );
}
/**
* This is attached to the ondblclik attribute of the events shown in the unifinder
*/
function unifinderDoubleClickEvent( id )
{
// find event by id
var calendarEvent = gEventSource.getCalendarEventById( id );
if( calendarEvent != null )
{
// go to day view, of the day of the event, select the event
//gCalendarWindow.dayView.clickEventBox( calendarEvent );
editEvent( calendarEvent );
}
}
/**
* This is attached to the onclik attribute of the events shown in the unifinder
*/
function unifinderClickEvent( id, event )
{
gUnifinderSelection = id;
var calendarEvent = gEventSource.getCalendarEventById( id );
var eventBox = gCalendarWindow.currentView.getVisibleEvent( calendarEvent );
if ( eventBox )
{
//the event box exists, so the event is visible.
gCalendarWindow.currentView.clickEventBox( eventBox, event );
}
else //else we go to the day
{
gCalendarWindow.currentView.clearSelectedDate( );
gCalendarWindow.setSelectedEvent( calendarEvent );
gCalendarWindow.currentView.goToDay( calendarEvent.start, true);
var eventBox = gCalendarWindow.currentView.getVisibleEvent( calendarEvent );
gCalendarWindow.currentView.clickEventBox( eventBox, event );
}
}
/**
* This is called from the unifinder's modify command
*/
function unifinderModifyCommand()
{
var SelectedItem = document.getElementById( "unifinder-categories-tree" ).selectedItems.item(0);
if( SelectedItem )
{
if( SelectedItem.getAttribute( "container" ) == "true" )
{
launchEditCategoryDialog( SelectedItem.categoryobject );
}
else
{
if( gUnifinderSelection != null )
{
var calendarEvent = gEventSource.getCalendarEventById( gUnifinderSelection );
if( calendarEvent != null )
{
editEvent( calendarEvent );
}
}
}
}
}
/**
* This is called from the unifinder's remove command
*/
function unifinderRemoveCommand()
{
var SelectedItem = document.getElementById( "unifinder-categories-tree" ).selectedItems[0];
if( SelectedItem )
{
if ( SelectedItem.getAttribute( "container" ) == "true" )
{
if ( confirm( "Are you sure you want to delete this category?" ) )
{
gCategoryManager.deleteCategory( SelectedItem.categoryobject );
}
}
else
{
if( gUnifinderSelection != null )
{
var calendarEvent = gEventSource.getCalendarEventById( gUnifinderSelection );
if( calendarEvent != null )
{
if ( confirm( confirmDeleteEvent+" "+calendarEvent.title+"?" ) ) {
gEventSource.deleteEvent( calendarEvent );
}
}
}
}
}
}
/**
* This is called from the unifinder when a key is pressed in the search field
*/
function unifinderSearchKeyPress( searchTextItem, event )
{
var searchText = searchTextItem.value;
if ( searchTextItem.value == '' )
{
gSearchEventTable = gEventSource.getAllEvents();
}
else if ( searchTextItem.value == " " )
{
searchTextItem.value = '';
}
else
{
var FieldsToSearch = new Array( "title", "description", "location" );
gSearchEventTable = gEventSource.search( searchText, FieldsToSearch );
}
refreshSearchTree( gSearchEventTable );
}
/**
* Redraw the unifinder tree, either search or categories
*/
function refreshSearchEventTree( eventArray, childrenName )
{
// get the old tree children item and remove it
var oldTreeChildren = document.getElementById( childrenName );
var parent = oldTreeChildren.parentNode;
oldTreeChildren.parentNode.removeChild( oldTreeChildren );
// make a new treechildren item
var treeChildren = document.createElement( "treechildren" );
treeChildren.setAttribute( "id" , childrenName );
treeChildren.setAttribute( "flex" , "1" );
// add: tree item, row, cell, box and text items for every event
for( var index = 0; index < eventArray.length; ++index )
{
var calendarEvent = eventArray[ index ];
// make the items
var treeItem = document.createElement( "treeitem" );
treeItem.setAttribute( "id", "search-unifinder-treeitem-"+calendarEvent.id );
treeItem.setAttribute( "ondblclick" , "unifinderDoubleClickEvent(" + calendarEvent.id + ")" );
treeItem.setAttribute( "onclick" , "unifinderClickEvent(" + calendarEvent.id + ")" );
treeItem.setAttribute( "flex", "1" );
var treeRow = document.createElement( "treerow" );
treeRow.setAttribute( "flex", "1" );
var treeCell = document.createElement( "treecell" );
treeCell.setAttribute( "flex" , "1" );
treeCell.setAttribute( "crop", "right" );
var treeCellBox = document.createElement( "vbox" );
treeCellBox.setAttribute( "class" , "unifinder-treecell-box-class" );
treeCellBox.setAttribute( "flex" , "1" );
treeCellBox.setAttribute( "id", "search-unifinder-treecell-box" );
treeCellBox.setAttribute( "crop", "right" );
var text1 = document.createElement( "text" );
text1.setAttribute( "class", "calendar-unifinder-event-text" );
text1.setAttribute( "crop", "right" );
var text2 = document.createElement( "text" );
text1.setAttribute( "class", "calendar-unifinder-event-text" );
text1.setAttribute( "crop", "right" );
// set up the display and behaviour of the tree items
// set the text of the two text items
text1.setAttribute( "value" , calendarEvent.title );
var startDate = formatUnifinderEventDate( calendarEvent.start );
var startTime = formatUnifinderEventTime( calendarEvent.start );
var endTime = formatUnifinderEventTime( calendarEvent.end );
if( calendarEvent.allDay )
{
text2.setAttribute( "value" , "All day on " + startDate + "" );
}
else
{
text2.setAttribute( "value" , startDate + " " + startTime + " - " + endTime );
}
// add the items
treeChildren.appendChild( treeItem );
treeItem.appendChild( treeRow );
treeRow.appendChild( treeCell );
treeCell.appendChild( treeCellBox );
if ( calendarEvent.title )
{
treeCellBox.appendChild( text1 );
}
treeCellBox.appendChild( text2 );
}
// add the treeChildren item to the tree
parent.appendChild( treeChildren );
}
/**
* Redraw the categories unifinder tree
*/
function refreshEventTree( eventArray, childrenName )
{
// get the old tree children item and remove it
var oldTreeChildren = document.getElementById( childrenName );
var parent = oldTreeChildren.parentNode;
oldTreeChildren.parentNode.removeChild( oldTreeChildren );
//add the categories to the tree first.
// make a new treechildren item
var catTreeChildren = document.createElement( "treechildren" );
catTreeChildren.setAttribute( "id", childrenName );
catTreeChildren.setAttribute( "flex", "1" );
/* WE HAVE NO CATEGORIES RIGHT NOW
Categories = gCategoryManager.getAllCategories();
for ( i in Categories )
{
var ThisCategory = Categories[i];
var catTreeItem = document.createElement( "treeitem" );
catTreeItem.setAttribute( "container", "true" );
catTreeItem.categoryobject = ThisCategory;
//catTreeItem.setAttribute( "id", "catitem"+Categories[i].id );
var catTreeRow = document.createElement( "treerow" );
var catTreeCell = document.createElement( "treecell" );
catTreeCell.setAttribute( "class", "treecell-indent" );
catTreeCell.setAttribute( "label", ThisCategory.name );
thisCatChildren = document.createElement( "treechildren" );
thisCatChildren.setAttribute( "id", "catchild"+ThisCategory.id );
catTreeRow.appendChild( catTreeCell );
catTreeItem.appendChild( catTreeRow );
catTreeItem.appendChild( thisCatChildren );
catTreeChildren.appendChild( catTreeItem );
}
*/
parent.appendChild( catTreeChildren );
// add: tree item, row, cell, box and text items for every event
for( var index = 0; index < eventArray.length; ++index )
{
var calendarEvent = eventArray[ index ];
// make the items
var treeItem = document.createElement( "treeitem" );
treeItem.setAttribute( "id", "unifinder-treeitem-"+calendarEvent.id );
treeItem.setAttribute( "ondblclick" , "unifinderDoubleClickEvent(" + calendarEvent.id + ")" );
treeItem.setAttribute( "onclick" , "unifinderClickEvent(" + calendarEvent.id + ")" );
var treeRow = document.createElement( "treerow" );
treeRow.setAttribute( "flex", "1" );
var treeCell = document.createElement( "treecell" );
treeCell.setAttribute( "flex" , "1" );
treeCell.setAttribute( "crop", "right" );
var image = document.createElement( "image" );
if ( calendarEvent.alarm )
{
var imageSrc = "chrome://calendar/skin/event_alarm.png";
}
else
{
var imageSrc = "chrome://calendar/skin/event.png";
}
image.setAttribute( "src", imageSrc );
var treeCellHBox = document.createElement( "hbox" );
/*
** HACK!
** There is a mysterious child of the HBox, with a flex of one, so set the flex on the HBox really high to hide the child.
*/
treeCellHBox.setAttribute( "flex" , "1000" );
treeCellHBox.setAttribute( "id", "unifinder-treecell-box" );
treeCellHBox.setAttribute( "crop", "right" );
var treeCellVBox = document.createElement( "vbox" );
treeCellVBox.setAttribute( "crop", "right" );
treeCellVBox.setAttribute( "flex", "1" );
var text1 = document.createElement( "text" );
//text1.setAttribute( "class", "calendar-unifinder-event-text" );
text1.setAttribute( "crop", "right" );
var text2 = document.createElement( "text" );
//text2.setAttribute( "class", "calendar-unifinder-event-text" );
text2.setAttribute( "crop", "right" );
// set up the display and behaviour of the tree items
// set the text of the two text items
text1.setAttribute( "value" , calendarEvent.title );
var startDate = formatUnifinderEventDate( calendarEvent.start );
var startTime = formatUnifinderEventTime( calendarEvent.start );
var endTime = formatUnifinderEventTime( calendarEvent.end );
if( calendarEvent.allDay )
{
text2.setAttribute( "value" , "All day on " + startDate + "" );
}
else
{
text2.setAttribute( "value" , startDate + " " + startTime + " - " + endTime );
}
//find the parent category treeitem.
var treeChild = document.getElementById( "catchild"+calendarEvent.category );
if ( treeChild )
{
treeChild.appendChild( treeItem );
//treeCell.setAttribute( "class", "calendar-unifinder-event-indent" );
}
//otherwise append it to the root node.
else
{
catTreeChildren.appendChild( treeItem );
}
// add the items
if ( calendarEvent.title )
{
treeCellVBox.appendChild( text1 );
}
treeCellVBox.appendChild( text2 );
treeCellHBox.appendChild( image );
treeCellHBox.appendChild( treeCellVBox );
treeCell.appendChild( treeCellHBox );
treeRow.appendChild( treeCell );
treeItem.appendChild( treeRow );
}
}

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

@ -0,0 +1,700 @@
/*
* 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 Corporation.
*
* The Initial Developer of the Original Code is
* OEone Corporation.
* Portions created by OEone Corporation are Copyright (C) 2001
* OEone Corporation. All Rights Reserved.
*
* Contributor(s): Garth Smedley (garths@oeone.com) , Mike Potter (mikep@oeone.com)
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
*
*/
/*-----------------------------------------------------------------
* WeekView Class subclass of CalendarView
*
* Calendar week view class :TODO: display of events has not been started
*
* PROPERTIES
* gHeaderDateItemArray - Array of text boxes used to display the dates of the currently displayed
* week.
*
*
*/
// Make WeekView inherit from CalendarView
WeekView.prototype = new CalendarView();
WeekView.prototype.constructor = WeekView;
/**
* WeekView Constructor.
*
* PARAMETERS
* calendarWindow - the owning instance of CalendarWindow.
*
*/
function WeekView( calendarWindow )
{
// call super
this.superConstructor( calendarWindow );
// get week view header items
gHeaderDateItemArray = new Array();
this.selectedEventBoxes = new Array();
for( var dayIndex = 1; dayIndex <= 7; ++dayIndex )
{
var headerDateItem = document.getElementById( "week-header-date-" + dayIndex );
gHeaderDateItemArray[ dayIndex ] = headerDateItem;
}
}
/** PUBLIC
*
* Redraw the events for the current week
*/
WeekView.prototype.refreshEvents = function( )
{
this.kungFooDeathGripOnEventBoxes = new Array();
var eventBoxList = document.getElementsByAttribute( "eventbox", "weekview" );
for( var eventBoxIndex = 0; eventBoxIndex < eventBoxList.length; ++eventBoxIndex )
{
var eventBox = eventBoxList[ eventBoxIndex ];
eventBox.parentNode.removeChild( eventBox );
}
for( var dayIndex = 1; dayIndex <= 7; ++dayIndex )
{
var headerDateItem = document.getElementById( "week-header-date-" + dayIndex );
headerDateItem.numEvents = 0;
}
//get the all day box.
var AllDayBox = document.getElementById( "week-view-all-day-content-box" );
AllDayBox.setAttribute( "collapsed", "true" );
//expand the day's content box by setting allday to false..
document.getElementById( "week-view-content-box" ).setAttribute( "allday", "false" );
//START FOR LOOP FOR DAYS--->
for ( dayIndex = 1; dayIndex <= 7; ++dayIndex )
{
//make the text node that will contain the text for the all day box.
var TextNode = document.getElementById( "all-day-content-box-text-week-"+dayIndex );
//set the seperator to nothing. After the first one, we'll change it to ", " so that we add commas between text.
var Seperator = "";
// get the events for the day and loop through them
dayToGet = new Date( gHeaderDateItemArray[dayIndex].getAttribute( "date" ) );
var dayEventList = new Array();
dayEventList = this.calendarWindow.eventSource.getEventsForDay( dayToGet );
//refresh the array and the current spot.
for ( i = 0; i < dayEventList.length; i++ )
{
dayEventList[i].OtherSpotArray = new Array('0');
dayEventList[i].CurrentSpot = 0;
dayEventList[i].NumberOfSameTimeEvents = 0;
}
for ( i = 0; i < dayEventList.length; i++ )
{
var calendarEvent = dayEventList[i];
//check to make sure that the event is not an all day event...
if ( calendarEvent.allDay != true )
{
//see if there's another event at the same start time.
for ( j = 0; j < dayEventList.length; j++ )
{
thisCalendarEvent = dayEventList[j];
//if this event overlaps with another event...
if ( ( ( thisCalendarEvent.displayDate >= calendarEvent.displayDate &&
thisCalendarEvent.displayDate < calendarEvent.end ) ||
( calendarEvent.displayDate >= thisCalendarEvent.displayDate &&
calendarEvent.displayDate < thisCalendarEvent.end ) ) &&
calendarEvent.id != thisCalendarEvent.id )
{
//get the spot that this event will go in.
var ThisSpot = thisCalendarEvent.CurrentSpot;
calendarEvent.OtherSpotArray.push( ThisSpot );
ThisSpot++;
if ( ThisSpot > calendarEvent.CurrentSpot )
{
calendarEvent.CurrentSpot = ThisSpot;
}
}
}
SortedOtherSpotArray = new Array();
SortedOtherSpotArray = calendarEvent.OtherSpotArray.sort( gCalendarWindow.compareNumbers);
LowestNumber = this.calendarWindow.getLowestElementNotInArray( SortedOtherSpotArray );
//this is the actual spot (0 -> n) that the event will go in on the day view.
calendarEvent.CurrentSpot = LowestNumber;
if ( SortedOtherSpotArray.length > 4 )
{
calendarEvent.NumberOfSameTimeEvents = 4;
}
else
{
calendarEvent.NumberOfSameTimeEvents = SortedOtherSpotArray.length;
}
dayEventList[i] = calendarEvent;
}
}
var ThisDayAllDayBox = document.getElementById( "all-day-content-box-week-"+dayIndex );
while ( ThisDayAllDayBox.hasChildNodes() )
{
ThisDayAllDayBox.removeChild( ThisDayAllDayBox.firstChild );
}
for ( var eventIndex = 0; eventIndex < dayEventList.length; ++eventIndex )
{
var calendarEvent = dayEventList[ eventIndex ];
var eventDate = calendarEvent.start;
// get the day box for the calendarEvent's day
var eventDayInMonth = eventDate.getDate();
var weekBoxItem = gHeaderDateItemArray[ dayIndex ];
// Display no more than three, show dots for the events > 3
if ( calendarEvent.allDay != true )
{
weekBoxItem.numEvents += 1;
}
//if its an all day event, don't show it in the hours bulletin board.
if ( calendarEvent.allDay == true )
{
// build up the text to show for this event
var eventText = calendarEvent.title;
if( calendarEvent.location )
{
eventText += " " + calendarEvent.location;
}
if( calendarEvent.description )
{
eventText += " " + calendarEvent.description;
}
//show the all day box
AllDayBox.setAttribute( "collapsed", "false" );
//shrink the day's content box.
document.getElementById( "week-view-content-box" ).setAttribute( "allday", "true" );
//note the use of the WeekViewAllDayText Attribute.
//This is used to remove the text when the day is changed.
SeperatorNode = document.createElement( "text" );
SeperatorNode.setAttribute( "value", Seperator );
SeperatorNode.setAttribute( "WeekViewAllDayText", "true" );
newHTMLNode = document.createElement( "html" );
newTextNode = document.createTextNode( eventText );
//newTextNode.setAttribute( "value", eventText );
newHTMLNode.appendChild( newTextNode );
newHTMLNode.setAttribute( "WeekViewAllDayText", "true" );
newImage = document.createElement("image");
newImage.setAttribute( "src", "chrome://calendar/skin/all_day_event.png" );
newImage.setAttribute( "WeekViewAllDayText", "true" );
newImage.calendarEvent = calendarEvent;
newImage.setAttribute( "onmouseover", "gCalendarWindow.mouseOverInfo( calendarEvent, event )" );
newImage.setAttribute( "tooltip", "savetip" );
//ThisDayAllDayBox.appendChild( SeperatorNode );
ThisDayAllDayBox.appendChild( newImage );
//ThisDayAllDayBox.appendChild( newHTMLNode );
//change the seperator to add commas after the text.
Seperator = ", ";
}
else if ( calendarEvent.CurrentSpot <= 4 )
{
eventBox = this.createEventBox( calendarEvent, dayIndex );
//add the box to the bulletin board.
document.getElementById( "week-view-content-board" ).appendChild( eventBox );
}
}
}
//--> END THE FOR LOOP FOR THE WEEK VIEW
var selectedEvent = this.calendarWindow.getSelectedEvent();
//if the selected event is today, highlight it. Otherwise, don't highlight anything.
if ( selectedEvent )
{
this.selectEvent( selectedEvent );
}
}
/** PRIVATE
*
* This creates an event box for the day view
*/
WeekView.prototype.createEventBox = function ( calendarEvent, dayIndex )
{
// build up the text to show for this event
var eventText = calendarEvent.title;
var eventStartDate = calendarEvent.displayDate;
var startHour = eventStartDate.getHours();
var startMinutes = eventStartDate.getMinutes();
var eventEndDate = calendarEvent.end;
var endHour = eventEndDate.getHours();
var eventEndDateTime = new Date( 2000, 1, 1, eventEndDate.getHours(), eventEndDate.getMinutes(), 0 );
var eventStartDateTime = new Date( 2000, 1, 1, eventStartDate.getHours(), eventStartDate.getMinutes(), 0 );
var eventDuration = new Date( eventEndDateTime - eventStartDateTime );
var hourDuration = eventDuration / (3600000);
var eventBox = document.createElement( "vbox" );
eventBox.calendarEvent = calendarEvent;
var Height = ( hourDuration * kWeekViewHourHeight ) + 1;
var Width = ( 80 / calendarEvent.NumberOfSameTimeEvents ) - 1;
eventBox.setAttribute( "height", Height );
eventBox.setAttribute( "width", Width );
top = eval( ( startHour*kWeekViewHourHeight ) + ( ( startMinutes/60 ) * kWeekViewHourHeight ) - kWeekViewHourHeightDifference );
eventBox.setAttribute( "top", top );
left = eval( kWeekViewHourLeftStart + ( kWeekViewHourWidth * ( dayIndex - 1 ) ) + ( ( calendarEvent.CurrentSpot - 1 ) * eventBox.getAttribute( "width" ) ) + 1 );
eventBox.setAttribute( "left", left );
eventBox.setAttribute( "class", "week-view-event-class" );
eventBox.setAttribute( "style", "max-width: "+Width+"; max-height: "+Height+";" );
eventBox.setAttribute( "flex", "0" );
eventBox.setAttribute( "eventbox", "weekview" );
eventBox.setAttribute( "onclick", "weekEventItemClick( this, event )" );
eventBox.setAttribute( "ondblclick", "weekEventItemDoubleClick( this, event )" );
eventBox.setAttribute( "id", "week-view-event-box-"+calendarEvent.id );
eventBox.setAttribute( "name", "week-view-event-box-"+calendarEvent.id );
eventBox.setAttribute( "onmouseover", "gCalendarWindow.mouseOverInfo( calendarEvent, event )" );
eventBox.setAttribute( "tooltip", "savetip" );
/*
** REMOVE THE EVENT TEXT FOR NOW
**
** THIS REQUIRES THE DESCRIPTION XUL ELEMENT, WHICH WE MISSED BY 9 DAYS FOR BETA
*/
var eventDescriptionElement = document.createElement( "description" );
eventDescriptionElement.value = "This is my new text";
var DescriptionText = document.createTextNode( "This is my new text" );
eventDescriptionElement.appendChild( DescriptionText );
//eventDescriptionElement.setAttribute( "style", "border: 1px solid red; min-height: "+Height+"; max-height: "+Height+"; overflow: never;" );
eventDescriptionElement.crop = "end";
eventBox.appendChild( eventDescriptionElement );
// add a property to the event box that holds the calendarEvent that the
// box represents
this.kungFooDeathGripOnEventBoxes.push( eventBox );
return( eventBox );
}
/** PUBLIC
*
* Called when the user switches to a different view
*/
WeekView.prototype.switchFrom = function( )
{
}
/** PUBLIC
*
* Called when the user switches to the week view
*/
WeekView.prototype.switchTo = function( )
{
// disable/enable view switching buttons
var weekViewButton = document.getElementById( "calendar-week-view-button" );
var monthViewButton = document.getElementById( "calendar-month-view-button" );
var dayViewButton = document.getElementById( "calendar-day-view-button" );
monthViewButton.setAttribute( "disabled", "false" );
weekViewButton.setAttribute( "disabled", "true" );
dayViewButton.setAttribute( "disabled", "false" );
// switch views in the deck
var calendarDeckItem = document.getElementById( "calendar-deck" );
calendarDeckItem.setAttribute( "index", 1 );
}
/** PUBLIC
*
* Redraw the display, but not the events
*/
WeekView.prototype.refreshDisplay = function( )
{
// Set the from-to title string, based on the selected date
var viewDay = this.calendarWindow.getSelectedDate().getDay();
var viewDayOfMonth = this.calendarWindow.getSelectedDate().getDate();
var viewMonth = this.calendarWindow.getSelectedDate().getMonth();
var viewYear = this.calendarWindow.getSelectedDate().getFullYear();
var daysLeftInWeek = 6 - viewDay;
var dateOfLastDayInWeek = viewDayOfMonth + daysLeftInWeek;
var dateOfFirstDayInWeek = viewDayOfMonth - viewDay;
var firstDayOfWeek = new Date( viewYear, viewMonth, dateOfFirstDayInWeek );
var lastDayOfWeek = new Date( viewYear, viewMonth, dateOfLastDayInWeek );
var firstDayMonthName = this.calendarWindow.dateFormater.getMonthName( firstDayOfWeek.getMonth() );
var lastDayMonthName = this.calendarWindow.dateFormater.getMonthName( lastDayOfWeek.getMonth() );
var dateString = firstDayMonthName + " " + firstDayOfWeek.getDate() + " - " +
lastDayMonthName + " " + lastDayOfWeek.getDate();
var weekTextItem = document.getElementById( "week-title-text" );
weekTextItem.setAttribute( "value" , dateString );
// Set the dates in the header
var weekDate = new Date( viewYear, viewMonth, dateOfFirstDayInWeek );
for( var dayIndex = 1; dayIndex < gHeaderDateItemArray.length; ++dayIndex )
{
var dateOfDay = weekDate.getDate();
var headerDateItem = gHeaderDateItemArray[ dayIndex ];
headerDateItem.setAttribute( "value" , dateOfDay );
headerDateItem.setAttribute( "date", weekDate );
headerDateItem.numEvents = 0;
// advance to next day
weekDate.setDate( dateOfDay + 1 );
}
this.hiliteTodaysDate( );
}
/** PUBLIC
*
* Get the selected event and delete it.
*/
WeekView.prototype.deletedSelectedEvent = function( )
{
// :TODO:
}
/** PUBLIC
*
* This is called when we are about the make a new event
* and we want to know what the default start date should be for the event.
*/
WeekView.prototype.getNewEventDate = function( )
{
return this.calendarWindow.getSelectedDate();
}
/** PUBLIC
*
* Go to the next week.
*/
WeekView.prototype.goToNext = function()
{
var nextWeek = new Date( this.calendarWindow.selectedDate.getFullYear(), this.calendarWindow.selectedDate.getMonth(), this.calendarWindow.selectedDate.getDate() + 7 );
this.goToDay( nextWeek );
}
/** PUBLIC
*
* Go to the previous week.
*/
WeekView.prototype.goToPrevious = function()
{
var prevWeek = new Date( this.calendarWindow.selectedDate.getFullYear(), this.calendarWindow.selectedDate.getMonth(), this.calendarWindow.selectedDate.getDate() - 7 );
this.goToDay( prevWeek );
}
WeekView.prototype.getVisibleEvent = function( calendarEvent )
{
eventBox = document.getElementById( "week-view-event-box-"+calendarEvent.id );
if ( eventBox )
{
return eventBox;
}
else
return null;
}
/** PRIVATE
*
* Mark today as selected, also unmark the old today if there was one.
*/
WeekView.prototype.hiliteTodaysDate = function( )
{
//clear out the old today boxes.
var OldTodayArray = document.getElementsByAttribute( "today", "true" );
for ( i = 0; i < OldTodayArray.length; i++ )
{
OldTodayArray[i].setAttribute( "today", "false" );
}
// 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() )
{
//today is visible, get the day index for today
for ( dayIndex = 1; dayIndex <= 7; ++dayIndex )
{
ThisDate = new Date( gHeaderDateItemArray[dayIndex].getAttribute( "date" ) );
if ( ThisDate.getFullYear() == Today.getFullYear()
&& ThisDate.getMonth() == Today.getMonth()
&& ThisDate.getDay() == Today.getDay() )
{
break;
}
}
//dayIndex now contains the box numbers that we need.
for ( i = 0; i < 24; i++ )
{
document.getElementById( "week-tree-day-"+(dayIndex-1)+"-item-"+i ).setAttribute( "today", "true" );
}
}
}
/** PUBLIC
*
* clear the selected event by taking off the selected attribute.
*/
WeekView.prototype.clearSelectedEvent = function( )
{
Event = gCalendarWindow.getSelectedEvent();
//if there is an event, and if the event is in the current view.
if ( Event && document.getElementsByAttribute( "name", "week-view-event-box-"+Event.id ).length > 0 )
{
for ( i = 0; i < this.selectedEventBoxes.length; i++ )
{
this.selectedEventBoxes[i].setAttribute( "selected", "false" );
}
//document.getElementById( "week-view-event-box-"+Event.id ).setAttribute( "selected", false );
}
this.selectedEventBoxes = Array();
//clear the selection in the unifinder
deselectEventInUnifinder( );
}
/** PUBLIC -- monthview only
*
* Called when an event box item is single clicked
*/
WeekView.prototype.clickEventBox = function( eventBox, event )
{
// clear the old selected box
if( this.selectedEventBoxes.length > 0 )
{
this.clearSelectedEvent();
}
if( eventBox )
{
// select the event
this.selectEvent( eventBox.calendarEvent );
//set the selected date to the start date of this event.
this.calendarWindow.selectedDate.setDate( eventBox.calendarEvent.start.getDate() );
// mark new box as selected
var ArrayOfBoxes = document.getElementsByAttribute( "name", "week-view-event-box-"+eventBox.calendarEvent.id );
for ( i = 0; i < ArrayOfBoxes.length; i++ )
{
ArrayOfBoxes[i].setAttribute( "selected", "true" );
this.selectedEventBoxes[ this.selectedEventBoxes.length ] = ArrayOfBoxes[i];
}
//select the event in the unifinder
selectEventInUnifinder( eventBox.calendarEvent );
}
// Do not let the click go through, suppress default selection
if ( event )
{
event.stopPropagation();
}
}
/** 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
*
* select an event.
*/
WeekView.prototype.selectEvent = function( calendarEvent )
{
//clear the selected event
gCalendarWindow.clearSelectedEvent( );
gCalendarWindow.setSelectedEvent( calendarEvent );
var EventBoxes = document.getElementsByAttribute( "name", "week-view-event-box-"+calendarEvent.id );
for ( i = 0; i < EventBoxes.length; i++ )
{
EventBoxes[i].setAttribute( "selected", "true" );
this.selectedEventBoxes[ this.selectedEventBoxes.length ] = EventBoxes[i];
}
selectEventInUnifinder( calendarEvent );
}
/** PUBLIC
*
* Unmark the selected date if there is one.
*/
WeekView.prototype.clearSelectedDate = function( )
{
if ( this.selectedBox )
{
this.selectedBox.setAttribute( "selected", "false" );
this.selectedBox = null;
}
}

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

@ -0,0 +1,506 @@
<?xml version="1.0"?>
<!--
- 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 OEone Corporation are Copyright (C) 2001
- OEone Corporation. All Rights Reserved.
-
- Contributor(s): Garth Smedley (garths@oeone.com), Mike Potter (mikep@oeone.com)
-
- Alternatively, the contents of this file may be used under the terms of
- either the GNU General Public License Version 2 or later (the "GPL"), or
- the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- in which case the provisions of the GPL or the LGPL are applicable instead
- of those above. If you wish to allow use of your version of this file only
- under the terms of either the GPL or the LGPL, and not to allow others to
- use your version of this file under the terms of the MPL, indicate your
- decision by deleting the provisions above and replace them with the notice
- and other provisions required by the 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.
-
- -->
<!-- Style sheets -->
<?xml-stylesheet href="chrome://global/skin/global.css" type="text/css"?>
<?xml-stylesheet href="chrome://calendar/skin/calendar.css" ?>
<!-- DTDs -->
<!-- DTD File with all strings specific to the calendar -->
<!DOCTYPE window
[
<!ENTITY % dtd1 SYSTEM "chrome://penglobal/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/calendarWeekView.js"/>
<vbox id="week-view-box" flex="1">
<!-- Week View: Controls-->
<hbox id="week-controls-box">
<image flex="1" id="week-previous-button" onclick="gCalendarWindow.goToPrevious()"/>
<text id="week-title-text" value="" />
<box flex="1" id="week-next-button-box" >
<image id="week-next-button" onclick="gCalendarWindow.goToNext()"/>
</box>
</hbox>
<!-- Week View: All Day Boxes -->
<vbox id="inner-week-view-box" flex="1">
<box id="week-view-header">
<vbox id="weekview-daynumber-spacer-left"/>
<vbox flex="1" class="weekview-daynumber-class" autostretch="never">
<label id="week-header-date-1" value="" />
<label value="&day.1.DDD;"/>
</vbox>
<vbox flex="1" class="weekview-daynumber-class" autostretch="never">
<label id="week-header-date-2" value="" />
<label value="&day.2.DDD;" />
</vbox>
<vbox flex="1" class="weekview-daynumber-class" autostretch="never">
<label id="week-header-date-3" value="" />
<label value="&day.3.DDD;" />
</vbox>
<vbox flex="1" class="weekview-daynumber-class" autostretch="never">
<label id="week-header-date-4" value="" />
<label value="&day.4.DDD;" />
</vbox>
<vbox flex="1" class="weekview-daynumber-class" autostretch="never">
<label id="week-header-date-5" value="" />
<label value="&day.5.DDD;" />
</vbox>
<vbox flex="1" class="weekview-daynumber-class" autostretch="never">
<label id="week-header-date-6" value="" />
<label value="&day.6.DDD;" />
</vbox>
<vbox flex="1" class="weekview-daynumber-class" autostretch="never">
<label id="week-header-date-7" value="" />
<label value="&day.7.DDD;" />
</vbox>
<vbox flex="1" autostretch="never" width="8"/>
</box>
<box id="week-view-all-day-content-box" debug="false">
<vbox id="weekview-daynumber-spacer-left" flex="1">
<label id="all-day-content-box-text-title" value="All Day Events"/>
</vbox>
<hbox autostretch="never" class="all-day-content-box-week" id="all-day-content-box-week-1"/>
<hbox autostretch="never" class="all-day-content-box-week" id="all-day-content-box-week-2"/>
<hbox autostretch="never" class="all-day-content-box-week" id="all-day-content-box-week-3"/>
<hbox autostretch="never" class="all-day-content-box-week" id="all-day-content-box-week-4"/>
<hbox autostretch="never" class="all-day-content-box-week" id="all-day-content-box-week-5"/>
<hbox autostretch="never" class="all-day-content-box-week" id="all-day-content-box-week-6"/>
<hbox autostretch="never" class="all-day-content-box-week" id="all-day-content-box-week-7"/>
<vbox autostretch="never" id="all-day-content-spacer"/>
</box>
<box id="week-view-content-box" flex="1">
<stack id="week-view-content-board" flex="1">
<image id="week-view-day-gradient" left="1" top="1" width="30" height="1199"/>
<vbox id="week-view-top-left-box" top="0" left="21">
<!-- HOURS -->
<box class="week-view-hours-only-box-class" id="week-tree-hour-0">
<box class="week-time-class" flex="1">
<label class="week-time-class-text" id="week-view-hour" value="&time.midnight; " />
</box>
</box>
<box class="week-view-hours-only-box-class" id="week-tree-hour-1">
<box class="week-time-class" flex="1">
<label class="week-time-class-text" id="week-view-hour" value="&time.1; " />
</box>
</box>
<box class="week-view-hours-only-box-class" id="week-tree-hour-2">
<box class="week-time-class" flex="1">
<label class="week-time-class-text" id="week-view-hour" value="&time.2; " />
</box>
</box>
<box class="week-view-hours-only-box-class" id="week-tree-hour-3">
<box class="week-time-class" flex="1">
<label class="week-time-class-text" id="week-view-hour" value="&time.3; " />
</box>
</box>
<box class="week-view-hours-only-box-class" id="week-tree-hour-4">
<box class="week-time-class" flex="1">
<label class="week-time-class-text" id="week-view-hour" value="&time.4; " />
</box>
</box>
<box class="week-view-hours-only-box-class" id="week-tree-hour-5">
<box class="week-time-class" flex="1">
<label class="week-time-class-text" id="week-view-hour" value="&time.5; " />
</box>
</box>
<box class="week-view-hours-only-box-class" id="week-tree-hour-6">
<box class="week-time-class" flex="1">
<label class="week-time-class-text" id="week-view-hour" value="&time.6; " />
</box>
</box>
<box class="week-view-hours-only-box-class" id="week-tree-hour-7">
<box class="week-time-class" flex="1">
<label class="week-time-class-text" id="week-view-hour" value="&time.7; " />
</box>
</box>
<box class="week-view-hours-only-box-class" id="week-tree-hour-8">
<box class="week-time-class" flex="1">
<label class="week-time-class-text" id="week-view-hour" value="&time.8; " />
</box>
</box>
<box class="week-view-hours-only-box-class" id="week-tree-hour-9">
<box class="week-time-class" flex="1">
<label class="week-time-class-text" id="week-view-hour" value="&time.9; " />
</box>
</box>
<box class="week-view-hours-only-box-class" id="week-tree-hour-10">
<box class="week-time-class" flex="1">
<label class="week-time-class-text" id="week-view-hour" value="&time.10; " />
</box>
</box>
<box class="week-view-hours-only-box-class" id="week-tree-hour-11">
<box class="week-time-class" flex="1">
<label class="week-time-class-text" id="week-view-hour" value="&time.11; " />
</box>
</box>
<box class="week-view-hours-only-box-class" id="week-tree-hour-12">
<box class="week-time-class" flex="1">
<label class="week-time-class-text" id="week-view-hour" value="&time.noon; " />
</box>
</box>
<box class="week-view-hours-only-box-class" id="week-tree-hour-13">
<box class="week-time-class" flex="1">
<label class="week-time-class-text" id="week-view-hour" value="&time.13; " />
</box>
</box>
<box class="week-view-hours-only-box-class" id="week-tree-hour-14">
<box class="week-time-class" flex="1">
<label class="week-time-class-text" id="week-view-hour" value="&time.14; " />
</box>
</box>
<box class="week-view-hours-only-box-class" id="week-tree-hour-15">
<box class="week-time-class" flex="1">
<label class="week-time-class-text" id="week-view-hour" value="&time.15; " />
</box>
</box>
<box class="week-view-hours-only-box-class" id="week-tree-hour-16">
<box class="week-time-class" flex="1">
<label class="week-time-class-text" id="week-view-hour" value="&time.16; " />
</box>
</box>
<box class="week-view-hours-only-box-class" id="week-tree-hour-17">
<box class="week-time-class" flex="1">
<label class="week-time-class-text" id="week-view-hour" value="&time.17; " />
</box>
</box>
<box class="week-view-hours-only-box-class" id="week-tree-hour-18">
<box class="week-time-class" flex="1">
<label class="week-time-class-text" id="week-view-hour" value="&time.18; " />
</box>
</box>
<box class="week-view-hours-only-box-class" id="week-tree-hour-19">
<box class="week-time-class" flex="1">
<label class="week-time-class-text" id="week-view-hour" value="&time.19; " />
</box>
</box>
<box class="week-view-hours-only-box-class" id="week-tree-hour-20">
<box class="week-time-class" flex="1">
<label class="week-time-class-text" id="week-view-hour" value="&time.20; " />
</box>
</box>
<box class="week-view-hours-only-box-class" id="week-tree-hour-21">
<box class="week-time-class" flex="1">
<label class="week-time-class-text" id="week-view-hour" value="&time.21; " />
</box>
</box>
<box class="week-view-hours-only-box-class" id="week-tree-hour-22">
<box class="week-time-class" flex="1">
<label class="week-time-class-text" id="week-view-hour" value="&time.22; " />
</box>
</box>
<box class="week-view-hours-only-box-class" id="week-tree-hour-23">
<box class="week-time-class" flex="1">
<label class="week-time-class-text" id="week-view-hour" value="&time.23; " />
</box>
</box>
<!-- / HOURS -->
</vbox>
<!-- DAY 0 -->
<vbox class="week-view-day-container-box" id="week-view-hour-0" left="98" top="0">
<box class="week-view-hour-box-class weekend" id="week-tree-day-0-item-0" onclick="weekViewHourClick( 1, 0, event )" ondblclick="weekViewHourDoubleClick( 1, 0, event )"/>
<box class="week-view-hour-box-class weekend" id="week-tree-day-0-item-1" onclick="weekViewHourClick( 1, 1, event )" ondblclick="weekViewHourDoubleClick( 1, 1, event )" />
<box class="week-view-hour-box-class weekend" id="week-tree-day-0-item-2" onclick="weekViewHourClick( 1, 2, event )" ondblclick="weekViewHourDoubleClick( 1, 2, event )" />
<box class="week-view-hour-box-class weekend" id="week-tree-day-0-item-3" onclick="weekViewHourClick( 1, 3, event )" ondblclick="weekViewHourDoubleClick( 1, 3, event )" />
<box class="week-view-hour-box-class weekend" id="week-tree-day-0-item-4" onclick="weekViewHourClick( 1, 4, event )" ondblclick="weekViewHourDoubleClick( 1, 4, event )" />
<box class="week-view-hour-box-class weekend" id="week-tree-day-0-item-5" onclick="weekViewHourClick( 1, 5, event )" ondblclick="weekViewHourDoubleClick( 1, 5, event )" />
<box class="week-view-hour-box-class weekend" id="week-tree-day-0-item-6" onclick="weekViewHourClick( 1, 6, event )" ondblclick="weekViewHourDoubleClick( 1, 6, event )" />
<box class="week-view-hour-box-class weekend" id="week-tree-day-0-item-7" onclick="weekViewHourClick( 1, 7, event )" ondblclick="weekViewHourDoubleClick( 1, 7, event )" />
<box class="week-view-hour-box-class weekend" id="week-tree-day-0-item-8" onclick="weekViewHourClick( 1, 8, event )" ondblclick="weekViewHourDoubleClick( 1, 8, event )" />
<box class="week-view-hour-box-class weekend" id="week-tree-day-0-item-9" onclick="weekViewHourClick( 1, 9, event )" ondblclick="weekViewHourDoubleClick( 1, 9, event )" />
<box class="week-view-hour-box-class weekend" id="week-tree-day-0-item-10" onclick="weekViewHourClick( 1, 10, event )" ondblclick="weekViewHourDoubleClick( 1, 10, event )" />
<box class="week-view-hour-box-class weekend" id="week-tree-day-0-item-11" onclick="weekViewHourClick( 1, 11, event )" ondblclick="weekViewHourDoubleClick( 1, 11, event )" />
<box class="week-view-hour-box-class weekend" id="week-tree-day-0-item-12" onclick="weekViewHourClick( 1, 12, event )" ondblclick="weekViewHourDoubleClick( 1, 12, event )" />
<box class="week-view-hour-box-class weekend" id="week-tree-day-0-item-13" onclick="weekViewHourClick( 1, 13, event )" ondblclick="weekViewHourDoubleClick( 1, 13, event )" />
<box class="week-view-hour-box-class weekend" id="week-tree-day-0-item-14" onclick="weekViewHourClick( 1, 14, event )" ondblclick="weekViewHourDoubleClick( 1, 14, event )" />
<box class="week-view-hour-box-class weekend" id="week-tree-day-0-item-15" onclick="weekViewHourClick( 1, 15, event )" ondblclick="weekViewHourDoubleClick( 1, 15, event )" />
<box class="week-view-hour-box-class weekend" id="week-tree-day-0-item-16" onclick="weekViewHourClick( 1, 16, event )" ondblclick="weekViewHourDoubleClick( 1, 16, event )" />
<box class="week-view-hour-box-class weekend" id="week-tree-day-0-item-17" onclick="weekViewHourClick( 1, 17, event )" ondblclick="weekViewHourDoubleClick( 1, 17, event )" />
<box class="week-view-hour-box-class weekend" id="week-tree-day-0-item-18" onclick="weekViewHourClick( 1, 18, event )" ondblclick="weekViewHourDoubleClick( 1, 18, event )" />
<box class="week-view-hour-box-class weekend" id="week-tree-day-0-item-19" onclick="weekViewHourClick( 1, 19, event )" ondblclick="weekViewHourDoubleClick( 1, 19, event )" />
<box class="week-view-hour-box-class weekend" id="week-tree-day-0-item-20" onclick="weekViewHourClick( 1, 20, event )" ondblclick="weekViewHourDoubleClick( 1, 20, event )"/>
<box class="week-view-hour-box-class weekend" id="week-tree-day-0-item-21" onclick="weekViewHourClick( 1, 21, event )" ondblclick="weekViewHourDoubleClick( 1, 21, event )"/>
<box class="week-view-hour-box-class weekend" id="week-tree-day-0-item-22" onclick="weekViewHourClick( 1, 22, event )" ondblclick="weekViewHourDoubleClick( 1, 22, event )"/>
<box class="week-view-hour-box-class weekend" id="week-tree-day-0-item-23" onclick="weekViewHourClick( 1, 23, event )" ondblclick="weekViewHourDoubleClick( 1, 23, event )"/>
</vbox>
<!-- / DAY 0 -->
<!-- DAY 1 -->
<vbox class="week-view-day-container-box" left="176" top="0">
<box class="week-view-hour-box-class" id="week-tree-day-1-item-0" onclick="weekViewHourClick( 2, 0, event )" ondblclick="weekViewHourDoubleClick( 2, 0, event )" />
<box class="week-view-hour-box-class" id="week-tree-day-1-item-1" onclick="weekViewHourClick( 2, 1, event )" ondblclick="weekViewHourDoubleClick( 2, 1, event )"/>
<box class="week-view-hour-box-class" id="week-tree-day-1-item-2" onclick="weekViewHourClick( 2, 2, event )" ondblclick="weekViewHourDoubleClick( 2, 2, event )" />
<box class="week-view-hour-box-class" id="week-tree-day-1-item-3" onclick="weekViewHourClick( 2, 3, event )" ondblclick="weekViewHourDoubleClick( 2, 3, event )" />
<box class="week-view-hour-box-class" id="week-tree-day-1-item-4" onclick="weekViewHourClick( 2, 4, event )" ondblclick="weekViewHourDoubleClick( 2, 4, event )" />
<box class="week-view-hour-box-class" id="week-tree-day-1-item-5" onclick="weekViewHourClick( 2, 5, event )" ondblclick="weekViewHourDoubleClick( 2, 5, event )" />
<box class="week-view-hour-box-class" id="week-tree-day-1-item-6" onclick="weekViewHourClick( 2, 6, event )" ondblclick="weekViewHourDoubleClick( 2, 6, event )" />
<box class="week-view-hour-box-class" id="week-tree-day-1-item-7" onclick="weekViewHourClick( 2, 7, event )" ondblclick="weekViewHourDoubleClick( 2, 7, event )" />
<box class="week-view-hour-box-class" id="week-tree-day-1-item-8" onclick="weekViewHourClick( 2, 8, event )" ondblclick="weekViewHourDoubleClick( 2, 8, event )" />
<box class="week-view-hour-box-class" id="week-tree-day-1-item-9" onclick="weekViewHourClick( 2, 9, event )" ondblclick="weekViewHourDoubleClick( 2, 9, event )" />
<box class="week-view-hour-box-class" id="week-tree-day-1-item-10" onclick="weekViewHourClick( 2, 10, event )" ondblclick="weekViewHourDoubleClick( 2, 10, event )" />
<box class="week-view-hour-box-class" id="week-tree-day-1-item-11" onclick="weekViewHourClick( 2, 11, event )" ondblclick="weekViewHourDoubleClick( 2, 11, event )" />
<box class="week-view-hour-box-class" id="week-tree-day-1-item-12" onclick="weekViewHourClick( 2, 12, event )" ondblclick="weekViewHourDoubleClick( 2, 12, event )" />
<box class="week-view-hour-box-class" id="week-tree-day-1-item-13" onclick="weekViewHourClick( 2, 13, event )" ondblclick="weekViewHourDoubleClick( 2, 13, event )" />
<box class="week-view-hour-box-class" id="week-tree-day-1-item-14" onclick="weekViewHourClick( 2, 14, event )" ondblclick="weekViewHourDoubleClick( 2, 14, event )" />
<box class="week-view-hour-box-class" id="week-tree-day-1-item-15" onclick="weekViewHourClick( 2, 15, event )" ondblclick="weekViewHourDoubleClick( 2, 15, event )" />
<box class="week-view-hour-box-class" id="week-tree-day-1-item-16" onclick="weekViewHourClick( 2, 16, event )" ondblclick="weekViewHourDoubleClick( 2, 16, event )" />
<box class="week-view-hour-box-class" id="week-tree-day-1-item-17" onclick="weekViewHourClick( 2, 17, event )" ondblclick="weekViewHourDoubleClick( 2, 17, event )" />
<box class="week-view-hour-box-class" id="week-tree-day-1-item-18" onclick="weekViewHourClick( 2, 18, event )" ondblclick="weekViewHourDoubleClick( 2, 18, event )" />
<box class="week-view-hour-box-class" id="week-tree-day-1-item-19" onclick="weekViewHourClick( 2, 19, event )" ondblclick="weekViewHourDoubleClick( 2, 19, event )" />
<box class="week-view-hour-box-class" id="week-tree-day-1-item-20" onclick="weekViewHourClick( 2, 20, event )" ondblclick="weekViewHourDoubleClick( 2, 20, event )"/>
<box class="week-view-hour-box-class" id="week-tree-day-1-item-21" onclick="weekViewHourClick( 2, 21, event )" ondblclick="weekViewHourDoubleClick( 2, 21, event )"/>
<box class="week-view-hour-box-class" id="week-tree-day-1-item-22" onclick="weekViewHourClick( 2, 22, event )" ondblclick="weekViewHourDoubleClick( 2, 22, event )"/>
<box class="week-view-hour-box-class" id="week-tree-day-1-item-23" onclick="weekViewHourClick( 2, 23, event )" ondblclick="weekViewHourDoubleClick( 2, 23, event )"/>
</vbox>
<!-- / DAY 1 -->
<!-- DAY 2 -->
<vbox class="week-view-day-container-box" left="254" top="0">
<box class="week-view-hour-box-class" id="week-tree-day-2-item-0" onclick="weekViewHourClick( 3, 0, event )" ondblclick="weekViewHourDoubleClick( 3, 0, event )" />
<box class="week-view-hour-box-class" id="week-tree-day-2-item-1" onclick="weekViewHourClick( 3, 1, event )" ondblclick="weekViewHourDoubleClick( 3, 1, event )"/>
<box class="week-view-hour-box-class" id="week-tree-day-2-item-2" onclick="weekViewHourClick( 3, 2, event )" ondblclick="weekViewHourDoubleClick( 3, 2, event )" />
<box class="week-view-hour-box-class" id="week-tree-day-2-item-3" onclick="weekViewHourClick( 3, 3, event )" ondblclick="weekViewHourDoubleClick( 3, 3, event )" />
<box class="week-view-hour-box-class" id="week-tree-day-2-item-4" onclick="weekViewHourClick( 3, 4, event )" ondblclick="weekViewHourDoubleClick( 3, 4, event )" />
<box class="week-view-hour-box-class" id="week-tree-day-2-item-5" onclick="weekViewHourClick( 3, 5, event )" ondblclick="weekViewHourDoubleClick( 3, 5, event )" />
<box class="week-view-hour-box-class" id="week-tree-day-2-item-6" onclick="weekViewHourClick( 3, 6, event )" ondblclick="weekViewHourDoubleClick( 3, 6, event )" />
<box class="week-view-hour-box-class" id="week-tree-day-2-item-7" onclick="weekViewHourClick( 3, 7, event )" ondblclick="weekViewHourDoubleClick( 3, 7, event )" />
<box class="week-view-hour-box-class" id="week-tree-day-2-item-8" onclick="weekViewHourClick( 3, 8, event )" ondblclick="weekViewHourDoubleClick( 3, 8, event )" />
<box class="week-view-hour-box-class" id="week-tree-day-2-item-9" onclick="weekViewHourClick( 3, 9, event )" ondblclick="weekViewHourDoubleClick( 3, 9, event )" />
<box class="week-view-hour-box-class" id="week-tree-day-2-item-10" onclick="weekViewHourClick( 3, 10, event )" ondblclick="weekViewHourDoubleClick( 3, 10, event )" />
<box class="week-view-hour-box-class" id="week-tree-day-2-item-11" onclick="weekViewHourClick( 3, 11, event )" ondblclick="weekViewHourDoubleClick( 3, 11, event )" />
<box class="week-view-hour-box-class" id="week-tree-day-2-item-12" onclick="weekViewHourClick( 3, 12, event )" ondblclick="weekViewHourDoubleClick( 3, 12, event )" />
<box class="week-view-hour-box-class" id="week-tree-day-2-item-13" onclick="weekViewHourClick( 3, 13, event )" ondblclick="weekViewHourDoubleClick( 3, 13, event )" />
<box class="week-view-hour-box-class" id="week-tree-day-2-item-14" onclick="weekViewHourClick( 3, 14, event )" ondblclick="weekViewHourDoubleClick( 3, 14, event )" />
<box class="week-view-hour-box-class" id="week-tree-day-2-item-15" onclick="weekViewHourClick( 3, 15, event )" ondblclick="weekViewHourDoubleClick( 3, 15, event )" />
<box class="week-view-hour-box-class" id="week-tree-day-2-item-16" onclick="weekViewHourClick( 3, 16, event )" ondblclick="weekViewHourDoubleClick( 3, 16, event )" />
<box class="week-view-hour-box-class" id="week-tree-day-2-item-17" onclick="weekViewHourClick( 3, 17, event )" ondblclick="weekViewHourDoubleClick( 3, 17, event )" />
<box class="week-view-hour-box-class" id="week-tree-day-2-item-18" onclick="weekViewHourClick( 3, 18, event )" ondblclick="weekViewHourDoubleClick( 3, 18, event )" />
<box class="week-view-hour-box-class" id="week-tree-day-2-item-19" onclick="weekViewHourClick( 3, 19, event )" ondblclick="weekViewHourDoubleClick( 3, 19, event )" />
<box class="week-view-hour-box-class" id="week-tree-day-2-item-20" onclick="weekViewHourClick( 3, 20, event )" ondblclick="weekViewHourDoubleClick( 3, 20, event )"/>
<box class="week-view-hour-box-class" id="week-tree-day-2-item-21" onclick="weekViewHourClick( 3, 21, event )" ondblclick="weekViewHourDoubleClick( 3, 21, event )"/>
<box class="week-view-hour-box-class" id="week-tree-day-2-item-22" onclick="weekViewHourClick( 3, 22, event )" ondblclick="weekViewHourDoubleClick( 3, 22, event )"/>
<box class="week-view-hour-box-class" id="week-tree-day-2-item-23" onclick="weekViewHourClick( 3, 23, event )" ondblclick="weekViewHourDoubleClick( 3, 23, event )"/>
</vbox>
<!-- / DAY 2 -->
<!-- DAY 3 -->
<vbox class="week-view-day-container-box" left="332" top="0">
<box class="week-view-hour-box-class" id="week-tree-day-3-item-0" onclick="weekViewHourClick( 4, 0, event )" ondblclick="weekViewHourDoubleClick( 4 ,0, event )" />
<box class="week-view-hour-box-class" id="week-tree-day-3-item-1" onclick="weekViewHourClick( 4, 1, event )" ondblclick="weekViewHourDoubleClick( 4, 1, event )"/>
<box class="week-view-hour-box-class" id="week-tree-day-3-item-2" onclick="weekViewHourClick( 4, 2, event )" ondblclick="weekViewHourDoubleClick( 4, 2, event )" />
<box class="week-view-hour-box-class" id="week-tree-day-3-item-3" onclick="weekViewHourClick( 4, 3, event )" ondblclick="weekViewHourDoubleClick( 4, 3, event )" />
<box class="week-view-hour-box-class" id="week-tree-day-3-item-4" onclick="weekViewHourClick( 4, 4, event )" ondblclick="weekViewHourDoubleClick( 4, 4, event )" />
<box class="week-view-hour-box-class" id="week-tree-day-3-item-5" onclick="weekViewHourClick( 4, 5, event )" ondblclick="weekViewHourDoubleClick( 4, 5, event )" />
<box class="week-view-hour-box-class" id="week-tree-day-3-item-6" onclick="weekViewHourClick( 4, 6, event )" ondblclick="weekViewHourDoubleClick( 4, 6, event )" />
<box class="week-view-hour-box-class" id="week-tree-day-3-item-7" onclick="weekViewHourClick( 4, 7, event )" ondblclick="weekViewHourDoubleClick( 4, 7, event )" />
<box class="week-view-hour-box-class" id="week-tree-day-3-item-8" onclick="weekViewHourClick( 4, 8, event )" ondblclick="weekViewHourDoubleClick( 4, 8, event )" />
<box class="week-view-hour-box-class" id="week-tree-day-3-item-9" onclick="weekViewHourClick( 4, 9, event )" ondblclick="weekViewHourDoubleClick( 4, 9, event )" />
<box class="week-view-hour-box-class" id="week-tree-day-3-item-10" onclick="weekViewHourClick( 4, 10, event )" ondblclick="weekViewHourDoubleClick( 4, 10, event )" />
<box class="week-view-hour-box-class" id="week-tree-day-3-item-11" onclick="weekViewHourClick( 4, 11, event )" ondblclick="weekViewHourDoubleClick( 4, 11, event )" />
<box class="week-view-hour-box-class" id="week-tree-day-3-item-12" onclick="weekViewHourClick( 4, 12, event )" ondblclick="weekViewHourDoubleClick( 4, 12, event )" />
<box class="week-view-hour-box-class" id="week-tree-day-3-item-13" onclick="weekViewHourClick( 4, 13, event )" ondblclick="weekViewHourDoubleClick( 4, 13, event )" />
<box class="week-view-hour-box-class" id="week-tree-day-3-item-14" onclick="weekViewHourClick( 4, 14, event )" ondblclick="weekViewHourDoubleClick( 4, 14, event )" />
<box class="week-view-hour-box-class" id="week-tree-day-3-item-15" onclick="weekViewHourClick( 4, 15, event )" ondblclick="weekViewHourDoubleClick( 4, 15, event )" />
<box class="week-view-hour-box-class" id="week-tree-day-3-item-16" onclick="weekViewHourClick( 4, 16, event )" ondblclick="weekViewHourDoubleClick( 4, 16, event )" />
<box class="week-view-hour-box-class" id="week-tree-day-3-item-17" onclick="weekViewHourClick( 4, 17, event )" ondblclick="weekViewHourDoubleClick( 4, 17, event )" />
<box class="week-view-hour-box-class" id="week-tree-day-3-item-18" onclick="weekViewHourClick( 4, 18, event )" ondblclick="weekViewHourDoubleClick( 4, 18, event )" />
<box class="week-view-hour-box-class" id="week-tree-day-3-item-19" onclick="weekViewHourClick( 4, 19, event )" ondblclick="weekViewHourDoubleClick( 4, 19, event )" />
<box class="week-view-hour-box-class" id="week-tree-day-3-item-20" onclick="weekViewHourClick( 4, 20, event )" ondblclick="weekViewHourDoubleClick( 4, 20, event )"/>
<box class="week-view-hour-box-class" id="week-tree-day-3-item-21" onclick="weekViewHourClick( 4, 21, event )" ondblclick="weekViewHourDoubleClick( 4, 21, event )"/>
<box class="week-view-hour-box-class" id="week-tree-day-3-item-22" onclick="weekViewHourClick( 4, 22, event )" ondblclick="weekViewHourDoubleClick( 4, 22, event )"/>
<box class="week-view-hour-box-class" id="week-tree-day-3-item-23" onclick="weekViewHourClick( 4, 23, event )" ondblclick="weekViewHourDoubleClick( 4, 23, event )"/>
</vbox>
<!-- / DAY 3 -->
<!-- DAY 4 -->
<vbox class="week-view-day-container-box" left="410" top="0">
<box class="week-view-hour-box-class" id="week-tree-day-4-item-0" onclick="weekViewHourClick( 5, 0, event )" ondblclick="weekViewHourDoubleClick( 5, 0, event )" />
<box class="week-view-hour-box-class" id="week-tree-day-4-item-1" onclick="weekViewHourClick( 5, 1, event )" ondblclick="weekViewHourDoubleClick( 5, 1, event )"/>
<box class="week-view-hour-box-class" id="week-tree-day-4-item-2" onclick="weekViewHourClick( 5, 2, event )" ondblclick="weekViewHourDoubleClick( 5, 2, event )" />
<box class="week-view-hour-box-class" id="week-tree-day-4-item-3" onclick="weekViewHourClick( 5, 3, event )" ondblclick="weekViewHourDoubleClick( 5, 3, event )" />
<box class="week-view-hour-box-class" id="week-tree-day-4-item-4" onclick="weekViewHourClick( 5, 4, event )" ondblclick="weekViewHourDoubleClick( 5, 4, event )" />
<box class="week-view-hour-box-class" id="week-tree-day-4-item-5" onclick="weekViewHourClick( 5, 5, event )" ondblclick="weekViewHourDoubleClick( 5, 5, event )" />
<box class="week-view-hour-box-class" id="week-tree-day-4-item-6" onclick="weekViewHourClick( 5, 6, event )" ondblclick="weekViewHourDoubleClick( 5, 6, event )" />
<box class="week-view-hour-box-class" id="week-tree-day-4-item-7" onclick="weekViewHourClick( 5, 7, event )" ondblclick="weekViewHourDoubleClick( 5, 7, event )" />
<box class="week-view-hour-box-class" id="week-tree-day-4-item-8" onclick="weekViewHourClick( 5, 8, event )" ondblclick="weekViewHourDoubleClick( 5, 8, event )" />
<box class="week-view-hour-box-class" id="week-tree-day-4-item-9" onclick="weekViewHourClick( 5, 9, event )" ondblclick="weekViewHourDoubleClick( 5, 9, event )" />
<box class="week-view-hour-box-class" id="week-tree-day-4-item-10" onclick="weekViewHourClick( 5, 10, event )" ondblclick="weekViewHourDoubleClick( 5, 10, event )" />
<box class="week-view-hour-box-class" id="week-tree-day-4-item-11" onclick="weekViewHourClick( 5, 11, event )" ondblclick="weekViewHourDoubleClick( 5, 11, event )" />
<box class="week-view-hour-box-class" id="week-tree-day-4-item-12" onclick="weekViewHourClick( 5, 12, event )" ondblclick="weekViewHourDoubleClick( 5, 12, event )" />
<box class="week-view-hour-box-class" id="week-tree-day-4-item-13" onclick="weekViewHourClick( 5, 13, event )" ondblclick="weekViewHourDoubleClick( 5, 13, event )" />
<box class="week-view-hour-box-class" id="week-tree-day-4-item-14" onclick="weekViewHourClick( 5, 14, event )" ondblclick="weekViewHourDoubleClick( 5, 14, event )" />
<box class="week-view-hour-box-class" id="week-tree-day-4-item-15" onclick="weekViewHourClick( 5, 15, event )" ondblclick="weekViewHourDoubleClick( 5, 15, event )" />
<box class="week-view-hour-box-class" id="week-tree-day-4-item-16" onclick="weekViewHourClick( 5, 16, event )" ondblclick="weekViewHourDoubleClick( 5, 16, event )" />
<box class="week-view-hour-box-class" id="week-tree-day-4-item-17" onclick="weekViewHourClick( 5, 17, event )" ondblclick="weekViewHourDoubleClick( 5, 17, event )" />
<box class="week-view-hour-box-class" id="week-tree-day-4-item-18" onclick="weekViewHourClick( 5, 18, event )" ondblclick="weekViewHourDoubleClick( 5, 18, event )" />
<box class="week-view-hour-box-class" id="week-tree-day-4-item-19" onclick="weekViewHourClick( 5, 19, event )" ondblclick="weekViewHourDoubleClick( 5, 19, event )" />
<box class="week-view-hour-box-class" id="week-tree-day-4-item-20" onclick="weekViewHourClick( 5, 20, event )" ondblclick="weekViewHourDoubleClick( 5, 20, event )"/>
<box class="week-view-hour-box-class" id="week-tree-day-4-item-21" onclick="weekViewHourClick( 5, 21, event )" ondblclick="weekViewHourDoubleClick( 5, 21, event )"/>
<box class="week-view-hour-box-class" id="week-tree-day-4-item-22" onclick="weekViewHourClick( 5, 22, event )" ondblclick="weekViewHourDoubleClick( 5, 22, event )"/>
<box class="week-view-hour-box-class" id="week-tree-day-4-item-23" onclick="weekViewHourClick( 5, 23, event )" ondblclick="weekViewHourDoubleClick( 5, 23, event )"/>
</vbox>
<!-- / DAY 4 -->
<!-- DAY 5 -->
<vbox class="week-view-day-container-box" left="488" top="0">
<box class="week-view-hour-box-class" id="week-tree-day-5-item-0" onclick="weekViewHourClick( 6, 0, event )" ondblclick="weekViewHourDoubleClick( 6, 0, event )" />
<box class="week-view-hour-box-class" id="week-tree-day-5-item-1" onclick="weekViewHourClick( 6, 1, event )" ondblclick="weekViewHourDoubleClick( 6, 1, event )"/>
<box class="week-view-hour-box-class" id="week-tree-day-5-item-2" onclick="weekViewHourClick( 6, 2, event )" ondblclick="weekViewHourDoubleClick( 6, 2, event )" />
<box class="week-view-hour-box-class" id="week-tree-day-5-item-3" onclick="weekViewHourClick( 6, 3, event )" ondblclick="weekViewHourDoubleClick( 6, 3, event )" />
<box class="week-view-hour-box-class" id="week-tree-day-5-item-4" onclick="weekViewHourClick( 6, 4, event )" ondblclick="weekViewHourDoubleClick( 6, 4, event )" />
<box class="week-view-hour-box-class" id="week-tree-day-5-item-5" onclick="weekViewHourClick( 6, 5, event )" ondblclick="weekViewHourDoubleClick( 6, 5, event )" />
<box class="week-view-hour-box-class" id="week-tree-day-5-item-6" onclick="weekViewHourClick( 6, 6, event )" ondblclick="weekViewHourDoubleClick( 6, 6, event )" />
<box class="week-view-hour-box-class" id="week-tree-day-5-item-7" onclick="weekViewHourClick( 6, 7, event )" ondblclick="weekViewHourDoubleClick( 6, 7, event )" />
<box class="week-view-hour-box-class" id="week-tree-day-5-item-8" onclick="weekViewHourClick( 6, 8, event )" ondblclick="weekViewHourDoubleClick( 6, 8, event )" />
<box class="week-view-hour-box-class" id="week-tree-day-5-item-9" onclick="weekViewHourClick( 6, 9, event )" ondblclick="weekViewHourDoubleClick( 6, 9, event )" />
<box class="week-view-hour-box-class" id="week-tree-day-5-item-10" onclick="weekViewHourClick( 6, 10, event )" ondblclick="weekViewHourDoubleClick( 6, 10, event )" />
<box class="week-view-hour-box-class" id="week-tree-day-5-item-11" onclick="weekViewHourClick( 6, 11, event )" ondblclick="weekViewHourDoubleClick( 6, 11, event )" />
<box class="week-view-hour-box-class" id="week-tree-day-5-item-12" onclick="weekViewHourClick( 6, 12, event )" ondblclick="weekViewHourDoubleClick( 6, 12, event )" />
<box class="week-view-hour-box-class" id="week-tree-day-5-item-13" onclick="weekViewHourClick( 6, 13, event )" ondblclick="weekViewHourDoubleClick( 6, 13, event )" />
<box class="week-view-hour-box-class" id="week-tree-day-5-item-14" onclick="weekViewHourClick( 6, 14, event )" ondblclick="weekViewHourDoubleClick( 6, 14, event )" />
<box class="week-view-hour-box-class" id="week-tree-day-5-item-15" onclick="weekViewHourClick( 6, 15, event )" ondblclick="weekViewHourDoubleClick( 6, 15, event )" />
<box class="week-view-hour-box-class" id="week-tree-day-5-item-16" onclick="weekViewHourClick( 6, 16, event )" ondblclick="weekViewHourDoubleClick( 6, 16, event )" />
<box class="week-view-hour-box-class" id="week-tree-day-5-item-17" onclick="weekViewHourClick( 6, 17, event )" ondblclick="weekViewHourDoubleClick( 6, 17, event )" />
<box class="week-view-hour-box-class" id="week-tree-day-5-item-18" onclick="weekViewHourClick( 6, 18, event )" ondblclick="weekViewHourDoubleClick( 6, 18, event )" />
<box class="week-view-hour-box-class" id="week-tree-day-5-item-19" onclick="weekViewHourClick( 6, 19, event )" ondblclick="weekViewHourDoubleClick( 6, 19, event )" />
<box class="week-view-hour-box-class" id="week-tree-day-5-item-20" onclick="weekViewHourClick( 6, 20, event )" ondblclick="weekViewHourDoubleClick( 6, 20, event )"/>
<box class="week-view-hour-box-class" id="week-tree-day-5-item-21" onclick="weekViewHourClick( 6, 21, event )" ondblclick="weekViewHourDoubleClick( 6, 21, event )"/>
<box class="week-view-hour-box-class" id="week-tree-day-5-item-22" onclick="weekViewHourClick( 6, 22, event )" ondblclick="weekViewHourDoubleClick( 6, 22, event )"/>
<box class="week-view-hour-box-class" id="week-tree-day-5-item-23" onclick="weekViewHourClick( 6, 23, event )" ondblclick="weekViewHourDoubleClick( 6, 23, event )"/>
</vbox>
<!-- / DAY 5 -->
<!-- DAY 6 -->
<vbox class="week-view-day-container-box" left="566" top="0">
<box class="week-view-hour-box-class week-view-hour-box-class-last-day weekend" id="week-tree-day-6-item-0" onclick="weekViewHourClick( 7, 0, event )" ondblclick="weekViewHourDoubleClick( 7, 0, event )" />
<box class="week-view-hour-box-class week-view-hour-box-class-last-day weekend" id="week-tree-day-6-item-1" onclick="weekViewHourClick( 7, 1, event )" ondblclick="weekViewHourDoubleClick( 7, 1, event )"/>
<box class="week-view-hour-box-class week-view-hour-box-class-last-day weekend" id="week-tree-day-6-item-2" onclick="weekViewHourClick( 7, 2, event )" ondblclick="weekViewHourDoubleClick( 7, 2, event )" />
<box class="week-view-hour-box-class week-view-hour-box-class-last-day weekend" id="week-tree-day-6-item-3" onclick="weekViewHourClick( 7, 3, event )" ondblclick="weekViewHourDoubleClick( 7, 3, event )" />
<box class="week-view-hour-box-class week-view-hour-box-class-last-day weekend" id="week-tree-day-6-item-4" onclick="weekViewHourClick( 7, 4, event )" ondblclick="weekViewHourDoubleClick( 7, 4, event )" />
<box class="week-view-hour-box-class week-view-hour-box-class-last-day weekend" id="week-tree-day-6-item-5" onclick="weekViewHourClick( 7, 5, event )" ondblclick="weekViewHourDoubleClick( 7, 5, event )" />
<box class="week-view-hour-box-class week-view-hour-box-class-last-day weekend" id="week-tree-day-6-item-6" onclick="weekViewHourClick( 7, 6, event )" ondblclick="weekViewHourDoubleClick( 7, 6, event )" />
<box class="week-view-hour-box-class week-view-hour-box-class-last-day weekend" id="week-tree-day-6-item-7" onclick="weekViewHourClick( 7, 7, event )" ondblclick="weekViewHourDoubleClick( 7, 7, event )" />
<box class="week-view-hour-box-class week-view-hour-box-class-last-day weekend" id="week-tree-day-6-item-8" onclick="weekViewHourClick( 7, 8, event )" ondblclick="weekViewHourDoubleClick( 7, 8, event )" />
<box class="week-view-hour-box-class week-view-hour-box-class-last-day weekend" id="week-tree-day-6-item-9" onclick="weekViewHourClick( 7, 9, event )" ondblclick="weekViewHourDoubleClick( 7, 9, event )" />
<box class="week-view-hour-box-class week-view-hour-box-class-last-day weekend" id="week-tree-day-6-item-10" onclick="weekViewHourClick( 7, 10, event )" ondblclick="weekViewHourDoubleClick( 7, 10, event )" />
<box class="week-view-hour-box-class week-view-hour-box-class-last-day weekend" id="week-tree-day-6-item-11" onclick="weekViewHourClick( 7, 11, event )" ondblclick="weekViewHourDoubleClick( 7, 11, event )" />
<box class="week-view-hour-box-class week-view-hour-box-class-last-day weekend" id="week-tree-day-6-item-12" onclick="weekViewHourClick( 7, 12, event )" ondblclick="weekViewHourDoubleClick( 7, 12, event )" />
<box class="week-view-hour-box-class week-view-hour-box-class-last-day weekend" id="week-tree-day-6-item-13" onclick="weekViewHourClick( 7, 13, event )" ondblclick="weekViewHourDoubleClick( 7, 13, event )" />
<box class="week-view-hour-box-class week-view-hour-box-class-last-day weekend" id="week-tree-day-6-item-14" onclick="weekViewHourClick( 7, 14, event )" ondblclick="weekViewHourDoubleClick( 7, 14, event )" />
<box class="week-view-hour-box-class week-view-hour-box-class-last-day weekend" id="week-tree-day-6-item-15" onclick="weekViewHourClick( 7, 15, event )" ondblclick="weekViewHourDoubleClick( 7, 15, event )" />
<box class="week-view-hour-box-class week-view-hour-box-class-last-day weekend" id="week-tree-day-6-item-16" onclick="weekViewHourClick( 7, 16, event )" ondblclick="weekViewHourDoubleClick( 7, 16, event )" />
<box class="week-view-hour-box-class week-view-hour-box-class-last-day weekend" id="week-tree-day-6-item-17" onclick="weekViewHourClick( 7, 17, event )" ondblclick="weekViewHourDoubleClick( 7, 17, event )" />
<box class="week-view-hour-box-class week-view-hour-box-class-last-day weekend" id="week-tree-day-6-item-18" onclick="weekViewHourClick( 7, 18, event )" ondblclick="weekViewHourDoubleClick( 7, 18, event )" />
<box class="week-view-hour-box-class week-view-hour-box-class-last-day weekend" id="week-tree-day-6-item-19" onclick="weekViewHourClick( 7, 19, event )" ondblclick="weekViewHourDoubleClick( 7, 19, event )" />
<box class="week-view-hour-box-class week-view-hour-box-class-last-day weekend" id="week-tree-day-6-item-20" onclick="weekViewHourClick( 7, 20, event )" ondblclick="weekViewHourDoubleClick( 7, 20, event )"/>
<box class="week-view-hour-box-class week-view-hour-box-class-last-day weekend" id="week-tree-day-6-item-21" onclick="weekViewHourClick( 7, 21, event )" ondblclick="weekViewHourDoubleClick( 7, 21, event )"/>
<box class="week-view-hour-box-class week-view-hour-box-class-last-day weekend" id="week-tree-day-6-item-22" onclick="weekViewHourClick( 7, 22, event )" ondblclick="weekViewHourDoubleClick( 7, 22, event )"/>
<box class="week-view-hour-box-class week-view-hour-box-class-last-day weekend" id="week-tree-day-6-item-23" onclick="weekViewHourClick( 7, 23, event )" ondblclick="weekViewHourDoubleClick( 7, 23, event )"/>
</vbox>
<!-- / DAY 6 -->
</stack>
</box>
</vbox>
</vbox>
</overlay>

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

@ -0,0 +1,134 @@
content,install,url,jar:resource:/chrome/comm.jar!/content/necko/
locale,install,url,jar:resource:/chrome/en-US.jar!/locale/en-US/necko/
content,install,url,jar:resource:/chrome/embed.jar!/content/embed/
skin,install,url,jar:resource:/chrome/embed.jar!/skin/modern/embed/
locale,install,url,jar:resource:/chrome/embed.jar!/locale/en-US/embed/
content,install,url,jar:resource:/chrome/comm.jar!/content/editor/
content,install,url,jar:resource:/chrome/comm.jar!/content/editor-region/
locale,install,url,jar:resource:/chrome/en-US.jar!/locale/en-US/editor/
locale,install,url,jar:resource:/chrome/US.jar!/locale/US/editor-region/
skin,install,url,jar:resource:/chrome/classic.jar!/skin/classic/communicator/
skin,install,url,jar:resource:/chrome/classic.jar!/skin/classic/editor/
skin,install,url,jar:resource:/chrome/classic.jar!/skin/classic/global/
skin,install,url,jar:resource:/chrome/classic.jar!/skin/classic/messenger/
skin,install,url,jar:resource:/chrome/classic.jar!/skin/classic/navigator/
skin,install,url,jar:resource:/chrome/modern.jar!/skin/modern/communicator/
skin,install,url,jar:resource:/chrome/modern.jar!/skin/modern/editor/
skin,install,url,jar:resource:/chrome/modern.jar!/skin/modern/global/
skin,install,url,jar:resource:/chrome/modern.jar!/skin/modern/messenger/
skin,install,url,jar:resource:/chrome/modern.jar!/skin/modern/navigator/
content,install,url,jar:resource:/chrome/comm.jar!/content/navigator/
content,install,url,jar:resource:/chrome/comm.jar!/content/navigator-region/
content,install,url,jar:resource:/chrome/comm.jar!/content/navigator-platform/
locale,install,url,jar:resource:/chrome/en-US.jar!/locale/en-US/navigator/
locale,install,url,jar:resource:/chrome/US.jar!/locale/US/navigator-region/
locale,install,url,jar:resource:/chrome/en-unix.jar!/locale/en-US/navigator-platform/
content,install,url,jar:resource:/chrome/comm.jar!/content/communicator/
locale,install,url,jar:resource:/chrome/en-US.jar!/locale/en-US/communicator/
content,install,url,jar:resource:/chrome/comm.jar!/content/communicator-region/
content,install,url,jar:resource:/chrome/comm.jar!/content/communicator-platform/
locale,install,url,jar:resource:/chrome/US.jar!/locale/US/communicator-region/
locale,install,url,jar:resource:/chrome/en-unix.jar!/locale/en-US/communicator-platform/
content,install,url,jar:resource:/chrome/toolkit.jar!/content/global/
locale,install,url,jar:resource:/chrome/en-US.jar!/locale/en-US/global/
content,install,url,jar:resource:/chrome/toolkit.jar!/content/global-region/
content,install,url,jar:resource:/chrome/toolkit.jar!/content/global-platform/
locale,install,url,jar:resource:/chrome/US.jar!/locale/US/global-region/
locale,install,url,jar:resource:/chrome/en-unix.jar!/locale/en-US/global-platform/
content,install,url,jar:resource:/chrome/pipnss.jar!/content/pipnss/
locale,install,url,jar:resource:/chrome/en-US.jar!/locale/en-US/pipnss/
content,install,url,jar:resource:/chrome/pippki.jar!/content/pippki/
locale,install,url,jar:resource:/chrome/en-US.jar!/locale/en-US/pippki/
content,install,url,jar:resource:/chrome/comm.jar!/content/mozldap/
locale,install,url,jar:resource:/chrome/en-US.jar!/locale/en-US/mozldap/
content,install,url,jar:resource:/chrome/comm.jar!/content/cookie/
locale,install,url,jar:resource:/chrome/en-US.jar!/locale/en-US/cookie/
content,install,url,jar:resource:/chrome/comm.jar!/content/wallet/
locale,install,url,jar:resource:/chrome/en-US.jar!/locale/en-US/wallet/
content,install,url,jar:resource:/chrome/content-packs.jar!/content/content-packs/
locale,install,url,jar:resource:/chrome/en-US.jar!/locale/en-US/content-packs/
content,install,url,jar:resource:/chrome/help.jar!/content/help/
locale,install,url,jar:resource:/chrome/en-US.jar!/locale/en-US/help/
content,install,url,jar:resource:/chrome/venkman.jar!/content/venkman/
skin,install,url,jar:resource:/chrome/venkman.jar!/skin/modern/venkman/
locale,install,url,jar:resource:/chrome/venkman.jar!/locale/en-US/venkman/
content,install,url,jar:resource:/chrome/chatzilla.jar!/content/chatzilla/
skin,install,url,jar:resource:/chrome/chatzilla.jar!/skin/modern/chatzilla/
locale,install,url,jar:resource:/chrome/chatzilla.jar!/locale/en-US/chatzilla/
content,install,url,jar:resource:/chrome/messenger.jar!/content/messenger/
content,install,url,jar:resource:/chrome/messenger.jar!/content/messenger-region/
locale,install,url,jar:resource:/chrome/en-US.jar!/locale/en-US/messenger/
locale,install,url,jar:resource:/chrome/US.jar!/locale/US/messenger-region/
content,install,url,jar:resource:/chrome/toolkit.jar!/content/global-platform/
content,install,url,jar:resource:/chrome/comm.jar!/content/communicator-platform/
content,install,url,jar:resource:/chrome/comm.jar!/content/navigator-platform/
content,install,url,jar:resource:/chrome/toolkit.jar!/content/global-region/
content,install,url,jar:resource:/chrome/comm.jar!/content/communicator-region/
content,install,url,jar:resource:/chrome/comm.jar!/content/editor-region/
content,install,url,jar:resource:/chrome/comm.jar!/content/navigator-region/
content,install,url,jar:resource:/chrome/toolkit.jar!/content/global/
content,install,url,jar:resource:/chrome/comm.jar!/content/cookie/
content,install,url,jar:resource:/chrome/comm.jar!/content/wallet/
content,install,url,jar:resource:/chrome/content-packs.jar!/content/content-packs/
content,install,url,jar:resource:/chrome/comm.jar!/content/communicator/
content,install,url,jar:resource:/chrome/comm.jar!/content/editor/
content,install,url,jar:resource:/chrome/comm.jar!/content/navigator/
content,install,url,jar:resource:/chrome/comm.jar!/content/necko/
content,install,url,jar:resource:/chrome/comm.jar!/content/mozldap/
skin,install,url,jar:resource:/chrome/classic.jar!/skin/classic/communicator/
skin,install,url,jar:resource:/chrome/classic.jar!/skin/classic/editor/
skin,install,url,jar:resource:/chrome/classic.jar!/skin/classic/global/
skin,install,url,jar:resource:/chrome/classic.jar!/skin/classic/messenger/
skin,install,url,jar:resource:/chrome/classic.jar!/skin/classic/navigator/
skin,install,url,jar:resource:/chrome/modern.jar!/skin/modern/communicator/
skin,install,url,jar:resource:/chrome/modern.jar!/skin/modern/editor/
skin,install,url,jar:resource:/chrome/modern.jar!/skin/modern/global/
skin,install,url,jar:resource:/chrome/modern.jar!/skin/modern/messenger/
skin,install,url,jar:resource:/chrome/modern.jar!/skin/modern/navigator/
content,install,url,jar:resource:/chrome/help.jar!/content/help/
content,install,url,jar:resource:/chrome/messenger.jar!/content/messenger/
content,install,url,jar:resource:/chrome/messenger.jar!/content/messenger-region/
content,install,url,jar:resource:/chrome/pippki.jar!/content/pippki/
content,install,url,jar:resource:/chrome/pipnss.jar!/content/pipnss/
skin,install,url,jar:resource:/chrome/chatzilla.jar!/content/chatzilla/
locale,install,url,jar:resource:/chrome/chatzilla.jar!/content/chatzilla/
content,install,url,jar:resource:/chrome/chatzilla.jar!/content/chatzilla/
skin,install,url,jar:resource:/chrome/chatzilla.jar!/skin/modern/chatzilla/
locale,install,url,jar:resource:/chrome/chatzilla.jar!/locale/en-US/chatzilla/
locale,install,url,jar:resource:/chrome/en-US.jar!/locale/en-US/global/
locale,install,url,jar:resource:/chrome/en-US.jar!/locale/en-US/communicator/
locale,install,url,jar:resource:/chrome/en-US.jar!/locale/en-US/messenger/
locale,install,url,jar:resource:/chrome/en-US.jar!/locale/en-US/editor/
locale,install,url,jar:resource:/chrome/en-US.jar!/locale/en-US/navigator/
locale,install,url,jar:resource:/chrome/en-US.jar!/locale/en-US/aim/
locale,install,url,jar:resource:/chrome/en-US.jar!/locale/en-US/necko/
locale,install,url,jar:resource:/chrome/en-US.jar!/locale/en-US/mozldap/
locale,install,url,jar:resource:/chrome/en-US.jar!/locale/en-US/cookie/
locale,install,url,jar:resource:/chrome/en-US.jar!/locale/en-US/wallet/
locale,install,url,jar:resource:/chrome/en-US.jar!/locale/en-US/content-packs/
locale,install,url,jar:resource:/chrome/en-US.jar!/locale/en-US/help/
locale,install,url,jar:resource:/chrome/en-US.jar!/locale/en-US/net2phone/
locale,install,url,jar:resource:/chrome/en-US.jar!/locale/en-US/pipnss/
locale,install,url,jar:resource:/chrome/en-US.jar!/locale/en-US/pippki/
locale,install,url,jar:resource:/chrome/en-unix.jar!/locale/en-US/global-platform/
locale,install,url,jar:resource:/chrome/en-unix.jar!/locale/en-US/communicator-platform/
locale,install,url,jar:resource:/chrome/en-unix.jar!/locale/en-US/navigator-platform/
locale,install,url,jar:resource:/chrome/US.jar!/locale/US/global-region/
locale,install,url,jar:resource:/chrome/US.jar!/locale/US/communicator-region/
locale,install,url,jar:resource:/chrome/US.jar!/locale/US/editor-region/
locale,install,url,jar:resource:/chrome/US.jar!/locale/US/messenger-region/
locale,install,url,jar:resource:/chrome/US.jar!/locale/US/navigator-region/
skin,install,url,jar:resource:/chrome/venkman.jar!/content/venkman/
locale,install,url,jar:resource:/chrome/venkman.jar!/content/venkman/
content,install,url,jar:resource:/chrome/venkman.jar!/content/venkman/
skin,install,url,jar:resource:/chrome/venkman.jar!/skin/modern/venkman/
locale,install,url,jar:resource:/chrome/venkman.jar!/locale/en-US/venkman/
content,install,url,resource:/chrome/calendar/content/penglobal/
locale,install,url,resource:/chrome/calendar/locale/en-US/penglobal/
skin,install,url,resource:/chrome/calendar/skin/modern/penglobal/
content,install,url,resource:/chrome/calendar/content/
locale,install,url,resource:/chrome/calendar/locale/en-US/
skin,install,url,resource:/chrome/calendar/skin/modern/

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

@ -0,0 +1,126 @@
<!--
- 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 OEone Corporation are Copyright (C) 2001
- OEone Corporation. All Rights Reserved.
-
- Contributor(s): Garth Smedley (garths@oeone.com), Mike Potter (mikep@oeone.com)
-
- Alternatively, the contents of this file may be used under the terms of
- either the GNU General Public License Version 2 or later (the "GPL"), or
- the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- in which case the provisions of the GPL or the LGPL are applicable instead
- of those above. If you wish to allow use of your version of this file only
- under the terms of either the GPL or the LGPL, and not to allow others to
- use your version of this file under the terms of the MPL, indicate your
- decision by deleting the provisions above and replace them with the notice
- and other provisions required by the 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.
-
- -->
<!ENTITY alarm.units.minutes "Minutes" >
<!ENTITY alarm.units.hours "Hours" >
<!ENTITY alarm.units.days "Days" >
<!ENTITY repeat.units.days "Days" >
<!ENTITY repeat.units.weeks "Weeks" >
<!ENTITY repeat.units.months "Months" >
<!ENTITY repeat.units.years "Years" >
<!ENTITY newevent.title.label "Title" >
<!ENTITY newevent.location.label "Location" >
<!ENTITY newevent.start.label "Start" >
<!ENTITY newevent.date.label "Date" >
<!ENTITY newevent.end.label "End" >
<!ENTITY newevent.alldayevent.label "This is an all-day event." >
<!ENTITY newevent.description.label "Description" >
<!ENTITY newevent.private.label "Private" >
<!ENTITY newevent.private.note "This event is private." >
<!ENTITY newevent.alarm.label "Alarm" >
<!ENTITY newevent.invite.label "Invite" >
<!ENTITY newevent.email.label "Email Alarm To" >
<!ENTITY newevent.beforealarm.label "before the event starts" >
<!ENTITY newevent.repeat.label "Repeat every" >
<!ENTITY newevent.until.label "Until" >
<!ENTITY newevent.forever.label "Forever" >
<!ENTITY newevent.category.label "Category" >
<!ENTITY newevent.choosecategory.label "Choose A Category" >
<!ENTITY newevent.nocategory.label "No Category" >
<!ENTITY newevent.starttimeerror.alertmessage "Your event cannot end before it has started. Please fix either the start time or the end time." >
<!ENTITY calendar.confirm.deleteevent "Are you sure you want to delete this event titled: " >
<!ENTITY event.alarm.checkbox.label "Remind me again in " >
<!ENTITY event.title.alarm "ALARM" >
<!ENTITY event.title.new "NEW EVENT" >
<!ENTITY event.title.edit "EDIT EVENT" >
<!ENTITY event.tip.new "Create a new event." >
<!ENTITY event.tip.edit "Edit an existing event." >
<!ENTITY event.tip.alert "Alarm!" >
<!ENTITY calendar.flat.topbar.new "New Event" >
<!ENTITY calendar.flat.topbar.gototoday "Go To Today" >
<!ENTITY calendar.flat.topbar.choosedate "Go To Date" >
<!ENTITY calendar.flat.topbar.dayview "Day View" >
<!ENTITY calendar.flat.topbar.weekview "Week View" >
<!ENTITY calendar.flat.topbar.monthview "Month View" >
<!ENTITY calendar.tools.delete.tooltip "Delete Event" >
<!ENTITY calendar.tools.modify.tooltip "Modify Event" >
<!ENTITY calendar.newevent.button.tooltip "Create New Calendar Event" >
<!ENTITY calendar.gototoday.button.tooltip "Go To Today" >
<!ENTITY calendar.choosedate.button.tooltip "Pick Date To Go To" >
<!ENTITY calendar.dayview.button.tooltip "Switch To Day View" >
<!ENTITY calendar.weekview.button.tooltip "Switch To Week View" >
<!ENTITY calendar.monthview.button.tooltip "Switch To Month View" >
<!ENTITY calendar.newevent.button.label "New Event" >
<!ENTITY calendar.gototoday.button.label "Today's Date" >
<!ENTITY calendar.choosedate.button.label "Choose A Date" >
<!ENTITY calendar.dayview.button.label "Day View" >
<!ENTITY calendar.weekview.button.label "Week View" >
<!ENTITY calendar.monthview.button.label "Month View" >
<!ENTITY calendar.menu.options.newcategory "New Category" >
<!ENTITY calendar.menu.options.modify "Edit" >
<!ENTITY calendar.menu.options.remove "Delete" >
<!ENTITY calendar.main.tab.label "Events" >
<!ENTITY calendar.portlet.outliner.titlecol "Title" >
<!ENTITY calendar.portlet.outliner.datecol "Date" >
<!ENTITY calendar.portlet.outliner.timecol "Time" >
<!ENTITY calendar.portlet.bottom.addevent "Add New Event" >
<!ENTITY calendar.portlet.bottom.viewcalendar "View Calendar" >
<!ENTITY calendar.portlet.title.nexteventsStart "Your next" >
<!ENTITY calendar.portlet.title.nexteventsEnd "events" >
<!ENTITY calendar.portlet.title.nexteventEnd "event" >
<!ENTITY calendar.portlet.title.noEventsText "No Events" >
<!ENTITY calendar.portlet.title.today "Today's Events" >
<!ENTITY calendar.portlet.title.week "Week's Events" >

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

@ -0,0 +1,54 @@
<?xml version="1.0"?>
<!--
- 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 OEone Corporation are Copyright (C) 2001
- OEone Corporation. All Rights Reserved.
-
- Contributor(s): 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.
-
- -->
<RDF:RDF xmlns:RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:chrome="http://www.mozilla.org/rdf/chrome#">
<!-- list all the skins being supplied by this package -->
<RDF:Seq about="urn:mozilla:locale:root">
<RDF:li resource="urn:mozilla:locale:en-US"/>
</RDF:Seq>
<!-- locale information -->
<RDF:Description about="urn:mozilla:en-US">
<chrome:packages>
<RDF:Seq about="urn:mozilla:locale:en-US:packages">
<RDF:li resource="urn:mozilla:locale:en-US:calendar"/>
</RDF:Seq>
</chrome:packages>
</RDF:Description>
</RDF:RDF>

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

@ -0,0 +1,55 @@
<?xml version="1.0"?>
<!--
- 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 OEone Corporation are Copyright (C) 2001
- OEone Corporation. All Rights Reserved.
-
- Contributor(s): 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.
-
- -->
<RDF:RDF xmlns:RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:chrome="http://www.mozilla.org/rdf/chrome#">
<!-- list all the skins being supplied by this package -->
<RDF:Seq about="urn:mozilla:locale:root">
<RDF:li resource="urn:mozilla:locale:en-US"/>
</RDF:Seq>
<!-- locale information -->
<RDF:Description about="urn:mozilla:en-US">
<chrome:packages>
<RDF:Seq about="urn:mozilla:locale:en-US:packages">
<RDF:li resource="urn:mozilla:locale:en-US:penglobal"/>
</RDF:Seq>
</chrome:packages>
</RDF:Description>
</RDF:RDF>

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

@ -0,0 +1,80 @@
# 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, released October 31st, 2001.
#
# The Initial Developer of the Original Code is
# OEone Corporation.
# Portions created by OEone Corporation are Copyright (C) 2001
# OEone Corporation. 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.
#
# Month names - Add full names when needed
month.1.Mmm=Jan
month.2.Mmm=Feb
month.3.Mmm=Mar
month.4.Mmm=Apr
month.5.Mmm=May
month.6.Mmm=Jun
month.7.Mmm=Jul
month.8.Mmm=Aug
month.9.Mmm=Sep
month.10.Mmm=Oct
month.11.Mmm=Nov
month.12.Mmm=Dec
month.1.name=January
month.2.name=February
month.3.name=March
month.4.name=April
month.5.name=May
month.6.name=June
month.7.name=July
month.8.name=August
month.9.name=September
month.10.name=October
month.11.name=November
month.12.name=December
day.1.name=Sunday
day.2.name=Monday
day.3.name=Tuesday
day.4.name=Wednesday
day.5.name=Thursday
day.6.name=Friday
day.7.name=Saturday
day.1.Mmm=Sun
day.2.Mmm=Mon
day.3.Mmm=Tue
day.4.Mmm=Wed
day.5.Mmm=Thu
day.6.Mmm=Fri
day.7.Mmm=Sat
am-string=AM
pm-string=PM

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

@ -0,0 +1,109 @@
<!--
- 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 OEone Corporation are Copyright (C) 2001
- OEone Corporation. 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.
-
- -->
<!ENTITY time.midnight "Midnight" >
<!ENTITY time.1 "1:00 AM" >
<!ENTITY time.2 "2:00 AM" >
<!ENTITY time.3 "3:00 AM" >
<!ENTITY time.4 "4:00 AM" >
<!ENTITY time.5 "5:00 AM" >
<!ENTITY time.6 "6:00 AM" >
<!ENTITY time.7 "7:00 AM" >
<!ENTITY time.8 "8:00 AM" >
<!ENTITY time.9 "9:00 AM" >
<!ENTITY time.10 "10:00 AM" >
<!ENTITY time.11 "11:00 AM" >
<!ENTITY time.noon "Noon" >
<!ENTITY time.13 "1:00 PM" >
<!ENTITY time.14 "2:00 PM" >
<!ENTITY time.15 "3:00 PM" >
<!ENTITY time.16 "4:00 PM" >
<!ENTITY time.17 "5:00 PM" >
<!ENTITY time.18 "6:00 PM" >
<!ENTITY time.19 "7:00 PM" >
<!ENTITY time.20 "8:00 PM" >
<!ENTITY time.21 "9:00 PM" >
<!ENTITY time.22 "10:00 PM" >
<!ENTITY time.23 "11:00 PM" >
<!-- Month Names -->
<!ENTITY day.1.Ddd "Sun" >
<!ENTITY day.2.Ddd "Mon" >
<!ENTITY day.3.Ddd "Tue" >
<!ENTITY day.4.Ddd "Wed" >
<!ENTITY day.5.Ddd "Thu" >
<!ENTITY day.6.Ddd "Fri" >
<!ENTITY day.7.Ddd "Sat" >
<!ENTITY day.1.DDD "SUN" >
<!ENTITY day.2.DDD "MON" >
<!ENTITY day.3.DDD "TUE" >
<!ENTITY day.4.DDD "WED" >
<!ENTITY day.5.DDD "THU" >
<!ENTITY day.6.DDD "FRI" >
<!ENTITY day.7.DDD "SAT" >
<!ENTITY day.1.name "Sunday" >
<!ENTITY day.2.name "Monday" >
<!ENTITY day.3.name "Tuesday" >
<!ENTITY day.4.name "Wednesday" >
<!ENTITY day.5.name "Thursday" >
<!ENTITY day.6.name "Friday" >
<!ENTITY day.7.name "Saturday" >
<!ENTITY time.am "AM" >
<!ENTITY time.pm "PM" >
<!ENTITY time.midnight "Midnight" >
<!ENTITY time.noon "Noon" >
<!ENTITY month.1.MMM "JAN" >
<!ENTITY month.2.MMM "FEB" >
<!ENTITY month.3.MMM "MAR" >
<!ENTITY month.4.MMM "APR" >
<!ENTITY month.5.MMM "MAY" >
<!ENTITY month.6.MMM "JUN" >
<!ENTITY month.7.MMM "JUL" >
<!ENTITY month.8.MMM "AUG" >
<!ENTITY month.9.MMM "SEP" >
<!ENTITY month.10.MMM "OCT" >
<!ENTITY month.11.MMM "NOV" >
<!ENTITY month.12.MMM "DEC" >
<!ENTITY time.AM "AM" >
<!ENTITY time.PM "PM" >

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

@ -0,0 +1,69 @@
<!--
- 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 OEone Corporation are Copyright (C) 2001
- OEone Corporation. 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.
-
- -->
<!ENTITY unifinder.menu.options.newfolder "New Folder...">
<!ENTITY unifinder.menu.options.moveto "Move To...">
<!ENTITY unifinder.menu.options.copyto "Copy To...">
<!ENTITY unifinder.menu.options.duplicate "Duplicate...">
<!ENTITY unifinder.menu.options.publishto "Publish To...">
<!ENTITY unifinder.menu.options.modify "Modify">
<!ENTITY unifinder.menu.options.remove "Remove">
<!ENTITY unifinder.menu.options.delete "Delete">
<!ENTITY unifinder.menu.options.showextraoptions "Show Extra Options">
<!ENTITY unifinder.menu.options.hideextraoptions "Hide Extra Options" >
<!ENTITY unifinder.menu.options.showmanagementtools "Show Management Tools">
<!ENTITY unifinder.menu.options.hidemanagementtools "Hide Management Tools">
<!-- Toolbar button tooltips -->
<!ENTITY unifinder.toolbar.newfolder.tooltip "Create New Item">
<!ENTITY unifinder.toolbar.modify.tooltip "Modify Item">
<!ENTITY unifinder.toolbar.delete.tooltip "Delete Item">
<!ENTITY unifinder.toolbar.moveto.tooltip "Move Item to New Location">
<!ENTITY unifinder.toolbar.copyto.tooltip "Copy Item to New Location">
<!ENTITY unifinder.toolbar.publish.tooltip "Publish Item to your personal page">
<!ENTITY unifinder.toolbar.options.tooltip "Show Extra Options">
<!ENTITY unifinder.search.options.searchfor "Search For">
<!ENTITY unifinder.history.options.documentsused "Documents Used">
<!ENTITY unifinder.history.menu.today "Today" >
<!ENTITY unifinder.history.menu.thisweek "This Week">
<!ENTITY unifinder.history.menu.thismonth "This Month">
<!ENTITY unifinder.history.menu.thisyear "This Year">
<!ENTITY unifinder.tab.search.label "Search">
<!ENTITY unifinder.tab.history.label "History">

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

@ -0,0 +1,61 @@
#!/bin/sh
#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 OEone Corporation are Copyright (C) 2001
#OEone Corporation. All Rights Reserved.
#
#Contributor(s): 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.
# Change this to point to your 0.9.5 installation
MOZ_PATH=/usr/local/mozilla0.9.5
# find out where the Calendar directory is based on where this script lives
WHERE_SCRIPT_LIVES=`dirname \`which $0 \``
CALENDAR_PATH=$WHERE_SCRIPT_LIVES
# Chrome
rm -f $MOZ_PATH/component.reg
rm -f $MOZ_PATH/chrome/calendar
ln -s $CALENDAR_PATH $MOZ_PATH/chrome/calendar
rm -f $MOZ_PATH/chrome/installed-chrome.txt
cp $CALENDAR_PATH/installed-chrome.txt $MOZ_PATH/chrome/installed-chrome.txt
rm -f $MOZ_PATH/chrome/*.rdf
rm -rf $MOZ_PATH/chrome/overlayinfo
# Libraries
cp $CALENDAR_PATH/libxpical/libxpical.so $MOZ_PATH/components
cp $CALENDAR_PATH/libxpical/oeIICal.xpt $MOZ_PATH/components
# Register chrome and libraries
export MOZILLA_FIVE_HOME=$MOZ_PATH
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$MOZ_PATH
$MOZ_PATH/regxpcom
$MOZ_PATH/regchrome
touch $MOZ_PATH/chrome/user-locales.rdf
touch $MOZ_PATH/chrome/user-skins.rdf

Двоичные данные
calendar/resources/skin/modern/add_event_small.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 519 B

Двоичные данные
calendar/resources/skin/modern/all_day_event.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 777 B

Двоичные данные
calendar/resources/skin/modern/arrow_left.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 257 B

Двоичные данные
calendar/resources/skin/modern/arrow_right.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 266 B

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

@ -0,0 +1,267 @@
/*
* 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 Corporation.
*
* The Initial Developer of the Original Code is
* OEone Corporation.
* Portions created by OEone Corporation are Copyright (C) 2001
* OEone Corporation. All Rights Reserved.
*
* Contributor(s): Garth Smedley (garths@oeone.com) , Mike Potter (mikep@oeone.com)
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
*
*/
#standard-dialog-title-icon
{
padding-left : 2px;
list-style-image : url("chrome://calendar/skin/ca-event-dialog/new_event_icon.png");
}
#repeat-box,
#repeat-end-box,
#alarm-box,
#end-event-time-box,
#start-event-time-box,
#start-date-box
{
vertical-align : middle;
}
#dialog-box
{
min-width : 453px;
/*min-height : 460px;*/
}
#category-field
{
margin-left : 4px;
margin-right : 4px;
}
.field-label-box-class
{
text-align : right;
margin-right : 3px;
}
/* line up all the check boxes on the left with the other boxes */
#repeat-checkbox,
#repeat-checkbox > .internal-box > .checkmark-box,
#alarm-checkbox,
#alarm-checkbox > .internal-box > .checkmark-box,
#private-checkbox,
#private-checkbox > .internal-box > .checkmark-box,
#all-day-event-checkbox,
#all-day-event-checkbox > .internal-box > .checkmark-box,
#alarm-email-checkbox,
#alarm-email-checkbox > .internal-box > .checkmark-box,
#invite-checkbox,
#invite-checkbox > .internal-box > .checkmark-box
{
margin-left : 1px;
}
#all-day-event-checkbox
{
margin-left : 2px;
}
#repeat-length-units
{
min-width : 98px;
}
#alarm-spacer
{
min-width : 52px;
}
#radio-spacer
{
min-width : 38px;
}
#until-spacer
{
min-width : 8px;
}
#invite-spacer
{
min-width : 54px;
}
#repeat-length-field
{
max-width : 3em;
}
#alarm-length-field
{
max-width : 3em;
}
#invite-email-field
{
max-width : 50em;
}
#alarm-email-field
{
max-width : 50em;
}
#start-date-text
{
-moz-user-focus : ignore !important;
max-width : 10em;
}
#start-time-text
{
max-width : 10em;
}
#end-time-text
{
max-width : 10em;
}
#repeat-end-date-text
{
max-width : 10em;
}
/*--------------------------------------------------------------------
* Start date button
*-------------------------------------------------------------------*/
#start-date-button
{
margin-left : 3px;
list-style-image : url("chrome://calendar/skin/ca-event-dialog/calendar_up.png");
}
#start-date-button[disabled="true"],
#start-date-button[disabled="true"]:hover,
#start-date-button[disabled="true"]:hover:active
{
list-style-image : url("chrome://calendar/skin/ca-event-dialog/calendar_disabled.png");
}
#start-date-button:hover
{
list-style-image : url("chrome://calendar/skin/ca-event-dialog/calendar_hover.png");
}
#start-date-button:hover:active
{
list-style-image : url("chrome://calendar/skin/ca-event-dialog/calendar_down.png");
}
/*--------------------------------------------------------------------
* Start time button
*-------------------------------------------------------------------*/
#start-time-button
{
margin-left : 3px;
list-style-image : url("chrome://calendar/skin/ca-event-dialog/clock_up.png");
}
#start-time-button[disabled="true"],
#start-time-button[disabled="true"]:hover,
#start-time-button[disabled="true"]:hover:active
{
list-style-image : url("chrome://calendar/skin/ca-event-dialog/clock_disabled.png");
}
#start-time-button:hover
{
list-style-image : url("chrome://calendar/skin/ca-event-dialog/clock_hover.png");
}
#start-time-button:hover:active
{
list-style-image : url("chrome://calendar/skin/ca-event-dialog/clock_down.png");
}
/*--------------------------------------------------------------------
* End time button
*-------------------------------------------------------------------*/
#end-time-button
{
margin-left : 3px;
list-style-image : url("chrome://calendar/skin/ca-event-dialog/clock_up.png");
}
#end-time-button[disabled="true"],
#end-time-button[disabled="true"]:hover,
#end-time-button[disabled="true"]:hover:active
{
list-style-image : url("chrome://calendar/skin/ca-event-dialog/clock_disabled.png");
}
#end-time-button:hover
{
list-style-image : url("chrome://calendar/skin/ca-event-dialog/clock_hover.png");
}
#end-time-button:hover:active
{
list-style-image : url("chrome://calendar/skin/ca-event-dialog/clock_down.png");
}
/*--------------------------------------------------------------------
* Repeat end date button
*-------------------------------------------------------------------*/
#repeat-end-date-button
{
margin-left : 3px;
list-style-image : url("chrome://calendar/skin/ca-event-dialog/calendar_up.png");
}
#repeat-end-date-button[disabled="true"],
#repeat-end-date-button[disabled="true"]:hover,
#repeat-end-date-button[disabled="true"]:hover:active
{
list-style-image : url("chrome://calendar/skin/ca-event-dialog/calendar_disabled.png");
}
#repeat-end-date-button:hover
{
list-style-image : url("chrome://calendar/skin/ca-event-dialog/calendar_hover.png");
}
#repeat-end-date-button:hover:active
{
list-style-image : url("chrome://calendar/skin/ca-event-dialog/calendar_down.png");
}

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Двоичные данные
calendar/resources/skin/modern/calendar_small.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 842 B

Двоичные данные
calendar/resources/skin/modern/calendar_topbar.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 12 KiB

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

@ -0,0 +1,55 @@
<?xml version="1.0"?>
<!--
- 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 OEone Corporation are Copyright (C) 2001
- OEone Corporation. All Rights Reserved.
-
- Contributor(s): Garth Smedley (garths@oeone.com), Colin Phillips (colinp@oeone.com)
-
- Alternatively, the contents of this file may be used under the terms of
- either the GNU General Public License Version 2 or later (the "GPL"), or
- the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- in which case the provisions of the GPL or the LGPL are applicable instead
- of those above. If you wish to allow use of your version of this file only
- under the terms of either the GPL or the LGPL, and not to allow others to
- use your version of this file under the terms of the MPL, indicate your
- decision by deleting the provisions above and replace them with the notice
- and other provisions required by the LGPL or the GPL. If you do not delete
- the provisions above, a recipient may use your version of this file under
- the terms of any one of the MPL, the GPL or the LGPL.
-
- -->
<RDF:RDF xmlns:RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:chrome="http://www.mozilla.org/rdf/chrome#">
<!-- List all the skins being supplied by this theme -->
<RDF:Seq about="urn:mozilla:skin:root">
<RDF:li resource="urn:mozilla:skin:modern/1.0" />
</RDF:Seq>
<!-- Modern Information -->
<RDF:Description about="urn:mozilla:skin:modern/1.0">
<chrome:packages>
<RDF:Seq about="urn:mozilla:skin:modern/1.0:packages">
<RDF:li resource="urn:mozilla:skin:modern/1.0:calendar"/>
</RDF:Seq>
</chrome:packages>
</RDF:Description>
</RDF:RDF>

Двоичные данные
calendar/resources/skin/modern/day_disabled.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 951 B

Двоичные данные
calendar/resources/skin/modern/day_down.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 2.0 KiB

Двоичные данные
calendar/resources/skin/modern/day_hover.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 1.9 KiB

Двоичные данные
calendar/resources/skin/modern/day_left_gradient.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 32 KiB

Двоичные данные
calendar/resources/skin/modern/day_up.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 1.0 KiB

Двоичные данные
calendar/resources/skin/modern/divider.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 582 B

Двоичные данные
calendar/resources/skin/modern/dot.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 460 B

Двоичные данные
calendar/resources/skin/modern/dot_selected.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 400 B

Двоичные данные
calendar/resources/skin/modern/event.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 417 B

Двоичные данные
calendar/resources/skin/modern/event_alarm.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 1.1 KiB

Двоичные данные
calendar/resources/skin/modern/event_attachment.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 718 B

Двоичные данные
calendar/resources/skin/modern/fri.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 615 B

Двоичные данные
calendar/resources/skin/modern/goto_disabled.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 1.5 KiB

Двоичные данные
calendar/resources/skin/modern/goto_down.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 2.5 KiB

Двоичные данные
calendar/resources/skin/modern/goto_hover.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 2.4 KiB

Двоичные данные
calendar/resources/skin/modern/goto_up.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 1.5 KiB

Двоичные данные
calendar/resources/skin/modern/mon.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 955 B

Двоичные данные
calendar/resources/skin/modern/month_disabled.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 1.3 KiB

Двоичные данные
calendar/resources/skin/modern/month_down.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 2.3 KiB

Двоичные данные
calendar/resources/skin/modern/month_hover.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 2.2 KiB

Двоичные данные
calendar/resources/skin/modern/month_up.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 1.4 KiB

Двоичные данные
calendar/resources/skin/modern/newitem_disabled.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 1.2 KiB

Двоичные данные
calendar/resources/skin/modern/newitem_down.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 2.4 KiB

Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше