Many small bug fixes, mostly look and feel, and moving some functions around.

This commit is contained in:
mikep%oeone.com 2002-08-27 20:06:09 +00:00
Родитель a1fa32b30a
Коммит b9eb2ed3e5
11 изменённых файлов: 232 добавлений и 212 удалений

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

@ -644,122 +644,10 @@ function closeCalendar()
}
function changeToolTipTextForToDo( event )
{
var toDoItem = getToDoFromEvent( event );
var Html = document.getElementById( "savetip" );
while( Html.hasChildNodes() )
{
Html.removeChild( Html.firstChild );
}
var HolderBox = document.createElement( "vbox" );
if( toDoItem )
{
showTooltip = true; //needed to show the tooltip.
if (toDoItem.title)
{
var TitleHtml = document.createElement( "description" );
var TitleText = document.createTextNode( "Title: "+toDoItem.title );
TitleHtml.appendChild( TitleText );
HolderBox.appendChild( TitleHtml );
}
var DateHtml = document.createElement( "description" );
var startDate = new Date( toDoItem.start.getTime() );
var DateText = document.createTextNode( "Start Date: "+gCalendarWindow.dateFormater.getFormatedDate( startDate ) );
DateHtml.appendChild( DateText );
HolderBox.appendChild( DateHtml );
DateHtml = document.createElement( "description" );
var dueDate = new Date( toDoItem.due.getTime() );
DateText = document.createTextNode( "Due Date: "+gCalendarWindow.dateFormater.getFormatedDate( dueDate ) );
DateHtml.appendChild( DateText );
HolderBox.appendChild( DateHtml );
if (toDoItem.description)
{
var DescriptionHtml = document.createElement( "description" );
var DescriptionText = document.createTextNode( "Description: "+toDoItem.description );
DescriptionHtml.appendChild( DescriptionText );
HolderBox.appendChild( DescriptionHtml );
}
Html.appendChild( HolderBox );
}
else
{
showTooltip = false; //Don't show the tooltip
}
}
function changeToolTipTextForEvent( event )
{
var thisEvent = getCalendarEventFromEvent( event );
var Html = document.getElementById( "savetip" );
while( Html.hasChildNodes() )
{
Html.removeChild( Html.firstChild );
}
if( !thisEvent )
{
showTooltip = false;
return;
}
showTooltip = true;
var HolderBox = getPreviewText( thisEvent );
Html.appendChild( HolderBox );
}
/**
* Called when a user hovers over an element and the text for the mouse over is changed.
*/
function getPreviewText( calendarEvent )
{
var HolderBox = document.createElement( "vbox" );
if (calendarEvent.title)
{
var TitleHtml = document.createElement( "description" );
var TitleText = document.createTextNode( "Title: "+calendarEvent.title );
TitleHtml.appendChild( TitleText );
HolderBox.appendChild( TitleHtml );
}
var DateHtml = document.createElement( "description" );
var startDate = new Date( calendarEvent.start.getTime() );
var DateText = document.createTextNode( "Start: "+gCalendarWindow.dateFormater.getFormatedDate( startDate )+" "+gCalendarWindow.dateFormater.getFormatedTime( startDate ) );
DateHtml.appendChild( DateText );
HolderBox.appendChild( DateHtml );
DateHtml = document.createElement( "description" );
var endDate = new Date( calendarEvent.end.getTime() );
DateText = document.createTextNode( "End: "+gCalendarWindow.dateFormater.getFormatedDate( endDate )+" "+gCalendarWindow.dateFormater.getFormatedTime( endDate ) );
DateHtml.appendChild( DateText );
HolderBox.appendChild( DateHtml );
if (calendarEvent.description)
{
var DescriptionHtml = document.createElement( "description" );
var DescriptionText = document.createTextNode( "Description: "+calendarEvent.description );
DescriptionHtml.appendChild( DescriptionText );
HolderBox.appendChild( DescriptionHtml );
}
return ( HolderBox );
}
/**
* Called when a user hovers over an element and the text for the mouse over is changed.
*/
@ -859,7 +747,49 @@ function publishCalendarData()
calendarPublish(calendarString, Server, FilePath, UserName, Password, "text/calendar");
}
/*
** A little function to see if we can show the tooltip
*/
function checkTooltip()
{
//returns true if you can show the tooltip
//or false if the tooltip should not be shown
return( showTooltip );
}
function getCharPref (prefObj, prefName, defaultValue)
{
try
{
return prefObj.getCharPref (prefName);
}
catch (e)
{
return defaultValue;
}
}
function getIntPref (prefObj, prefName, defaultValue)
{
try
{
return prefObj.getIntPref (prefName);
}
catch (e)
{
return defaultValue;
}
}
function getBoolPref (prefObj, prefName, defaultValue)
{
try
{
return prefObj.getBoolPref (prefName);
}
catch (e)
{
return defaultValue;
}
}

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

