зеркало из https://github.com/mozilla/gecko-dev.git
Adding in patch from bug 156687 from AJB.
This commit is contained in:
Родитель
5db26d654b
Коммит
4fbefdf37b
|
@ -129,6 +129,10 @@ function loadCalendarToDoDialog()
|
|||
|
||||
setDateFieldValue( "start-date-text", startDate );
|
||||
|
||||
setFieldValue( "priority-levels", gToDo.priority );
|
||||
|
||||
setFieldValue( "percent-complete-menulist", gToDo.percent );
|
||||
|
||||
if( gToDo.completed.getTime() > 0 )
|
||||
{
|
||||
var completedDate = new Date( gToDo.completed.getTime() );
|
||||
|
@ -158,6 +162,24 @@ function loadCalendarToDoDialog()
|
|||
setFieldValue( "alarm-length-field", gToDo.alarmLength );
|
||||
setFieldValue( "alarm-length-units", gToDo.alarmUnits );
|
||||
|
||||
|
||||
// Load default categories
|
||||
this.categoriesStringBundle = srGetStrBundle("chrome://calendar/locale/categories.properties");
|
||||
var categoriesString = this.categoriesStringBundle.GetStringFromName("categories" );
|
||||
var categoriesList = categoriesString.split( "," );
|
||||
|
||||
var oldMenulist = document.getElementById( "categories-menulist-menupopup" );
|
||||
while( oldMenulist.hasChildNodes() )
|
||||
oldMenulist.removeChild( oldMenulist.lastChild );
|
||||
|
||||
for (var i = 0; i < categoriesList.length ; i++)
|
||||
{
|
||||
document.getElementById( "categories-field" ).appendItem(categoriesList[i], "Categories-"+categoriesList[i]);
|
||||
}
|
||||
|
||||
document.getElementById( "categories-field" ).selectedIndex = -1;
|
||||
setFieldValue( "categories-field", gToDo.categories );
|
||||
|
||||
// update enabling and disabling
|
||||
|
||||
updateAlarmItemEnabled();
|
||||
|
@ -206,8 +228,20 @@ function onOKCommand()
|
|||
gToDo.alarmLength = getFieldValue( "alarm-length-field" );
|
||||
gToDo.alarmUnits = getFieldValue( "alarm-length-units", "value" );
|
||||
|
||||
gToDo.priority = getFieldValue( "priority-levels", "value" );
|
||||
var completed = getFieldValue( "completed-checkbox", "checked" );
|
||||
|
||||
gToDo.categories = getFieldValue( "categories-field", "value" );
|
||||
|
||||
var percentcomplete = getFieldValue( "percent-complete-menulist" );
|
||||
percentcomplete = parseInt( percentcomplete );
|
||||
if(percentcomplete > 100)
|
||||
percentcomplete = 100;
|
||||
else if(percentcomplete < 0)
|
||||
percentcomplete = 0;
|
||||
|
||||
gToDo.percent = percentcomplete;
|
||||
|
||||
if( completed )
|
||||
{
|
||||
//get the time for the completed event
|
||||
|
@ -216,9 +250,15 @@ function onOKCommand()
|
|||
gToDo.completed.year = completedDate.getYear() + 1900;
|
||||
gToDo.completed.month = completedDate.getMonth();
|
||||
gToDo.completed.day = completedDate.getDate();
|
||||
gToDo.status = gToDo.ICAL_STATUS_COMPLETED;
|
||||
}
|
||||
else
|
||||
gToDo.completed.clear();
|
||||
if (percentcomplete == 0)
|
||||
gToDo.status = gToDo.ICAL_STATUS_NEEDSACTION;
|
||||
else
|
||||
gToDo.status = gToDo.ICAL_STATUS_INPROCESS;
|
||||
|
||||
|
||||
dump( "!!!-->in calendarEventDialog.js, alarmUnits is "+gToDo.alarmUnits );
|
||||
if ( getFieldValue( "alarm-email-checkbox", "checked" ) )
|
||||
|
@ -358,12 +398,30 @@ function updateCompletedItemEnabled()
|
|||
{
|
||||
setFieldValue( "completed-date-text", false, "disabled" );
|
||||
setFieldValue( "completed-date-button", false, "disabled" );
|
||||
setFieldValue( "percent-complete-menulist", "100" );
|
||||
setFieldValue( "percent-complete-menulist", true, "disabled" );
|
||||
setFieldValue( "percent-complete-text", true, "disabled" );
|
||||
}
|
||||
else
|
||||
{
|
||||
setFieldValue( "completed-date-text", true, "disabled" );
|
||||
setFieldValue( "completed-date-button", true, "disabled" );
|
||||
setFieldValue( "percent-complete-menulist", false, "disabled" );
|
||||
setFieldValue( "percent-complete-text", false, "disabled" );
|
||||
if( getFieldValue( "percent-complete-menulist" ) == 100 )
|
||||
setFieldValue( "percent-complete-menulist", "0" );
|
||||
}
|
||||
}
|
||||
|
||||
function percentCompleteCommand()
|
||||
{
|
||||
var percentcompletemenu = "percent-complete-menulist";
|
||||
var percentcomplete = getFieldValue( "percent-complete-menulist" );
|
||||
percentcomplete = parseInt( percentcomplete );
|
||||
if( percentcomplete == 100)
|
||||
setFieldValue( "completed-checkbox", "true", "checked" );
|
||||
|
||||
updateCompletedItemEnabled();
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -158,31 +158,61 @@
|
|||
</row>
|
||||
|
||||
<!-- Priority -->
|
||||
<row align="center" collapsed="true">
|
||||
<row align="center">
|
||||
<hbox class="field-label-box-class" pack="end">
|
||||
<label value="&newtodo.priority.label;"/>
|
||||
</hbox>
|
||||
<menulist>
|
||||
<hbox>
|
||||
<menulist id="priority-levels">
|
||||
<menupopup>
|
||||
<menuitem label="1" value="1"/>
|
||||
<menuitem label="2" value="2"/>
|
||||
<menuitem label="3" value="3"/>
|
||||
<menuitem label="4" value="4"/>
|
||||
<menuitem label="5" value="5"/>
|
||||
<menuitem label="&priority.level.none;" value="0"/>
|
||||
<menuitem label="&priority.level.low;" value="9"/>
|
||||
<menuitem label="&priority.level.medium;" value="5"/>
|
||||
<menuitem label="&priority.level.high;" value="1"/>
|
||||
</menupopup>
|
||||
</menulist>
|
||||
</hbox>
|
||||
</row>
|
||||
|
||||
<!-- Completed -->
|
||||
<row align="center">
|
||||
<label value="&newtodo.completed.label;" for="completed-checkbox"/>
|
||||
<label value="&newtodo.completed.label;" for="completed-checkbox" pack="end"/>
|
||||
<hbox align="center">
|
||||
<checkbox id="completed-checkbox" oncommand="updateCompletedItemEnabled()"/>
|
||||
<textbox disabled="true" class="date-text-class" id="completed-date-text" readonly="true" value="" onmousedown="prepareDatePicker('completed-date-text')" popup="oe-date-picker-popup" position="after_start"/>
|
||||
<image disabled="true" id="completed-date-button" class="event-date-button-class" onmousedown="prepareDatePicker('completed-date-text')" popup="oe-date-picker-popup" position="after_start"/>
|
||||
<spacer minwidth="30px"/>
|
||||
<menulist id="percent-complete-menulist" editable="true" oncommand="percentCompleteCommand()">
|
||||
<menupopup>
|
||||
<menuitem label="0" value="0"/>
|
||||
<menuitem label="10" value="10"/>
|
||||
<menuitem label="20" value="20"/>
|
||||
<menuitem label="30" value="30"/>
|
||||
<menuitem label="40" value="40"/>
|
||||
<menuitem label="50" value="50"/>
|
||||
<menuitem label="60" value="60"/>
|
||||
<menuitem label="70" value="70"/>
|
||||
<menuitem label="80" value="80"/>
|
||||
<menuitem label="90" value="90"/>
|
||||
<menuitem label="100" value="100"/>
|
||||
</menupopup>
|
||||
</menulist>
|
||||
<label id="percent-complete-text" value="&newtodo.percentcomplete.label;"/>
|
||||
</hbox>
|
||||
</row>
|
||||
|
||||
<!-- Categories -->
|
||||
<row align="center">
|
||||
<hbox class="field-label-box-class" pack="end">
|
||||
<label value="&newtodo.categories.label;"/>
|
||||
</hbox>
|
||||
<menulist id="categories-field" flex="1">
|
||||
<menupopup id="categories-menulist-menupopup">
|
||||
<menuitem label="&priority.level.none;" value="0"/>
|
||||
</menupopup>
|
||||
</menulist>
|
||||
</row>
|
||||
|
||||
<!-- Alarm -->
|
||||
<row align="center" collapsed="true">
|
||||
<spacer />
|
||||
|
|
|
@ -129,6 +129,10 @@ function loadCalendarToDoDialog()
|
|||
|
||||
setDateFieldValue( "start-date-text", startDate );
|
||||
|
||||
setFieldValue( "priority-levels", gToDo.priority );
|
||||
|
||||
setFieldValue( "percent-complete-menulist", gToDo.percent );
|
||||
|
||||
if( gToDo.completed.getTime() > 0 )
|
||||
{
|
||||
var completedDate = new Date( gToDo.completed.getTime() );
|
||||
|
@ -158,6 +162,24 @@ function loadCalendarToDoDialog()
|
|||
setFieldValue( "alarm-length-field", gToDo.alarmLength );
|
||||
setFieldValue( "alarm-length-units", gToDo.alarmUnits );
|
||||
|
||||
|
||||
// Load default categories
|
||||
this.categoriesStringBundle = srGetStrBundle("chrome://calendar/locale/categories.properties");
|
||||
var categoriesString = this.categoriesStringBundle.GetStringFromName("categories" );
|
||||
var categoriesList = categoriesString.split( "," );
|
||||
|
||||
var oldMenulist = document.getElementById( "categories-menulist-menupopup" );
|
||||
while( oldMenulist.hasChildNodes() )
|
||||
oldMenulist.removeChild( oldMenulist.lastChild );
|
||||
|
||||
for (var i = 0; i < categoriesList.length ; i++)
|
||||
{
|
||||
document.getElementById( "categories-field" ).appendItem(categoriesList[i], "Categories-"+categoriesList[i]);
|
||||
}
|
||||
|
||||
document.getElementById( "categories-field" ).selectedIndex = -1;
|
||||
setFieldValue( "categories-field", gToDo.categories );
|
||||
|
||||
// update enabling and disabling
|
||||
|
||||
updateAlarmItemEnabled();
|
||||
|
@ -206,8 +228,20 @@ function onOKCommand()
|
|||
gToDo.alarmLength = getFieldValue( "alarm-length-field" );
|
||||
gToDo.alarmUnits = getFieldValue( "alarm-length-units", "value" );
|
||||
|
||||
gToDo.priority = getFieldValue( "priority-levels", "value" );
|
||||
var completed = getFieldValue( "completed-checkbox", "checked" );
|
||||
|
||||
gToDo.categories = getFieldValue( "categories-field", "value" );
|
||||
|
||||
var percentcomplete = getFieldValue( "percent-complete-menulist" );
|
||||
percentcomplete = parseInt( percentcomplete );
|
||||
if(percentcomplete > 100)
|
||||
percentcomplete = 100;
|
||||
else if(percentcomplete < 0)
|
||||
percentcomplete = 0;
|
||||
|
||||
gToDo.percent = percentcomplete;
|
||||
|
||||
if( completed )
|
||||
{
|
||||
//get the time for the completed event
|
||||
|
@ -216,9 +250,15 @@ function onOKCommand()
|
|||
gToDo.completed.year = completedDate.getYear() + 1900;
|
||||
gToDo.completed.month = completedDate.getMonth();
|
||||
gToDo.completed.day = completedDate.getDate();
|
||||
gToDo.status = gToDo.ICAL_STATUS_COMPLETED;
|
||||
}
|
||||
else
|
||||
gToDo.completed.clear();
|
||||
if (percentcomplete == 0)
|
||||
gToDo.status = gToDo.ICAL_STATUS_NEEDSACTION;
|
||||
else
|
||||
gToDo.status = gToDo.ICAL_STATUS_INPROCESS;
|
||||
|
||||
|
||||
dump( "!!!-->in calendarEventDialog.js, alarmUnits is "+gToDo.alarmUnits );
|
||||
if ( getFieldValue( "alarm-email-checkbox", "checked" ) )
|
||||
|
@ -358,12 +398,30 @@ function updateCompletedItemEnabled()
|
|||
{
|
||||
setFieldValue( "completed-date-text", false, "disabled" );
|
||||
setFieldValue( "completed-date-button", false, "disabled" );
|
||||
setFieldValue( "percent-complete-menulist", "100" );
|
||||
setFieldValue( "percent-complete-menulist", true, "disabled" );
|
||||
setFieldValue( "percent-complete-text", true, "disabled" );
|
||||
}
|
||||
else
|
||||
{
|
||||
setFieldValue( "completed-date-text", true, "disabled" );
|
||||
setFieldValue( "completed-date-button", true, "disabled" );
|
||||
setFieldValue( "percent-complete-menulist", false, "disabled" );
|
||||
setFieldValue( "percent-complete-text", false, "disabled" );
|
||||
if( getFieldValue( "percent-complete-menulist" ) == 100 )
|
||||
setFieldValue( "percent-complete-menulist", "0" );
|
||||
}
|
||||
}
|
||||
|
||||
function percentCompleteCommand()
|
||||
{
|
||||
var percentcompletemenu = "percent-complete-menulist";
|
||||
var percentcomplete = getFieldValue( "percent-complete-menulist" );
|
||||
percentcomplete = parseInt( percentcomplete );
|
||||
if( percentcomplete == 100)
|
||||
setFieldValue( "completed-checkbox", "true", "checked" );
|
||||
|
||||
updateCompletedItemEnabled();
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -158,31 +158,61 @@
|
|||
</row>
|
||||
|
||||
<!-- Priority -->
|
||||
<row align="center" collapsed="true">
|
||||
<row align="center">
|
||||
<hbox class="field-label-box-class" pack="end">
|
||||
<label value="&newtodo.priority.label;"/>
|
||||
</hbox>
|
||||
<menulist>
|
||||
<hbox>
|
||||
<menulist id="priority-levels">
|
||||
<menupopup>
|
||||
<menuitem label="1" value="1"/>
|
||||
<menuitem label="2" value="2"/>
|
||||
<menuitem label="3" value="3"/>
|
||||
<menuitem label="4" value="4"/>
|
||||
<menuitem label="5" value="5"/>
|
||||
<menuitem label="&priority.level.none;" value="0"/>
|
||||
<menuitem label="&priority.level.low;" value="9"/>
|
||||
<menuitem label="&priority.level.medium;" value="5"/>
|
||||
<menuitem label="&priority.level.high;" value="1"/>
|
||||
</menupopup>
|
||||
</menulist>
|
||||
</hbox>
|
||||
</row>
|
||||
|
||||
<!-- Completed -->
|
||||
<row align="center">
|
||||
<label value="&newtodo.completed.label;" for="completed-checkbox"/>
|
||||
<label value="&newtodo.completed.label;" for="completed-checkbox" pack="end"/>
|
||||
<hbox align="center">
|
||||
<checkbox id="completed-checkbox" oncommand="updateCompletedItemEnabled()"/>
|
||||
<textbox disabled="true" class="date-text-class" id="completed-date-text" readonly="true" value="" onmousedown="prepareDatePicker('completed-date-text')" popup="oe-date-picker-popup" position="after_start"/>
|
||||
<image disabled="true" id="completed-date-button" class="event-date-button-class" onmousedown="prepareDatePicker('completed-date-text')" popup="oe-date-picker-popup" position="after_start"/>
|
||||
<spacer minwidth="30px"/>
|
||||
<menulist id="percent-complete-menulist" editable="true" oncommand="percentCompleteCommand()">
|
||||
<menupopup>
|
||||
<menuitem label="0" value="0"/>
|
||||
<menuitem label="10" value="10"/>
|
||||
<menuitem label="20" value="20"/>
|
||||
<menuitem label="30" value="30"/>
|
||||
<menuitem label="40" value="40"/>
|
||||
<menuitem label="50" value="50"/>
|
||||
<menuitem label="60" value="60"/>
|
||||
<menuitem label="70" value="70"/>
|
||||
<menuitem label="80" value="80"/>
|
||||
<menuitem label="90" value="90"/>
|
||||
<menuitem label="100" value="100"/>
|
||||
</menupopup>
|
||||
</menulist>
|
||||
<label id="percent-complete-text" value="&newtodo.percentcomplete.label;"/>
|
||||
</hbox>
|
||||
</row>
|
||||
|
||||
<!-- Categories -->
|
||||
<row align="center">
|
||||
<hbox class="field-label-box-class" pack="end">
|
||||
<label value="&newtodo.categories.label;"/>
|
||||
</hbox>
|
||||
<menulist id="categories-field" flex="1">
|
||||
<menupopup id="categories-menulist-menupopup">
|
||||
<menuitem label="&priority.level.none;" value="0"/>
|
||||
</menupopup>
|
||||
</menulist>
|
||||
</row>
|
||||
|
||||
<!-- Alarm -->
|
||||
<row align="center" collapsed="true">
|
||||
<spacer />
|
||||
|
|
|
@ -43,6 +43,7 @@ calendar.jar:
|
|||
locale/en-US/calendar/calendarMenuOverlay.dtd (locale/en-US/calendarMenuOverlay.dtd)
|
||||
locale/en-US/calendar/calendarOverlay.dtd (locale/en-US/calendarOverlay.dtd)
|
||||
locale/en-US/calendar/calendarPrefs.dtd (locale/en-US/calendarPrefs.dtd)
|
||||
locale/en-US/calendar/categories.properties (locale/en-US/categories.properties)
|
||||
locale/en-US/calendar/contactsSelectAddressesDialog.dtd (locale/en-US/contactsSelectAddressesDialog.dtd)
|
||||
locale/en-US/calendar/contents.rdf (locale/en-US/contents.rdf)
|
||||
locale/en-US/calendar/dateFormat.properties (locale/en-US/dateFormat.properties)
|
||||
|
|
|
@ -55,6 +55,15 @@
|
|||
<!ENTITY repeat.units.months.singular "Month" >
|
||||
<!ENTITY repeat.units.years.singular "Year" >
|
||||
|
||||
<!ENTITY priority.level.none "None" >
|
||||
<!ENTITY priority.level.low "Low" >
|
||||
<!ENTITY priority.level.medium "Medium" >
|
||||
<!ENTITY priority.level.high "High" >
|
||||
|
||||
<!ENTITY tasks.category.business "Business" >
|
||||
<!ENTITY tasks.category.personal "Personal" >
|
||||
<!ENTITY tasks.category.family "Family" >
|
||||
<!ENTITY tasks.category.unfiled "Unfiled" >
|
||||
|
||||
<!ENTITY newevent.title.label "Title" >
|
||||
<!ENTITY newevent.location.label "Location" >
|
||||
|
@ -97,6 +106,8 @@
|
|||
<!ENTITY newtodo.duedate.label "Due Date">
|
||||
<!ENTITY newtodo.startdate.label "Start Date">
|
||||
<!ENTITY newtodo.priority.label "Priority">
|
||||
<!ENTITY newtodo.percentcomplete.label "% complete">
|
||||
<!ENTITY newtodo.categories.label "Categories">
|
||||
<!ENTITY newtodo.starttime.warning "Your start date occurs after your due date.">
|
||||
|
||||
<!ENTITY calendar.confirm.deleteevent "Are you sure you want to delete this event titled: " >
|
||||
|
|
|
@ -0,0 +1,39 @@
|
|||
# ***** 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 Mozilla Calendar code.
|
||||
#
|
||||
# The Initial Developer of the Original Code is
|
||||
# ArentJan Banck <ajbanck@planet.nl>.
|
||||
# Portions created by the Initial Developer are Copyright (C) 2002
|
||||
# the Initial Developer. All Rights Reserved.
|
||||
#
|
||||
# Contributor(s): ArentJan Banck <ajbanck@planet.nl>
|
||||
#
|
||||
# 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 *****
|
||||
|
||||
# default categories
|
||||
|
||||
categories=Birthday,Business,Calls,Clients,Competition,Customer,Favorites,Follow up,Gifts,Holidays,Ideas,Issues,Miscellaneous,Personal,Projects,Public Holiday,Status,Suppliers,Travel,Vacation
|
Загрузка…
Ссылка в новой задаче