Use task context menu in the whole task pane

bug 155648, r=mostafah
This commit is contained in:
mvl%exedo.nl 2004-08-27 10:42:12 +00:00
Родитель ea39eadbee
Коммит 41a93646b9
4 изменённых файлов: 27 добавлений и 37 удалений

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

@ -301,18 +301,10 @@
persist="checked"
disabled="true"/>
<!--
<menuitem label="test" observes="change_display_todo_in_view" checked="true"/>
-->
<menuseparator/>
<menuitem label="&calendar.context.emailevent.label;"
accesskey="&calendar.context.emailevent.accesskey;"
observes="send_event_command"/>
<!--
<menuseparator/>
<menuitem label="&calendar.context.reload.label;" accesskey="&calendar.context.reload.accesskey;" oncommand="window.location = 'chrome://calendar/content/calendar.xul';"/>
-->
</popup>
<!-- TASK ITEM CONTEXT MENU -->
@ -327,7 +319,8 @@
accesskey="&calendar.context.deletetask.accesskey;"
observes="delete_todo_command"/>
<menu label="&calendar.context.progress.label;"
accesskey="&calendar.context.progress.accesskey;">
accesskey="&calendar.context.progress.accesskey;"
observes="is_editable">
<menupopup>
<menuitem type="checkbox"
id="percent-0-menuitem"
@ -357,7 +350,8 @@
</menupopup>
</menu>
<menu label="&calendar.context.priority.label;"
accesskey="&calendar.context.priority.accesskey;">
accesskey="&calendar.context.priority.accesskey;"
observes="is_editable">
<menupopup>
<menuitem type="checkbox"
id="priority-0-menuitem"
@ -545,18 +539,20 @@
oncommand="toDoUnifinderRefresh( event )"
persist="checked"/>
</box>
<tree id="unifinder-todo-tree" flex="1" enableColumnDrag="false" ondblclick="modifyToDoCommand( event )">
<tree id="unifinder-todo-tree" flex="1" enableColumnDrag="false"
ondblclick="modifyToDoCommand( event )"
context="taskitem-context-menu">
<treecols id="unifinder-todo-tree-cols">
<treecol id="unifinder-todo-tree-col-completed"
persist="hidden ordinal width sortDirection sortActive" width="18" cycler="true"
label="&calendar.unifinder.tree.done.label;">
<image id="checkboximg" contextmenu="taskitem-context-menu"/>
<image id="checkboximg" />
</treecol>
<splitter class="tree-splitter"/>
<treecol id="unifinder-todo-tree-col-priority"
persist="hidden ordinal width sortDirection sortActive" width="18"
label="&calendar.unifinder.tree.priority.label;">
<image id="priorityimg" contextmenu="taskitem-context-menu"/>
<image id="priorityimg"/>
</treecol>
<splitter class="tree-splitter"/>
<treecol id="unifinder-todo-tree-col-title"
@ -590,8 +586,7 @@
</treecols>
<treechildren tooltip="taskTooltip"
onmousedown="unifinderMouseDownToDo( event )"
context="taskitem-context-menu"/>
onmousedown="unifinderMouseDownToDo( event )"/>
</tree>
</vbox>
</vbox>

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

@ -721,4 +721,4 @@ CalendarAlarmObserver.prototype.fireAlarm = function calAlarm_fireAlarm( calenda
//send an email for the event
sendEmail( EmailSubject, EmailBody, calendarEvent.alarmEmailAddress, null, null, null, null );
}
}
}

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

