bug 296662: Javascript strict warnings in preferences dialog

patch by Henrik Skupin <hskupin@gmail.com>, r=bsmedberg, a=asa


git-svn-id: svn://10.0.0.236/trunk@174557 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
db48x%yahoo.com 2005-06-14 10:19:34 +00:00
parent 6a9696a71d
commit 3925837bec
14 changed files with 32 additions and 30 deletions

View File

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

View File

@ -140,10 +140,11 @@ var gContentPane = {
},
_exceptionsParams: {
install: { blockVisible: false, sessionVisible: false, allowVisible: true, prefilledHost: "", permissionType: "install", },
install: { blockVisible: false, sessionVisible: false, allowVisible: true, prefilledHost: "", permissionType: "install" },
popup: { blockVisible: false, sessionVisible: false, allowVisible: true, prefilledHost: "", permissionType: "popup" },
image: { blockVisible: true, sessionVisible: false, allowVisible: true, prefilledHost: "", permissionType: "image" },
image: { blockVisible: true, sessionVisible: false, allowVisible: true, prefilledHost: "", permissionType: "image" }
},
showExceptions: function (aPermissionType)
{
var bundlePreferences = document.getElementById("bundlePreferences");

View File

@ -480,6 +480,8 @@ var gCookiesWindow = {
var ids = ["nameLabel", "name", "valueLabel", "value", "isDomain", "host",
"pathLabel", "path", "isSecureLabel", "isSecure", "expiresLabel",
"expires"];
var properties;
if (aItem && !aItem.container && seln.count > 0) {
properties = { name: aItem.name, value: aItem.value, host: aItem.host,
path: aItem.path, expires: this.formatExpiresString(aItem.expires),
@ -515,7 +517,7 @@ var gCookiesWindow = {
var rangeCount = seln.getRangeCount();
var selectedCookieCount = 0;
for (i = 0; i < rangeCount; ++i) {
for (var i = 0; i < rangeCount; ++i) {
var min = {}; var max = {};
seln.getRangeAt(i, min, max);
for (var j = min.value; j <= max.value; ++j) {

View File

@ -177,6 +177,5 @@ var gDownloadsPane = {
document.documentElement.openWindow("Preferences:DownloadActions",
"chrome://browser/content/preferences/downloadactions.xul",
"", null);
},
}
};

View File

@ -93,13 +93,13 @@ var gLanguagesDialog = {
var ab = useABCDFormat ? abCDPairs[0] : abCD;
var cd = useABCDFormat ? abCDPairs[1] : "";
if (ab) {
var language = region = "";
var language = "";
try {
language = bundleLanguages.getString(ab);
}
catch (e) { continue; };
var region = "";
if (useABCDFormat) {
try {
region = bundleRegions.getString(cd);
@ -331,6 +331,6 @@ var gLanguagesDialog = {
downButton.disabled = true;
removeButton.disabled = false;
}
},
}
};

View File

@ -95,6 +95,6 @@ var gTreeUtils = {
aTree.treeBoxObject.ensureRowIsVisible(0);
return ascending;
},
}
};

View File

@ -235,6 +235,5 @@ var gPrivacyPane = {
this.updateMasterPasswordButton();
document.getElementById("setMasterPassword").focus();
}
},
}
};

View File

@ -49,6 +49,6 @@ var gSanitizeDialog = {
{
this.sanitizePasswords();
return undefined;
},
}
};

View File

@ -501,17 +501,17 @@ function DeleteSelectedItemFromTree
box.endUpdateBatch();
// update selection and/or buttons
var removeButton = document.getElementById(removeButton);
var removeAllButton = document.getElementById(removeAllButton);
var removeBtn = document.getElementById(removeButton);
var removeAllBtn = document.getElementById(removeAllButton);
if (table.length) {
removeButton.removeAttribute("disabled");
removeAllButton.removeAttribute("disabled");
removeBtn.removeAttribute("disabled");
removeAllBtn.removeAttribute("disabled");
selection.select(oldSelectStart < table.length ? oldSelectStart : table.length - 1);
} else {
removeButton.setAttribute("disabled", "true");
removeAllButton.setAttribute("disabled", "true");
removeBtn.setAttribute("disabled", "true");
removeAllBtn.setAttribute("disabled", "true");
}
}

View File

@ -363,13 +363,15 @@
dump(e);
}
}
var value = ("value" in aElement) ? aElement.value : aElement.getAttribute("value");
switch (this.type) {
case "int":
return aElement.value != "" ? parseInt(aElement.value) : 0;
return value != "" ? parseInt(value) : 0;
case "bool":
return typeof(aElement.value) == "boolean" ? aElement.value : aElement.value == "true";
return typeof(value) == "boolean" ? value : value == "true";
}
return aElement.value;
return value;
]]>
</body>
</method>

View File

@ -273,6 +273,6 @@ DownloadProgressListener.prototype =
result = this._replaceInsert(result, 3, secs);
return result;
},
}
};

View File

@ -631,7 +631,7 @@ var gContextMenus = [
function buildContextMenu(aEvent)
{
if (aEvent.target.id != "downloadContextMenu")
return;
return false;
var popup = document.getElementById("downloadContextMenu");
while (popup.hasChildNodes())
@ -782,11 +782,11 @@ function initAutoDownloadDisplay()
}
var displayName = null;
var folder;
switch (pref.getIntPref("browser.download.folderList")) {
case 0:
folder = getDownloadsFolder("Desktop");
var strings = document.getElementById("downloadStrings");
displayName = strings.getString("displayNameDesktop");
displayName = document.getElementById("downloadStrings").getString("displayNameDesktop");
break;
case 1:
folder = getDownloadsFolder("Downloads");
@ -881,7 +881,7 @@ function getLocalFileFromNativePathOrUrl(aPathOrUrl)
} else {
// if it's a pathname, create the nsILocalFile directly
f = Components.classes["@mozilla.org/file/local;1"].
var f = Components.classes["@mozilla.org/file/local;1"].
createInstance(Components.interfaces.nsILocalFile);
f.initWithPath(aPathOrUrl);

View File

@ -115,5 +115,5 @@ var FontBuilder = {
}
}
aMenuList.appendChild(popup);
},
}
};

View File

@ -90,6 +90,5 @@ var gOCSPDialog = {
break;
}
}
},
}
};