mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-26 02:17:34 +09:00
Issue #1258 - Part 1: Import mailnews, ldap, and mork from comm-esr52.9.1
This commit is contained in:
parent
23e0d82436
commit
e400f4130a
1564 changed files with 510348 additions and 0 deletions
69
mailnews/base/content/charsetList.xml
Normal file
69
mailnews/base/content/charsetList.xml
Normal file
|
|
@ -0,0 +1,69 @@
|
|||
<?xml version="1.0"?>
|
||||
<!-- This Source Code Form is subject to the terms of the Mozilla Public
|
||||
- License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
- file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
-->
|
||||
|
||||
<bindings id="charsetListBinding"
|
||||
xmlns="http://www.mozilla.org/xbl"
|
||||
xmlns:xbl="http://www.mozilla.org/xbl"
|
||||
xmlns:html="http://www.w3.org/1999/xhtml"
|
||||
xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
|
||||
|
||||
<binding id="charsetpicker"
|
||||
extends="chrome://global/content/bindings/menulist.xml#menulist">
|
||||
<implementation>
|
||||
<constructor><![CDATA[
|
||||
let charsetValues = "";
|
||||
|
||||
if (this.getAttribute("subset") == "sending")
|
||||
charsetValues = ["UTF-8", "EUC-KR", "gbk", "gb18030", "ISO-2022-JP",
|
||||
"ISO-8859-1", "ISO-8859-7", "windows-1252"];
|
||||
|
||||
else if (!this.getAttribute("subset")
|
||||
|| this.getAttribute("subset") == "viewing")
|
||||
charsetValues = ["UTF-8", "Big5", "EUC-KR", "gbk", "ISO-2022-JP",
|
||||
"ISO-8859-1", "ISO-8859-2", "ISO-8859-7",
|
||||
"windows-874", "windows-1250", "windows-1251",
|
||||
"windows-1252", "windows-1255", "windows-1256",
|
||||
"windows-1257", "windows-1258"];
|
||||
|
||||
Components.utils.import("resource://gre/modules/Services.jsm");
|
||||
|
||||
let charsetBundle = Services.strings.createBundle(
|
||||
"chrome://messenger/locale/charsetTitles.properties");
|
||||
let aMenuList = this;
|
||||
let menuLabels = [];
|
||||
|
||||
charsetValues.forEach(function(item) {
|
||||
let strCharset = charsetBundle.GetStringFromName(
|
||||
item.toLowerCase() + ".title");
|
||||
|
||||
menuLabels.push({label: strCharset, value: item});
|
||||
});
|
||||
|
||||
menuLabels.sort(function(a, b) {
|
||||
if (a.value == "UTF-8" || a.label < b.label)
|
||||
return -1;
|
||||
else if (b.value == "UTF-8" || a.label > b.label)
|
||||
return 1;
|
||||
return 0;
|
||||
});
|
||||
|
||||
menuLabels.forEach(function(item) {
|
||||
aMenuList.appendItem(item.label, item.value);
|
||||
});
|
||||
|
||||
// Selecting appropiate menu item corresponding to preference stored
|
||||
// value.
|
||||
if (this.hasAttribute("preference")) {
|
||||
const Ci = Components.interfaces;
|
||||
|
||||
let preference = Services.prefs.getComplexValue(
|
||||
this.getAttribute("preference"), Ci.nsIPrefLocalizedString);
|
||||
this.value = preference.data;
|
||||
}
|
||||
]]></constructor>
|
||||
</implementation>
|
||||
</binding>
|
||||
</bindings>
|
||||
Loading…
Add table
Add a link
Reference in a new issue