Bug 389150- Display Today Pane with Task List in Calendar mode too;patch by berend, Sven Giermann;r=philipp;uir=christian.jansen

This commit is contained in:
Berend.Cornelius%sun.com 2008-04-18 14:04:56 +00:00
Родитель b2226dfe1c
Коммит d80d7a3b05
25 изменённых файлов: 1417 добавлений и 339 удалений

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

@ -0,0 +1,843 @@
/* ***** 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 Sun Microsystems code.
*
* The Initial Developer of the Original Code is
* Sun Microsystems.
* Portions created by the Initial Developer are Copyright (C) 2007
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Berend Cornelius <berend.cornelius@sun.com>
* Philipp Kewisch <mozilla@kewis.ch>
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
function Synthetic(aOpen, aDuration) {
this.open = aOpen;
this.duration = aDuration;
}
var agendaListbox = {
agendaListboxControl: null,
pendingRefresh: null,
eventlistItem: null,
newalldayeventlistItem: null,
kDefaultTimezone: null,
showsToday: false
};
agendaListbox.init =
function initAgendaListbox() {
this.agendaListboxControl = document.getElementById("agenda-listbox");
this.agendaListboxControl.removeAttribute("suppressonselect");
this.newalldayeventlistItem = document.getElementById("richlistitem-container").firstChild;
this.eventlistItem = this.newalldayeventlistItem.nextSibling;
var showTodayHeader = (document.getElementById("today-header-hidden").getAttribute("checked") == "true");
var showTomorrowHeader = (document.getElementById("tomorrow-header-hidden").getAttribute("checked") == "true");
var showSoonHeader = (document.getElementById("nextweek-header-hidden").getAttribute("checked") == "true");
this.today = new Synthetic(showTodayHeader, 1);
this.addPeriodListItem(this.today, "today-header");
this.tomorrow = new Synthetic(showTomorrowHeader, 1);
this.soon = new Synthetic(showSoonHeader, 5);
this.periods = [this.today, this.tomorrow, this.soon];
// Make sure the agenda listbox is unloaded
var self = this;
window.addEventListener("unload",
function unload_agendaListbox() {
self.uninit();
},
false);
};
agendaListbox.uninit =
function uninit() {
if (this.calendar) {
this.calendar.removeObserver(this.calendarObserver);
}
for each (var period in this.periods) {
if (period.listItem) {
period.listItem.getCheckbox()
.removeEventListener("CheckboxStateChange",
this.onCheckboxChange,
true);
}
}
};
agendaListbox.addPeriodListItem =
function addPeriodListItem(aPeriod, aItemId) {
aPeriod.listItem = document.getElementById(aItemId + "-hidden").cloneNode(true);
agendaListbox.agendaListboxControl.appendChild(aPeriod.listItem);
aPeriod.listItem.id = aItemId;
aPeriod.listItem.getCheckbox().setChecked(aPeriod.open);
aPeriod.listItem.getCheckbox().addEventListener("CheckboxStateChange", this.onCheckboxChange, true);
}
agendaListbox.removePeriodListItem =
function removePeriodListItem(aPeriod) {
if (aPeriod.listItem) {
aPeriod.listItem.getCheckbox().removeEventListener("CheckboxStateChange", this.onCheckboxChange, true);
if (aPeriod.listItem) {
this.agendaListboxControl.removeChild(aPeriod.listItem);
aPeriod.listItem = null;
}
}
}
agendaListbox.onCheckboxChange =
function onCheckboxChange(event) {
var periodCheckbox = event.target;
var lopen = (periodCheckbox.getAttribute("checked") == "true");
var listItem = getParentNode(periodCheckbox, "agenda-checkbox-richlist-item");
var period = listItem.getItem();
period.open= lopen;
document.getElementById(listItem.id + "-hidden").setAttribute("checked", lopen);
if (lopen) {
agendaListbox.refreshCalendarQuery(period.start, period.end);
} else {
listItem = listItem.nextSibling;
do {
var leaveloop = (listItem == null);
if (!leaveloop) {
var nextItemSibling = listItem.nextSibling;
leaveloop = (!agendaListbox.isEventListItem(listItem));
if (!leaveloop) {
agendaListbox.agendaListboxControl.removeChild(listItem);
listItem = nextItemSibling;
}
}
} while (!leaveloop);
}
};
agendaListbox.onSelect =
function onSelect() {
var listbox = document.getElementById("agenda-listbox");
listbox.focus();
listbox.removeAttribute("disabled");
var item = listbox.selectedItem;
if (item) {
item.selected = true;
item.removeAttribute("disabled");
}
document.commandDispatcher.updateCommands('calendar_commands');
}
agendaListbox.onFocus =
function onFocus() {
var listbox = document.getElementById("agenda-listbox");
listbox.removeAttribute("disabled");
this.enableListItems();
}
agendaListbox.onBlur =
function onBlur() {
var item = document.getElementById("agenda-listbox").selectedItem;
if (item) {
item.setAttribute("disabled","true");
}
document.commandDispatcher.updateCommands('calendar_commands');
}
agendaListbox.enableListItems =
function enableListItems() {
var childNodes = document.getElementById("agenda-listbox").childNodes;
for (var i = 0;i < childNodes.length; i++) {
var listItem = childNodes[i];
listItem.removeAttribute("disabled");
}
}
agendaListbox.onKeyPress =
function onKeyPress(aEvent) {
var listItem = aEvent.target;
if (listItem.localName == "richlistbox") {
listItem = listItem.selectedItem;
}
switch(aEvent.keyCode) {
case aEvent.DOM_VK_RETURN:
createNewEvent();
break;
case aEvent.DOM_VK_DELETE:
document.getElementById('agenda_delete_event_command').doCommand();
aEvent.stopPropagation();
aEvent.preventDefault();
break;
case aEvent.DOM_VK_LEFT:
if (!this.isEventListItem(listItem)) {
listItem.getCheckbox().setChecked(false);
}
break;
case aEvent.DOM_VK_RIGHT:
if (!this.isEventListItem(listItem)) {
listItem.getCheckbox().setChecked(true);
}
break;
}
}
agendaListbox.editSelectedItem =
function editSelectedItem(aEvent) {
var listItem = document.getElementById("agenda-listbox").selectedItem;
if (listItem) {
modifyEventWithDialog(getOccurrenceOrParent(listItem.getItem()));
}
}
agendaListbox.findPeriodsForItem =
function findPeriodsForItem(aItem) {
var retPeriods = [];
for (var i = 0; i < this.periods.length; i++) {
if (this.periods[i].open) {
if (checkIfInRange(aItem, this.periods[i].start, this.periods[i].end)) {
retPeriods.push(this.periods[i]);
}
}
}
return retPeriods;
};
agendaListbox.getStart =
function getStart(){
var retStart = null;
for (var i = 0; i < this.periods.length; i++) {
if (this.periods[i].open) {
retStart = this.periods[i].start;
break;
}
}
return retStart;
}
agendaListbox.getEnd =
function getEnd(){
var retEnd = null;
for (var i = this.periods.length - 1; i >= 0; i--) {
if (this.periods[i].open) {
retEnd = this.periods[i].end;
break;
}
}
return retEnd;
}
agendaListbox.addItemBefore =
function addItemBefore(aNewItem, aAgendaItem, aPeriod, visible) {
var newelement = null;
if (aNewItem.startDate.isDate) {
newelement = this.newalldayeventlistItem.cloneNode(true);
} else {
newelement = this.eventlistItem.cloneNode(true);
}
// set the item at the richlistItem. When the duration of the period
// is bigger than 1 (day) the starttime of the item has to include
// information about the day of the item
if (aAgendaItem == null) {
this.agendaListboxControl.appendChild(newelement);
} else {
this.agendaListboxControl.insertBefore(newelement, aAgendaItem);
}
newelement.setItem(aNewItem, (aPeriod.duration > 1));
newelement.removeAttribute("selected");
return newelement;
}
agendaListbox.addItem =
function addItem(aItem) {
if (!isEvent(aItem)) {
return null;
}
var periods = this.findPeriodsForItem(aItem);
if (periods.length == 0) {
return null;
}
for (var i = 0; i < periods.length; i++) {
period = periods[i];
var complistItem = period.listItem;
var visible = complistItem.getCheckbox().checked;
var newlistItem = null;
if ((aItem.startDate.isDate) && (period.duration == 1)) {
if (this.getListItems(aItem, period).length == 0) {
this.addItemBefore(aItem, period.listItem.nextSibling, period, visible);
}
} else {
do {
var prevlistItem = complistItem;
var complistItem = complistItem.nextSibling;
if (!this.isEventListItem(complistItem)) {
newlistItem = this.addItemBefore(aItem, complistItem, period, visible);
break;
} else {
var compitem = complistItem.getItem();
if (this.isSameEvent(aItem, compitem)) {
// The same event occurs on several calendars but we only
// display the first one.
// TODO: find a way to display this special circumstance
break;
} else if (this.isBefore(aItem, compitem)) {
if (this.isSameEvent(aItem, compitem)) {
newlistItem = this.addItemBefore(aItem, complistItem, period, visible);
break
} else {
newlistItem = this.addItemBefore(aItem, complistItem, period, visible);
break;
}
}
}
} while (complistItem)
}
}
return newlistItem;
};
agendaListbox.isBefore =
function isBefore(aItem, aCompItem) {
if (aCompItem.startDate.day == aItem.startDate.day) {
if (aItem.startDate.isDate) {
return true;
} else if (aCompItem.startDate.isDate) {
return false;
}
}
var comp = aItem.startDate.compare(aCompItem.startDate);
if (comp == 0) {
comp = aItem.endDate.compare(aCompItem.endDate);
}
return (comp <= 0);
}
agendaListbox.getListItems =
function getListItems(aItem, aPeriod) {
var retlistItems = new Array();
var periods = [aPeriod];
if (!aPeriod) {
var periods = this.findPeriodsForItem(aItem);
}
if (periods.length > 0) {
for (var i = 0; i < periods.length; i++) {
period = periods[i];
var complistItem = period.listItem;
do {
var complistItem = complistItem.nextSibling;
var leaveloop = (!this.isEventListItem(complistItem));
if (!leaveloop) {
if (this.isSameEvent(aItem, complistItem.getItem())){
retlistItems.push(complistItem);
break;
}
}
} while (!leaveloop)
}
}
return retlistItems;
}
agendaListbox.deleteItem =
function deleteItem(aItem, aMoveSelection) {
var isSelected = false;
var listItems = this.getListItems(aItem);
if (listItems.length > 0) {
for (var i = listItems.length - 1; i >= 0; i--) {
var listItem = listItems[i];
var isSelected2 = listItem.selected;
if (isSelected2 && !isSelected) {
isSelected = true;
if (aMoveSelection) {
this.moveSelection();
}
}
if ((!this.isEventListItem(listItem.previousSibling)) &&
(!this.isEventListItem(listItem.nextSibling))) {
var prevlistItem = listItem.previousSibling;
this.agendaListboxControl.removeChild(listItem);
prevlistItem.getCheckbox().setChecked(false);
} else {
this.agendaListboxControl.removeChild(listItem);
}
}
}
return isSelected;
}
agendaListbox.isSameEvent =
function isSameEvent(aItem, aCompItem) {
return ((aItem.id == aCompItem.id) &&
(calGetStartDate(aItem).compare(calGetStartDate(aCompItem)) == 0));
}
agendaListbox.isEventSelected =
function isEventSelected() {
var listItem = this.agendaListboxControl.selectedItem;
if (listItem) {
return (this.isEventListItem(listItem));
}
return false;
}
agendaListbox.deleteSelectedItem =
function deleteSelectedItem(aDoNotConfirm) {
var listItem = this.agendaListboxControl.selectedItem;
var selectedItems = [listItem.getItem()];
if (this.isEventListItem(listItem)) {
calendarViewController.deleteOccurrences(selectedItems.length,
selectedItems,
false,
aDoNotConfirm);
}
}
agendaListbox.createNewEvent =
function createNewEvent(aEvent) {
if (aEvent.target instanceof Components.interfaces.nsIDOMXULSelectControlItemElement) {
return;
}
// Create new event for the date currently displayed in the agenda. Setting
// isDate = true automatically makes the start time be the next full hour.
var eventStart = this.today.start.clone();
eventStart.isDate = true;
createEventWithDialog(getSelectedCalendar(), eventStart);
}
agendaListbox.buildAgendaPopupMenu =
function enableAgendaPopupMenu(aPopupMenu){
var listItem = this.agendaListboxControl.selectedItem;
var enabled = this.isEventListItem(listItem);
var popup = document.getElementById("agenda-menu");
while (popup.hasChildNodes()) {
popup.removeChild(popup.firstChild);
}
var menuitems = document.getElementById("agenda-menu-box").childNodes;
for (var i= 0; i < menuitems.length; i++) {
setBooleanAttribute(menuitems[i], "disabled", !enabled);
popup.appendChild(menuitems[i].cloneNode(true));
}
return true;
}
agendaListbox.refreshCalendarQuery =
function refreshCalendarQuery(aStart, aEnd) {
var pendingRefresh = this.pendingRefresh;
if (pendingRefresh) {
if (pendingRefresh instanceof Components.interfaces.calIOperation) {
this.pendingRefresh = null;
pendingRefresh.cancel(null);
} else {
return;
}
}
if ((!aStart) && (!aEnd)) {
this.removeListItems();
}
if (!aStart) {
aStart = this.getStart();
}
if (!aEnd) {
aEnd = this.getEnd();
}
if (aStart && aEnd) {
var filter = this.calendar.ITEM_FILTER_CLASS_OCCURRENCES |
this.calendar.ITEM_FILTER_TYPE_EVENT;
this.pendingRefresh = true;
pendingRefresh = this.calendar.getItems(filter, 0, aStart, aEnd,
this.calendarOpListener);
if (pendingRefresh && pendingRefresh.isPending) { // support for calIOperation
this.pendingRefresh = pendingRefresh;
}
}
};
agendaListbox.setupCalendar =
function setupCalendar() {
this.init();
if (this.calendar == null) {
this.calendar = getCompositeCalendar();
}
if (this.calendar) {
// XXX This always gets called, does that happen on purpose?
this.calendar.removeObserver(this.calendarObserver);
}
this.calendar.addObserver(this.calendarObserver);
if (this.mListener){
this.mListener.updatePeriod();
}
};
agendaListbox.refreshPeriodDates =
function refreshPeriodDates(newDate) {
this.kDefaultTimezone = calendarDefaultTimezone();
// Today: now until midnight of tonight
var oldshowstoday = this.showstoday;
this.showstoday = this.showsToday(newDate);
if ((this.showstoday) && (!oldshowstoday)) {
this.addPeriodListItem(this.tomorrow, "tomorrow-header");
this.addPeriodListItem(this.soon, "nextweek-header");
} else if (!this.showstoday) {
this.removePeriodListItem(this.tomorrow);
this.removePeriodListItem(this.soon);
}
newDate.isDate = true;
for (var i = 0; i < this.periods.length; i++) {
var curPeriod = this.periods[i];
newDate.hour = newDate.minute = newDate.second = 0;
if ((i == 0) && (this.showstoday)){
curPeriod.start = now();
} else {
curPeriod.start = newDate.clone();
}
newDate.day += curPeriod.duration;
curPeriod.end = newDate.clone();
curPeriod.listItem.setItem(curPeriod, this.showstoday);
}
this.refreshCalendarQuery();
};
agendaListbox.addListener =
function addListener(aListener) {
this.mListener = aListener;
}
agendaListbox.showsToday =
function showsToday(aStartDate) {
var lstart = aStartDate;
if (!lstart) {
lstart = this.today.start;
}
var lshowsToday = (sameDay(now(), lstart));
if (lshowsToday) {
this.periods = [this.today, this.tomorrow, this.soon];
} else {
this.periods = [this.today];
}
return lshowsToday;
};
agendaListbox.moveSelection =
function moveSelection() {
var selindex = this.agendaListboxControl.selectedIndex;
if ( !this.isEventListItem(this.agendaListboxControl.selectedItem.nextSibling)) {
this.agendaListboxControl.goUp();
} else {
this.agendaListboxControl.goDown();
}
}
agendaListbox.isEventListItem =
function isEventListItem(aListItem) {
var isEventListItem = (aListItem != null);
if (isEventListItem) {
var localName = aListItem.localName;
isEventListItem = ((localName == "agenda-richlist-item") ||
(localName == "agenda-allday-richlist-item"));
}
return isEventListItem;
}
agendaListbox.removeListItems =
function removeListItems() {
var listItem = this.agendaListboxControl.lastChild;
if (listItem) {
var leaveloop = false;
do {
var newlistItem = null;
if (listItem) {
newlistItem = listItem.previousSibling;
} else {
leaveloop = true;
}
if (this.isEventListItem(listItem)) {
if (!listItem.isSameNode(this.agendaListboxControl.firstChild)) {
this.agendaListboxControl.removeChild(listItem);
} else {
leaveloop = true;
}
}
listItem = newlistItem;
} while (!leaveloop)
}
}
agendaListbox.getListItemByHashId =
function getListItemByHashId(ahashId) {
var listItem = this.agendaListboxControl.firstChild;
var leaveloop = false;
do {
if (this.isEventListItem(listItem)) {
if (listItem.getItem().hashId == ahashId) {
return listItem;
}
}
listItem = listItem.nextSibling;
leaveloop = (listItem == null);
} while (!leaveloop)
return null;
}
agendaListbox.calendarOpListener = {
agendaListbox : agendaListbox
};
agendaListbox.calendarOpListener.onOperationComplete =
function listener_onOperationComplete(calendar, status, optype, id,
detail) {
// signal that the current operation finished.
this.agendaListbox.pendingRefresh = null;
setCurrentEvent();
};
agendaListbox.calendarOpListener.onGetResult =
function listener_onGetResult(calendar, status, itemtype, detail, count, items) {
if (!Components.isSuccessCode(status))
return;
items.forEach(this.agendaListbox.addItem, this.agendaListbox);
};
agendaListbox.calendarObserver = {
agendaListbox : agendaListbox
};
agendaListbox.calendarObserver.QueryInterface =
function agenda_QI(aIID) {
if (!aIID.equals(Components.interfaces.calIObserver) &&
!aIID.equals(Components.interfaces.calICompositeObserver) &&
!aIID.equals(Components.interfaces.nsISupports)) {
throw Components.results.NS_ERROR_NO_INTERFACE;
}
return this;
};
// calIObserver:
agendaListbox.calendarObserver.onStartBatch = function agenda_onBatchStart() {
this.mBatchCount++;
};
agendaListbox.calendarObserver.onEndBatch =
function() {
this.mBatchCount--;
if (this.mBatchCount == 0) {
// Rebuild everything
this.agendaListbox.refreshCalendarQuery();
}
};
agendaListbox.calendarObserver.onLoad = function() {
this.agendaListbox.refreshCalendarQuery();
};
agendaListbox.calendarObserver.onAddItem =
function observer_onAddItem(item)
{
if (this.mBatchCount) {
return;
}
if (!isEvent(item)) {
return;
}
// get all sub items if it is a recurring item
var occs = this.getOccurrencesBetween(item);
occs.forEach(this.agendaListbox.addItem, this.agendaListbox);
setCurrentEvent();
};
agendaListbox.calendarObserver.getOccurrencesBetween =
function getOccurrencesBetween(aItem) {
var occs = [];
var start = this.agendaListbox.getStart();
var end = this.agendaListbox.getEnd();
if (start && end) {
occs = aItem.getOccurrencesBetween(start, end, {});
}
return occs;
}
agendaListbox.calendarObserver.onDeleteItem =
function observer_onDeleteItem(item, rebuildFlag) {
this.onLocalDeleteItem(item, true);
};
agendaListbox.calendarObserver.onLocalDeleteItem =
function observer_onLocalDeleteItem(item, moveSelection) {
if (this.mBatchCount) {
return false;
}
if (!isEvent(item)) {
return false;
}
var selectedItemHashId = -1;
// get all sub items if it is a recurring item
var occs = this.getOccurrencesBetween(item);
for (var i = 0; i < occs.length; i++) {
var isSelected = this.agendaListbox.deleteItem(occs[i], moveSelection);
if (isSelected) {
selectedItemHashId = occs[i].hashId;
}
}
return selectedItemHashId;
};
agendaListbox.calendarObserver.onModifyItem =
function observer_onModifyItem(newItem, oldItem) {
if (this.mBatchCount) {
return;
}
var selectedItemHashId = this.onLocalDeleteItem(oldItem, false);
if (!isEvent(newItem)) {
return;
}
this.onAddItem(newItem);
if (selectedItemHashId != -1) {
var listItem = agendaListbox.getListItemByHashId(selectedItemHashId);
if (listItem) {
agendaListbox.agendaListboxControl.clearSelection();
agendaListbox.agendaListboxControl.ensureElementIsVisible(listItem);
agendaListbox.agendaListboxControl.selectedItem = listItem;
}
}
setCurrentEvent();
};
agendaListbox.calendarObserver.onError = function(errno, msg) {};
agendaListbox.calendarObserver.onPropertyChanged = function(aCalendar, aName, aValue, aOldValue) {};
agendaListbox.calendarObserver.onPropertyDeleting = function(aCalendar, aName) {};
agendaListbox.calendarObserver.onCalendarRemoved =
function agenda_calRemove(aCalendar) {
this.agendaListbox.refreshCalendarQuery();
};
agendaListbox.calendarObserver.onCalendarAdded =
function agenda_calAdd(aCalendar) {
this.agendaListbox.refreshCalendarQuery();
};
agendaListbox.calendarObserver.onDefaultCalendarChanged = function(aCalendar) {
};
function setCurrentEvent() {
if (agendaListbox.showsToday() && agendaListbox.today.open) {
var msScheduleTime = -1;
var complistItem = agendaListbox.tomorrow.listItem.previousSibling;
var removelist = [];
var anow = now();
var msuntillend = 0;
var msuntillstart = 0;
do {
var leaveloop = (!agendaListbox.isEventListItem(complistItem));
if (!leaveloop) {
msuntillstart = complistItem.getItem().startDate
.getInTimezone(agendaListbox.kDefaultTimezone)
.subtractDate(anow).inSeconds;
if (msuntillstart <= 0) {
var msuntillend = complistItem.getItem().endDate
.getInTimezone(agendaListbox.kDefaultTimezone)
.subtractDate(anow).inSeconds;
if (msuntillend >= 0) {
complistItem.setAttribute("current", "true");
if ((msuntillend < msScheduleTime) || (msScheduleTime == -1)){
msScheduleTime = msuntillend;
}
} else {
removelist.push(complistItem);
}
} else {
complistItem.removeAttribute("current");
}
if ((msScheduleTime == -1) || (msuntillstart < msScheduleTime)) {
if (msuntillstart > 0) {
msScheduleTime = msuntillstart;
}
}
}
if (!leaveloop) {
complistItem = complistItem.previousSibling;
}
} while (!leaveloop)
if (msScheduleTime > -1) {
scheduleNextCurrentEventUpdate(setCurrentEvent, msScheduleTime * 1000);
}
}
if (removelist) {
if (removelist.length > 0) {
for (var i = 0;i < removelist.length; i++) {
agendaListbox.agendaListboxControl.removeChild(removelist[i]);
}
}
}
}
var gEventTimer;
/** Creates a timer that will fire after the next event is current.
Pass in a function as
* aRefreshCallback that should be called at that time.
*/
function scheduleNextCurrentEventUpdate(aRefreshCallback, aMsUntill) {
// Is an nsITimer/callback extreme overkill here? Yes, but it's necessary to
// workaround bug 291386. If we don't, we stand a decent chance of getting
// stuck in an infinite loop.
var udCallback = {
notify: function(timer) {
aRefreshCallback();
}
};
if (!gEventTimer) {
// Observer for wake after sleep/hibernate/standby to create new timers and refresh UI
var wakeObserver = {
observe: function(aSubject, aTopic, aData) {
if (aTopic == "wake_notification") {
aRefreshCallback();
}
}
};
// Add observer
var observerService = Components.classes["@mozilla.org/observer-service;1"]
.getService(Components.interfaces.nsIObserverService);
observerService.addObserver(wakeObserver, "wake_notification", false);
// Remove observer on unload
window.addEventListener("unload",
function() {
observerService.removeObserver(wakeObserver, "wake_notification");
}, false);
gEventTimer = Components.classes["@mozilla.org/timer;1"]
.createInstance(Components.interfaces.nsITimer);
} else {
gEventTimer.cancel();
}
gEventTimer.initWithCallback(udCallback, aMsUntill, gEventTimer.TYPE_ONE_SHOT);
}

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

