Bug 374101 - clean up some strict js warnings and errors

p=Magnus Melin <mkmelin+mozilla@iki.fi>
r+sr=bienvenu
This commit is contained in:
asqueella%gmail.com 2007-03-15 21:40:44 +00:00
Родитель a811888d73
Коммит 545f1f993f
16 изменённых файлов: 41 добавлений и 40 удалений

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

@ -75,7 +75,7 @@
else else
{ {
// we may be nested inside of a link node // we may be nested inside of a link node
linkNode = event.originalTarget; var linkNode = event.originalTarget;
while (linkNode && !(linkNode instanceof HTMLAnchorElement)) while (linkNode && !(linkNode instanceof HTMLAnchorElement))
linkNode = linkNode.parentNode; linkNode = linkNode.parentNode;

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

@ -210,7 +210,7 @@ function view_init()
} }
// hide the views menu item if the user doesn't have the views toolbar button visible // hide the views menu item if the user doesn't have the views toolbar button visible
viewsToolbarButton = document.getElementById("mailviews-container"); var viewsToolbarButton = document.getElementById("mailviews-container");
document.getElementById('viewMessageViewMenu').hidden = !viewsToolbarButton; document.getElementById('viewMessageViewMenu').hidden = !viewsToolbarButton;
// Initialize the View Attachment Inline menu // Initialize the View Attachment Inline menu

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

@ -113,7 +113,7 @@ urlListener.prototype = {
// start the alert. // start the alert.
if (!gPendingPreviewFetchRequests) if (!gPendingPreviewFetchRequests)
showAlert(); showAlert();
}, }
} }
function onAlertLoad() function onAlertLoad()

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

@ -431,5 +431,5 @@ var gComposePane = {
try { try {
document.getElementById('msgcompose.background_color').reset(); document.getElementById('msgcompose.background_color').reset();
} catch (ex) {} } catch (ex) {}
}, }
}; };

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

@ -199,5 +199,5 @@ var gConnectionsDialog = {
if (shareProxiesPref.value) if (shareProxiesPref.value)
this.updateProtocolPrefs(); this.updateProtocolPrefs();
return undefined; return undefined;
}, }
}; };

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

@ -109,10 +109,10 @@ var gDisplayPane = {
var tagElToEdit = this.mTagListBox.getItemAtIndex(index); var tagElToEdit = this.mTagListBox.getItemAtIndex(index);
var args = {result: "", keyToEdit: tagElToEdit.getAttribute("value"), okCallback: editTagCallback}; var args = {result: "", keyToEdit: tagElToEdit.getAttribute("value"), okCallback: editTagCallback};
var dialog = window.openDialog( var dialog = window.openDialog(
"chrome://messenger/content/newTagDialog.xul", "chrome://messenger/content/newTagDialog.xul",
"", "",
"chrome,titlebar,modal", "chrome,titlebar,modal",
args); args);
} }
}, },
@ -120,11 +120,11 @@ var gDisplayPane = {
{ {
var args = {result: "", okCallback: addTagCallback}; var args = {result: "", okCallback: addTagCallback};
var dialog = window.openDialog( var dialog = window.openDialog(
"chrome://messenger/content/newTagDialog.xul", "chrome://messenger/content/newTagDialog.xul",
"", "",
"chrome,titlebar,modal", "chrome,titlebar,modal",
args); args);
}, }
}; };
function addTagCallback(aName, aColor) function addTagCallback(aName, aColor)

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

@ -211,5 +211,5 @@ var gGeneralPane = {
soundTypeEl.disabled = soundsDisabled; soundTypeEl.disabled = soundsDisabled;
document.getElementById('browseForSound').disabled = soundsDisabled || soundTypeEl.value != 1; document.getElementById('browseForSound').disabled = soundsDisabled || soundTypeEl.value != 1;
document.getElementById('playSound').disabled = soundsDisabled || soundTypeEl.value != 1; document.getElementById('playSound').disabled = soundsDisabled || soundTypeEl.value != 1;
}, }
}; };

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