@ -207,16 +207,11 @@ function unifinderMouseDownToDo( event )
var ThisToDo = getToDoFromEvent( event );
if( ThisToDo )
{
if(event.button == 2)
treechildren.setAttribute("context", "taskitem-context-menu")
// TODO HACK notifiers should be rewritten to integrate events and todos
document.getElementById( "delete_todo_command" ).removeAttribute( "disabled" );
document.getElementById( "print_command" ).setAttribute( "disabled", "true" );
} else
{
if(event.button == 2)
treechildren.setAttribute("context", "context-menu");
tree.view.selection.clearSelection();
// TODO HACK notifiers should be rewritten to integrate events and todos
@ -614,10 +609,13 @@ function changeToolTipTextForToDo( event )
function changeContextMenuForToDo( event )
{
if (event.target.id != "taskitem-context-menu")
return;
var toDoItem = getToDoFromEvent( event );
if( toDoItem )
{
document.getElementById("is_editable").removeAttribute("disabled");
var liveList = document.getElementById( "taskitem-context-menu" ).getElementsByAttribute( "checked", "true" );
// Delete in reverse order. Moz1.8+ getElementsByAttribute list is
// 'live', so when attribute is deleted the indexes of later elements
@ -636,6 +634,8 @@ function changeContextMenuForToDo( event )
{
document.getElementById( "priority-"+toDoItem.priority+"-menuitem" ).setAttribute( "checked", "true" );
}
} else {
document.getElementById("is_editable").setAttribute("disabled", "true");
}
}

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

@ -302,18 +302,10 @@
persist="checked"
disabled="true"/>
<!--
<menuitem label="test" observes="change_display_todo_in_view" checked="true"/>
-->
<menuseparator/>
<menuitem label="&calendar.context.emailevent.label;"
accesskey="&calendar.context.emailevent.accesskey;"
observes="send_event_command"/>
<!--
<menuseparator/>
<menuitem label="&calendar.context.reload.label;" accesskey="&calendar.context.reload.accesskey;" oncommand="window.location = 'chrome://calendar/content/calendar.xul';"/>
-->
</popup>
<!-- TASK ITEM CONTEXT MENU -->
@ -328,7 +320,8 @@
accesskey="&calendar.context.deletetask.accesskey;"
observes="delete_todo_command"/>
<menu label="&calendar.context.progress.label;"
accesskey="&calendar.context.progress.accesskey;">
accesskey="&calendar.context.progress.accesskey;"
observes="is_editable">
<menupopup>
<menuitem type="checkbox"
id="percent-0-menuitem"
@ -358,7 +351,8 @@
</menupopup>
</menu>
<menu label="&calendar.context.priority.label;"
accesskey="&calendar.context.priority.accesskey;">
accesskey="&calendar.context.priority.accesskey;"
observes="is_editable">
<menupopup>
<menuitem type="checkbox"
id="priority-0-menuitem"
@ -624,18 +618,20 @@
oncommand="toDoUnifinderRefresh( event )"
persist="checked"/>
</box>
<tree id="unifinder-todo-tree" flex="1" enableColumnDrag="false" ondblclick="modifyToDoCommand( event )">
<tree id="unifinder-todo-tree" flex="1" enableColumnDrag="false"
ondblclick="modifyToDoCommand( event )"
context="taskitem-context-menu">
<treecols id="unifinder-todo-tree-cols">
<treecol id="unifinder-todo-tree-col-completed"
persist="hidden ordinal width sortDirection sortActive" width="18" cycler="true"
label="&calendar.unifinder.tree.done.label;">
<image id="checkboximg" contextmenu="taskitem-context-menu"/>
<image id="checkboximg" />
</treecol>
<splitter class="tree-splitter"/>
<treecol id="unifinder-todo-tree-col-priority"
persist="hidden ordinal width sortDirection sortActive" width="18"
label="&calendar.unifinder.tree.priority.label;">
<image id="priorityimg" contextmenu="taskitem-context-menu"/>
<image id="priorityimg"/>
</treecol>
<splitter class="tree-splitter"/>
<treecol id="unifinder-todo-tree-col-title"
@ -669,8 +665,7 @@
</treecols>
<treechildren tooltip="taskTooltip"
onmousedown="unifinderMouseDownToDo( event )"
context="taskitem-context-menu"/>
onmousedown="unifinderMouseDownToDo( event )"/>
</tree>
</vbox>
</vbox>