@ -0,0 +1,208 @@
<?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 Sun Microsystems code.
-
- The Initial Developer of the Original Code is
- Sun Microsystems.
- Portions created by the Initial Developer are Copyright (C) 2007
- the Initial Developer. All Rights Reserved.
-
- Contributor(s):
- Berend Cornelius <berend.cornelius@sun.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 ***** -->
<bindings id="agenda-list-bindings"
xmlns="http://www.mozilla.org/xbl"
xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
xmlns:xbl="http://www.mozilla.org/xbl">
<binding id="agenda-checkbox-richlist-item"
extends="chrome://global/content/bindings/richlistbox.xml#richlistitem">
<resources>
<stylesheet src="chrome://calendar/skin/widgets/calendar-widgets.css"/>
</resources>
<content>
<xul:treenode-checkbox class="agenda-checkbox" anonid="agenda-checkbox-widget"
flex="1"
xbl:inherits="selected,label,hidden,disabled"/>
</content>
<implementation>
<field name="kCheckbox">null</field>;
<field name="mItem">null</field>;
<constructor><![CDATA[
this.kCheckbox = document.getAnonymousElementByAttribute(this, "anonid", "agenda-checkbox-widget");
]]></constructor>
<method name="setItem">
<parameter name="synthetic"/>
<parameter name="showsToday"/>
<body><![CDATA[
this.mItem = synthetic;
var dateFormatter = Components.classes["@mozilla.org/calendar/datetime-formatter;1"]
.getService(Components.interfaces.calIDateTimeFormatter);
if (showsToday) {
this.kCheckbox.label = this.getAttribute("title");
} else {
if (synthetic.end.day == (synthetic.start.day + 1)) {
var label = dateFormatter.formatDate(synthetic.start);
this.kCheckbox.label = label;
} else {
var startString = new Object();
var endString = new Object();
dateFormatter.formatInterval(synthetic.start, synthetic.end, startString, endString);
this.kCheckbox.label = startString.value + " - " + endString.value;
}
}
]]></body>
</method>
<method name="getItem">
<body><![CDATA[
return this.mItem;
]]></body>
</method>
<method name="getCheckbox">
<body><![CDATA[
return this.kCheckbox;
]]></body>
</method>
</implementation>
</binding>
<binding id="agenda-allday-richlist-item"
extends="chrome://global/content/bindings/richlistbox.xml#richlistitem">
<resources>
<stylesheet src="chrome://calendar/content/calendar-view-bindings.css"/>
</resources>
<content>
<xul:hbox anonid="agenda-container-box" class="agenda-allday-container-box" xbl:inherits="selected,disabled"
flex="1"
ondblclick="document.getElementById('agenda_edit_event_command').doCommand();">
<xul:vbox pack="center" flex="1">
<xul:hbox flex="1">
<xul:calendar-month-day-box-item anonid="allday-item" flex="1"/>
</xul:hbox>
</xul:vbox>
</xul:hbox>
</content>
<implementation>
<field name="mItem">null</field>;
<field name="mAllDayItem">null</field>;
<constructor><![CDATA[
this.mAllDayItem = document.getAnonymousElementByAttribute(this, "anonid", "allday-item");
this.mAllDayItem.removeShadows();
this.mAllDayItem.removeAttribute("tooltip");
this.mAllDayItem.addEventListener("dblclick", this.ondblclick, true);
]]></constructor>
<destructor><![CDATA[
this.mAllDayItem.removeEventListener("dblclick", this.ondblclick, true);
]]></destructor>
<method name="ondblclick">
<parameter name="aEvent"/>
<body><![CDATA[
document.getElementById('agenda_edit_event_command').doCommand();
aEvent.stopPropagation();
aEvent.preventDefault();
]]></body>
</method>
<method name="setItem">
<parameter name="item"/>
<parameter name="period"/>
<body><![CDATA[
this.mItem= item;
this.mAllDayItem.occurrence = item;
var container = document.getAnonymousElementByAttribute(this.mAllDayItem, "anonid", "event-container");
container.setAttribute("class", "calendar-item");
]]></body>
</method>
<method name="getItem">
<body><![CDATA[
return this.mItem;
]]></body>
</method>
</implementation>
</binding>
<binding id="agenda-richlist-item"
extends="chrome://global/content/bindings/richlistbox.xml#richlistitem">
<content>
<xul:hbox anonid="agenda-container-box" class="agenda-container-box" xbl:inherits="selected,disabled,current" flex="1"
ondblclick="document.getElementById('agenda_edit_event_command').doCommand();">
<xul:hbox>
<xul:vbox>
<xul:image anonid="agenda-calendar-image" class="agenda-calendar-image"/>
<xul:spacer flex="1"/>
</xul:vbox>
</xul:hbox>
<xul:vbox anonid="agenda-description">
<xul:label anonid="agenda-event-start" class="agenda-event-start" crop="end" xbl:inherits="selected"/>
<xul:label anonid="agenda-event-title" class="agenda-event-title" crop="end" xbl:inherits="selected"/>
</xul:vbox>
</xul:hbox>
</content>
<implementation>
<field name="mItem">null</field>;
<method name="setItem">
<parameter name="item"/>
<parameter name="longFormat"/>
<body><![CDATA[
this.mItem= item;
var titlebox = document.getAnonymousElementByAttribute(this, "anonid", "agenda-event-title");
titlebox.value = item.title;
var dateFormatter = Components.classes["@mozilla.org/calendar/datetime-formatter;1"]
.getService(Components.interfaces.calIDateTimeFormatter);
var duration = "";
var start = calGetStartDate(item).getInTimezone(calendarDefaultTimezone());
if (longFormat) {
duration = dateFormatter.formatDateTime(start);
} else {
duration = dateFormatter.formatTime(start);
}
var durationbox = document.getAnonymousElementByAttribute(this, "anonid", "agenda-event-start");
durationbox.value = duration;
var calcolor = "";
try {
var calcolor = this.mItem.calendar.getProperty("color");
} catch (e) {
}
if (!calcolor) {
calcolor = "#a8c2e1";
}
var imagebox = document.getAnonymousElementByAttribute(this, "anonid", "agenda-calendar-image");
imagebox.setAttribute("style","background-color: " + calcolor + ";");
]]></body>
</method>
<method name="getItem">
<body><![CDATA[
return this.mItem;
]]></body>
</method>
</implementation>
</binding>
</bindings>

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

