Code clean up and small bug fixes from OEone.

This commit is contained in:
mikep%oeone.com 2002-07-02 17:07:38 +00:00
Родитель 81009c4c61
Коммит cfcf565b5b
10 изменённых файлов: 82 добавлений и 26 удалений

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

@ -188,7 +188,7 @@ function calendarFinish()
finishCalendarUnifinder( );
finishCalendarToDoUnifinder( );
gCalendarWindow.close( );
}
@ -456,17 +456,17 @@ function newToDoCommand()
function createEvent ()
{
var iCalToDoComponent = Components.classes["@mozilla.org/icalevent;1"].createInstance();
var iCalToDo = iCalToDoComponent.QueryInterface(Components.interfaces.oeIICalEvent);
return iCalToDo;
var iCalEventComponent = Components.classes["@mozilla.org/icalevent;1"].createInstance();
var iCalEvent = iCalEventComponent.QueryInterface(Components.interfaces.oeIICalEvent);
return iCalEvent;
}
function createToDo ()
{
var iCalEventComponent = Components.classes["@mozilla.org/icaltodo;1"].createInstance();
var iCalEvent = iCalEventComponent.QueryInterface(Components.interfaces.oeIICalTodo);
return iCalEvent;
var iCalToDoComponent = Components.classes["@mozilla.org/icaltodo;1"].createInstance();
var iCalToDo = iCalToDoComponent.QueryInterface(Components.interfaces.oeIICalTodo);
return iCalToDo;
}

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

@ -80,7 +80,7 @@
width="830px"
persist="screenX screenY width height sizemode">
<commandset>
<commandset id="calendar_commands">
<command id="new_command" oncommand="newEventCommand()"/>
<command id="new_todo_command" oncommand="newToDoCommand()"/>
<command id="delete_command" oncommand="unifinderDeleteCommand( true )" disabled="true"/>

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

@ -1079,7 +1079,7 @@ function updateAddExceptionButton()
//get the date from the picker
var datePickerValue = getDateTimeFieldValue( "exception-dates-text" );
if( isAlreadyException( datePickerValue ) )
if( isAlreadyException( datePickerValue ) || document.getElementById( "repeat-checkbox" ).getAttribute( "checked" ) != "true" )
{
document.getElementById( "exception-add-button" ).setAttribute( "disabled", "true" );
}
@ -1179,11 +1179,9 @@ function getWeekNumberOfMonth()
var oldStartTime = startTime;
var dayNumber = startTime.getDay();
var thisMonth = startTime.getMonth();
var monthToCompare = startTime.getMonth();
var monthToCompare = thisMonth;
var weekNumber = 0;
@ -1423,3 +1421,10 @@ function formatTime( time )
var timeString = opener.gCalendarWindow.dateFormater.getFormatedTime( time );
return timeString;
}
function debug( Text )
{
dump( "\n"+ Text + "\n");
}

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

@ -217,7 +217,7 @@
<!-- Private -->
<row collapsed="true" align="center">
<row align="center">
<spacer />
<checkbox id="private-checkbox" checked="false" label="&newevent.private.label;"/>
</row>
@ -356,7 +356,10 @@
ondragover="nsDragAndDrop.dragOver(event, attachmentBucketObserver);"
ondragdrop="nsDragAndDrop.drop(event, attachmentBucketObserver);"
ondragexit="nsDragAndDrop.dragExit(event, attachmentBucketObserver);"/>
<button onclick="AttachFile()" label="Choose File"/>
<vbox>
<button onclick="AttachFile()" label="Choose File"/>
<spacer flex="1"/>
</vbox>
</tabpanel>
</tabpanels>
</tabbox>

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

@ -200,7 +200,9 @@ function onOKCommand()
//get the time for the completed event
var completedDate = getDateTimeFieldValue( "completed-date-text" );
gToDo.completed = completedDate;
gToDo.completed.year = completedDate.getYear() + 1900;
gToDo.completed.month = completedDate.getMonth();
gToDo.completed.day = completedDate.getDate();
}
else
gToDo.completed.clear();

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

@ -1,3 +1,40 @@
/* ***** 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 OEone Calendar Code, released October 31st, 2001.
*
* The Initial Developer of the Original Code is
* OEone Corporation.
* Portions created by the Initial Developer are Copyright (C) 2001
* the Initial Developer. All Rights Reserved.
*
* Contributor(s): Garth Smedley <garths@oeone.com>
* Mike Potter <mikep@oeone.com>
*
* 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 ***** */
/*-----------------------------------------------------------------
* C A L E N D A R C L A S S E S
*/

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

@ -1079,7 +1079,7 @@ function updateAddExceptionButton()
//get the date from the picker
var datePickerValue = getDateTimeFieldValue( "exception-dates-text" );
if( isAlreadyException( datePickerValue ) )
if( isAlreadyException( datePickerValue ) || document.getElementById( "repeat-checkbox" ).getAttribute( "checked" ) != "true" )
{
document.getElementById( "exception-add-button" ).setAttribute( "disabled", "true" );
}
@ -1179,11 +1179,9 @@ function getWeekNumberOfMonth()
var oldStartTime = startTime;
var dayNumber = startTime.getDay();
var thisMonth = startTime.getMonth();
var monthToCompare = startTime.getMonth();
var monthToCompare = thisMonth;
var weekNumber = 0;
@ -1423,3 +1421,10 @@ function formatTime( time )
var timeString = opener.gCalendarWindow.dateFormater.getFormatedTime( time );
return timeString;
}
function debug( Text )
{
dump( "\n"+ Text + "\n");
}

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

@ -217,7 +217,7 @@
<!-- Private -->
<row collapsed="true" align="center">
<row align="center">
<spacer />
<checkbox id="private-checkbox" checked="false" label="&newevent.private.label;"/>
</row>
@ -356,7 +356,10 @@
ondragover="nsDragAndDrop.dragOver(event, attachmentBucketObserver);"
ondragdrop="nsDragAndDrop.drop(event, attachmentBucketObserver);"
ondragexit="nsDragAndDrop.dragExit(event, attachmentBucketObserver);"/>
<button onclick="AttachFile()" label="Choose File"/>
<vbox>
<button onclick="AttachFile()" label="Choose File"/>
<spacer flex="1"/>
</vbox>
</tabpanel>
</tabpanels>
</tabbox>

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

@ -200,7 +200,9 @@ function onOKCommand()
//get the time for the completed event
var completedDate = getDateTimeFieldValue( "completed-date-text" );
gToDo.completed = completedDate;
gToDo.completed.year = completedDate.getYear() + 1900;
gToDo.completed.month = completedDate.getMonth();
gToDo.completed.day = completedDate.getDate();
}
else
gToDo.completed.clear();

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

@ -347,14 +347,13 @@ function unifinderSearchKeyPress( searchTextItem, event )
eventTable = gEventSource.search( searchText, FieldsToSearch );
}
if( document.getElementById( "unifinder-clear-results-button" ) )
if( document.getElementById( "erase_command" ) )
{
if( searchText.length <= 0 )
document.getElementById( "unifinder-clear-results-button" ).setAttribute( "disabled", "true" );
document.getElementById( "erase_command" ).setAttribute( "disabled", "true" );
else
document.getElementById( "unifinder-clear-results-button" ).removeAttribute( "disabled" );
document.getElementById( "erase_command" ).removeAttribute( "disabled" );
}
refreshEventTree( eventTable );
}