bug 340195 - Adds printing for Lightning. Original patch by jminta. Updates by lilmatt. r=mvl, ui-r rs=dmose

This commit is contained in:
mattwillis%gmail.com 2006-10-30 21:10:22 +00:00
Родитель 495d41fb1b
Коммит 78495a7427
6 изменённых файлов: 30 добавлений и 3 удалений

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

@ -80,6 +80,7 @@
<command id="publish_calendar" oncommand="ltnPublishCalendar()"/>
<command id="import_command" oncommand="loadEventsFromFile()"/>
<command id="export_command" oncommand="exportEntireCalendar()"/>
<command id="print_command" oncommand="calPrint()"/>
<command id="reload_remote_calendars" oncommand="getCompositeCalendar().refresh();"/>
</commandset>

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

@ -116,6 +116,9 @@
<menuitem id="calendar-export-menu"
label="&calendar.export.calendar;"
observes="export_command"/>
<menuitem id="calendar-print-menu"
label="&lightning.toolbar.print.label;"
observes="print_command"/>
</menupopup>
</menu>
</menubar>

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

@ -37,6 +37,8 @@ calendar.jar:
content/calendar/datetimepickers/datetimepickers.xml (/calendar/resources/content/datetimepickers/datetimepickers.xml)
content/calendar/datetimepickers/minimonth.css (/calendar/resources/content/datetimepickers/minimonth.css)
content/calendar/datetimepickers/minimonth.xml (/calendar/resources/content/datetimepickers/minimonth.xml)
content/calendar/printDialog.js (/calendar/resources/content/printDialog.js)
content/calendar/printDialog.xul (/calendar/resources/content/printDialog.xul)
content/calendar/publish.js (/calendar/resources/content/publish.js)
content/calendar/publishDialog.js (/calendar/resources/content/publishDialog.js)
content/calendar/publishDialog.xul (/calendar/resources/content/publishDialog.xul)

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

@ -542,3 +542,26 @@ function calPrint()
window.openDialog("chrome://calendar/content/printDialog.xul", "Print",
"centerscreen,chrome,resizable");
}
function calRadioGroupSelectItem(radioGroupId, id)
{
var radioGroup = document.getElementById(radioGroupId);
var index = calRadioGroupIndexOf(radioGroup, id);
if (index != -1) {
radioGroup.selectedIndex = index;
} else {
throw "radioGroupSelectItem: No such Element: "+id;
}
}
function calRadioGroupIndexOf(radioGroup, id)
{
var items = radioGroup.getElementsByTagName("radio");
var i;
for (i in items) {
if (items[i].getAttribute("id") == id) {
return i;
}
}
return -1; // not found
}

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

@ -45,7 +45,6 @@
var gTempFile = null;
var gPrintSettings = null;
var gCalendarWindow = window.opener.gCalendarWindow;
function loadCalendarPrintDialog()
{
@ -213,6 +212,6 @@ function refreshHtml()
* Called when once a date has been selected in the datepicker.
*/
function onDatePick() {
radioGroupSelectItem("view-field", "custom-range");
calRadioGroupSelectItem("view-field", "custom-range");
refreshHtml();
}

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

@ -75,7 +75,6 @@
xmlns:nc="http://home.netscape.com/NC-rdf#">
<script type="application/x-javascript" src="chrome://calendar/content/printDialog.js"/>
<script type="application/x-javascript" src="chrome://calendar/content/applicationUtil.js"/>
<script type="application/x-javascript" src="chrome://calendar/content/calendarUtils.js"/>
<script type="application/x-javascript" src="chrome://global/content/printUtils.js"/>