зеркало из https://github.com/mozilla/pjs.git
Some function renaming.
This commit is contained in:
Родитель
461ac3de77
Коммит
5bb64e31f0
|
@ -508,6 +508,7 @@ function newToDoCommand()
|
|||
args.onOk = self.addToDoDialogResponse;
|
||||
args.calendarToDo = calendarToDo;
|
||||
|
||||
window.setCursor( "wait" );
|
||||
// open the dialog modally
|
||||
openDialog("chrome://calendar/content/calendarToDoDialog.xul", "caEditEvent", "chrome,modal", args );
|
||||
}
|
||||
|
@ -663,8 +664,8 @@ function editToDo( calendarToDo )
|
|||
args.onOk = self.modifyToDoDialogResponse;
|
||||
args.calendarToDo = calendarToDo;
|
||||
|
||||
window.setCursor( "wait" );
|
||||
// open the dialog modally
|
||||
|
||||
openDialog("chrome://calendar/content/calendarToDoDialog.xul", "caEditToDo", "chrome,modal", args );
|
||||
}
|
||||
|
||||
|
@ -695,6 +696,120 @@ function modifyToDoDialogResponse( calendarToDo, Server )
|
|||
}
|
||||
|
||||
|
||||
/**
|
||||
* This is called from the unifinder's edit command
|
||||
*/
|
||||
|
||||
function editEventCommand()
|
||||
{
|
||||
if( gCalendarWindow.EventSelection.selectedEvents.length == 1 )
|
||||
{
|
||||
var calendarEvent = gCalendarWindow.EventSelection.selectedEvents[0];
|
||||
|
||||
if( calendarEvent != null )
|
||||
{
|
||||
editEvent( calendarEvent );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* This is called from the unifinder's delete command
|
||||
*/
|
||||
|
||||
function deleteEventCommand( DoNotConfirm )
|
||||
{
|
||||
if( unifinderToDoHasFocus() )
|
||||
{
|
||||
unifinderDeleteToDoCommand( DoNotConfirm );
|
||||
return;
|
||||
}
|
||||
|
||||
var SelectedItems = gCalendarWindow.EventSelection.selectedEvents;
|
||||
|
||||
if( SelectedItems.length == 1 )
|
||||
{
|
||||
var calendarEvent = SelectedItems[0];
|
||||
|
||||
if ( calendarEvent.title != "" ) {
|
||||
if( !DoNotConfirm ) {
|
||||
if ( confirm( confirmDeleteEvent+" "+calendarEvent.title+"?" ) ) {
|
||||
gICalLib.deleteEvent( calendarEvent.id );
|
||||
|
||||
gCalendarWindow.clearSelectedEvent( calendarEvent );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
gICalLib.deleteEvent( calendarEvent.id );
|
||||
|
||||
gCalendarWindow.clearSelectedEvent( calendarEvent );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if( !DoNotConfirm ) {
|
||||
if ( confirm( confirmDeleteUntitledEvent ) ) {
|
||||
gICalLib.deleteEvent( calendarEvent.id );
|
||||
|
||||
gCalendarWindow.clearSelectedEvent( calendarEvent );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
gICalLib.deleteEvent( calendarEvent.id );
|
||||
|
||||
gCalendarWindow.clearSelectedEvent( calendarEvent );
|
||||
}
|
||||
}
|
||||
}
|
||||
else if( SelectedItems.length > 1 )
|
||||
{
|
||||
var NumberOfEventsToDelete = SelectedItems.length;
|
||||
|
||||
gICalLib.batchMode = true;
|
||||
|
||||
if( !DoNotConfirm )
|
||||
{
|
||||
if( confirm( "Are you sure you want to delete all selected events?" ) )
|
||||
{
|
||||
gCalendarWindow.clearSelectedEvent( calendarEvent );
|
||||
|
||||
while( SelectedItems.length )
|
||||
{
|
||||
var ThisItem = SelectedItems.pop();
|
||||
|
||||
gICalLib.deleteEvent( ThisItem.id );
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
gCalendarWindow.clearSelectedEvent( calendarEvent );
|
||||
|
||||
while( SelectedItems.length )
|
||||
{
|
||||
var ThisItem = SelectedItems.pop();
|
||||
|
||||
gICalLib.deleteEvent( ThisItem.id );
|
||||
}
|
||||
}
|
||||
|
||||
gICalLib.batchMode = false;
|
||||
|
||||
/*
|
||||
var NumberOfTotalEvents = gCalendarWindow.calendarEvent.getAllEvents().length;
|
||||
|
||||
if( NumberOfTotalEvents = NumberOfEventsToDelete )
|
||||
{
|
||||
//highlight today's date
|
||||
gCalendarWindow.currentView.hiliteTodaysDate();
|
||||
}
|
||||
*/
|
||||
}
|
||||
}
|
||||
|
||||
function goFindNewCalendars()
|
||||
{
|
||||
//launch the browser to http://www.apple.com/ical/library/
|
||||
|
@ -886,11 +1001,17 @@ function publishCalendarDataDialogResponse( CalendarPublishObject )
|
|||
/*
|
||||
** A little function to see if we can show the tooltip
|
||||
*/
|
||||
function checkTooltip()
|
||||
function checkTooltip( event )
|
||||
{
|
||||
//returns true if you can show the tooltip
|
||||
//or false if the tooltip should not be shown
|
||||
|
||||
return( showTooltip );
|
||||
|
||||
if( getCalendarEventFromEvent( event ) == false )
|
||||
return( false );
|
||||
else
|
||||
return( true );
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -80,9 +80,9 @@
|
|||
|
||||
<commandset id="calendar_commands">
|
||||
<command id="new_command" oncommand="newEventCommand( event )"/>
|
||||
<command id="delete_command" oncommand="unifinderDeleteCommand( )" disabled="true"/>
|
||||
<command id="delete_command_no_confirm" oncommand="unifinderDeleteCommand( true )" disabled="true"/>
|
||||
<command id="modify_command" oncommand="unifinderEditCommand()" disabled="true"/>
|
||||
<command id="delete_command" oncommand="deleteEventCommand( )" disabled="true"/>
|
||||
<command id="delete_command_no_confirm" oncommand="deleteEventCommand( true )" disabled="true"/>
|
||||
<command id="modify_command" oncommand="editEventCommand()" disabled="true"/>
|
||||
<command id="send_event_command" oncommand="sendEvent()" disabled="true"/>
|
||||
<command id="print_command" oncommand="print()" disabled="true"/>
|
||||
<command id="cut_command" oncommand="cutToClipboard()" disabled="true"/>
|
||||
|
@ -91,8 +91,8 @@
|
|||
<command id="select_all_command" oncommand="selectAllEvents()"/>
|
||||
|
||||
<command id="new_todo_command" oncommand="newToDoCommand()"/>
|
||||
<command id="modify_todo_command" oncommand="unifinderDoubleClickToDo( event )"/>
|
||||
<command id="delete_todo_command" oncommand="unifinderDeleteToDoCommand()"/>
|
||||
<command id="modify_todo_command" oncommand="modifyToDoCommand( event )"/>
|
||||
<command id="delete_todo_command" oncommand="deleteToDoCommand()"/>
|
||||
|
||||
<command id="new_server_command" oncommand="gCalendarWindow.calendarManager.launchAddCalendarDialog()"/>
|
||||
<command id="edit_server_command" oncommand="gCalendarWindow.calendarManager.launchEditCalendarDialog()"/>
|
||||
|
@ -277,7 +277,9 @@
|
|||
</toolbar>
|
||||
</toolbox>
|
||||
|
||||
<tooltip id="savetip" onpopupshowing="changeToolTipTextForToDo( event );return( checkTooltip() );"/>
|
||||
<tooltip id="eventTooltip" onpopupshowing="changeToolTipTextForEvent( event );"/>
|
||||
|
||||
<tooltip id="taskTooltip" onpopupshowing="changeToolTipTextForToDo( event );return( checkTooltip( event ) );"/>
|
||||
|
||||
<!-- V I S I B L E C O N T E N T -->
|
||||
|
||||
|
@ -379,12 +381,11 @@
|
|||
flex="1" label="&calendar.unifinder.tree.categories.label;"/>
|
||||
</treecols>
|
||||
|
||||
<treechildren tooltip="savetip"
|
||||
<treechildren tooltip="taskTooltip"
|
||||
onclick="unifinderClickToDo( event )"
|
||||
ondblclick="unifinderDoubleClickToDo( event )"
|
||||
ondblclick="modifyToDoCommand( event )"
|
||||
onmousedown="unifinderMouseDownToDo( event )"
|
||||
context="taskitem-context-menu">
|
||||
</treechildren>
|
||||
context="taskitem-context-menu"/>
|
||||
</tree>
|
||||
</vbox>
|
||||
</vbox>
|
||||
|
@ -455,8 +456,7 @@
|
|||
</treecols>
|
||||
|
||||
<!-- on mousedown here happens before onclick above -->
|
||||
<treechildren tooltip="savetip"
|
||||
onmousemove="changeToolTipTextForEvent( event )"
|
||||
<treechildren tooltip="eventTooltip"
|
||||
onkeypress="if (event.keyCode == 13) unifinderEditCommand();"
|
||||
ondragover="return( false );"
|
||||
ondblclick="unifinderDoubleClickEvent( event )"
|
||||
|
|
Загрузка…
Ссылка в новой задаче