зеркало из https://github.com/mozilla/lightbeam.git
Address Garrett's comments
This commit is contained in:
Родитель
5db88ec550
Коммит
76b8179c0c
|
@ -148,13 +148,13 @@ function onLoad(connections){
|
|||
console.log('aggregate::onLoad end, took %s ms', Date.now() - startTime);
|
||||
}
|
||||
|
||||
function setPrefs(prefs) {
|
||||
function updateUIFromPrefs(prefs) {
|
||||
console.log("in aggregate prefs");
|
||||
global.setPrefs(prefs);
|
||||
global.updateUIFromPrefs(prefs);
|
||||
}
|
||||
|
||||
aggregate.on('load', onLoad);
|
||||
aggregate.on("setPrefs", setPrefs);
|
||||
aggregate.on("updateUIFromPrefs", updateUIFromPrefs);
|
||||
|
||||
// Constants for indexes of properties in array format
|
||||
//const SOURCE = 0;
|
||||
|
|
|
@ -55,12 +55,12 @@ self.port.on("private-browsing", function() {
|
|||
unsafeWindow.informUserOfUnsafeWindowsDialog();
|
||||
});
|
||||
|
||||
self.port.on("setPrefs", function(prefs) {
|
||||
self.port.on("updateUIFromPrefs", function(prefs) {
|
||||
console.log("Got set prefs", prefs);
|
||||
if (unsafeWindow && unsafeWindow.aggregate) {
|
||||
unsafeWindow.aggregate.emit("setPrefs", prefs);
|
||||
unsafeWindow.aggregate.emit("updateUIFromPrefs", prefs);
|
||||
} else {
|
||||
console.error("cannot call aggregate.setPrefs");
|
||||
console.error("cannot call aggregate.updateUIFromPrefs");
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
@ -140,10 +140,8 @@ function resetAdditionalUI(){
|
|||
|
||||
|
||||
function startSharing(askForConfirmation, callback) {
|
||||
let result = true;
|
||||
if (askForConfirmation) {
|
||||
askForDataSharingConfirmationDialog(function(confirmed) {
|
||||
result = confirmed;
|
||||
callback(confirmed);
|
||||
});
|
||||
} else {
|
||||
|
|
|
@ -475,7 +475,7 @@ function colourHighlightNodes(highlight){
|
|||
}
|
||||
}
|
||||
|
||||
function setPrefs(event) {
|
||||
function updateUIFromPrefs(event) {
|
||||
if ("contributeData" in event && event["contributeData"]) {
|
||||
var toggleBtn = document.querySelector(".share-btn");
|
||||
toggleBtn.querySelector("input").checked = true;
|
||||
|
|
|
@ -34,7 +34,7 @@ function addConnection(connection){
|
|||
exports.getAllConnections = function getAllConnections() {
|
||||
console.log("got", connBatch.length, "buffered connections",
|
||||
ss.storage.connections.length, "persisted connections");
|
||||
return connBatch.concat(ss.storage.connections);
|
||||
return ss.storage.connections.concat(connBatch);
|
||||
}
|
||||
|
||||
function excludePrivateConnections(connections){
|
||||
|
|
|
@ -148,9 +148,10 @@ function attachToLightbeamPage(worker) {
|
|||
|
||||
// Send over the the blocklist initially so we can use it.
|
||||
worker.port.emit('update-blocklist-all',
|
||||
Object.keys(blockmap).map(function(site) {
|
||||
return { domain: site, flag: blockmap[site] };
|
||||
}));
|
||||
Object.keys(blockmap).map(
|
||||
function(site) {
|
||||
return { domain: site, flag: blockmap[site] };
|
||||
}));
|
||||
|
||||
function onWorkerReset() {
|
||||
// Reset buffered state
|
||||
|
|
Загрузка…
Ссылка в новой задаче