fix some javascript strict warnings when starting calendar

bug 237368, r=mostafah
This commit is contained in:
mvl%exedo.nl 2004-03-16 20:23:12 +00:00
Родитель 1799c57970
Коммит 30af29cd9c
5 изменённых файлов: 34 добавлений и 25 удалений

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

@ -172,7 +172,8 @@ function calendarInit()
// initialize calendar color style rules in the calendar's styleSheet
// find calendar's style sheet index
for (var i=0; i<document.styleSheets.length; i++)
var i;
for (i=0; i<document.styleSheets.length; i++)
{
if (document.styleSheets[i].href.match(/chrome.*\/skin.*\/calendar.css$/))
{
@ -189,13 +190,13 @@ function calendarInit()
var seq = gCalendarWindow.calendarManager.rdf.getRootSeq("urn:calendarcontainer");
var list = seq.getSubNodes();
for(var i=0; i<list.length;i++)
{
for(i=0; i<list.length;i++)
{
calendarNode = gCalendarWindow.calendarManager.rdf.getNode( list[i].subject );
// grab the container name and use it for the name of the style rule
containerName = list[i].subject.split(":")[2];
// grab the container name and use it for the name of the style rule
containerName = list[i].subject.split(":")[2];
// obtain calendar color from the rdf datasource
calendarColor = calendarNode.getAttribute("http://home.netscape.com/NC-rdf#color");
@ -996,21 +997,24 @@ function deleteToDoCommand( DoNotConfirm )
var end = new Object();
var numRanges = tree.view.selection.getRangeCount();
var t;
var v;
var toDoItem;
if( numRanges == 1 ) {
for (var t=0; t<numRanges; t++){
for (t=0; t<numRanges; t++){
tree.view.selection.getRangeAt(t,start,end);
for (var v=start.value; v<=end.value; v++){
var toDoItem = tree.taskView.getCalendarTaskAtRow( v );
for (v=start.value; v<=end.value; v++){
toDoItem = tree.taskView.getCalendarTaskAtRow( v );
refreshRemoteCalendarAndRunFunction( toDoItem.id, toDoItem.parent.server, "deleteTodo" );
}
}
} else {
gICalLib.batchMode = true;
for (var t=0; t<numRanges; t++){
for (t=0; t<numRanges; t++){
tree.view.selection.getRangeAt(t,start,end);
for (var v=start.value; v<=end.value; v++){
var toDoItem = tree.taskView.getCalendarTaskAtRow( v );
for (v=start.value; v<=end.value; v++){
toDoItem = tree.taskView.getCalendarTaskAtRow( v );
var todoId = toDoItem.id
gICalLib.deleteTodo( todoId );
}
@ -1145,6 +1149,7 @@ function getPreviewTextForTask( toDoItem )
{
showTooltip = false; //Don't show the tooltip
}
return null;
}
/**
@ -1479,7 +1484,7 @@ function changeOnlyWorkdayCheckbox( menuindex ) {
changemenu = 1 ;
break;
default:
return(false);
return;
}
if(check == "true") {
document.getElementById( "only-workday-checkbox-" + changemenu ).setAttribute("checked","true");
@ -1505,7 +1510,7 @@ function changeDisplayToDoInViewCheckbox( menuindex ) {
changemenu = 1 ;
break;
default:
return(false);
return;
}
if(check == "true") {
document.getElementById( "display-todo-inview-checkbox-" + changemenu ).setAttribute("checked","true");

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

@ -460,7 +460,7 @@ calendarManager.prototype.publishCalendar = function calMan_publishCalendar( Sel
if( !SelectedCalendar )
{
var SelectedCalendarId = this.getSelectedCalendarId();
var SelectedCalendar = this.rdf.getNode( SelectedCalendarId );
SelectedCalendar = this.rdf.getNode( SelectedCalendarId );
}
calendarUploadFile(SelectedCalendar.getAttribute( "http://home.netscape.com/NC-rdf#path" ),
@ -956,6 +956,8 @@ function deleteCalendar( )
refreshToDoTree( false );
gCalendarWindow.currentView.refreshEvents();
return true;
}
// CofC
@ -965,12 +967,13 @@ function deleteCalendar( )
function calendarColorStyleRuleUpdate( ThisCalendarObject )
{
var j = -1;
var i;
// obtain calendar name from the Id
containerName = ThisCalendarObject.Id.split(':')[2];
var tempStyleSheets = document.styleSheets;
for (var i=0; i<tempStyleSheets.length; i++)
for (i=0; i<tempStyleSheets.length; i++)
{
if (tempStyleSheets[i].href.match(/chrome.*\/skin.*\/calendar.css$/))
{
@ -985,7 +988,7 @@ function calendarColorStyleRuleUpdate( ThisCalendarObject )
var ruleList = tempStyleSheets[j].cssRules;
var ruleName;
for (var i=0; i < ruleList.length; i++)
for (i=0; i < ruleList.length; i++)
{
ruleName = ruleList[i].cssText.split(' ');

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

@ -148,7 +148,7 @@ function copyToClipboard( calendarEventArray )
{
if( !calendarEventArray)
{
var calendarEventArray = new Array( 0 );
calendarEventArray = new Array( 0 );
calendarEventArray = gCalendarWindow.EventSelection.selectedEvents;
}

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

@ -136,7 +136,7 @@ function loadEventsFromFile()
tempEventArray = parseXCSData( aDataStream );
break;
case 2: // csv
var tempEventArray = parseOutlookCSVData( aDataStream );
tempEventArray = parseOutlookCSVData( aDataStream );
break;
default:
tempEventArray = null;
@ -167,8 +167,9 @@ function loadEventsFromFile()
( promptService.BUTTON_TITLE_IS_STRING * promptService.BUTTON_POS_2 );
// Ask user what to import (all / prompt each / none)
var buttonPressed;
if (calendarEventArray.length > 0) {
var buttonPressed = promptService.confirmEx( window, "Import", importText, flags,
buttonPressed = promptService.confirmEx( window, "Import", importText, flags,
importAllStr, discardAllStr, promptStr,
null, result );
@ -181,7 +182,7 @@ function loadEventsFromFile()
// Ask user what to do with duplicates
if (duplicateEventArray.length > 0) {
var buttonPressed = promptService.confirmEx( window, "Import duplicates", dupeText, flags,
buttonPressed = promptService.confirmEx( window, "Import duplicates", dupeText, flags,
importAllStr, discardAllStr, promptStr,
null, result );
if(buttonPressed == 0) // Import all
@ -254,13 +255,13 @@ function addEventsToCalendar( calendarEventArray, silent, ServerName )
else
{
//otherwise use the default
var ServerName = gCalendarWindow.calendarManager.getDefaultServer();
ServerName = gCalendarWindow.calendarManager.getDefaultServer();
}
}
else
{
//otherwise use the default
var ServerName = gCalendarWindow.calendarManager.getDefaultServer();
ServerName = gCalendarWindow.calendarManager.getDefaultServer();
}
}
gICalLib.addEvent( calendarEvent, ServerName );
@ -506,7 +507,7 @@ function parseOutlookCSVData( outlookCsvStr ) {
// Construct event regexp according to field indexes. The regexp can
// be made stricter, if it seems this matches too loosely.
var regExpStr = "^";
for( var i = 1; i < header.length; i++ ) {
for( i = 1; i < header.length; i++ ) {
if( i != 1 )
regExpStr += ",";
if( i == args.descriptionIndex )
@ -522,7 +523,7 @@ function parseOutlookCSVData( outlookCsvStr ) {
do {
eventFields[0] ="";
//strip quotation marks
for( var i=1; i < eventFields.length; i++ )
for( i=1; i < eventFields.length; i++ )
if( eventFields[i].length > 0 )
eventFields[i] = eventFields[i].slice( 1, -1 );

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

@ -100,7 +100,7 @@ function calendarUploadFile(aSourceFilename, newLocation, login, password, conte
output_file_to_channel(protocolChannel, aSourceFilename, contentType);
protocolChannel.asyncOpen(gPublishingListener, protocolChannel);
return( true );
return;
}
catch (e)
{