@ -279,7 +279,7 @@
<listbox id="list-calendars-listbox" class="unifinder-tree-class" flex="1"
ondragover="return( false );" contextmenu="calendarlist-context-menu">
<listhead>
<listheader label="Calendars"/>
<listheader flex="1" crop="end" label="Calendars"/>
</listhead>
<listcols>
<listcol flex="1"/>
@ -292,10 +292,10 @@
</splitter>
<vbox id="left-hand-below-splitter" flex="1" persist="height">
<box align="left">
<label style="font-weight: bold" value="&calendar.unifinder.todoitems.label;"/>
<label flex="1" crop="end" style="font-weight: bold" value="&calendar.unifinder.todoitems.label;"/>
</box>
<box align="center">
<checkbox id="only-completed-checkbox" label="&calendar.unifinder.hidecompletedtodos.label;" oncommand="toDoUnifinderRefesh( event )" persist="checked"/>
<checkbox id="only-completed-checkbox" label="&calendar.unifinder.hidecompletedtodos.label;" flex="1" crop="end" oncommand="toDoUnifinderRefresh( event )" persist="checked"/>
</box>
<tree id="unifinder-todo-tree" flex="1" enableColumnDrag="false">
@ -359,24 +359,26 @@
<vbox flex="1">
<vbox id="bottom-events-box" persist="height">
<box align="center">
<label control="unifinder-search-field" value="&calendar.search.options.searchfor;"/>
<textbox id="unifinder-search-field" onkeypress="unifinderSearchKeyPress( this, event )" flex="1"/>
</box>
<box align="center">
<checkbox label="&calendar.unifinder.withalarms.label;" oncommand="unifinderShowEventsWithAlarmsOnly( event )" collapsed="true"/>
<menulist id="event-filter-menulist" persist="selectedIndex">
<menupopup id="event-filter-menupopup" oncommand="unifinderShowFutureEventsOnly( event );" persist="selectedIndex">
<menuitem id="event-filter-all" label="All Events" value="all" persist="selected"/>
<menuitem id="event-filter-today" label="Today's Events" value="today" persist="selected"/>
<menuitem id="event-filter-week" label="Events This Week" value="week" persist="selected"/>
<menuitem id="event-filter-2weeks" label="Events Next 2 Weeks" value="2weeks" persist="selected"/>
<menuitem id="event-filter-month" label="Events In The Next Month" value="month" persist="selected"/>
<menuitem id="event-filter-future" label="All Future Events" value="future" persist="selected"/>
</menupopup>
</menulist>
</box>
<hbox>
<box align="center">
<checkbox label="&calendar.unifinder.withalarms.label;" oncommand="unifinderShowEventsWithAlarmsOnly( event )" collapsed="true"/>
<menulist id="event-filter-menulist" persist="selectedIndex">
<menupopup id="event-filter-menupopup" oncommand="unifinderShowFutureEventsOnly( event );" persist="selectedIndex">
<menuitem id="event-filter-all" label="All Events" value="all" persist="selected"/>
<menuitem id="event-filter-today" label="Today's Events" value="today" persist="selected"/>
<menuitem id="event-filter-week" label="Events This Week" value="week" persist="selected"/>
<menuitem id="event-filter-2weeks" label="Events Next 2 Weeks" value="2weeks" persist="selected"/>
<menuitem id="event-filter-month" label="Events In The Next Month" value="month" persist="selected"/>
<menuitem id="event-filter-future" label="All Future Events" value="future" persist="selected"/>
</menupopup>
</menulist>
</box>
<box align="center" flex="1">
<label control="unifinder-search-field" value="&calendar.search.options.searchfor;"/>
<textbox id="unifinder-search-field" onkeypress="unifinderSearchKeyPress( this, event )" flex="1"/>
</box>
</hbox>
<tree id="unifinder-search-results-listbox" flex="1" seltype="multiple" enableColumnDrag="false">
<treecols id="unifinder-search-results-tree-cols">
<treecol id="unifinder-search-results-tree-col-title"
@ -399,13 +401,12 @@
flex="1" label="&calendar.unifinder.tree.categories.label;"/>
</treecols>
<treechildren tooltip="savetip" onmousemove="changeToolTipTextForEvent( event )" onpopupshowing="return( false );"
<treechildren tooltip="savetip" onmousemove="changeToolTipTextForEvent( event )"
onclick="unifinderClickEvent( event )"
onkeypress="if (event.keyCode == 13) unifinderEditCommand();"
ondragover="return( false );"
ondblclick="unifinderDoubleClickEvent( event )"
onfocus="focusFirstItemIfNoSelection( );"
context="taskitem-context-menu">
onfocus="focusFirstItemIfNoSelection( );">
</treechildren>
</tree>
</vbox>

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