@ -51,8 +51,7 @@
dlgbuttons="accept,cancel" dlgbuttons="accept,cancel"
title="&offlineDialog.title;"> title="&offlineDialog.title;">
<prefpane id="OfflineSettingsDialogPane" onpaneload="gOfflineDialog.init();"> <prefpane id="OfflineSettingsDialogPane">
<preferences> <preferences>
<preference id="offline.startup_state" name="offline.startup_state" type="int"/> <preference id="offline.startup_state" name="offline.startup_state" type="int"/>
<preference id="offline.send.unsent_messages" name="offline.send.unsent_messages" type="int"/> <preference id="offline.send.unsent_messages" name="offline.send.unsent_messages" type="int"/>

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

@ -166,5 +166,5 @@ var gPrivacyPane = {
updateDownloadedPhishingListState: function() updateDownloadedPhishingListState: function()
{ {
document.getElementById('useDownloadedList').disabled = !document.getElementById('enablePhishingDetector').checked; document.getElementById('useDownloadedList').disabled = !document.getElementById('enablePhishingDetector').checked;
}, }
}; };

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

@ -149,5 +149,5 @@ var gSendOptionsDialog = {
var item = document.createElement('listitem'); var item = document.createElement('listitem');
item.setAttribute('label', aDomainTitle); item.setAttribute('label', aDomainTitle);
aListBox.appendChild(item); aListBox.appendChild(item);
}, }
}; };

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

@ -475,7 +475,7 @@ function DeleteAllFromTree
} }
function DeleteSelectedItemFromTree function DeleteSelectedItemFromTree
(tree, view, table, deletedTable, removeButton, removeAllButton) { (tree, view, table, deletedTable, removeButtonId, removeAllButtonId) {
var box = tree.treeBoxObject; var box = tree.treeBoxObject;
@ -521,8 +521,8 @@ function DeleteSelectedItemFromTree
box.endUpdateBatch(); box.endUpdateBatch();
// update selection and/or buttons // update selection and/or buttons
var removeButton = document.getElementById(removeButton); var removeButton = document.getElementById(removeButtonId);
var removeAllButton = document.getElementById(removeAllButton); var removeAllButton = document.getElementById(removeAllButtonId);
if (table.length) { if (table.length) {
removeButton.removeAttribute("disabled"); removeButton.removeAttribute("disabled");

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

@ -143,10 +143,7 @@ var gFeedSubscriptionsWindow = {
getCellText: function (aIndex, aColumn) getCellText: function (aIndex, aColumn)
{ {
var item = this.getItemAtIndex(aIndex); var item = this.getItemAtIndex(aIndex);
if (!item) return (item && aColumn.id == "folderNameCol") ? item.name : "";
return "";
else if (aColumn.id == "folderNameCol")
return item.name;
}, },
_selection: null, _selection: null,
@ -473,7 +470,7 @@ var gFeedSubscriptionsWindow = {
document.getElementById('locationValue').value = ""; document.getElementById('locationValue').value = "";
} }
for (i = 0; i < ids.length; ++i) for (var i = 0; i < ids.length; ++i)
document.getElementById(ids[i]).disabled = !aItem || aItem.container; document.getElementById(ids[i]).disabled = !aItem || aItem.container;
}, },
@ -814,7 +811,7 @@ var gFeedSubscriptionsWindow = {
onProgress: function(feed, aProgress, aProgressMax) onProgress: function(feed, aProgress, aProgressMax)
{ {
updateStatusItem('progressMeter', (aProgress * 100) / aProgressMax); updateStatusItem('progressMeter', (aProgress * 100) / aProgressMax);
}, }
}, },
exportOPML: function() exportOPML: function()
@ -948,14 +945,18 @@ var gFeedSubscriptionsWindow = {
var parser = new DOMParser(); var parser = new DOMParser();
opmlDom = parser.parseFromStream(stream, null, stream.available(), 'application/xml'); opmlDom = parser.parseFromStream(stream, null, stream.available(), 'application/xml');
}catch(e){ }catch(e){
return promptService.alert(window, null, this.mBundle.getString("subscribe-errorOpeningFile")); promptService.alert(window, null, this.mBundle.getString("subscribe-errorOpeningFile"));
return;
}finally{ }finally{
stream.close(); stream.close();
} }
// return if the user didn't give us an OPML file // return if the user didn't give us an OPML file
if(!opmlDom || !(opmlDom.documentElement.tagName == "opml")) if(!opmlDom || !(opmlDom.documentElement.tagName == "opml"))
return promptService.alert(window, null, this.mBundle.getFormattedString("subscribe-errorInvalidOPMLFile", [rv.file.leafName])); {
promptService.alert(window, null, this.mBundle.getFormattedString("subscribe-errorInvalidOPMLFile", [rv.file.leafName]));
return;
}
var outlines = opmlDom.getElementsByTagName("body")[0].getElementsByTagName("outline"); var outlines = opmlDom.getElementsByTagName("body")[0].getElementsByTagName("outline");
var feedsAdded = false; var feedsAdded = false;
@ -1004,7 +1005,10 @@ var gFeedSubscriptionsWindow = {
} }
if (!outlines.length || !feedsAdded) if (!outlines.length || !feedsAdded)
return promptService.alert(window, null, this.mBundle.getFormattedString("subscribe-errorInvalidOPMLFile", [rv.file.leafName])); {
promptService.alert(window, null, this.mBundle.getFormattedString("subscribe-errorInvalidOPMLFile", [rv.file.leafName]));
return;
}
//add the new feeds to our view //add the new feeds to our view
refreshSubscriptionView(); refreshSubscriptionView();
@ -1022,9 +1026,7 @@ var gFeedSubscriptionsWindow = {
outlineTitle = anOutline.getAttribute("xmlUrl"); outlineTitle = anOutline.getAttribute("xmlUrl");
return outlineTitle; return outlineTitle;
}
},
}; };
// opens the feed properties dialog // opens the feed properties dialog

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