@ -103,6 +103,7 @@
<command id="calendar_toggle_calendarlist_command" oncommand="document.getElementById('calendar-list-pane').togglePane(event)"/>
<command id="calendar_task_filter_command" oncommand="taskViewUpdate(event.explicitOriginalTarget.getAttribute('value'))"/>
<command id="calendar_toggle_filter_command" oncommand="document.getElementById('task-filter-pane').togglePane(event)"/>
<command id="calendar_toggle_todaypane_command" oncommand="document.getElementById('today-pane-panel').togglePane(event)"/>
<command id="calendar_view_next_command" oncommand="moveView(1)"/>
<command id="calendar_view_prev_command" oncommand="moveView(-1)"/>

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

@ -222,11 +222,8 @@ function deleteToDoCommand(aDoNotConfirm) {
function getFocusedTaskTree() {
// Which tree is focused depends on the mode.
var taskTree;
if (isSunbird() || !gCurrentMode || gCurrentMode == "mail") {
taskTree = document.getElementById("unifinder-todo-tree");
} else if (!isSunbird() && gCurrentMode == "task") {
taskTree = document.getElementById("calendar-task-tree");
}
var focusedElement = document.commandDispatcher.focusedElement;
taskTree = getParentNode(focusedElement, "calendar-task-tree");
return taskTree;
}

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

@ -63,7 +63,8 @@
<xul:tree anonid="calendar-task-tree"
class="calendar-task-tree"
flex="1"
enableColumnDrag="false">
enableColumnDrag="false"
onfocus="document.commandDispatcher.updateCommands('calendar_commands')">
<xul:treecols anonid="calendar-task-tree-cols">
<xul:treecol anonid="calendar-task-tree-col-completed"
class="calendar-task-tree-col-completed"

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

@ -38,315 +38,159 @@
var TodayPane = {
CurrentPaneView: 0,
paneViews: null,
stodaypaneButton: "calendar-show-todaypane-button",
start: null,
cwlabel: null,
dateFormatter: Components.classes["@mozilla.org/calendar/datetime-formatter;1"]
.getService(Components.interfaces.calIDateTimeFormatter),
weekFormatter: Components.classes["@mozilla.org/calendar/weektitle-service;1"]
.getService(Components.interfaces.calIWeekTitleService),
paneViews: null,
start: null,
cwlabel: null,
dateFormatter: Components.classes["@mozilla.org/calendar/datetime-formatter;1"]
.getService(Components.interfaces.calIDateTimeFormatter),
weekFormatter: Components.classes["@mozilla.org/calendar/weektitle-service;1"]
.getService(Components.interfaces.calIWeekTitleService),
onLoad: function onLoad() {
var addToolbarbutton = false;
var todaypanebox = document.getElementById("today-pane-panel");
this.paneViews = [ calGetString("calendar", "eventsandtasks"), calGetString("calendar", "tasksonly"), calGetString("calendar", "eventsonly") ];
var mailToolbar = getMailBar();
var defaultSetString = mailToolbar.getAttribute("defaultset");
if (defaultSetString.indexOf(this.stodaypaneButton) == -1) {
defaultSetString = this.addButtonToDefaultset(defaultSetString);
mailToolbar.setAttribute("defaultset", defaultSetString);
}
// add the toolbarbutton to the mailtoolbarpalette on first startup
if (todaypanebox.hasAttribute("addtoolbarbutton")) {
addToolbarbutton = (todaypanebox.getAttribute("addtoolbarbutton") == "true");
}
if (addToolbarbutton) {
var currentSetString = mailToolbar.getAttribute("currentset");
if (currentSetString.indexOf(this.stodaypaneButton) == -1) {
this.addButtonToToolbarset();
}
todaypanebox.setAttribute("addtoolbarbutton", "false");
}
var agendapanel = document.getElementById("agenda-panel");
var todopanel = document.getElementById("todo-tab-panel");
if (agendapanel.hasAttribute("collapsed")) {
if (!todopanel.hasAttribute("collapsed")) {
this.CurrentPaneView = 1;
}
else{
dump("Cannot display todaypane with both subpanes collapsed");
}
}
else {
if (todopanel.hasAttribute("collapsed")) {
this.CurrentPaneView = 2
}
}
agendaListbox.setupCalendar();
var todayheader = document.getElementById("today-pane-header");
todayheader.setAttribute("value", this.paneViews[this.CurrentPaneView]);
// add a menuitem to the 'View/Layout' -menu. As the respective "Layout" menupopup
// carries no 'id' attribute it cannot be overlaid
var todayMenuItem = document.createElementNS("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul", "menuitem");
todayMenuItem.setAttribute("id", "menu_showTodayPane");
todayMenuItem.setAttribute("type", "checkbox");
todayMenuItem.setAttribute("command", "cmd_toggleTodayPane");
todayMenuItem.setAttribute("accesskey", calGetString("calendar", "todaypane-accesskey"));
todayMenuItem.setAttribute("key", "todaypanekey");
todayMenuItem.setAttribute("persist", "checked");
todayMenuItem.setAttribute("label", todaylabel);
var messagePaneMenu = document.getElementById("menu_MessagePaneLayout");
var messagePanePopupMenu = messagePaneMenu.firstChild;
messagePanePopupMenu.appendChild(todayMenuItem);
var checked = !todaypanebox.hasAttribute("collapsedinMailMode");
updateTodayPaneDisplay(checked);
this.checkMenuItem(checked);
this.initializeMiniday();
document.getElementById("today-splitter").addEventListener("DOMAttrModified", this.onModified, false);
this.setShortWeekdays();
this.paneViews = [ calGetString("calendar", "eventsandtasks"), calGetString("calendar", "tasksonly"), calGetString("calendar", "eventsonly") ];
agendaListbox.setupCalendar();
this.initializeMiniday();
this.setShortWeekdays();
document.getElementById("modeBroadcaster").addEventListener("DOMAttrModified", this.onModeModified, false);
this.setTodayHeader(this.getTodayHeaderValue());
},
checkMenuItem: function checkMenuItem(checked) {
document.getElementById('cmd_toggleTodayPane').setAttribute("checked", checked);
var todayMenuItem = document.getElementById("menu_showTodayPane");
todayMenuItem.setAttribute("checked", checked);
var toolbarbutton = document.getElementById(this.stodaypaneButton);
if (toolbarbutton != null) {
toolbarbutton.setAttribute("checked", checked);
}
var todayCloser = document.getElementById("today-closer");
todayCloser.setAttribute("checked", false);
getTodayHeaderValue: function getTodayHeaderValue() {
var currentMode = document.getElementById("modeBroadcaster").getAttribute("mode");
var agendaIsVisible = document.getElementById("agenda-panel").isVisible(currentMode);
var todoIsVisible = document.getElementById("todo-tab-panel").isVisible(currentMode);
if (agendaIsVisible && todoIsVisible) {
var index = 0;
} else if (!agendaIsVisible && (todoIsVisible)) {
var index = 1;
} else if (agendaIsVisible && (!todoIsVisible)) {
var index = 2;
}
return index;
},
setTodayHeader: function setTodayHeader(aIndex) {
var todayHeader = document.getElementById("today-pane-header");
todayHeader.setAttribute("index", aIndex);
todayHeader.setAttribute("value", this.paneViews[aIndex]);
var todayPaneSplitter = document.getElementById("today-pane-splitter");
setBooleanAttribute(todayPaneSplitter, "hidden", (aIndex != 0));
},
initializeMiniday: function initializeMiniday() {
// initialize the label denoting the current month, year and calendarweek
// with numbers that are supposed to consume the largest width
// in order to guarantee that the text will not be cropped when modified
// during runtime
const kYEARINIT= "5555";
const kCALWEEKINIT= "55";
var monthdisplaydeck = document.getElementById("monthNameContainer");
var childNodes = monthdisplaydeck.childNodes;
// initialize the label denoting the current month, year and calendarweek
// with numbers that are supposed to consume the largest width
// in order to guarantee that the text will not be cropped when modified
// during runtime
const kYEARINIT= "5555";
const kCALWEEKINIT= "55";
var monthdisplaydeck = document.getElementById("monthNameContainer");
var childNodes = monthdisplaydeck.childNodes;
for (var i = 0; i < childNodes.length; i++) {
var monthlabel = childNodes[i];
this.setMonthDescription(monthlabel, i, kYEARINIT, kCALWEEKINIT);
}
agendaListbox.addListener(this);
this.setDay(now());
for (var i = 0; i < childNodes.length; i++) {
var monthlabel = childNodes[i];
this.setMonthDescription(monthlabel, i, kYEARINIT, kCALWEEKINIT);
}
agendaListbox.addListener(this);
this.setDay(now());
},
setMonthDescription: function setMonthDescription(aMonthLabel, aIndex, aYear, aCalWeek) {
if (this.cwlabel == null) {
this.cwlabel = calGetString("calendar", "shortcalendarweek");
}
return aMonthLabel.value = this.dateFormatter.shortMonthName(aIndex)
+ " " + aYear + ", " + this.cwlabel + " " + aCalWeek;
},
addButtonToDefaultset: function addButtonToDefaultSet(toolbarSetString) {
var mailToolbar = getMailBar();
var elementcount = mailToolbar.childNodes.length;
var buttonisWithinSet = false;
// by default the todaypane-button is to be placed before the first
// separator of the toolbar
for (var i = 0; i < elementcount; i++) {
var element = mailToolbar.childNodes[i];
if (element.localName == "toolbarseparator") {
var separatorindex = toolbarSetString.indexOf("separator");
if (separatorindex > -1) {
var firstSubString = toolbarSetString.substring(0, separatorindex);
var secondSubString = toolbarSetString.substring(separatorindex);
toolbarSetString = firstSubString + this.stodaypaneButton + "," + secondSubString;
}
buttonisWithinSet = true;
break;
if (this.cwlabel == null) {
this.cwlabel = calGetString("calendar", "shortcalendarweek");
}
}
if (!buttonisWithinSet) {
// in case there is no separator within the toolbar we append the
// toddaypane-button
toolbarSetString += "," + this.stodaypaneButton;
}
return toolbarSetString;
},
addButtonToToolbarset: function addButtonToToolbarset() {
var mailToolbar = getMailBar();
var elementcount = mailToolbar.childNodes.length;
var buttonisWithinSet = false;
// by default the todaypane-button is to be placed before the first
// separator of the toolbar
for (var i = 0; i < elementcount; i++) {
var element = mailToolbar.childNodes[i];
if (element.localName == "toolbarseparator") {
mailToolbar.insertItem(this.stodaypaneButton, element, null, false);
buttonisWithinSet = true;
break;
}
}
if (!buttonisWithinSet) {
// in case there is no separator within the toolbar we append the
// toddaypane-button
mailToolbar.insertItem(this.stodaypaneButton, null, null, false);
}
return aMonthLabel.value = this.dateFormatter.shortMonthName(aIndex)
+ " " + aYear + ", " + this.cwlabel + " " + aCalWeek;
},
// we can cycle the pane view forward or backwards
cyclePaneView: function cyclePaneView(aCycleForward) {
function _collapsePanel(oPanel, bCollapse)
{
if (bCollapse) {
oPanel.setAttribute("collapsed", bCollapse)
if (this.paneViews == null) {
return;
}
else{
oPanel.removeAttribute("collapsed")
var index = parseInt(document.getElementById("today-pane-header").getAttribute("index"));
index = index + aCycleForward;
var nViewLen = this.paneViews.length;
if (index >= nViewLen) {
index = 0;
} else if (index == -1) {
index = nViewLen - 1;
}
}
this.CurrentPaneView = this.CurrentPaneView + aCycleForward;
var nViewLen = this.paneViews.length;
if (this.CurrentPaneView >= nViewLen) {
this.CurrentPaneView = 0;
}
else if (this.CurrentPaneView == -1) {
this.CurrentPaneView = nViewLen -1;
}
var agendapanel = document.getElementById("agenda-panel");
var todopanel = document.getElementById("todo-tab-panel");
var todayheader = document.getElementById("today-pane-header");
todayheader.setAttribute("value", this.paneViews[this.CurrentPaneView]);
switch (this.CurrentPaneView) {
case 0:
_collapsePanel(agendapanel, false);
_collapsePanel(todopanel, false);
document.getElementById("today-pane-splitter").removeAttribute("hidden");
break;
case 1:
_collapsePanel(agendapanel, true);
_collapsePanel(todopanel, false);
document.getElementById("today-pane-splitter").setAttribute("hidden", "true");
break;
case 2:
_collapsePanel(agendapanel, false);
_collapsePanel(todopanel, true);
document.getElementById("today-pane-splitter").setAttribute("hidden", "true");
break;
}
var agendaPanel = document.getElementById("agenda-panel");
var todoPanel = document.getElementById("todo-tab-panel");
agendaPanel.setVisible(index != 1);
todoPanel.setVisible(index != 2);
this.setTodayHeader(index);
},
setShortWeekdays: function setShortWeekdays() {
var weekdisplaydeck = document.getElementById("weekdayNameContainer");
var childNodes = weekdisplaydeck.childNodes;
for (var i = 0; i < childNodes.length; i++) {
childNodes[i].setAttribute("value", calGetString("dateFormat","day." + (i+1) + ".Mmm"));
}
var weekdisplaydeck = document.getElementById("weekdayNameContainer");
var childNodes = weekdisplaydeck.childNodes;
for (var i = 0; i < childNodes.length; i++) {
childNodes[i].setAttribute("value", calGetString("dateFormat","day." + (i+1) + ".Mmm"));
}
},
setDaywithjsDate: function setDaywithjsDate(aNewDate) {
var newdatetime = jsDateToDateTime(aNewDate);
newdatetime = newdatetime.getInTimezone(calendarDefaultTimezone());
document.getElementById("aMinimonthPopupset").hidePopup();
return this.setDay(newdatetime);
var newdatetime = jsDateToDateTime(aNewDate, floating());
newdatetime = newdatetime.getInTimezone(calendarDefaultTimezone());
document.getElementById("aMinimonthPopupset").hidePopup();
return this.setDay(newdatetime);
},
getDay: function getDay(aNewDate)
{
getDay: function getDay(aNewDate) {
return this.start;
},
setDay: function setDay(aNewDate) {
this.start = aNewDate.clone();
this.start = aNewDate.clone();
var daylabel = document.getElementById("datevalue-label");
daylabel.value = this.start.day;
var weekdaylabel = document.getElementById("weekdayNameContainer");
weekdaylabel.selectedIndex = this.start.weekday;
var daylabel = document.getElementById("datevalue-label");
daylabel.value = this.start.day;
var weekdaylabel = document.getElementById("weekdayNameContainer");
weekdaylabel.selectedIndex = this.start.weekday;
var monthnamedeck = document.getElementById("monthNameContainer");
monthnamedeck.selectedIndex = this.start.month;
var monthnamedeck = document.getElementById("monthNameContainer");
monthnamedeck.selectedIndex = this.start.month;
var selMonthPanel = monthnamedeck.selectedPanel;
this.updatePeriod();
return this.setMonthDescription(selMonthPanel, this.start.month,
this.start.year,
this.weekFormatter.getWeekTitle(this.start));
var selMonthPanel = monthnamedeck.selectedPanel;
this.updatePeriod();
return this.setMonthDescription(selMonthPanel, this.start.month,
this.start.year,
this.weekFormatter.getWeekTitle(this.start));
},
advance: function advance(dir) {
this.start.day += dir;
this.setDay(this.start);
this.start.day += dir;
this.setDay(this.start);
},
showsToday: function showsToday() {
return (sameDay(now(), this.start));
return (sameDay(now(), this.start));
},
showsYesterday: function showsYesterday() {
return (sameDay(yesterday(), this.start));
return (sameDay(yesterday(), this.start));
},
updatePeriod: function updatePeriod() {
var date = this.start.clone();
return agendaListbox.refreshPeriodDates(date);
var date = this.start.clone();
return agendaListbox.refreshPeriodDates(date);
},
// DOMAttrModified handler that listens to the todaypane-splitter
onModified: function onModified(aEvent) {
if (aEvent.attrName == "state") {
var checked = aEvent.newValue != "collapsed";
TodayPane.checkMenuItem(checked);
var todaypanebox = document.getElementById("today-pane-panel");
if (checked) {
todaypanebox.removeAttribute("collapsedinMailMode");
onModeModified: function onModeModified(aEvent) {
if (aEvent.attrName == "mode") {
TodayPane.setTodayHeader(TodayPane.getTodayHeaderValue());
var todaypanebox = document.getElementById("today-pane-panel");
if (todaypanebox.isVisible()) {
document.getElementById("today-splitter").setAttribute("state", "open");
}
}
else {
todaypanebox.setAttribute("collapsedinMailMode", true);
}
}
}
};
}};
function loadTodayPane() {
TodayPane.onLoad();
TodayPane.onLoad();
}
window.addEventListener("load", loadTodayPane, false);
function updateTodayPaneDisplay() {
var deck = document.getElementById("displayDeck");
var id = null;
try { id = deck.selectedPanel.id } catch (e) { }
var todaysplitter = document.getElementById("today-splitter");
if (id == "calendar-view-box" || id == "calendar-task-box") {
// we collapse the todaypane but don't not affect the
// attribute "collapsedinMailMode". Therefor this function is only to be used
// when switching to calendar mode
var oTodayPane = document.getElementById("today-pane-panel");
oTodayPane.setAttribute("collapsed", true);
document.getElementById('cmd_toggleTodayPane').setAttribute("disabled","true");
todaysplitter.setAttribute("collapsed", "true");
}
else {
// only show the today-pane if was not collapsed during the last
// "mail-mode session"
var oTodayPane = document.getElementById("today-pane-panel");
if (!oTodayPane.hasAttribute("collapsedinMailMode")) {
if (oTodayPane.hasAttribute("collapsed")) {
oTodayPane.removeAttribute("collapsed");
}
}
document.getElementById('cmd_toggleTodayPane').removeAttribute("disabled");
todaysplitter.removeAttribute("collapsed");
}
}
document.getElementById("displayDeck").
addEventListener("select", updateTodayPaneDisplay, true);
window.addEventListener("load", loadTodayPane, false);

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

@ -53,23 +53,13 @@
<overlay xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<script type="application/x-javascript" src="chrome://calendar/content/today-pane.js"/>
<script type="application/x-javascript" src="chrome://lightning/content/agenda-listbox.js"/>
<script type="application/x-javascript" src="chrome://calendar/content/agenda-listbox.js"/>
<script type="application/x-javascript" src="chrome://calendar/content/calendar-management.js"/>
<script type="application/x-javascript" src="chrome://calendar/content/calendar-dnd-listener.js"/>
<script type="application/x-javascript">
var todaylabel = "&calendar.context.button.label;";
</script>
#ifdef MOZILLA_1_8_BRANCH
<box id="mailContent">
#else
<box id="messengerBox">
#endif
<splitter id="today-splitter" collapse="after" persist="state" resizebefore="closest">
<grippy/>
</splitter>
<vbox id="today-pane-panel" addtoolbarbutton="true" width="200" persist="collapsed collapsedinMailMode addtoolbarbutton width">
<modevbox id="today-pane-panel" addtoolbarbutton="true" width="200"
mode="mail,calendar,task" refcontrol="calendar_toggle_todaypane_command"
broadcaster="modeBroadcaster" persist="addtoolbarbutton width">
<sidebarheader align="center">
<label id ="today-pane-header"/>
<spacer flex="1"/>
@ -78,7 +68,8 @@
<toolbarbutton id="folderview-cycler-right" class="folderview-cycler"
oncommand="TodayPane.cyclePaneView(1);"/>
<spacer id="buttonspacer"/>
<toolbarbutton id="today-closer" class="today-closebutton" command="cmd_toggleTodayPane"/>
<toolbarbutton id="today-closer" class="today-closebutton"
oncommand="document.getElementById('today-pane-panel').setVisible(false, true, true);"/>
</sidebarheader>
<box id="mini-day-box" class="today-subpane">
<stack flex="1">
@ -138,7 +129,8 @@
</stack>
</box>
<vbox flex="1">
<vbox id="agenda-panel" width="20"
<modevbox id="agenda-panel" mode="mail,calendar,task"
broadcaster="modeBroadcaster"
height="200" persist="collapsed height" flex="1"
ondraggesture="nsDragAndDrop.startDrag(event, calendarCalendarButtonDNDObserver);"
ondragover="nsDragAndDrop.dragOver(event, calendarCalendarButtonDNDObserver);"
@ -175,13 +167,13 @@
onfocus="agendaListbox.onFocus();"
onkeypress="agendaListbox.onKeyPress(event);"
ondblclick="agendaListbox.createNewEvent(event);"/>
</vbox>
</modevbox>
<splitter id="today-pane-splitter" persist="hidden"/>
<vbox id="todo-tab-panel" flex="1" persist="collapsed height"
ondraggesture="nsDragAndDrop.startDrag(event, calendarTaskButtonDNDObserver);"
ondragover="nsDragAndDrop.dragOver(event, calendarTaskButtonDNDObserver);"
ondragdrop="nsDragAndDrop.drop(event, calendarTaskButtonDNDObserver);"/>
</vbox>
<modevbox id="todo-tab-panel" flex="1" mode="mail,calendar,task"
broadcaster="modeBroadcaster" persist="height"
ondraggesture="nsDragAndDrop.startDrag(event, calendarTaskButtonDNDObserver);"
ondragover="nsDragAndDrop.dragOver(event, calendarTaskButtonDNDObserver);"
ondragdrop="nsDragAndDrop.drop(event, calendarTaskButtonDNDObserver);"/>
</vbox>
</box>
</modevbox>
</overlay>

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

@ -138,10 +138,24 @@
]]></getter>
</property>
<method name="setVisible">
<method name="isVisible">
<parameter name="aMode"/>
<body><![CDATA[
var lMode = aMode || this.currentMode;
var collapsedModes = this.getAttribute("collapsedinmodes").split(",");
var modeIndex = collapsedModes.indexOf(this.currentMode);
return (modeIndex == -1);
]]></body>
</method>
<method name="setVisible">
<parameter name="aVisible"/>
<parameter name="aCheckModeCollapsed"/>
<parameter name="aPushModeCollapsedAttribute"/>
<parameter name="aNotifyRefControl"/>
<body><![CDATA[
var notifyRefControl = ((aNotifyRefControl == null) || (aNotifyRefControl === true))
var pushModeCollapsedAttribute = ((aPushModeCollapsedAttribute == null)
|| (aPushModeCollapsedAttribute === true));
var collapsedModes = [];
var modeIndex = -1;
var display = aVisible;
@ -151,11 +165,11 @@
var modeIndex = collapsedModes.indexOf(this.currentMode);
collapsedInMode = (modeIndex > -1);
}
if ((aVisible === true) && (aCheckModeCollapsed)){
if ((aVisible === true) && (pushModeCollapsedAttribute == false)){
display = (aVisible === true) && (!collapsedInMode);
}
setBooleanAttribute(this, "collapsed", (!display));
if (aCheckModeCollapsed == null) {
if (pushModeCollapsedAttribute) {
if (!display) {
if (modeIndex == -1) {
collapsedModes.push(this.currentMode);
@ -170,7 +184,8 @@
if (id) {
document.persist(id, "collapsedinmodes");
}
} else if (aCheckModeCollapsed === true) {
}
if (notifyRefControl === true) {
if (this.hasAttribute("refcontrol")) {
var command = document.getElementById(this.getAttribute("refcontrol"))
if (command) {
@ -184,7 +199,7 @@
<method name="_isVisibleInCurrentMode">
<parameter name="aMode"/>
<body><![CDATA[
var lMode = aMode || currentMode;
var lMode = aMode || this.currentMode;
var display = true;
var lModes = new Array();
if (this.hasAttribute("mode")) {
@ -204,7 +219,7 @@
<body><![CDATA[
if (aEvent.attrName == "mode") {
var display = aBinding._isVisibleInCurrentMode(aEvent.newValue);
aBinding.setVisible(display, true);
aBinding.setVisible(display, false, true);
}
]]></body>
</method>
@ -215,7 +230,7 @@
var command = aEvent.target;
var newValue = (command.getAttribute("checked") == "true" ? "false" : "true");
command.setAttribute("checked", newValue);
this.setVisible(newValue == "true");
this.setVisible(newValue == "true", true, true);
]]></body>
</method>
@ -224,7 +239,7 @@
<parameter name="aBinding"/>
<body><![CDATA[
var newValue = aEvent.target.checked;
this.setVisible(newValue);
this.setVisible(newValue, true, true);
]]></body>
</method>
<method name="setAttribute">

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

@ -2,6 +2,8 @@
calendar.jar:
% content calendar %content/calendar/
content/calendar/agenda-listbox.js (content/agenda-listbox.js)
content/calendar/agenda-listbox.xml (content/agenda-listbox.xml)
* content/calendar/calendar-alarm-dialog.js (content/calendar-alarm-dialog.js)
content/calendar/calendar-alarm-dialog.xul (content/calendar-alarm-dialog.xul)
content/calendar/calendar-alarm-snooze-popup.xul (content/calendar-alarm-snooze-popup.xul)

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

@ -2027,7 +2027,7 @@ function removeAnonymousElement(aParentNode, aId) {
function getParentNode(aNode, aLocalName) {
var node = aNode;
do {
node = node.parentNode;
node = node && node.parentNode;
} while (node && (node.localName != aLocalName));
return node;
}

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

@ -213,22 +213,34 @@ toolbar[iconsize="small"] #calendar-unifinder-button[disabled="true"] {
* Show Today-Pane button
*-------------------------------------------------------------------*/
#mail-show-todaypane-button,
#task-show-todaypane-button,
#calendar-show-todaypane-button {
-moz-image-region: rect(0px 672px 32px 640px);
}
#mail-show-todaypane-button:active,
#task-show-todaypane-button:active,
#calendar-show-todaypane-button:active {
-moz-image-region: rect(32px 672px 64px 640px);
}
#mail-show-todaypane-button[disabled="true"],
#task-show-todaypane-button[disabled="true"],
#calendar-show-todaypane-button[disabled="true"] {
-moz-image-region: rect(64px 672px 96px 640px);
}
toolbar[iconsize="small"] #mail-show-todaypane-button,
toolbar[iconsize="small"] #task-show-todaypane-button,
toolbar[iconsize="small"] #calendar-show-todaypane-button {
-moz-image-region: rect(0px 504px 24px 480px);
}
toolbar[iconsize="small"] #mail-show-todaypane-button:active,
toolbar[iconsize="small"] #task-show-todaypane-button:active,
toolbar[iconsize="small"] #calendar-show-todaypane-button:active {
-moz-image-region: rect(24px 504px 48px 480px);
}
toolbar[iconsize="small"] #mail-show-todaypane-button[disabled="true"],
toolbar[iconsize="small"] #task-show-todaypane-button[disabled="true"],
toolbar[iconsize="small"] #calendar-show-todaypane-button[disabled="true"] {
-moz-image-region: rect(48px 504px 72px 480px);
}

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

@ -175,19 +175,19 @@
}
agenda-checkbox-richlist-item {
-moz-binding: url("chrome://lightning/content/agenda-listbox.xml#agenda-checkbox-richlist-item");
-moz-binding: url("chrome://calendar/content/agenda-listbox.xml#agenda-checkbox-richlist-item");
-moz-user-focus: normal;
overflow: hidden;
}
agenda-richlist-item {
-moz-binding: url("chrome://lightning/content/agenda-listbox.xml#agenda-richlist-item");
-moz-binding: url("chrome://calendar/content/agenda-listbox.xml#agenda-richlist-item");
-moz-user-focus: normal;
overflow: hidden;
}
agenda-allday-richlist-item {
-moz-binding: url("chrome://lightning/content/agenda-listbox.xml#agenda-allday-richlist-item");
-moz-binding: url("chrome://calendar/content/agenda-listbox.xml#agenda-allday-richlist-item");
-moz-user-focus: normal;
overflow: hidden;
}

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

@ -292,17 +292,29 @@ toolbar[iconsize="small"] #calendar-go-to-today-button:hover:active {
* Show TodayPane button
*-------------------------------------------------------------------*/
#mail-show-todaypane-button,
#task-show-todaypane-button,
#calendar-show-todaypane-button {
-moz-image-region: rect(0px 504px 24px 480px);
}
#mail-show-todaypane-button[disabled="true"],
#mail-show-todaypane-button[disabled="true"]:hover,
#mail-show-todaypane-button[disabled="true"]:hover:active,
#task-show-todaypane-button[disabled="true"],
#task-show-todaypane-button[disabled="true"]:hover,
#task-show-todaypane-button[disabled="true"]:hover:active,
#calendar-show-todaypane-button[disabled="true"],
#calendar-show-todaypane-button[disabled="true"]:hover,
#calendar-show-todaypane-button[disabled="true"]:hover:active {
-moz-image-region: rect(48px 504px 72px 480px);
}
#mail-show-todaypane-button:hover,
#task-show-todaypane-button:hover,
#calendar-show-todaypane-button:hover {
-moz-image-region: rect(24px 504px 48px 480px);
}
#mail-show-todaypane-button:hover:active,
#task-show-todaypane-button:hover:active,
#calendar-show-todaypane-button:hover:active {
}
@ -310,17 +322,29 @@ toolbar[iconsize="small"] #calendar-go-to-today-button:hover:active {
* Show TodayPane button - small
*-------------------------------------------------------------------*/
toolbar[iconsize="small"] #mail-show-todaypane-button,
toolbar[iconsize="small"] #task-show-todaypane-button,
toolbar[iconsize="small"] #calendar-show-todaypane-button {
-moz-image-region: rect(0px 336px 16px 320px);
}
toolbar[iconsize="small"] #mail-show-todaypane-button[disabled="true"],
toolbar[iconsize="small"] #mail-show-todaypane-button[disabled="true"]:hover,
toolbar[iconsize="small"] #mail-show-todaypane-button[disabled="true"]:hover:active,
toolbar[iconsize="small"] #task-show-todaypane-button[disabled="true"],
toolbar[iconsize="small"] #task-show-todaypane-button[disabled="true"]:hover,
toolbar[iconsize="small"] #task-show-todaypane-button[disabled="true"]:hover:active,
toolbar[iconsize="small"] #calendar-show-todaypane-button[disabled="true"],
toolbar[iconsize="small"] #calendar-show-todaypane-button[disabled="true"]:hover,
toolbar[iconsize="small"] #calendar-show-todaypane-button[disabled="true"]:hover:active {
-moz-image-region: rect(32px 336px 48px 320px);
}
toolbar[iconsize="small"] #mail-show-todaypane-button:hover,
toolbar[iconsize="small"] #task-show-todaypane-button:hover,
toolbar[iconsize="small"] #calendar-show-todaypane-button:hover {
-moz-image-region: rect(16px 336px 32px 320px);
}
toolbar[iconsize="small"] #mail-show-todaypane-button:hover:active,
toolbar[iconsize="small"] #task-show-todaypane-button:hover:active,
toolbar[iconsize="small"] #calendar-show-todaypane-button:hover:active {
}

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

