зеркало из https://github.com/mozilla/gecko-dev.git
getting event dialog wired up for lightning
This commit is contained in:
Родитель
0f2bb076ba
Коммит
b0f46a53e2
|
@ -0,0 +1,100 @@
|
|||
/* -*- Mode: javascript; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is Oracle Corporation code.
|
||||
*
|
||||
* The Initial Developer of the Original Code is Oracle Corporation
|
||||
* Portions created by the Initial Developer are Copyright (C) 2005
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Stuart Parmenter <stuart.parmenter@oracle.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 ***** */
|
||||
|
||||
|
||||
/* all params are optional */
|
||||
function createEventWithDialog(calendar, startDate, endDate, summary)
|
||||
{
|
||||
var event = createEvent();
|
||||
|
||||
if (!startDate) {
|
||||
startDate = jsDateToDateTime(new Date());
|
||||
startDate.second = 0;
|
||||
startDate.normalize();
|
||||
}
|
||||
event.startDate = startDate.clone();
|
||||
|
||||
if (!endDate) {
|
||||
endDate = startDate.clone();
|
||||
endDate.hour = endDate.hour + 1; // XXX we should get a default duration from prefs
|
||||
endDate.normalize();
|
||||
}
|
||||
event.endDate = endDate.clone();
|
||||
|
||||
if (summary)
|
||||
event.title = summary;
|
||||
|
||||
var onNewEvent = function(event, calendar, originalEvent) {
|
||||
calendar.addItem(event, null);
|
||||
}
|
||||
|
||||
openEventDialog(event, calendar, "new", onNewEvent);
|
||||
}
|
||||
|
||||
|
||||
function modifyEventWithDialog(event)
|
||||
{
|
||||
var onModifyEvent = function(event, calendar, originalEvent) {
|
||||
// compare cal.uri because there may be multiple instances of
|
||||
// calICalendar or uri for the same spec, and those instances are
|
||||
// not ==.
|
||||
if (!originalEvent.parent ||
|
||||
(originalEvent.parent.uri.equals(calendar.uri)))
|
||||
calendar.modifyItem(calendarEvent, null);
|
||||
else {
|
||||
originalEvent.parent.deleteItem(calendarEvent, null);
|
||||
calendar.addItem(calendarEvent, null);
|
||||
}
|
||||
}
|
||||
|
||||
openEventDialog(event, calendar, "modify", onModifyEvent);
|
||||
}
|
||||
|
||||
function openEventDialog(calendarEvent, calendar, mode, callback)
|
||||
{
|
||||
var args = new Object();
|
||||
args.calendarEvent = calendarEvent;
|
||||
args.calendar = calendar;
|
||||
args.mode = mode;
|
||||
args.onOk = callback;
|
||||
|
||||
// wait cursor will revert to auto in eventDialog.js loadCalendarEventDialog
|
||||
window.setCursor("wait");
|
||||
// open the dialog modally
|
||||
openDialog("chrome://calendar/content/eventDialog.xul", "caEditEvent", "chrome,titlebar,modal", args);
|
||||
}
|
||||
|
|
@ -80,7 +80,7 @@ var ltnCalendarViewController = {
|
|||
},
|
||||
|
||||
createNewEvent: function (aCalendar, aStartTime, aEndTime) {
|
||||
dump ("+++ createNewEvent!!\n");
|
||||
createEventWithDialog(aCalendar, aStartTime, aEndTime);
|
||||
},
|
||||
|
||||
modifyEventTime: function (aCalendar, aEvent, aNewStartTime, aNewEndTime) {
|
||||
|
|
|
@ -1,164 +0,0 @@
|
|||
/* -*- Mode: javascript; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is Oracle Corporation code.
|
||||
*
|
||||
* The Initial Developer of the Original Code is Oracle Corporation
|
||||
* Portions created by the Initial Developer are Copyright (C) 2005
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Stuart Parmenter <stuart.parmenter@oracle.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 ***** */
|
||||
|
||||
/*
|
||||
every view needs to have the following:
|
||||
|
||||
properties:
|
||||
displayCalendar calICalendar
|
||||
startDate calIDateTime
|
||||
endDate calIDateTime
|
||||
|
||||
functions:
|
||||
goToDay
|
||||
goToNext
|
||||
goToPrevious
|
||||
*/
|
||||
|
||||
function CalendarView()
|
||||
{
|
||||
}
|
||||
|
||||
CalendarView.prototype = {
|
||||
|
||||
|
||||
setDisplayCalendar: function(calendar) {
|
||||
this.displayCalendar = calendar;
|
||||
},
|
||||
|
||||
/* public stuff */
|
||||
refresh: function() {
|
||||
var savedThis = this;
|
||||
var getListener = {
|
||||
onOperationComplete: function(aCalendar, aStatus, aOperationType, aId, aDetail) {},
|
||||
onGetResult: function(aCalendar, aStatus, aItemType, aDetail, aCount, aItems) {
|
||||
for (var i = 0; i < aCount; ++i) {
|
||||
savedThis.createEventBox(aItems[i],
|
||||
function(a1, a2, a3) {
|
||||
eventController.createEventBoxInternal(a1, a2, a3);
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
var calendar = this.displayCalendar;
|
||||
calendar.getItems(calendar.ITEM_FILTER_TYPE_EVENT | calendar.ITEM_FILTER_CLASS_OCCURRENCES,
|
||||
0, this.startDate, this.endDate, getListener);
|
||||
},
|
||||
|
||||
goToToday: function() {
|
||||
var today = jsDateToDateTime(Date());
|
||||
this.goToDay(today);
|
||||
},
|
||||
|
||||
goToDay: function(date) {
|
||||
|
||||
},
|
||||
|
||||
goToNext: function() {
|
||||
|
||||
},
|
||||
|
||||
goToPrevious: function() {
|
||||
},
|
||||
|
||||
|
||||
/* protected stuff */
|
||||
removeElementsByAttribute: function(attributeName, attributeValue) {
|
||||
var liveList = document.getElementsByAttribute(attributeName, attributeValue);
|
||||
// Delete in reverse order. Moz1.8+ getElementsByAttribute list is
|
||||
// 'live', so when an element is deleted the indexes of later elements
|
||||
// change, but in Moz1.7- list is 'dead'. Reversed order works with both.
|
||||
for (var i = liveList.length - 1; i >= 0; i--) {
|
||||
var element = liveList.item(i);
|
||||
if (element.parentNode != null)
|
||||
element.parentNode.removeChild(element);
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
/* private stuff */
|
||||
createEventBox: function(aItemOccurrence, aInteralFunction) {
|
||||
var startDate;
|
||||
var origEndDate;
|
||||
|
||||
if ("displayTimezone" in this) {
|
||||
startDate = aItemOccurrence.occurrenceStartDate.getInTimezone(this.displayTimezone).clone();
|
||||
origEndDate = aItemOccurrence.occurrenceEndDate.getInTimezone(this.displayTimezone).clone();
|
||||
} else {
|
||||
// Copy the values from jsDate. jsDate is in de users timezone
|
||||
// It's a hack, but it kind of works. It doesn't set the right
|
||||
// timezone info for the date, but that's not a real problem.
|
||||
startDate = aItemOccurrence.occurrenceStartDate.clone();
|
||||
startDate.year = startDate.jsDate.getFullYear();
|
||||
startDate.month = startDate.jsDate.getMonth();
|
||||
startDate.day = startDate.jsDate.getDate();
|
||||
startDate.hour = startDate.jsDate.getHours();
|
||||
startDate.minute = startDate.jsDate.getMinutes();
|
||||
startDate.second = startDate.jsDate.getSeconds();
|
||||
startDate.normalize();
|
||||
|
||||
origEndDate = aItemOccurrence.occurrenceEndDate.clone();
|
||||
origEndDate.year = origEndDate.jsDate.getFullYear();
|
||||
origEndDate.month = origEndDate.jsDate.getMonth();
|
||||
origEndDate.day = origEndDate.jsDate.getDate();
|
||||
origEndDate.hour = origEndDate.jsDate.getHours();
|
||||
origEndDate.minute = origEndDate.jsDate.getMinutes();
|
||||
origEndDate.second = origEndDate.jsDate.getSeconds();
|
||||
origEndDate.normalize();
|
||||
}
|
||||
|
||||
var endDate = startDate.clone();
|
||||
endDate.hour = 23;
|
||||
endDate.minute = 59;
|
||||
endDate.second = 59;
|
||||
endDate.normalize();
|
||||
while (endDate.compare(origEndDate) < 0) {
|
||||
aInteralFunction(aItemOccurrence, startDate, endDate);
|
||||
|
||||
startDate.day = startDate.day + 1;
|
||||
startDate.hour = 0;
|
||||
startDate.minute = 0;
|
||||
startDate.second = 0;
|
||||
startDate.normalize();
|
||||
|
||||
endDate.day = endDate.day + 1;
|
||||
endDate.normalize();
|
||||
}
|
||||
aInteralFunction(aItemOccurrence, startDate, origEndDate);
|
||||
},
|
||||
};
|
|
@ -11,6 +11,7 @@
|
|||
|
||||
<script type="application/x-javascript" src="chrome://calendar/content/calendarUtils.js"/>
|
||||
<script type="application/x-javascript" src="chrome://calendar/content/calendarCreation.js"/>
|
||||
<script type="application/x-javascript" src="chrome://calendar/content/calendar-item-editing.js"/>
|
||||
<script type="application/x-javascript" src="chrome://lightning/content/lightning-utils.js"/>
|
||||
<script type="application/x-javascript" src="chrome://lightning/content/calendar-management.js"/>
|
||||
<script type="application/x-javascript" src="chrome://lightning/content/messenger-overlay-sidebar.js"/>
|
||||
|
|
|
@ -1,203 +0,0 @@
|
|||
/* -*- Mode: javascript; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is Oracle Corporation code.
|
||||
*
|
||||
* The Initial Developer of the Original Code is Oracle Corporation
|
||||
* Portions created by the Initial Developer are Copyright (C) 2005
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Stuart Parmenter <stuart.parmenter@oracle.com>
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
function WeekView()
|
||||
{
|
||||
}
|
||||
|
||||
WeekView.prototype = {
|
||||
__proto__: CalendarView ? (new CalendarView()) : {},
|
||||
|
||||
refresh: function() {
|
||||
// clean up anything that was here before
|
||||
this.removeElementsByAttribute("eventbox", "weekview");
|
||||
|
||||
// XXX we need to do a lot more work to update column headers, etc here as well.
|
||||
|
||||
this.__proto__.refresh();
|
||||
},
|
||||
|
||||
goToDay: function(date) {
|
||||
// compute this.startDate and this.endDate from date
|
||||
this.startDate = date.clone();
|
||||
this.endDate = date.clone();
|
||||
|
||||
this.startDate.day -= this.startDate.weekday;
|
||||
this.startDate.hour = this.startDate.minute = this.startDate.second = 0;
|
||||
this.startDate.normalize();
|
||||
|
||||
this.endDate.day += (6 - this.endDate.weekday);
|
||||
this.endDate.hour = 23;
|
||||
this.endDate.minute = 59;
|
||||
this.endDate.second = 59;
|
||||
this.endDate.normalize();
|
||||
|
||||
this.refresh();
|
||||
},
|
||||
|
||||
goToNext: function() {
|
||||
var currentEndDate = this.endDate.clone();
|
||||
currentEndDate.day += 7;
|
||||
currentEndDate.normalize();
|
||||
goToDay(currentEndDate);
|
||||
},
|
||||
|
||||
goToPrevious: function() {
|
||||
var currentEndDate = this.endDate.clone();
|
||||
currentEndDate.day -= 7;
|
||||
currentEndDate.normalize();
|
||||
goToDay(currentEndDate);
|
||||
},
|
||||
|
||||
};
|
||||
|
||||
|
||||
WeekView.prototype.createEventBoxInternal = function(itemOccurrence, startDate, endDate)
|
||||
{
|
||||
var calEvent = itemOccurrence.item.QueryInterface(Components.interfaces.calIEvent);
|
||||
|
||||
// Check if the event is within the bounds of events to be displayed.
|
||||
if ((endDate.jsDate < this.displayStartDate) ||
|
||||
(startDate.jsDate > this.displayEndDate))
|
||||
return;
|
||||
|
||||
// XXX Should this really be done? better would be to adjust the
|
||||
// lowestStart and highestEnd
|
||||
if ((endDate.hour < this.lowestStartHour) ||
|
||||
(startDate.hour > this.highestEndHour))
|
||||
return;
|
||||
|
||||
if (startDate.hour < this.lowestStartHour) {
|
||||
startDate.hour = this.lowestStartHour;
|
||||
startDate.normalize();
|
||||
}
|
||||
if (endDate.hour > this.highestEndHour) {
|
||||
endDate.hour = this.highestEndHour;
|
||||
endDate.normalize();
|
||||
}
|
||||
|
||||
dump(startDate+" "+endDate+"\n");
|
||||
dump(this.displayEndDate+"\n");
|
||||
|
||||
/*
|
||||
if (calEvent.isAllDay) {
|
||||
endDate = endDate.clone();
|
||||
endDate.hour = 23;
|
||||
endDate.minute = 59;
|
||||
endDate.normalize();
|
||||
}
|
||||
*/
|
||||
debug("all day: " + calEvent.isAllDay + "\n");
|
||||
debug("startdate: " + startDate + "\n");
|
||||
debug("enddate: " + endDate + "\n");
|
||||
|
||||
var startHour = startDate.hour;
|
||||
var startMinutes = startDate.minute;
|
||||
var eventDuration = (endDate.jsDate - startDate.jsDate) / (60 * 60 * 1000);
|
||||
|
||||
debug("duration: " + eventDuration + "\n");
|
||||
|
||||
var eventBox = document.createElement("vbox");
|
||||
|
||||
// XXX Consider changing this to only store the ID
|
||||
eventBox.event = calEvent;
|
||||
|
||||
var ElementOfRef = document.getElementById("week-tree-day-" + gRefColumnIndex + "-item-" + startHour) ;
|
||||
var hourHeight = ElementOfRef.boxObject.height;
|
||||
var ElementOfRefEnd = document.getElementById("week-tree-day-" + gRefColumnIndex + "-item-" + endDate.hour) ;
|
||||
var hourHeightEnd = ElementOfRefEnd.boxObject.height;
|
||||
|
||||
var hourWidth = ElementOfRef.boxObject.width;
|
||||
var eventSlotWidth = Math.round(hourWidth / 1/*calendarEventDisplay.totalSlotCount*/);
|
||||
|
||||
var Width = ( 1 /*calendarEventDisplay.drawSlotCount*/ * eventSlotWidth ) - 1;
|
||||
eventBox.setAttribute( "width", Width );
|
||||
|
||||
var top = eval( ElementOfRef.boxObject.y + ( ( startMinutes/60 ) * hourHeight ) );
|
||||
top = top - ElementOfRef.parentNode.boxObject.y - 2;
|
||||
eventBox.setAttribute("top", top);
|
||||
|
||||
var bottom = eval( ElementOfRefEnd.boxObject.y + ( ( endDate.minute/60 ) * hourHeightEnd ) );
|
||||
bottom = bottom - ElementOfRefEnd.parentNode.boxObject.y - 2;
|
||||
eventBox.setAttribute("height", bottom - top);
|
||||
|
||||
// figure out what column we need to put this on
|
||||
debug("d: "+gHeaderDateItemArray[1].getAttribute("date")+"\n");
|
||||
var dayIndex = new Date(gHeaderDateItemArray[1].getAttribute("date"));
|
||||
var index = startDate.weekday - dayIndex.getDay();
|
||||
debug("index is:" + index + "(" + startDate.weekday + " - " + dayIndex.getDay() + ")\n");
|
||||
|
||||
var boxLeft = document.getElementById("week-tree-day-"+index+"-item-"+startHour).boxObject.x -
|
||||
document.getElementById( "week-view-content-box" ).boxObject.x +
|
||||
( /*calendarEventDisplay.startDrawSlot*/0 * eventSlotWidth );
|
||||
//dump(boxLeft + "\n");
|
||||
eventBox.setAttribute("left", boxLeft);
|
||||
|
||||
// set the event box to be of class week-view-event-class and the appropriate calendar-color class
|
||||
this.setEventboxClass(eventBox, calEvent, "week-view");
|
||||
|
||||
eventBox.setAttribute("eventbox", "weekview");
|
||||
eventBox.setAttribute("dayindex", index + 1);
|
||||
eventBox.setAttribute("onclick", "weekEventItemClick(this, event)" );
|
||||
eventBox.setAttribute("ondblclick", "weekEventItemDoubleClick(this, event)");
|
||||
eventBox.setAttribute("ondraggesture", "nsDragAndDrop.startDrag(event,calendarViewDNDObserver);");
|
||||
eventBox.setAttribute("ondragover", "nsDragAndDrop.dragOver(event,calendarViewDNDObserver)");
|
||||
eventBox.setAttribute("ondragdrop", "nsDragAndDrop.drop(event,calendarViewDNDObserver)");
|
||||
eventBox.setAttribute("id", "week-view-event-box-" + calEvent.id);
|
||||
eventBox.setAttribute("name", "week-view-event-box-" + calEvent.id);
|
||||
eventBox.setAttribute("onmouseover", "getEventToolTip(this, event)" );
|
||||
eventBox.setAttribute("tooltip", "eventTooltip");
|
||||
|
||||
// Event box text (title, location and description)
|
||||
if (calEvent.title || calEvent.getProperty("location")) {
|
||||
var titleText = ( (calEvent.title || "") +
|
||||
(calEvent.getProperty("location") ? " ("+calEvent.getProperty("location")+")" : "") );
|
||||
var titleElement = document.createElement( "label" );
|
||||
titleElement.setAttribute( "class", "week-view-event-title-label-class" );
|
||||
titleElement.appendChild( document.createTextNode( titleText ));
|
||||
eventBox.appendChild( titleElement );
|
||||
}
|
||||
if (calEvent.getProperty("description")) {
|
||||
var descriptionElement = document.createElement( "description" );
|
||||
descriptionElement.setAttribute( "class", "week-view-event-description-class" );
|
||||
descriptionElement.appendChild( document.createTextNode( calEvent.getProperty("description") ));
|
||||
eventBox.appendChild( descriptionElement );
|
||||
}
|
||||
|
||||
debug("Adding eventBox " + eventBox + "\n");
|
||||
document.getElementById("week-view-content-board").appendChild(eventBox);
|
||||
}
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -3,9 +3,6 @@ lightning.jar:
|
|||
content/lightning/messenger-overlay-sidebar.xul (content/messenger-overlay-sidebar.xul)
|
||||
content/lightning/messenger-overlay-sidebar.js (content/messenger-overlay-sidebar.js)
|
||||
content/lightning/calendar-management.js (content/calendar-management.js)
|
||||
content/lightning/weekView.xul (content/weekView.xul)
|
||||
content/lightning/weekView.js (content/weekView.js)
|
||||
content/lightning/calendarView.js (content/calendarView.js)
|
||||
content/lightning/lightning-widgets.css (content/lightning-widgets.css)
|
||||
|
||||
en-US.jar:
|
||||
|
@ -14,13 +11,31 @@ en-US.jar:
|
|||
calendar.jar:
|
||||
content/calendar/calendarCreation.xul (/calendar/resources/content/calendarCreation.xul)
|
||||
content/calendar/calendarCreation.js (/calendar/resources/content/calendarCreation.js)
|
||||
content/calendar/calendarUtils.js (/calendar/resources/content/calendarUtils.js)
|
||||
content/calendar/calendarUtils.js (/calendar/resources/content/calendarUtils.js)
|
||||
content/calendar/eventDialog.js (/calendar/resources/content/eventDialog.js)
|
||||
* content/calendar/eventDialog.xul (/calendar/resources/content/eventDialog.xul)
|
||||
* content/calendar/applicationUtil.js (/calendar/resources/content/applicationUtil.js)
|
||||
content/calendar/dateUtils.js (/calendar/resources/content/dateUtils.js)
|
||||
content/calendar/selectAddressesDialog.js (/calendar/resources/content/selectAddressesDialog.js)
|
||||
content/calendar/attachFile.js (/calendar/resources/content/attachFile.js)
|
||||
content/calendar/datetimepickers/datepicker.css (/calendar/resources/content/datetimepickers/datepicker.css)
|
||||
content/calendar/datetimepickers/datepicker.xbl (/calendar/resources/content/datetimepickers/datepicker.xbl)
|
||||
content/calendar/datetimepickers/datetimepicker.css (/calendar/resources/content/datetimepickers/datetimepicker.css)
|
||||
content/calendar/datetimepickers/datetimepicker.xbl (/calendar/resources/content/datetimepickers/datetimepicker.xbl)
|
||||
content/calendar/datetimepickers/timepicker.css (/calendar/resources/content/datetimepickers/timepicker.css)
|
||||
content/calendar/datetimepickers/timepicker.xbl (/calendar/resources/content/datetimepickers/timepicker.xbl)
|
||||
content/calendar/datetimepickers/minimonth.css (/calendar/resources/content/datetimepickers/minimonth.css)
|
||||
content/calendar/datetimepickers/minimonth.xbl (/calendar/resources/content/datetimepickers/minimonth.xbl)
|
||||
content/calendar/calendar-multiday-view.css (/calendar/base/content/calendar-multiday-view.css)
|
||||
content/calendar/calendar-multiday-view.xml (/calendar/base/content/calendar-multiday-view.xml)
|
||||
content/calendar/calendar-item-editing.js (/calendar/base/content/calendar-item-editing.js)
|
||||
|
||||
calendar-en-US.jar:
|
||||
locale/en-US/calendar/global.dtd (/calendar/resources/locale/en-US/global.dtd)
|
||||
locale/en-US/calendar/calendar.dtd (/calendar/resources/locale/en-US/calendar.dtd)
|
||||
locale/en-US/calendar/selectAddresses.dtd (/calendar/resources/locale/en-US/selectAddresses.dtd)
|
||||
locale/en-US/calendar/calendar.properties (/calendar/resources/locale/en-US/calendar.properties)
|
||||
locale/en-US/calendar/dateFormat.properties (/calendar/resources/locale/en-US/dateFormat.properties)
|
||||
|
||||
classic.jar:
|
||||
#expand skin/classic/lightning/lightning.css (themes/__THEME__/lightning.css)
|
||||
|
|
|
@ -1541,25 +1541,6 @@ function CalendarToolboxCustomizeDone(aToolboxChanged)
|
|||
window.focus();
|
||||
}
|
||||
|
||||
//
|
||||
// timezone pref bits
|
||||
//
|
||||
|
||||
// returns the TZID of the timezone pref
|
||||
var gDefaultTimezone = -1;
|
||||
function calendarDefaultTimezone() {
|
||||
if (gDefaultTimezone == -1) {
|
||||
var prefobj = prefService.getBranch("calendar.");
|
||||
try {
|
||||
gDefaultTimezone = prefobj.getCharPref("timezone.local");
|
||||
} catch (e) {
|
||||
gDefaultTimezone = null;
|
||||
}
|
||||
}
|
||||
|
||||
return gDefaultTimezone;
|
||||
}
|
||||
|
||||
/* Called from doCreateWizardFinished after the calendar is created. */
|
||||
function afterCreateWizardFinish(newCalendar)
|
||||
{
|
||||
|
|
|
@ -117,3 +117,27 @@ function isToDo(aObject)
|
|||
return aObject instanceof Components.interfaces.calITodo;
|
||||
}
|
||||
|
||||
//
|
||||
// timezone pref bits
|
||||
// XXX is this really the function we want here?
|
||||
//
|
||||
|
||||
var prefService = Components.classes["@mozilla.org/preferences-service;1"]
|
||||
.getService(Components.interfaces.nsIPrefService);
|
||||
var rootPrefNode = prefService.getBranch(null); // preferences root node
|
||||
|
||||
// returns the TZID of the timezone pref
|
||||
var gDefaultTimezone = -1;
|
||||
function calendarDefaultTimezone() {
|
||||
if (gDefaultTimezone == -1) {
|
||||
var prefobj = prefService.getBranch("calendar.");
|
||||
try {
|
||||
gDefaultTimezone = prefobj.getCharPref("timezone.local");
|
||||
} catch (e) {
|
||||
gDefaultTimezone = null;
|
||||
}
|
||||
}
|
||||
|
||||
return gDefaultTimezone;
|
||||
}
|
||||
|
||||
|
|
|
@ -391,6 +391,7 @@ function loadCalendarEventDialog()
|
|||
|
||||
// CATEGORIES --------------------------------------------------------
|
||||
// Load categories from preferences
|
||||
try {
|
||||
var categoriesString = opener.GetUnicharPref(opener.gCalendarWindow.calendarPreferences.calendarPref, "categories.names", getDefaultCategories());
|
||||
var categoriesList = categoriesString.split( "," );
|
||||
|
||||
|
@ -412,7 +413,9 @@ function loadCalendarEventDialog()
|
|||
menuListSelectItem("categories-field", categories);
|
||||
else
|
||||
document.getElementById("categories-field").selectedIndex = -1;
|
||||
|
||||
} catch (ex) {
|
||||
dump("unable to do categories stuff in event dialog\n");
|
||||
}
|
||||
// The event calendar is its current calendar, or for a new event,
|
||||
// the selected calendar in the calendar list, passed in args.calendar.
|
||||
var eventCalendar = event.parent || args.calendar;
|
||||
|
@ -427,8 +430,12 @@ function loadCalendarEventDialog()
|
|||
// compare cal.uri because there may be multiple instances of
|
||||
// calICalendar or uri for the same spec, and those instances are
|
||||
// not ==.
|
||||
if (eventCalendar && eventCalendar.uri.equals(calendars[i].uri))
|
||||
calendarField.selectedIndex = i;
|
||||
try {
|
||||
if (eventCalendar && eventCalendar.uri.equals(calendars[i].uri))
|
||||
calendarField.selectedIndex = i;
|
||||
} catch(ex) {
|
||||
dump("eventCalendar.uri not found...\n");
|
||||
}
|
||||
}
|
||||
|
||||
// update enabling and disabling
|
||||
|
@ -1209,7 +1216,7 @@ function addException(dateToAdd)
|
|||
if ( isAlreadyException( dateToAdd ) )
|
||||
return;
|
||||
|
||||
var DateLabel = formatDate(dateToAdd);
|
||||
var DateLabel = (new dateFormater()).getFormatedDate(date);
|
||||
|
||||
// add a row to the listbox.
|
||||
var listbox = document.getElementById("exception-dates-listbox");
|
||||
|
@ -1394,26 +1401,6 @@ function loadURL()
|
|||
launch = true;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Take a Date object and return a displayable date string i.e.: May 5, 1959
|
||||
*/
|
||||
function formatDate( date )
|
||||
{
|
||||
return( opener.gCalendarWindow.dateFormater.getFormatedDate( date ) );
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Take a Date object and return a displayable time string i.e.: 12:30 PM
|
||||
*/
|
||||
function formatTime( time )
|
||||
{
|
||||
var timeString = opener.gCalendarWindow.dateFormater.getFormatedTime( time );
|
||||
return timeString;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* A textbox changed - see if its button needs to be enabled or disabled
|
||||
*/
|
||||
|
|
|
@ -89,7 +89,6 @@
|
|||
<!-- Javascript includes -->
|
||||
<script type="application/x-javascript" src="chrome://global/content/strres.js"/>
|
||||
<script type="application/x-javascript" src="chrome://calendar/content/calendarUtils.js"/>
|
||||
<script type="application/x-javascript" src="chrome://calendar/content/calendar.js"/>
|
||||
<script type="application/x-javascript" src="chrome://calendar/content/dateUtils.js"/>
|
||||
<script type="application/x-javascript" src="chrome://calendar/content/eventDialog.js"/>
|
||||
<script type="application/x-javascript" src="chrome://calendar/content/selectAddressesDialog.js"/>
|
||||
|
|
Загрузка…
Ссылка в новой задаче