@ -448,6 +448,7 @@ CalendarEventDataSource.prototype.getAllEvents = function( )
CalendarEventDataSource.prototype.getEventsForRange = function( StartDate, EndDate )
{
dump( "\n->get events from "+StartDate+"\n"+EndDate );
var eventList = this.gICalLib.getFirstEventsForRange( StartDate, EndDate );
var eventArray = new Array();
@ -455,7 +456,7 @@ CalendarEventDataSource.prototype.getEventsForRange = function( StartDate, EndDa
while( eventList.hasMoreElements() )
{
var tmpevent = eventList.getNext().QueryInterface(Components.interfaces.oeIICalEvent);
dump( "\n->event is "+tmpevent );
eventArray[ eventArray.length ] = tmpevent;
}
eventArray.sort( this.orderRawEventsByDate );

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

@ -251,16 +251,28 @@ function loadCalendarEventDialog()
/* Server stuff */
var serverList = opener.gCalendarWindow.calendarManager.calendars;
var oldMenulist = document.getElementById( "server-menulist-menupopup" );
while( oldMenulist.hasChildNodes() )
oldMenulist.removeChild( oldMenulist.lastChild );
for (var i = 0; i < serverList.length ; i++)
if( args.mode == "new" )
{
if( serverList[i].remote != true )
document.getElementById( "server-field" ).appendItem(serverList[i].name, serverList[i].path);
for (var i = 0; i < serverList.length ; i++)
{
if( serverList[i].remote != true )
document.getElementById( "server-field" ).appendItem(serverList[i].name, serverList[i].path);
}
}
else
{
for (var i = 0; i < serverList.length ; i++)
{
document.getElementById( "server-field" ).appendItem(serverList[i].name, serverList[i].path);
if( serverList[i].remote == true && serverList[i].path == gEvent.parent.server )
document.getElementById( "ok" ).setAttribute( "disabled", "true" );
}
}
//if the server
document.getElementById( "server-field" ).selectedIndex = 0;
//the next line seems to crash Mozilla

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

@ -336,9 +336,12 @@ function onError( )
function removeCalendar( event )
{
dump( "\nbutton is "+event.button );
if (event.button != 0)
return;
{
return( false );
}
if( event.currentTarget.checked )
gCalendarWindow.calendarManager.addCalendar( event.currentTarget.calendarObject );
else

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

@ -176,8 +176,10 @@
<!-- Completed -->
<row align="center">
<label value="&newtodo.completed.label;" for="completed-checkbox" pack="end"/>
<hbox align="center">
<hbox class="field-label-box-class" pack="end">
<label value="&newtodo.completed.label;" pack="end"/>
</hbox>
<hbox>
<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"/>

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

@ -251,16 +251,28 @@ function loadCalendarEventDialog()
/* Server stuff */
var serverList = opener.gCalendarWindow.calendarManager.calendars;
var oldMenulist = document.getElementById( "server-menulist-menupopup" );
while( oldMenulist.hasChildNodes() )
oldMenulist.removeChild( oldMenulist.lastChild );
for (var i = 0; i < serverList.length ; i++)
if( args.mode == "new" )
{
if( serverList[i].remote != true )
document.getElementById( "server-field" ).appendItem(serverList[i].name, serverList[i].path);
for (var i = 0; i < serverList.length ; i++)
{
if( serverList[i].remote != true )
document.getElementById( "server-field" ).appendItem(serverList[i].name, serverList[i].path);
}
}
else
{
for (var i = 0; i < serverList.length ; i++)
{
document.getElementById( "server-field" ).appendItem(serverList[i].name, serverList[i].path);
if( serverList[i].remote == true && serverList[i].path == gEvent.parent.server )
document.getElementById( "ok" ).setAttribute( "disabled", "true" );
}
}
//if the server
document.getElementById( "server-field" ).selectedIndex = 0;
//the next line seems to crash Mozilla

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

@ -118,39 +118,4 @@ calendarPreferences.prototype.getPref = function( Preference )
return( ThisPref );
}
function getCharPref (prefObj, prefName, defaultValue)
{
try
{
return prefObj.getCharPref (prefName);
}
catch (e)
{
return defaultValue;
}
}
function getIntPref (prefObj, prefName, defaultValue)
{
try
{
return prefObj.getIntPref (prefName);
}
catch (e)
{
return defaultValue;
}
}
function getBoolPref (prefObj, prefName, defaultValue)
{
try
{
return prefObj.getBoolPref (prefName);
}
catch (e)
{
return defaultValue;
}
}

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

@ -176,8 +176,10 @@
<!-- Completed -->
<row align="center">
<label value="&newtodo.completed.label;" for="completed-checkbox" pack="end"/>
<hbox align="center">
<hbox class="field-label-box-class" pack="end">
<label value="&newtodo.completed.label;" pack="end"/>
</hbox>
<hbox>
<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"/>

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

@ -44,7 +44,6 @@
* This is a hacked in interface to the unifinder. We will need to
* improve this to make it usable in general.
*/
const UnifinderTreeName = "unifinder-search-results-listbox";
function calendarUnifinderInit( )
@ -53,12 +52,8 @@ function calendarUnifinderInit( )
{
onSelectionChanged : function( EventSelectionArray )
{
/*
This no longer works since we moved to a tree
*/
var SearchTree = document.getElementById( "unifinder-search-results-listbox" );
SearchTree.setAttribute( "suppressonselect", "true" );
SearchTree.treeBoxObject.selection.select( -1 );
@ -79,22 +74,6 @@ function calendarUnifinderInit( )
}
}
}
/*SearchTree.clearSelection();
if( EventSelectionArray.length > 0 )
{
for( i = 0; i < EventSelectionArray.length; i++ )
{
var SearchTreeItem = document.getElementById( "search-unifinder-treeitem-"+EventSelectionArray[i].id );
//you need this for when an event is added. It doesn't yet exist.
if( SearchTreeItem )
SearchTree.addItemToSelection( SearchTreeItem );
}
}
dump( "\nAllow on select now!" );
SearchTree.removeAttribute( "suppressonselect" );
*/
}
}
@ -257,10 +236,6 @@ function getCalendarEventFromEvent( event )
function unifinderClickEvent( event )
{
// only change checkbox on left mouse-button click
if( event.button != 0)
return;
var tree = document.getElementById( UnifinderTreeName );
var ThisEvent = getCalendarEventFromEvent( event );
var ArrayOfEvents = new Array( ThisEvent );
@ -646,3 +621,65 @@ function getNextOrPreviousRecurrence( calendarEvent )
return eventStartDate;
}
function changeToolTipTextForEvent( event )
{
var thisEvent = getCalendarEventFromEvent( event );
var Html = document.getElementById( "savetip" );
while( Html.hasChildNodes() )
{
Html.removeChild( Html.firstChild );
}
if( !thisEvent )
{
showTooltip = false;
return;
}
showTooltip = true;
var HolderBox = getPreviewText( thisEvent );
Html.appendChild( HolderBox );
}
function getPreviewText( calendarEvent )
{
var HolderBox = document.createElement( "vbox" );
if (calendarEvent.title)
{
var TitleHtml = document.createElement( "description" );
var TitleText = document.createTextNode( "Title: "+calendarEvent.title );
TitleHtml.appendChild( TitleText );
HolderBox.appendChild( TitleHtml );
}
var DateHtml = document.createElement( "description" );
var startDate = new Date( calendarEvent.start.getTime() );
var DateText = document.createTextNode( "Start: "+gCalendarWindow.dateFormater.getFormatedDate( startDate )+" "+gCalendarWindow.dateFormater.getFormatedTime( startDate ) );
DateHtml.appendChild( DateText );
HolderBox.appendChild( DateHtml );
DateHtml = document.createElement( "description" );
var endDate = new Date( calendarEvent.end.getTime() );
DateText = document.createTextNode( "End: "+gCalendarWindow.dateFormater.getFormatedDate( endDate )+" "+gCalendarWindow.dateFormater.getFormatedTime( endDate ) );
DateHtml.appendChild( DateText );
HolderBox.appendChild( DateHtml );
if (calendarEvent.description)
{
var DescriptionHtml = document.createElement( "description" );
var DescriptionText = document.createTextNode( "Description: "+calendarEvent.description );
DescriptionHtml.appendChild( DescriptionText );
HolderBox.appendChild( DescriptionHtml );
}
return ( HolderBox );
}

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

