зеркало из https://github.com/mozilla/gecko-dev.git
Removing useless files, moving others around.
This commit is contained in:
Родитель
eca3cf1070
Коммит
b0130387c1
|
@ -38,8 +38,8 @@
|
|||
|
||||
<?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"?>
|
||||
<?xul-overlay href="chrome://calendar/content/datepicker/datepicker-overlay.xul"?>
|
||||
<?xul-overlay href="chrome://calendar/content/timepicker/timepicker-overlay.xul"?>
|
||||
|
||||
<!-- CSS File with all styles specific to the dialog -->
|
||||
<?xml-stylesheet href="chrome://calendar/skin/calendarEventDialog.css" ?>
|
||||
|
@ -63,7 +63,7 @@
|
|||
<!-- 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/dateUtils.js"/>
|
||||
<script type="application/x-javascript" src="chrome://calendar/content/calendarEventAlertDialog.js"/>
|
||||
|
||||
<!-- Picker popups -->
|
||||
|
|
|
@ -47,9 +47,9 @@
|
|||
<!-- Overlays -->
|
||||
<?xul-overlay href="chrome://global/content/globalOverlay.xul"?>
|
||||
<?xul-overlay href="chrome://calendar/content/calendarMenuOverlay.xul"?>
|
||||
<?xul-overlay href="chrome://penglobal/content/datepicker-overlay.xul"?>
|
||||
<?xul-overlay href="chrome://calendar/content/datepicker/datepicker-overlay.xul"?>
|
||||
|
||||
<?xul-overlay href="chrome://calendar/content/unifinder-overlay.xul"?>
|
||||
<?xul-overlay href="chrome://calendar/content/unifinder/unifinderOverlay.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"?>
|
||||
|
@ -87,12 +87,12 @@
|
|||
|
||||
<!-- 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/dateUtils.js"/>
|
||||
<script type="application/x-javascript" src="chrome://calendar/content/unifinder/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"/>
|
||||
<script type="application/x-javascript" src="chrome://calendar/content/calendarEvent.js"/>
|
||||
|
||||
|
||||
<!-- Pop up menus -->
|
||||
|
|
|
@ -38,8 +38,8 @@
|
|||
|
||||
<?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"?>
|
||||
<?xul-overlay href="chrome://calendar/content/datepicker/datepicker-overlay.xul"?>
|
||||
<?xul-overlay href="chrome://calendar/content/timepicker/timepicker-overlay.xul"?>
|
||||
|
||||
<!-- CSS File with all styles specific to the dialog -->
|
||||
<?xml-stylesheet href="chrome://calendar/skin/calendarEventDialog.css" ?>
|
||||
|
@ -63,7 +63,7 @@
|
|||
<!-- 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/dateUtils.js"/>
|
||||
<script type="application/x-javascript" src="chrome://calendar/content/calendarEventAlertDialog.js"/>
|
||||
|
||||
<!-- Picker popups -->
|
||||
|
|
|
@ -41,8 +41,8 @@
|
|||
* 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"/>
|
||||
* <script type="application/x-javascript" src="chrome://calendar/content/dateUtils.js"/>
|
||||
* <script type="application/x-javascript" src="chrome://calendar/content/calendarEvent.js"/>
|
||||
*
|
||||
* NOTES
|
||||
* Code for the calendar's new/edit event dialog.
|
||||
|
|
|
@ -39,8 +39,8 @@
|
|||
<?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"?>
|
||||
<?xul-overlay href="chrome://calendar/content/datepicker/datepicker-overlay.xul"?>
|
||||
<?xul-overlay href="chrome://calendar/content/timepicker/timepicker-overlay.xul"?>
|
||||
|
||||
<!-- CSS File with all styles specific to the dialog -->
|
||||
<?xml-stylesheet href="chrome://calendar/skin/calendarEventDialog.css" ?>
|
||||
|
@ -72,7 +72,7 @@
|
|||
<!-- 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/dateUtils.js"/>
|
||||
<script type="application/x-javascript" src="chrome://calendar/content/calendarEventDialog.js"/>
|
||||
|
||||
<!-- Data used in JS from dtd -->
|
||||
|
|
|
@ -1,84 +0,0 @@
|
|||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is OEone Calendar Code, released October 31st, 2001.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* OEone Corporation.
|
||||
* Portions created by the Initial Developer are Copyright (C) 2001
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s): Garth Smedley <garths@oeone.com>
|
||||
* Mike Potter <mikep@oeone.com>
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
var 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 );
|
||||
}
|
|
@ -1,113 +0,0 @@
|
|||
<?xml version="1.0"?>
|
||||
|
||||
<!-- ***** BEGIN LICENSE BLOCK *****
|
||||
- Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
-
|
||||
- The contents of this file are subject to the Mozilla Public License Version
|
||||
- 1.1 (the "License"); you may not use this file except in compliance with
|
||||
- the License. You may obtain a copy of the License at
|
||||
- http://www.mozilla.org/MPL/
|
||||
-
|
||||
- Software distributed under the License is distributed on an "AS IS" basis,
|
||||
- WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
- for the specific language governing rights and limitations under the
|
||||
- License.
|
||||
-
|
||||
- The Original Code is OEone Calendar Code, released October 31st, 2001.
|
||||
-
|
||||
- The Initial Developer of the Original Code is
|
||||
- OEone Corporation.
|
||||
- Portions created by the Initial Developer are Copyright (C) 2001
|
||||
- the Initial Developer. All Rights Reserved.
|
||||
-
|
||||
- Contributor(s): Garth Smedley <garths@oeone.com>
|
||||
- Mike Potter <mikep@oeone.com>
|
||||
-
|
||||
- Alternatively, the contents of this file may be used under the terms of
|
||||
- either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
- the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
- in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
- of those above. If you wish to allow use of your version of this file only
|
||||
- under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
- use your version of this file under the terms of the MPL, indicate your
|
||||
- decision by deleting the provisions above and replace them with the notice
|
||||
- and other provisions required by the LGPL or the GPL. If you do not delete
|
||||
- the provisions above, a recipient may use your version of this file under
|
||||
- the terms of any one of the MPL, the GPL or the LGPL.
|
||||
-
|
||||
- ***** END LICENSE BLOCK ***** -->
|
||||
|
||||
<?xml-stylesheet href="chrome://global/skin/global.css" type="text/css"?>
|
||||
<?xul-overlay href="chrome://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"/>
|
||||
<spacer flex="1"/>
|
||||
<box id="standard-dialog-title-text-box" flex="1">
|
||||
<label id="standard-dialog-title-text"/>
|
||||
</box>
|
||||
<spacer flex="1"/>
|
||||
</hbox>
|
||||
|
||||
<box id="standard-dialog-content">
|
||||
<separator class="thin"/>
|
||||
|
||||
<grid id="calendarnamegrid">
|
||||
<columns>
|
||||
<column/>
|
||||
<column flex="1"/>
|
||||
</columns>
|
||||
<rows>
|
||||
<row>
|
||||
<spacer/>
|
||||
</row>
|
||||
<row>
|
||||
<label class="label" value="&addCalendarFolder.name.label;" for="name"/>
|
||||
<box>
|
||||
<textbox size="40" id="name"/>
|
||||
<spacer flex="1"/>
|
||||
</box>
|
||||
</row>
|
||||
<row>
|
||||
<spacer/>
|
||||
</row>
|
||||
</rows>
|
||||
</grid>
|
||||
|
||||
</box>
|
||||
|
||||
<!-- Bottom Box -->
|
||||
|
||||
<box id="standard-dialog-command">
|
||||
<box id="standard-dialog-commands-standard"/>
|
||||
</box>
|
||||
</vbox>
|
||||
|
||||
</window>
|
|
@ -1,130 +0,0 @@
|
|||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is OEone Calendar Code, released October 31st, 2001.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* OEone Corporation.
|
||||
* Portions created by the Initial Developer are Copyright (C) 2001
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s): Garth Smedley <garths@oeone.com>
|
||||
* Mike Potter <mikep@oeone.com>
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
/**
|
||||
* 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" );
|
||||
}
|
||||
}
|
|
@ -58,8 +58,8 @@
|
|||
<!-- 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"/>
|
||||
<script type="application/x-javascript" src="chrome://calendar/content/dateUtils.js"/>
|
||||
<script type="application/x-javascript" src="chrome://calendar/content/datepicker/datepicker.js"/>
|
||||
|
||||
<!-- Popup that holds the picker -->
|
||||
|
||||
|
|
|
@ -41,8 +41,8 @@
|
|||
* 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"/>
|
||||
* <script type="application/x-javascript" src="chrome://calendar/content/dateUtils.js"/>
|
||||
* <script type="application/x-javascript" src="chrome://calendar/content/calendarEvent.js"/>
|
||||
*
|
||||
* NOTES
|
||||
* Code for the calendar's new/edit event dialog.
|
||||
|
|
|
@ -39,8 +39,8 @@
|
|||
<?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"?>
|
||||
<?xul-overlay href="chrome://calendar/content/datepicker/datepicker-overlay.xul"?>
|
||||
<?xul-overlay href="chrome://calendar/content/timepicker/timepicker-overlay.xul"?>
|
||||
|
||||
<!-- CSS File with all styles specific to the dialog -->
|
||||
<?xml-stylesheet href="chrome://calendar/skin/calendarEventDialog.css" ?>
|
||||
|
@ -72,7 +72,7 @@
|
|||
<!-- 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/dateUtils.js"/>
|
||||
<script type="application/x-javascript" src="chrome://calendar/content/calendarEventDialog.js"/>
|
||||
|
||||
<!-- Data used in JS from dtd -->
|
||||
|
|
|
@ -58,9 +58,9 @@
|
|||
<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://calendar/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/calendarEvent.js"></script>
|
||||
<script type="application/x-javascript" src="chrome://calendar/content/test/testCalendarEvent.js"></script>
|
||||
|
||||
|
||||
|
|
|
@ -57,8 +57,8 @@
|
|||
<!-- 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"/>
|
||||
<script type="application/x-javascript" src="chrome://calendar/content/dateUtils.js"/>
|
||||
<script type="application/x-javascript" src="chrome://calendar/content/timepicker/timepicker.js"/>
|
||||
|
||||
<!-- Popup to hold time picker-->
|
||||
|
||||
|
|
|
@ -46,7 +46,7 @@
|
|||
*
|
||||
* 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"?>
|
||||
<?xul-overlay href="chrome://calendar/content/timepicker/timepicker-overlay.xul"?>
|
||||
*
|
||||
*
|
||||
<popup id="oe-time-picker-popup" oncommand="yourCommandFunction( this )" >
|
||||
|
|
|
@ -1,596 +0,0 @@
|
|||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is OEone Calendar Code, released October 31st, 2001.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* OEone Corporation.
|
||||
* Portions created by the Initial Developer are Copyright (C) 2001
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s): Garth Smedley <garths@oeone.com>
|
||||
* Mike Potter <mikep@oeone.com>
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
/*-----------------------------------------------------------------
|
||||
* 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()
|
||||
{
|
||||
if( !gICalLib.batchMode )
|
||||
{
|
||||
unifinderRefesh();
|
||||
}
|
||||
},
|
||||
|
||||
onStartBatch : function()
|
||||
{
|
||||
},
|
||||
|
||||
onEndBatch : function()
|
||||
{
|
||||
unifinderRefesh();
|
||||
},
|
||||
|
||||
onAddItem : function( calendarEvent )
|
||||
{
|
||||
if( !gICalLib.batchMode )
|
||||
{
|
||||
if( calendarEvent )
|
||||
{
|
||||
unifinderRefesh();
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
onModifyItem : function( calendarEvent, originalEvent )
|
||||
{
|
||||
if( !gICalLib.batchMode )
|
||||
{
|
||||
unifinderRefesh();
|
||||
}
|
||||
},
|
||||
|
||||
onDeleteItem : function( calendarEvent )
|
||||
{
|
||||
if( !gICalLib.batchMode )
|
||||
{
|
||||
unifinderRefesh();
|
||||
}
|
||||
},
|
||||
|
||||
onAlarm : function( calendarEvent )
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Called when the calendar is loaded
|
||||
*/
|
||||
|
||||
function prepareCalendarUnifinder( eventSource )
|
||||
{
|
||||
// tell the unifinder to get ready
|
||||
unifinderInit();
|
||||
|
||||
// set up our calendar event observer
|
||||
|
||||
gICalLib.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 = gICalLib.fetchEvent( 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 = gICalLib.fetchEvent( 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 );
|
||||
|
||||
var eventStartDate = new Date( calendarEvent.start.getTime() );
|
||||
gCalendarWindow.currentView.goToDay( eventStartDate, 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 = gICalLib.fetchEvent( 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 = gICalLib.fetchEvent( gUnifinderSelection );
|
||||
|
||||
if( calendarEvent != null )
|
||||
{
|
||||
if ( confirm( confirmDeleteEvent+" "+calendarEvent.title+"?" ) ) {
|
||||
gICalLib.deleteEvent( calendarEvent.id );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 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( "label" );
|
||||
text1.setAttribute( "class", "calendar-unifinder-event-text" );
|
||||
text1.setAttribute( "crop", "right" );
|
||||
var text2 = document.createElement( "label" );
|
||||
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 eventStartDate = new Date( calendarEvent.start.getTime() );
|
||||
var eventEndDate = new Date( calendarEvent.end.getTime() );
|
||||
var startDate = formatUnifinderEventDate( eventStartDate );
|
||||
var startTime = formatUnifinderEventTime( eventStartDate );
|
||||
var endTime = formatUnifinderEventTime( eventEndDate );
|
||||
|
||||
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.setAttribute( "onclick", "selectCategoryInUnifinder()" );
|
||||
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" );
|
||||
|
||||
image.setAttribute( "class", "unifinder-calendar-event-icon-class" );
|
||||
|
||||
if ( calendarEvent.alarm )
|
||||
{
|
||||
image.setAttribute( "alarm", "true" );
|
||||
}
|
||||
else if( calendarEvent.recur == true )
|
||||
{
|
||||
image.setAttribute( "recur", "true" );
|
||||
}
|
||||
|
||||
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( "label" );
|
||||
//text1.setAttribute( "class", "calendar-unifinder-event-text" );
|
||||
text1.setAttribute( "crop", "right" );
|
||||
|
||||
var text2 = document.createElement( "label" );
|
||||
//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 eventStartDate = new Date( calendarEvent.start.getTime() );
|
||||
var eventEndDate = new Date( calendarEvent.end.getTime() );
|
||||
var startDate = formatUnifinderEventDate( eventStartDate );
|
||||
var startTime = formatUnifinderEventTime( eventStartDate );
|
||||
var endTime = formatUnifinderEventTime( eventEndDate );
|
||||
|
||||
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 );
|
||||
}
|
||||
}
|
|
@ -19,6 +19,7 @@
|
|||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s): Garth Smedley <garths@oeone.com>
|
||||
* Mike Potter <mikep@oeone.com>
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
|
@ -34,9 +35,12 @@
|
|||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
|
||||
// U N I F I N D E R -------------------------------------
|
||||
|
||||
/*-----------------------------------------------------------------
|
||||
* 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.
|
||||
*/
|
||||
|
||||
function unifinderInit()
|
||||
{
|
||||
|
@ -61,3 +65,555 @@ function unifinderSelectTab( tabid )
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
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()
|
||||
{
|
||||
if( !gICalLib.batchMode )
|
||||
{
|
||||
unifinderRefesh();
|
||||
}
|
||||
},
|
||||
|
||||
onStartBatch : function()
|
||||
{
|
||||
},
|
||||
|
||||
onEndBatch : function()
|
||||
{
|
||||
unifinderRefesh();
|
||||
},
|
||||
|
||||
onAddItem : function( calendarEvent )
|
||||
{
|
||||
if( !gICalLib.batchMode )
|
||||
{
|
||||
if( calendarEvent )
|
||||
{
|
||||
unifinderRefesh();
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
onModifyItem : function( calendarEvent, originalEvent )
|
||||
{
|
||||
if( !gICalLib.batchMode )
|
||||
{
|
||||
unifinderRefesh();
|
||||
}
|
||||
},
|
||||
|
||||
onDeleteItem : function( calendarEvent )
|
||||
{
|
||||
if( !gICalLib.batchMode )
|
||||
{
|
||||
unifinderRefesh();
|
||||
}
|
||||
},
|
||||
|
||||
onAlarm : function( calendarEvent )
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Called when the calendar is loaded
|
||||
*/
|
||||
|
||||
function prepareCalendarUnifinder( eventSource )
|
||||
{
|
||||
// tell the unifinder to get ready
|
||||
unifinderInit();
|
||||
|
||||
// set up our calendar event observer
|
||||
|
||||
gICalLib.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 = gICalLib.fetchEvent( 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 = gICalLib.fetchEvent( 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 );
|
||||
|
||||
var eventStartDate = new Date( calendarEvent.start.getTime() );
|
||||
gCalendarWindow.currentView.goToDay( eventStartDate, 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 = gICalLib.fetchEvent( 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 = gICalLib.fetchEvent( gUnifinderSelection );
|
||||
|
||||
if( calendarEvent != null )
|
||||
{
|
||||
if ( confirm( confirmDeleteEvent+" "+calendarEvent.title+"?" ) ) {
|
||||
gICalLib.deleteEvent( calendarEvent.id );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 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( "label" );
|
||||
text1.setAttribute( "class", "calendar-unifinder-event-text" );
|
||||
text1.setAttribute( "crop", "right" );
|
||||
var text2 = document.createElement( "label" );
|
||||
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 eventStartDate = new Date( calendarEvent.start.getTime() );
|
||||
var eventEndDate = new Date( calendarEvent.end.getTime() );
|
||||
var startDate = formatUnifinderEventDate( eventStartDate );
|
||||
var startTime = formatUnifinderEventTime( eventStartDate );
|
||||
var endTime = formatUnifinderEventTime( eventEndDate );
|
||||
|
||||
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.setAttribute( "onclick", "selectCategoryInUnifinder()" );
|
||||
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" );
|
||||
|
||||
image.setAttribute( "class", "unifinder-calendar-event-icon-class" );
|
||||
|
||||
if ( calendarEvent.alarm )
|
||||
{
|
||||
image.setAttribute( "alarm", "true" );
|
||||
}
|
||||
else if( calendarEvent.recur == true )
|
||||
{
|
||||
image.setAttribute( "recur", "true" );
|
||||
}
|
||||
|
||||
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( "label" );
|
||||
//text1.setAttribute( "class", "calendar-unifinder-event-text" );
|
||||
text1.setAttribute( "crop", "right" );
|
||||
|
||||
var text2 = document.createElement( "label" );
|
||||
//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 eventStartDate = new Date( calendarEvent.start.getTime() );
|
||||
var eventEndDate = new Date( calendarEvent.end.getTime() );
|
||||
var startDate = formatUnifinderEventDate( eventStartDate );
|
||||
var startTime = formatUnifinderEventTime( eventStartDate );
|
||||
var endTime = formatUnifinderEventTime( eventEndDate );
|
||||
|
||||
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 );
|
||||
}
|
||||
}
|
|
@ -50,7 +50,7 @@
|
|||
</resources>
|
||||
</binding>
|
||||
|
||||
<binding id="unifinder" extends="chrome://penglobal/content/unifinderBindings.xml#unifinder-base">
|
||||
<binding id="unifinder" extends="chrome://calendar/content/unifinder/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" >
|
||||
|
@ -124,7 +124,7 @@
|
|||
</binding>
|
||||
|
||||
|
||||
<binding id="unifinder-search-controls" extends="chrome://penglobal/content/unifinderBindings.xml#unifinder-base">
|
||||
<binding id="unifinder-search-controls" extends="chrome://calendar/content/unifinder/unifinderBindings.xml#unifinder-base">
|
||||
<content orient="horizontal">
|
||||
<xul:hbox pack="center" align="start" flex="1">
|
||||
<xul:label for="unifinder-search-field" value="&unifinder.search.options.searchfor;" />
|
||||
|
@ -134,7 +134,7 @@
|
|||
</content>
|
||||
</binding>
|
||||
|
||||
<binding id="unifinder-history-controls" extends="chrome://penglobal/content/unifinderBindings.xml#unifinder-base">
|
||||
<binding id="unifinder-history-controls" extends="chrome://calendar/content/unifinder/unifinderBindings.xml#unifinder-base">
|
||||
<content orient="horizontal">
|
||||
<xul:hbox class="unifinder-sub-control-box-class" align="start" pack="center">
|
||||
<xul:label for="unifinder-history-menu" value="&unifinder.history.options.documentsused;"/>
|
||||
|
|
|
@ -49,7 +49,7 @@
|
|||
<!ENTITY % dtd3 SYSTEM "chrome://calendar/locale/calendar.dtd" > %dtd3;
|
||||
]>
|
||||
|
||||
<?xul-overlay href="chrome://penglobal/content/unifinder-overlay.xul"?>
|
||||
<?xul-overlay href="chrome://calendar/content/unifinder/unifinderOverlay.xul"?>
|
||||
|
||||
<overlay
|
||||
id="unifinder-overlay"
|
|
@ -38,20 +38,20 @@
|
|||
/******* unifinder *******/
|
||||
|
||||
unifinder {
|
||||
-moz-binding: url("chrome://penglobal/content/unifinderBindings.xml#unifinder");
|
||||
-moz-binding: url("chrome://calendar/content/unifinder/unifinderBindings.xml#unifinder");
|
||||
}
|
||||
|
||||
unifinder-search-controls {
|
||||
-moz-binding: url("chrome://penglobal/content/unifinderBindings.xml#unifinder-search-controls");
|
||||
-moz-binding: url("chrome://calendar/content/unifinder/unifinderBindings.xml#unifinder-search-controls");
|
||||
}
|
||||
|
||||
unifinder-history-controls {
|
||||
-moz-binding: url("chrome://penglobal/content/unifinderBindings.xml#unifinder-history-controls");
|
||||
-moz-binding: url("chrome://calendar/content/unifinder/unifinderBindings.xml#unifinder-history-controls");
|
||||
}
|
||||
|
||||
|
||||
unifinder-button{
|
||||
-moz-binding: url("chrome://penglobal/content/unifinderBindings.xml#unifinder-button-base");
|
||||
-moz-binding: url("chrome://calendar/content/unifinder/unifinderBindings.xml#unifinder-button-base");
|
||||
}
|
||||
|
||||
unifinder-image-button{
|
||||
|
|
Загрузка…
Ссылка в новой задаче