mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-30 00:01:50 +00:00
Adding in the patch from bug 157273.
This commit is contained in:
parent
532b7c841e
commit
36b876dea9
@ -78,7 +78,7 @@ h1 {
|
||||
|
||||
<td id="mozver">
|
||||
<h1>
|
||||
<a id="mozlink" href="http://www.mozilla.org/projects/calendar/" target="_new">Mozilla Calendar 2002072510-cal</a>
|
||||
<a id="mozlink" href="http://www.mozilla.org/projects/calendar/" target="_new">Mozilla Calendar 2002072611-cal</a>
|
||||
</h1>
|
||||
<script type="application/x-javascript">
|
||||
// using try..catch to handle empty useragents and other cases where the regex fails to apply
|
||||
|
@ -25,6 +25,7 @@
|
||||
- Chris Charabaruk <coldacid@meldstar.com>
|
||||
- Karl Guertin <grayrest@grayrest.com>
|
||||
- Dan Parent <danp@oeone.com>
|
||||
- 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
|
||||
@ -92,7 +93,7 @@
|
||||
<command id="select_all_command" oncommand="selectAllEvents()"/>
|
||||
|
||||
<command id="new_todo_command" oncommand="newToDoCommand()"/>
|
||||
<command id="delete_todo_command" oncommand="deleteToDoCommand( event )"/>
|
||||
<command id="delete_todo_command" oncommand="unifinderDeleteToDoCommand()"/>
|
||||
|
||||
<command id="next_command" oncommand="gCalendarWindow.currentView.goToNext()"/>
|
||||
<command id="previous_command" oncommand="gCalendarWindow.currentView.goToPrevious()"/>
|
||||
@ -192,6 +193,10 @@
|
||||
<menuitem label="&calendar.context.reload.label;" accesskey="&calendar.context.reload.accesskey;" oncommand="window.location = 'chrome://calendar/content/calendar.xul';"/>
|
||||
</popup>
|
||||
|
||||
<popup id="taskitem-context-menu">
|
||||
<menuitem label="&calendar.context.deletetask.label;" accesskey="&calendar.context.deletetask.accesskey;" observes="delete_todo_command"/>
|
||||
</popup>
|
||||
|
||||
<popup id="oe-date-picker-popup" position="after_start" oncommand="gCalendarWindow.goToDay( date )" value=""/>
|
||||
|
||||
<commandset id="commands"/>
|
||||
@ -266,9 +271,9 @@
|
||||
<listcol flex="5"/>
|
||||
<listcol flex="3"/>
|
||||
</listcols>
|
||||
<listitem allowevents="true" onmouseover="changeToolTipTextForToDo( event )" collapsed="true" name="sample-todo-listitem" ondblclick="unifinderDoubleClickToDo( event )">
|
||||
<listitem onmouseover="changeToolTipTextForToDo( event )" collapsed="true" name="sample-todo-listitem" onclick="unifinderClickToDo( event )" ondblclick="unifinderDoubleClickToDo( event )" context="taskitem-context-menu" >
|
||||
<listcell name="checkbox-listcell">
|
||||
<checkbox name="firstcheckbox" oncommand="checkboxClick( event )"/>
|
||||
<checkbox name="firstcheckbox"/>
|
||||
</listcell>
|
||||
<listcell name="title-listcell" label=""/>
|
||||
<listcell name="due-date-listcell" label=""/>
|
||||
|
@ -22,6 +22,7 @@
|
||||
* Mike Potter <mikep@oeone.com>
|
||||
* Chris Charabaruk <coldacid@meldstar.com>
|
||||
* Colin Phillips <colinp@oeone.com>
|
||||
* 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
|
||||
@ -74,7 +75,7 @@ var unifinderToDoDataSourceObserver =
|
||||
|
||||
onModifyItem : function( calendarToDo, originalToDo )
|
||||
{
|
||||
toDoUnifinderRefesh();
|
||||
toDoUnifinderItemUpdate( calendarToDo );
|
||||
},
|
||||
|
||||
onDeleteItem : function( calendarToDo )
|
||||
@ -141,6 +142,12 @@ function toDoUnifinderRefesh()
|
||||
|
||||
function unifinderClickToDo( event )
|
||||
{
|
||||
var listItemCheckbox = event.target.getElementsByTagName( "checkbox" )[0];
|
||||
if ( event.clientX > listItemCheckbox.boxObject.x && event.clientX < listItemCheckbox.boxObject.x + listItemCheckbox.boxObject.width )
|
||||
{
|
||||
listItemCheckbox.checked = !listItemCheckbox.checked;
|
||||
checkboxClick( event )
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@ -157,11 +164,25 @@ function unifinderDoubleClickToDo( event )
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete all ToDo items that are selected in the ToDo unifinder list
|
||||
*/
|
||||
|
||||
function unifinderDeleteToDoCommand( DoNotConfirm )
|
||||
{
|
||||
var unifinderTodoTree = document.getElementById( ToDoUnifinderTreeName );
|
||||
|
||||
for( var i = 0; i < unifinderTodoTree.selectedCount; i++ ) {
|
||||
gICalLib.deleteTodo( unifinderTodoTree.getSelectedItem( i ).toDo.id );
|
||||
}
|
||||
}
|
||||
|
||||
function checkboxClick( event )
|
||||
{
|
||||
var ThisToDo = event.currentTarget.parentNode.parentNode.toDo;
|
||||
// var ThisToDo = event.currentTarget.parentNode.parentNode.toDo;
|
||||
var ThisToDo = event.currentTarget.toDo;
|
||||
|
||||
if( event.currentTarget.checked == true )
|
||||
if( event.target.getElementsByTagName( "checkbox" )[0].checked == true )
|
||||
{
|
||||
var completedTime = new Date();
|
||||
|
||||
@ -180,46 +201,26 @@ function checkboxClick( event )
|
||||
ThisToDo.status = ThisToDo.ICAL_STATUS_INPROCESS;
|
||||
}
|
||||
gICalLib.modifyTodo( ThisToDo );
|
||||
|
||||
toDoUnifinderRefesh();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Redraw the categories unifinder tree
|
||||
* Attach the calendarToDo event to the treeitem
|
||||
*/
|
||||
|
||||
function refreshToDoTree( eventArray )
|
||||
{
|
||||
// get the old tree children item and remove it
|
||||
|
||||
var oldTreeChildren = document.getElementById( ToDoUnifinderTreeName );
|
||||
|
||||
var elementsToRemove = document.getElementsByAttribute( "taskitem", "true" );
|
||||
|
||||
for( var i = 0; i < elementsToRemove.length; i++ )
|
||||
function setUnifinderToDoTreeItem( treeItem, calendarToDo )
|
||||
{
|
||||
elementsToRemove[i].parentNode.removeChild( elementsToRemove[i] );
|
||||
}
|
||||
|
||||
// add: tree item, row, cell, box and text items for every event
|
||||
for( var index = 0; index < eventArray.length; ++index )
|
||||
{
|
||||
var calendarToDo = eventArray[ index ];
|
||||
|
||||
// make the items
|
||||
var oldTreeItems = document.getElementsByAttribute( "name", "sample-todo-listitem" );
|
||||
|
||||
var oldTreeItem = oldTreeItems[0];
|
||||
|
||||
var treeItem = oldTreeItem.cloneNode( true );
|
||||
|
||||
treeItem.toDo = calendarToDo;
|
||||
|
||||
var now = new Date();
|
||||
|
||||
var thisMorning = new Date( now.getFullYear(), now.getMonth(), now.getDate(), 0, 0, 0 );
|
||||
|
||||
treeItem.removeAttribute( "completed" );
|
||||
treeItem.removeAttribute( "started" );
|
||||
treeItem.removeAttribute( "overdue" );
|
||||
|
||||
|
||||
if( calendarToDo.start.getTime() <= thisMorning.getTime() )
|
||||
{
|
||||
//this task should be started
|
||||
@ -257,7 +258,61 @@ function refreshToDoTree( eventArray )
|
||||
treeItem.removeAttribute( "collapsed" );
|
||||
|
||||
treeItem.setAttribute( "taskitem", "true" );
|
||||
}
|
||||
|
||||
/**
|
||||
* Redraw the categories unifinder tree
|
||||
*/
|
||||
|
||||
function refreshToDoTree( eventArray )
|
||||
{
|
||||
// get the old tree children item and remove it
|
||||
|
||||
var oldTreeChildren = document.getElementById( ToDoUnifinderTreeName );
|
||||
|
||||
var elementsToRemove = document.getElementsByAttribute( "taskitem", "true" );
|
||||
|
||||
var oldSelectedIndex = oldTreeChildren.selectedIndex;
|
||||
|
||||
for( var i = 0; i < elementsToRemove.length; i++ )
|
||||
{
|
||||
elementsToRemove[i].parentNode.removeChild( elementsToRemove[i] );
|
||||
}
|
||||
|
||||
// add: tree item, row, cell, box and text items for every event
|
||||
for( var index = 0; index < eventArray.length; ++index )
|
||||
{
|
||||
var calendarToDo = eventArray[ index ];
|
||||
|
||||
// make the items
|
||||
var oldTreeItems = document.getElementsByAttribute( "name", "sample-todo-listitem" );
|
||||
|
||||
var oldTreeItem = oldTreeItems[0];
|
||||
|
||||
var treeItem = oldTreeItem.cloneNode( true );
|
||||
|
||||
setUnifinderToDoTreeItem( treeItem, calendarToDo );
|
||||
|
||||
oldTreeChildren.appendChild( treeItem );
|
||||
}
|
||||
oldTreeChildren.selectedIndex = oldSelectedIndex;
|
||||
}
|
||||
|
||||
/**
|
||||
* Redraw a single item of the ToDo unifinder tree
|
||||
*/
|
||||
|
||||
function toDoUnifinderItemUpdate( calendarToDo )
|
||||
{
|
||||
var oldTreeChildren = document.getElementById( ToDoUnifinderTreeName );
|
||||
|
||||
var elementsToRemove = document.getElementsByAttribute( "taskitem", "true" );
|
||||
|
||||
for( var i = 0; i < elementsToRemove.length; i++ )
|
||||
{
|
||||
if(elementsToRemove[i].toDo == calendarToDo)
|
||||
{
|
||||
setUnifinderToDoTreeItem( elementsToRemove[i], calendarToDo );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -21,6 +21,7 @@
|
||||
- Contributor(s): Garth Smedley <garths@oeone.com>
|
||||
- Mike Potter <mikep@oeone.com>
|
||||
- Chris Charabaruk <coldacid@meldstar.com>
|
||||
- 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
|
||||
@ -208,6 +209,8 @@
|
||||
<!ENTITY calendar.context.modifyevent.label "Edit Event">
|
||||
<!ENTITY calendar.context.modifyevent.accesskey "e">
|
||||
<!ENTITY calendar.context.deleteevent.label "Delete Event">
|
||||
<!ENTITY calendar.context.deletetask.accesskey "l">
|
||||
<!ENTITY calendar.context.deletetask.label "Delete Task">
|
||||
<!ENTITY calendar.context.deleteevent.accesskey "l">
|
||||
<!ENTITY calendar.context.cutevent.label "Cut">
|
||||
<!ENTITY calendar.context.cutevent.accesskey "t">
|
||||
|
@ -1119,11 +1119,16 @@
|
||||
border : none;
|
||||
}
|
||||
|
||||
.unifinder-tree-class > listitem[selected="true"] > listcell > .unifinder-treecell-box-class
|
||||
.unifinder-tree-class:focus > listitem[selected="true"] > listcell > .unifinder-treecell-box-class
|
||||
{
|
||||
background-color : #d5e3f2;
|
||||
}
|
||||
|
||||
.unifinder-tree-class > listitem[selected="true"] > listcell > .unifinder-treecell-box-class
|
||||
{
|
||||
background-color : -moz-Dialog;
|
||||
}
|
||||
|
||||
.unifinder-treecell-box-class
|
||||
{
|
||||
padding : 2px;
|
||||
|
@ -1083,11 +1083,17 @@
|
||||
border : none;
|
||||
}
|
||||
|
||||
.unifinder-tree-class > listitem[selected="true"] > listcell > .unifinder-treecell-box-class
|
||||
.unifinder-tree-class:focus > listitem[selected="true"] > listcell > .unifinder-treecell-box-class
|
||||
{
|
||||
background-color : #d5e3f2;
|
||||
}
|
||||
|
||||
.unifinder-tree-class > listitem[selected="true"] > listcell > .unifinder-treecell-box-class
|
||||
{
|
||||
background-color : -moz-Dialog;
|
||||
}
|
||||
|
||||
|
||||
.unifinder-treecell-box-class
|
||||
{
|
||||
padding : 2px;
|
||||
@ -1112,3 +1118,13 @@
|
||||
{
|
||||
color : green;
|
||||
}
|
||||
|
||||
#unifinder-todo-listbox:focus > listitem[selected="true"] > listcell
|
||||
{
|
||||
background-color : #d5e3f2;
|
||||
}
|
||||
|
||||
#unifinder-todo-listbox > listitem[selected="true"] > listcell
|
||||
{
|
||||
background-color : -moz-Dialog;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user