зеркало из https://github.com/mozilla/gecko-dev.git
Backing out bug 720997 and bug 798160 due to bad l10n.
This commit is contained in:
Родитель
c599a3463f
Коммит
db06eaef4d
|
@ -156,6 +156,16 @@ let dataProviders = {
|
|||
},
|
||||
|
||||
modifiedPreferences: function modifiedPreferences(done) {
|
||||
function getPref(name) {
|
||||
let table = {};
|
||||
table[Ci.nsIPrefBranch.PREF_STRING] = "getCharPref";
|
||||
table[Ci.nsIPrefBranch.PREF_INT] = "getIntPref";
|
||||
table[Ci.nsIPrefBranch.PREF_BOOL] = "getBoolPref";
|
||||
let type = Services.prefs.getPrefType(name);
|
||||
if (!(type in table))
|
||||
throw new Error("Unknown preference type " + type + " for " + name);
|
||||
return Services.prefs[table[type]](name);
|
||||
}
|
||||
done(PREFS_WHITELIST.reduce(function (prefs, branch) {
|
||||
Services.prefs.getChildList(branch).forEach(function (name) {
|
||||
if (Services.prefs.prefHasUserValue(name) &&
|
||||
|
@ -356,47 +366,4 @@ let dataProviders = {
|
|||
}
|
||||
done(data);
|
||||
},
|
||||
|
||||
syncService: function syncService(done) {
|
||||
let data = {};
|
||||
data.prefs = {};
|
||||
let main = {};
|
||||
Cu.import("resource://services-sync/main.js", main);
|
||||
if (main.Weave.Status.checkSetup() != main.Weave.CLIENT_NOT_CONFIGURED) {
|
||||
data.isEnabled = true;
|
||||
let syncWhiteList = [
|
||||
"services.sync.clusterURL",
|
||||
"services.sync.jpake.serverURL",
|
||||
/^services\.sync\.engine\.[^.]+$/,
|
||||
/^services\.sync\.[^.]+\.(lastSync|lastSyncLocal)$/,
|
||||
];
|
||||
let allprefs = Services.prefs.getChildList("services.sync");
|
||||
for (let entry of syncWhiteList) {
|
||||
if (entry instanceof RegExp) {
|
||||
for (let pref of allprefs) {
|
||||
if (entry.test(pref))
|
||||
data.prefs[pref] = getPref(pref);
|
||||
}
|
||||
}
|
||||
else {
|
||||
data.prefs[entry] = getPref(entry);
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
data.isEnabled = false;
|
||||
}
|
||||
done(data);
|
||||
},
|
||||
};
|
||||
|
||||
function getPref(name) {
|
||||
let table = {};
|
||||
table[Ci.nsIPrefBranch.PREF_STRING] = "getCharPref";
|
||||
table[Ci.nsIPrefBranch.PREF_INT] = "getIntPref";
|
||||
table[Ci.nsIPrefBranch.PREF_BOOL] = "getBoolPref";
|
||||
let type = Services.prefs.getPrefType(name);
|
||||
if (!(type in table))
|
||||
throw new Error("Unknown preference type " + type + " for " + name);
|
||||
return Services.prefs[table[type]](name);
|
||||
}
|
||||
|
|
|
@ -178,28 +178,6 @@ let snapshotFormatters = {
|
|||
);
|
||||
$.append($("libversions-tbody"), trs);
|
||||
},
|
||||
|
||||
syncService: function syncService(data) {
|
||||
if (data.isEnabled) {
|
||||
let contents = document.getElementById("contents");
|
||||
let disabledTable = document.getElementById("sync-disabled-table");
|
||||
contents.removeChild(disabledTable);
|
||||
|
||||
let trs = [];
|
||||
for (let [name, val] of sortedArrayFromObject(data.prefs)) {
|
||||
trs.push($.new("tr", [
|
||||
$.new("td", name),
|
||||
$.new("td", val),
|
||||
]));
|
||||
}
|
||||
$.append($("sync-tbody"), trs);
|
||||
}
|
||||
else {
|
||||
let contents = document.getElementById("contents");
|
||||
let enabledTable = document.getElementById("sync-enabled-table");
|
||||
contents.removeChild(enabledTable);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
let $ = document.getElementById.bind(document);
|
||||
|
|
|
@ -8,7 +8,6 @@
|
|||
<!ENTITY % htmlDTD PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd"> %htmlDTD;
|
||||
<!ENTITY % globalDTD SYSTEM "chrome://global/locale/global.dtd"> %globalDTD;
|
||||
<!ENTITY % brandDTD SYSTEM "chrome://branding/locale/brand.dtd"> %brandDTD;
|
||||
<!ENTITY % syncBrandDTD SYSTEM "chrome://browser/locale/syncBrand.dtd"> %syncBrandDTD;
|
||||
<!ENTITY % aboutSupportDTD SYSTEM "chrome://global/locale/aboutSupport.dtd"> %aboutSupportDTD;
|
||||
<!ENTITY % resetProfileDTD SYSTEM "chrome://global/locale/resetProfile.dtd"> %resetProfileDTD;
|
||||
]>
|
||||
|
@ -244,28 +243,6 @@
|
|||
</tbody>
|
||||
</table>
|
||||
|
||||
<!-- - - - - - - - - - - - - - - - - - - - - -->
|
||||
<h2 class="major-section">
|
||||
&syncBrand.fullName.label;
|
||||
</h2>
|
||||
<table id="sync-enabled-table">
|
||||
<thead>
|
||||
<th>
|
||||
&aboutSupport.syncPrefsName;
|
||||
</th>
|
||||
<th>
|
||||
&aboutSupport.syncPrefsValue;
|
||||
</th>
|
||||
</thead>
|
||||
<tbody id="sync-tbody">
|
||||
</tbody>
|
||||
</table>
|
||||
<table id="sync-disabled-table">
|
||||
<td>
|
||||
&aboutSupport.syncNotSupported;
|
||||
</td>
|
||||
</table>
|
||||
|
||||
<!-- - - - - - - - - - - - - - - - - - - - - -->
|
||||
<h2 class="major-section">
|
||||
&aboutSupport.a11yTitle;
|
||||
|
|
|
@ -129,10 +129,6 @@ const SNAPSHOT_SCHEMA = {
|
|||
required: true,
|
||||
type: "object",
|
||||
},
|
||||
syncService: {
|
||||
required: true,
|
||||
type: "object",
|
||||
},
|
||||
graphics: {
|
||||
required: true,
|
||||
type: "object",
|
||||
|
|
|
@ -62,7 +62,3 @@ variant of aboutSupport.showDir.label. -->
|
|||
|
||||
<!ENTITY aboutSupport.copyTextToClipboard.label "Copy text to clipboard">
|
||||
<!ENTITY aboutSupport.copyRawDataToClipboard.label "Copy raw data to clipboard">
|
||||
|
||||
<!ENTITY aboutSupport.syncPrefsName "Name">
|
||||
<!ENTITY aboutSupport.syncPrefsValue "Value">
|
||||
<!ENTITY aboutSupport.syncNotSupported "Service is not enabled">
|
||||
|
|
Загрузка…
Ссылка в новой задаче