Bug 824150 - Code cleanup in /mail/ and /mailnews/: Use new String methods like startsWith, endsWith, contains, remaining Services.jsm switches and querySelector use instead of NodeList calls: newsblog. r=mbanner

This commit is contained in:
Sebastian Hengst 2013-02-09 20:05:22 +01:00
Родитель 754821cbcd
Коммит 228952edf9
4 изменённых файлов: 8 добавлений и 8 удалений

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

@ -307,7 +307,7 @@ Feed.prototype =
if (quickMode)
{
quickMode = quickMode.QueryInterface(Ci.nsIRDFLiteral);
quickMode = quickMode.Value == "true" ? true : false;
quickMode = quickMode.Value == "true";
}
return quickMode;

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

@ -300,7 +300,7 @@ FeedItem.prototype =
this.mUnicodeConverter.charset = this.characterSet;
// If the sender isn't a valid email address, quote it so it looks nicer.
if (this.author && this.author.indexOf("@") == -1)
if (this.author && !this.author.contains("@"))
this.author = "<" + this.author + ">";
// Convert the title to UTF-16 before performing our HTML entity

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

@ -79,7 +79,7 @@ FeedParser.prototype =
// Get the first channel (assuming there is only one per RSS File).
let parsedItems = new Array();
let channel = aDOM.getElementsByTagName("channel")[0];
let channel = aDOM.querySelector("channel");
if (!channel)
return aFeed.onParseError(aFeed);
@ -310,7 +310,7 @@ FeedParser.prototype =
let parsedItems = new Array();
// Get the first channel (assuming there is only one per Atom File).
let channel = aDOM.getElementsByTagName("feed")[0];
let channel = aDOM.querySelector("feed");
if (!channel)
{
aFeed.onParseError(aFeed);

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

@ -1282,7 +1282,7 @@ var FeedSubscriptions = {
*/
moveCopyFeed: function(aOldFeedIndex, aNewParentIndex, aMoveCopy)
{
let moveFeed = aMoveCopy == "move" ? true : false;
let moveFeed = aMoveCopy == "move";
let currentItem = this.mView.getItemAtIndex(aOldFeedIndex);
if (!currentItem ||
this.mView.getParentIndex(aOldFeedIndex) == aNewParentIndex)
@ -2147,7 +2147,7 @@ var FeedSubscriptions = {
stream.close();
}
let body = opmlDom ? opmlDom.getElementsByTagName("body")[0] : null;
let body = opmlDom ? opmlDom.querySelector("body") : null;
// Return if the OPML file is invalid or empty.
if (!body || !body.childElementCount ||
@ -2243,8 +2243,8 @@ var FeedSubscriptions = {
// Create the feed.
let quickMode = outline.hasAttribute("fz:quickMode") ?
outline.getAttribute("fz:quickMode") == "true" ?
true : false : rssServer.getBoolValue("quickMode");
outline.getAttribute("fz:quickMode") == "true" :
rssServer.getBoolValue("quickMode");
if (firstFeedInFolderQuickMode === null)
// The summary/web page pref applies to all feeds in a folder,