@ -178,19 +178,19 @@
}
agenda-checkbox-richlist-item {
-moz-binding: url("chrome://lightning/content/agenda-listbox.xml#agenda-checkbox-richlist-item");
-moz-binding: url("chrome://calendar/content/agenda-listbox.xml#agenda-checkbox-richlist-item");
-moz-user-focus: normal;
overflow: hidden;
}
agenda-richlist-item {
-moz-binding: url("chrome://lightning/content/agenda-listbox.xml#agenda-richlist-item");
-moz-binding: url("chrome://calendar/content/agenda-listbox.xml#agenda-richlist-item");
-moz-user-focus: normal;
overflow: hidden;
}
agenda-allday-richlist-item {
-moz-binding: url("chrome://lightning/content/agenda-listbox.xml#agenda-allday-richlist-item");
-moz-binding: url("chrome://calendar/content/agenda-listbox.xml#agenda-allday-richlist-item");
-moz-user-focus: normal;
overflow: hidden;
}

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

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

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

@ -46,6 +46,7 @@
<script type="application/x-javascript" src="chrome://lightning/content/messenger-overlay-sidebar.js"/>
<script type="application/x-javascript" src="chrome://lightning/content/messenger-overlay-toolbar.js"/>
<script type="application/x-javascript" src="chrome://lightning/content/lightning-common-sets.js"/>
<script type="application/x-javascript" src="chrome://lightning/content/lightning-today-pane.js"/>
<script type="application/x-javascript" src="chrome://calendar/content/calendar-invitations-manager.js"/>
<script type="application/x-javascript">
var calendarmenulabel = "&lightning.calendar.label;";

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

