| Index: chrome/content/ui/composer.js |
| =================================================================== |
| --- a/chrome/content/ui/composer.js |
| +++ b/chrome/content/ui/composer.js |
| @@ -114,42 +114,42 @@ function init() |
| E("patternGroup").value = ""; |
| } |
| if (Prefs.composer_default == 0) |
| E("customPattern").focus(); |
| else |
| E("patternGroup").focus(); |
| let types = []; |
| - for (let type of Policy.localizedDescr.keys()) |
| - types.push(type); |
| + for (let type of Policy.contentTypes) |
| + types.push([type, Utils.getString("type_label_" + type.toLowerCase())]); |
| types.sort(); |
|
tschuster
2015/11/05 15:06:15
Seems like sorting [type, label] could be differen
Wladimir Palant
2015/11/05 15:47:11
It actually is the same, due to the way arrays are
|
| let docDomain = item.docDomain; |
| let thirdParty = item.thirdParty; |
| if (docDomain) |
| docDomain = docDomain.replace(/^www\./i, "").replace(/\.+$/, ""); |
| if (docDomain) |
| E("domainRestriction").value = docDomain; |
| E("thirdParty").hidden = !thirdParty; |
| E("firstParty").hidden = thirdParty; |
| let typeGroup = E("typeGroup"); |
| let defaultTypes = RegExpFilter.prototype.contentType & ~RegExpFilter.typeMap.DOCUMENT; |
| let isDefaultType = (RegExpFilter.typeMap[item.typeDescr] & defaultTypes) != 0; |
| - for (let type of types) |
| + for (let [type, label] of types) |
| { |
| if (type == "ELEMHIDE") |
| continue; |
| let typeNode = document.createElement("checkbox"); |
| typeNode.setAttribute("value", type.toLowerCase().replace(/\_/g, "-")); |
| - typeNode.setAttribute("label", Policy.localizedDescr.get(type).toLowerCase()); |
| + typeNode.setAttribute("label", label); |
| let typeMask = RegExpFilter.typeMap[type]; |
| typeNode._defaultType = (typeMask & defaultTypes) != 0; |
| if ((isDefaultType && typeNode._defaultType) || (!isDefaultType && item.type == type)) |
| typeNode.setAttribute("checked", "true"); |
| if (item.type == type) |
| typeNode.setAttribute("disabled", "true"); |