зеркало из https://github.com/mozilla/lightbeam.git
Merge fixup-data
This commit is contained in:
Коммит
a1d0a1e700
|
@ -148,15 +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");
|
||||
if (global.setPrefs) {
|
||||
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;
|
||||
|
|
|
@ -27,8 +27,8 @@ self.port.on('init', function() {
|
|||
global.aggregate.emit('load', global.allConnections);
|
||||
});
|
||||
|
||||
self.port.on("setPrefs", function(prefs) {
|
||||
self.port.on("updateUIFromPrefs", function(prefs) {
|
||||
console.log("Got set prefs", prefs);
|
||||
global.aggregate.emit("setPrefs", prefs);
|
||||
global.aggregate.emit("updateUIFromPrefs", prefs);
|
||||
});
|
||||
})(this);
|
||||
|
|
|
@ -142,10 +142,8 @@ function resetAdditionalUI(){
|
|||
|
||||
|
||||
global.startSharing = function startSharing(askForConfirmation, callback) {
|
||||
let result = true;
|
||||
if (askForConfirmation) {
|
||||
askForDataSharingConfirmationDialog(function(confirmed) {
|
||||
result = confirmed;
|
||||
callback(confirmed);
|
||||
});
|
||||
} else {
|
||||
|
|
14
data/ui.js
14
data/ui.js
|
@ -434,16 +434,8 @@ global.singularOrPluralNoun = function singularOrPluralNoun(num,str){
|
|||
return ( num > 1) ? str+"s" : str;
|
||||
}
|
||||
|
||||
/**************************************************
|
||||
* Check if a site has certain preference set to it
|
||||
*/
|
||||
/**************************************************
|
||||
* When initializing Graph View / Clock View
|
||||
* if the "Watched Sites" or "Blocked Sites" toggles are on, apply colour to the corresponding nodes
|
||||
*/
|
||||
function setPrefs(event) {
|
||||
console.log("Setting content script prefs", JSON.stringify(event));
|
||||
if ("contributeData" in event) {
|
||||
function updateUIFromPrefs(event) {
|
||||
if ("contributeData" in event && event["contributeData"]) {
|
||||
var toggleBtn = document.querySelector(".share-btn");
|
||||
if (event["contributeData"]) {
|
||||
toggleBtn.querySelector("input").checked = true;
|
||||
|
@ -472,5 +464,5 @@ function setPrefs(event) {
|
|||
}
|
||||
|
||||
// Exports
|
||||
global.setPrefs = setPrefs;
|
||||
global.updateUIFromPrefs = updateUIFromPrefs;
|
||||
})(this);
|
||||
|
|
|
@ -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){
|
||||
|
|
|
@ -150,9 +150,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
|
||||
|
|
Загрузка…
Ссылка в новой задаче