@ -0,0 +1,127 @@
/* ***** 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 Sun Microsystems code.
*
* The Initial Developer of the Original Code is Sun Microsystems.
* Portions created by the Initial Developer are Copyright (C) 2008
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Berend Cornelius <berend.cornelius@sun.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 ltnTodaypaneButton = "mail-show-todaypane-button";
function ltnAddButtonToDefaultset(toolbarSetString) {
var mailToolbar = getMailBar();
var elementcount = mailToolbar.childNodes.length;
var buttonisWithinSet = false;
// by default the todaypane-button is to be placed before the first
// separator of the toolbar
for (var i = 0; i < elementcount; i++) {
var element = mailToolbar.childNodes[i];
if (element.localName == "toolbarseparator") {
var separatorindex = toolbarSetString.indexOf("separator");
if (separatorindex > -1) {
var firstSubString = toolbarSetString.substring(0, separatorindex);
var secondSubString = toolbarSetString.substring(separatorindex);
toolbarSetString = firstSubString + ltnTodaypaneButton + "," + secondSubString;
}
buttonisWithinSet = true;
break;
}
}
if (!buttonisWithinSet) {
// in case there is no separator within the toolbar we append the
// todaypane-button
toolbarSetString += "," + ltnTodaypaneButton;
}
return toolbarSetString;
}
function ltnAddButtonToToolbarset() {
var mailToolbar = getMailBar();
var elementcount = mailToolbar.childNodes.length;
var buttonisWithinSet = false;
// by default the todaypane-button is to be placed before the first
// separator of the toolbar
for (var i = 0; i < elementcount; i++) {
var element = mailToolbar.childNodes[i];
if (element.localName == "toolbarseparator") {
mailToolbar.insertItem(ltnTodaypaneButton, element, null, false);
buttonisWithinSet = true;
break;
}
}
if (!buttonisWithinSet) {
// in case there is no separator within the toolbar we append the
// todaypane-button
mailToolbar.insertItem(ltnTodaypaneButton, null, null, false);
}
}
/** ltnInitTodayPane()
* initializes TodayPane for Lightning and adds a toolbarbutton to mail-toolbar once
*/
function ltnInitTodayPane() {
// set Lightning attributes for current mode and restore last PaneView
// add a menuitem to the 'View/Layout' -menu. As the respective "Layout" menupopup
// carries no 'id' attribute it cannot be overlaid
var todayMenuItem = document.getElementById("ltnShowTodayPane");
todayMenuItem = todayMenuItem.cloneNode(false);
todayMenuItem.setAttribute("id", "ltnShowTodayPaneMailMode");
todayMenuItem.removeAttribute("mode");
var messagePaneMenu = document.getElementById("menu_MessagePaneLayout");
if (messagePaneMenu != null) {
var messagePanePopupMenu = messagePaneMenu.firstChild;
messagePanePopupMenu.appendChild(todayMenuItem);
}
// add toolbar-button to mail-toolbar
var mailToolbar = getMailBar();
var addToolbarbutton = false;
var defaultSetString = mailToolbar.getAttribute("defaultset");
if (defaultSetString.indexOf(ltnTodaypaneButton) == -1) {
defaultSetString = ltnAddButtonToDefaultset(defaultSetString);
mailToolbar.setAttribute("defaultset", defaultSetString);
}
// add the toolbarbutton to the toolbarpalette on first startup
var todaypanebox = document.getElementById("today-pane-panel");
if (todaypanebox.hasAttribute("addtoolbarbutton")) {
addToolbarbutton = (todaypanebox.getAttribute("addtoolbarbutton") == "true");
}
if (addToolbarbutton) {
var currentSetString = mailToolbar.getAttribute("currentset");
if (currentSetString.indexOf(ltnTodaypaneButton) == -1) {
ltnAddButtonToToolbarset();
}
todaypanebox.setAttribute("addtoolbarbutton", "false");
}
}

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

