Checked in patches for bug 243115

This commit is contained in:
mostafah%oeone.com 2004-05-10 14:43:47 +00:00
Родитель 4a3b011318
Коммит 97086d7103
2 изменённых файлов: 8 добавлений и 134 удалений

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

@ -170,115 +170,3 @@ function onDatePick( datepicker )
}
/*-----------------------------------------------------------------
* Helper function for filling the form, set the value of a property of a XUL element
*
* PARAMETERS
* elementId - ID of XUL element to set
* newValue - value to set property to ( if undefined no change is made )
* propertyName - OPTIONAL name of property to set, default is "value", use "checked" for
* radios & checkboxes, "data" for drop-downs
*/
function setFieldValue( elementId, newValue, propertyName )
{
var undefined;
if( newValue !== undefined )
{
var field = document.getElementById( elementId );
if( newValue === false )
{
field.removeAttribute( propertyName );
} else {
if( propertyName )
{
field.setAttribute( propertyName, newValue );
} else {
field.value = newValue;
}
}
}
}
/*-----------------------------------------------------------------
* Helper function for getting data from the form,
* Get the value of a property of a XUL element
*
* PARAMETERS
* elementId - ID of XUL element to get from
* propertyName - OPTIONAL name of property to set, default is "value", use "checked" for
* radios & checkboxes, "data" for drop-downs
* RETURN
* newValue - value of property
*/
function getFieldValue( elementId, propertyName )
{
var field = document.getElementById( elementId );
if( propertyName )
{
return field[ propertyName ];
} else {
return field.value;
}
}
/*-----------------------------------------------------------------
* Helper function for getting a date/time from the form.
* The element must have been set up with setDateFieldValue or setTimeFieldValue.
*
* PARAMETERS
* elementId - ID of XUL element to get from
* RETURN
* newValue - Date value of element
*/
function getDateTimeFieldValue( elementId )
{
var field = document.getElementById( elementId );
return field.editDate;
}
/*-----------------------------------------------------------------
* Helper function for filling the form, set the value of a date field
*
* PARAMETERS
* elementId - ID of time textbox to set
* newDate - Date Object to use
*/
function setDateFieldValue( elementId, newDate )
{
// set the value to a formatted date string
var field = document.getElementById( elementId );
field.value = formatDate( newDate );
// add an editDate property to the item to hold the Date object
// used in onDatePick to update the date from the date picker.
// used in getDateTimeFieldValue to get the Date back out.
// we clone the date object so changes made in place do not propagte
field.editDate = new Date( newDate );
}
/*-----------------------------------------------------------------
* Take a Date object and return a displayable date string i.e.: May 5, 1959
* :TODO: This should be moved into DateFormater and made to use some kind of
* locale or user date format preference.
*/
function formatDate( date )
{
return( opener.gCalendarWindow.dateFormater.getFormatedDate( date ) );
}
//Needed?
function debug( Text )
{
dump( "\nprintDialog.js:"+ Text + "\n");
}

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

@ -43,15 +43,12 @@
<?xml-stylesheet href="chrome://global/skin/global.css" type="text/css"?>
<?xul-overlay href="chrome://global/content/dialogOverlay.xul"?>
<?xul-overlay href="chrome://calendar/content/timepicker/timepicker-overlay.xul"?>
<!-- CSS File with all styles specific to the dialog -->
<?xml-stylesheet href="chrome://calendar/skin/eventDialog.css" ?>
<?xml-stylesheet href="chrome://calendar/skin/dialogOverlay.css" type="text/css"?>
<?xml-stylesheet href="chrome://calendar/content/datepicker/datepicker.css" ?>
<?xml-stylesheet href="chrome://calendar/content/datepicker/calendar.css" ?>
<?xml-stylesheet href="chrome://calendar/content/datetimepickers/datepicker.css" ?>
<!-- DTD File with all strings specific to the calendar -->
<!DOCTYPE dialog
@ -102,6 +99,11 @@ var descriptionTag="&newevent.description.label;"
<script type="application/x-javascript" src="chrome://calendar/content/printDialog.js"/>
<!-- required for datepicker (probably until bug 58757 fixed) -->
<script type="application/x-javascript"
src="chrome://global/content/strres.js" />
<script type="application/x-javascript"
src="chrome://calendar/content/dateUtils.js"/>
<!-- Data used in JS from dtd -->
@ -111,10 +113,6 @@ var descriptionTag="&newevent.description.label;"
</dataset>
<!-- Picker popups -->
<popup id="oe-time-picker-popup" position="after_start" oncommand="onTimePick( this )" value=""/>
<vbox id="standard-dialog-content" flex="1">
<grid>
@ -166,20 +164,8 @@ var descriptionTag="&newevent.description.label;"
<label value="&newevent.startdate.label;"/>
</hbox>
<hbox id="start-date-box" align="center">
<datepicker id="start-date-picker" value="" ondatepick="onDatePick( this );"/>
<textbox id="start-time-text"
readonly="true"
value=""
onmousedown="prepareTimePicker('start-time-text')"
popup="oe-time-picker-popup"
position="after_start"
collapsed="true"/>
<image id="start-time-button"
class="event-time-button-class"
onmousedown="prepareTimePicker('start-time-text')"
popup="oe-time-picker-popup"
position="after_start"
collapsed="true"/>
<datepicker id="start-date-picker" value=""
onchange="onDatePick( this );"/>
</hbox>
</row>