@ -478,3 +478,58 @@ function contextChangePriority( Priority, event )
}
}
}
function changeToolTipTextForToDo( event )
{
var toDoItem = getToDoFromEvent( event );
var Html = document.getElementById( "savetip" );
while( Html.hasChildNodes() )
{
Html.removeChild( Html.firstChild );
}
var HolderBox = document.createElement( "vbox" );
if( toDoItem )
{
showTooltip = true; //needed to show the tooltip.
if (toDoItem.title)
{
var TitleHtml = document.createElement( "description" );
var TitleText = document.createTextNode( "Title: "+toDoItem.title );
TitleHtml.appendChild( TitleText );
HolderBox.appendChild( TitleHtml );
}
var DateHtml = document.createElement( "description" );
var startDate = new Date( toDoItem.start.getTime() );
var DateText = document.createTextNode( "Start Date: "+gCalendarWindow.dateFormater.getFormatedDate( startDate ) );
DateHtml.appendChild( DateText );
HolderBox.appendChild( DateHtml );
DateHtml = document.createElement( "description" );
var dueDate = new Date( toDoItem.due.getTime() );
DateText = document.createTextNode( "Due Date: "+gCalendarWindow.dateFormater.getFormatedDate( dueDate ) );
DateHtml.appendChild( DateText );
HolderBox.appendChild( DateHtml );
if (toDoItem.description)
{
var DescriptionHtml = document.createElement( "description" );
var DescriptionText = document.createTextNode( "Description: "+toDoItem.description );
DescriptionHtml.appendChild( DescriptionText );
HolderBox.appendChild( DescriptionHtml );
}
Html.appendChild( HolderBox );
}
else
{
showTooltip = false; //Don't show the tooltip
}
}