@ -45,10 +45,23 @@
tooltiptext="&calendar.delete.button.tooltip;"
observes="lightning_delete_item_command"/>
<toolbarbutton id="calendar-show-todaypane-button"
mode="calendar"
class="cal-toolbarbutton-1"
label="&calendar.context.button.label;"
tooltiptext="&calendar.todaypane.button.tooltip;"
command="cmd_toggleTodayPane"/>
command="calendar_toggle_todaypane_command"/>
<toolbarbutton id="task-show-todaypane-button"
mode="task"
class="cal-toolbarbutton-1"
label="&calendar.context.button.label;"
tooltiptext="&calendar.todaypane.button.tooltip;"
command="calendar_toggle_todaypane_command"/>
<toolbarbutton id="mail-show-todaypane-button"
mode="mail"
class="cal-toolbarbutton-1"
label="&calendar.context.button.label;"
tooltiptext="&calendar.todaypane.button.tooltip;"
command="calendar_toggle_todaypane_command"/>
<toolbarbutton id="calendar-edit-button"
mode="calendar"
class="cal-toolbarbutton-1"

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

@ -261,7 +261,9 @@ function ltnOnLoad(event)
var filter = document.getElementById("task-tree-filtergroup");
filter.value = filter.value || "all";
}
document.getElementById("modeBroadcaster").setAttribute("mode", gCurrentMode);
ltnInitTodayPane();
}
function onSelectionChanged(aEvent) {
var selectedItems = aEvent.detail;
@ -389,23 +391,6 @@ function ltnShowCalendarView(type)
ltnSelectCalendarView(type);
}
function toggleTodayPaneinMailMode()
{
var oTodayPane = document.getElementById("today-pane-panel");
var todayPaneCommand = document.getElementById('cmd_toggleTodayPane');
if (oTodayPane.hasAttribute("collapsed")) {
oTodayPane.removeAttribute("collapsed");
oTodayPane.removeAttribute("collapsedinMailMode");
todayPaneCommand.setAttribute("checked","true");
document.getElementById("today-closer").setAttribute("checked", "false");
}
else {
oTodayPane.setAttribute("collapsed", true);
oTodayPane.setAttribute("collapsedinMailMode", "true");
todayPaneCommand.setAttribute("checked", "false");
}
}
/**
* This function has the sole responsibility to switch back to

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

@ -279,6 +279,15 @@
label="&calendar.tasks.view.calendarlist.label;"
accesskey="&calendar.tasks.view.calendarlist.accesskey;"
command="calendar_toggle_calendarlist_command"/>
<menuseparator id="before-today-pane" mode="mail,calendar,task"/>
<menuitem id="ltnShowTodayPane"
label="&calendar.context.button.label;"
accesskey="&calendar.context.button.accesskey;"
type="checkbox"
key="todaypanekey"
mode="mail,calendar,task"
command="calendar_toggle_todaypane_command"/>
</menupopup>
<menupopup id="view_toolbars_popup">
<menuitem id="ltnCalendarToolbar"
@ -310,7 +319,7 @@
<broadcasterset id="calendar_broadcasters">
<broadcaster id="is_editable" hidden="false"/>
<broadcaster id="modeBroadcaster" mode="mail"/>
<broadcaster id="modeBroadcaster"/>
<broadcaster id="filterBroadcaster" value="all"/>
</broadcasterset>
@ -338,7 +347,7 @@
<keyset id="ltnKeys">
<key id="openLightningKey" modifiers="accel" key="3" observes="switch2calendar"/>
<key id="openTasksKey" modifiers="accel" key="4" command="switch2task"/>
<key id="todaypanekey" command="cmd_toggleTodayPane" keycode="VK_F11"/>
<key id="todaypanekey" command="calendar_toggle_todaypane_command" keycode="VK_F11"/>
<key id="newEventKey" key="I" modifiers="accel" command="calendar_new_event_command"/>
<key id="newTaskKey" key="D" modifiers="accel" command="calendar_new_todo_command"/>
<key id="day-view-key" key="1" modifiers="alt" command="calendar_day-view_command"/>
@ -572,6 +581,12 @@
</toolbox>
</vbox>
<splitter id="today-splitter" collapse="after" resizebefore="closest" state="collapsed">
<grippy/>
</splitter>
<modevbox id="today-pane-panel"
addtoolbarbutton="true"
persist="width addtoolbarbutton"/>
</hbox>
<deck id="displayDeck">

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

@ -84,7 +84,7 @@
context="toolbar-context-menu"
collapsed="true"
collapsedinMode="false"
defaultset="calendar-new-event-button,calendar-new-task-button,separator,calendar-go-to-today-button,separator,calendar-day-view-button,calendar-week-view-button,calendar-multiweek-view-button,calendar-month-view-button,separator,calendar-unifinder-button,separator,calendar-delete-button,calendar-print-button,separator,calendar-remote-reload-button,spring"
defaultset="calendar-new-event-button,calendar-new-task-button,calendar-show-todaypane-button,separator,calendar-go-to-today-button,separator,calendar-day-view-button,calendar-week-view-button,calendar-multiweek-view-button,calendar-month-view-button,separator,calendar-unifinder-button,separator,calendar-delete-button,calendar-print-button,separator,calendar-remote-reload-button,spring"
persist="collapsedinMode"/>
<toolbar id="task-toolbar"
class="chromeclass-toolbar"
@ -92,7 +92,7 @@
context="toolbar-context-menu"
collapsed="true"
collapsedinMode="false"
defaultset="task-new-event-button,task-new-task-button,task-button-address,separator,task-category-button,task-progress-button,task-priority-button,separator,task-delete-button,task-print-button,separator,task-remote-reload-button,spring"
defaultset="task-new-event-button,task-new-task-button,task-button-address,calendar-show-todaypane-button,separator,task-category-button,task-progress-button,task-priority-button,separator,task-delete-button,task-print-button,separator,task-remote-reload-button,spring"
persist="collapsedinMode"/>
</toolbox>

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

@ -15,24 +15,23 @@ lightning.jar:
% overlay chrome://lightning/content/messenger-overlay-sidebar.xul chrome://calendar/content/calendar-unifinder.xul
% overlay chrome://lightning/content/messenger-overlay-sidebar.xul chrome://calendar/content/calendar-unifinder-todo.xul
% overlay chrome://lightning/content/messenger-overlay-sidebar.xul chrome://calendar/content/calendar-task-view.xul
% overlay chrome://lightning/content/messenger-overlay-sidebar.xul chrome://calendar/content/today-pane.xul
% overlay chrome://lightning/content/lightning-standalone.xul chrome://lightning/content/messenger-overlay-sidebar.xul
% overlay chrome://global/content/customizeToolbar.xul chrome://lightning/content/toolkit-overlay-custombar.xul
% overlay chrome://messenger/content/messenger.xul chrome://calendar/content/today-pane.xul
% skin lightning classic/1.0 %skin/classic/lightning/
content/lightning/agenda-listbox.js (content/agenda-listbox.js)
content/lightning/agenda-listbox.xml (content/agenda-listbox.xml)
content/lightning/customize-toolbar.js (content/customize-toolbar.js)
content/lightning/customize-toolbar.xul (content/customize-toolbar.xul)
content/lightning/imip-bar.js (content/imip-bar.js)
content/lightning/imip-bar-overlay.xul (content/imip-bar-overlay.xul)
content/lightning/lightning-common-sets.js (content/lightning-common-sets.js)
content/lightning/lightning-migration.xul (content/lightning-migration.xul)
content/lightning/lightning-standalone.xul (content/lightning-standalone.xul)
content/lightning/lightning-utils.js (content/lightning-utils.js)
content/lightning/lightning-widgets.css (content/lightning-widgets.css)
content/lightning/messenger-overlay-sidebar.css (content/messenger-overlay-sidebar.css)
content/lightning/messenger-overlay-sidebar.js (content/messenger-overlay-sidebar.js)
* content/lightning/messenger-overlay-sidebar.xul (content/messenger-overlay-sidebar.xul)
content/lightning/lightning-standalone.xul (content/lightning-standalone.xul)
content/lightning/lightning-utils.js (content/lightning-utils.js)
content/lightning/lightning-widgets.css (content/lightning-widgets.css)
content/lightning/lightning-today-pane.js (content/lightning-today-pane.js)
content/lightning/messenger-overlay-sidebar.css (content/messenger-overlay-sidebar.css)
content/lightning/messenger-overlay-sidebar.js (content/messenger-overlay-sidebar.js)
* content/lightning/messenger-overlay-sidebar.xul (content/messenger-overlay-sidebar.xul)
content/lightning/messenger-overlay-preferences.js (content/messenger-overlay-preferences.js)
content/lightning/messenger-overlay-preferences.xul (content/messenger-overlay-preferences.xul)
content/lightning/messenger-overlay-toolbar.js (content/messenger-overlay-toolbar.js)

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

@ -257,8 +257,9 @@
<!ENTITY calendar.context.selectall.label "Select All">
<!ENTITY calendar.context.selectall.accesskey "A">
<!ENTITY calendar.context.gototoday.label "Go to Today">
<!ENTITY calendar.context.button.label "Today Pane" >
<!ENTITY calendar.context.gototoday.accesskey "T">
<!ENTITY calendar.context.button.label "Today Pane" >
<!ENTITY calendar.context.button.accesskey "T" >
<!ENTITY calendar.context.emailevent.label "Email Selected Events…">
<!ENTITY calendar.context.emailevent.accesskey "i">

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

@ -330,8 +330,6 @@ eventsonly=Events
eventsandtasks=Events and Tasks
tasksonly=Tasks
shortcalendarweek=CW
todaypane=Today Pane
todaypane-accesskey=T
go=Go