@ -126,7 +126,7 @@ function buildServerFilterMenuList()
var ispDirectories = fileLocator.get(KEY_ISP_DIRECTORY_LIST, Components.interfaces.nsISimpleEnumerator); var ispDirectories = fileLocator.get(KEY_ISP_DIRECTORY_LIST, Components.interfaces.nsISimpleEnumerator);
while (ispDirectories.hasMoreElements()) while (ispDirectories.hasMoreElements())
{ {
ispDirectory = ispDirectories.getNext().QueryInterface(Components.interfaces.nsIFile); var ispDirectory = ispDirectories.getNext().QueryInterface(Components.interfaces.nsIFile);
if (ispDirectory) if (ispDirectory)
buildServerFilterListFromDir(ispDirectory); buildServerFilterListFromDir(ispDirectory);
} }

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

@ -76,9 +76,9 @@ function BrowseForLocalFolders()
return; return;
} }
} }
// convert the nsILocalFile into a nsIFileSpec
currentFolderTextBox.value = fp.file.path;
} }
// convert the nsILocalFile into a nsIFileSpec
currentFolderTextBox.value = fp.file.path;
} }
function hostnameIsIllegal(hostname) function hostnameIsIllegal(hostname)

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

@ -108,7 +108,7 @@ function onOKEditTag()
} }
tagService.setColorForKey(dialog.editTagKey, document.getElementById("tagColorPicker").color); tagService.setColorForKey(dialog.editTagKey, document.getElementById("tagColorPicker").color);
dialog.okCallback(); return dialog.okCallback();
} }
/** /**
@ -127,7 +127,7 @@ function onOKNewTag()
return false; return false;
} }
else else
dialog.okCallback(name, document.getElementById("tagColorPicker").color); return dialog.okCallback(name, document.getElementById("tagColorPicker").color);
} }
/** /**

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

@ -149,7 +149,7 @@ pref("mail.pop3.deleteFromServerOnMove", false);
pref("mail.remember_password", false); pref("mail.remember_password", false);
pref("mail.pop_password", ""); pref("mail.pop_password", "");
pref("mail.fixed_width_messages", true); pref("mail.fixed_width_messages", true);
pref("mail.citation_color", ""); // quoted color pref("mail.citation_color", "#000000"); // quoted color
pref("mail.quoted_style", 0); // 0=plain, 1=bold, 2=italic, 3=bolditalic pref("mail.quoted_style", 0); // 0=plain, 1=bold, 2=italic, 3=bolditalic
pref("mail.quoted_size", 0); // 0=normal, 1=big, 2=small pref("mail.quoted_size", 0); // 0=normal, 1=big, 2=small
pref("mail.quoted_graphical", true); // use HTML-style quoting for displaying plain text pref("mail.quoted_graphical", true); // use HTML-style quoting for displaying plain text