Index: options.js |
=================================================================== |
--- a/options.js |
+++ b/options.js |
@@ -145,17 +145,17 @@ function loadRecommendations() |
var selectedPrefix = null; |
var matchCount = 0; |
var list = document.getElementById("subscriptionSelector"); |
var elements = request.responseXML.documentElement.getElementsByTagName("subscription"); |
for (var i = 0; i < elements.length; i++) |
{ |
var element = elements[i]; |
- var option = document.createElement("option"); |
+ var option = new Option(); |
option.text = element.getAttribute("title") + " (" + element.getAttribute("specialization") + ")"; |
option._data = { |
title: element.getAttribute("title"), |
url: element.getAttribute("url"), |
homepage: element.getAttribute("homepage") |
}; |
var prefix = require("utils").Utils.checkLocalePrefixMatch(element.getAttribute("prefixes")); |
@@ -183,17 +183,17 @@ function loadRecommendations() |
selectedIndex = i; |
selectedPrefix = prefix; |
} |
} |
} |
list.appendChild(option); |
} |
- var option = document.createElement("option"); |
+ var option = new Option(); |
option.text = i18n.getMessage("filters_addSubscriptionOther_label") + "\u2026"; |
option._data = null; |
list.appendChild(option); |
list.selectedIndex = selectedIndex; |
if (delayedSubscriptionSelection) |
startSubscriptionSelection.apply(null, delayedSubscriptionSelection); |
@@ -414,38 +414,35 @@ function populateList(id, entries) |
{ |
var list = document.getElementById(id); |
while (list.lastChild) |
list.removeChild(list.lastChild); |
entries.sort(); |
for (var i = 0; i < entries.length; i++) |
{ |
- var option = document.createElement("option"); |
+ var option = new Option(); |
option.text = entries[i]; |
option.value = entries[i]; |
list.appendChild(option); |
} |
} |
// Add a filter string to the list box. |
function appendToListBox(boxId, text) |
{ |
- var elt = document.createElement("option"); |
+ var elt = new Option(); |
elt.text = text; |
elt.value = text; |
document.getElementById(boxId).appendChild(elt); |
} |
// Remove a filter string from a list box. |
function removeFromListBox(boxId, text) |
{ |
- var elt = document.createElement("option"); |
- elt.text = text; |
- elt.value = text; |
var list = document.getElementById(boxId); |
for (var i = 0; i < list.length; i++) |
if (list.options[i].value == text) |
list.remove(i--); |
} |
function addWhitelistDomain(event) |
{ |