зеркало из https://github.com/mozilla/lightbeam.git
Fix up some stuff
This commit is contained in:
Родитель
d96f77ccaa
Коммит
36b2f25fe1
|
@ -177,6 +177,7 @@ function assignTabIndices(modal) {
|
|||
}
|
||||
|
||||
function askForDataSharingConfirmationDialog(callback) {
|
||||
console.log("callback in ask for data start sharing", callback);
|
||||
dialog({
|
||||
"name": dialogNames.startUploadData,
|
||||
"title": "Upload Data",
|
||||
|
|
|
@ -141,21 +141,6 @@ function resetAdditionalUI() {
|
|||
}
|
||||
|
||||
|
||||
/****************************************
|
||||
* Upload data
|
||||
*/
|
||||
|
||||
|
||||
global.startSharing = function startSharing(askForConfirmation, callback) {
|
||||
if (askForConfirmation) {
|
||||
askForDataSharingConfirmationDialog(function (confirmed) {
|
||||
callback(confirmed);
|
||||
});
|
||||
} else {
|
||||
callback(true);
|
||||
}
|
||||
};
|
||||
|
||||
/****************************************
|
||||
* Format date string
|
||||
*/
|
||||
|
|
13
data/ui.js
13
data/ui.js
|
@ -87,9 +87,10 @@ document.querySelector(".toggle-btn.share-btn").addEventListener("click",
|
|||
}
|
||||
});
|
||||
|
||||
global.confirmStartSharing = function confirmStartSharing(askForConfirmation, elmClicked) {
|
||||
global.startSharing(askForConfirmation, function (confirmed) {
|
||||
function confirmStartSharing(askForConfirmation, elmClicked) {
|
||||
let callback = function (confirmed) {
|
||||
if (confirmed) {
|
||||
console.log("Sharing confirmed!");
|
||||
toggleBtnOnEffect(document.querySelector(".share-btn"));
|
||||
global.self.port.emit("prefChanged", {
|
||||
"contributeData": true
|
||||
|
@ -97,7 +98,13 @@ global.confirmStartSharing = function confirmStartSharing(askForConfirmation, el
|
|||
} else {
|
||||
elmClicked.checked = false;
|
||||
}
|
||||
});
|
||||
};
|
||||
if (askForConfirmation) {
|
||||
askForDataSharingConfirmationDialog(callback);
|
||||
} else {
|
||||
callback(true);
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
global.confirmStopSharing = function confirmStopSharing(elmClicked) {
|
||||
|
|
|
@ -47,6 +47,7 @@ function getUserAgentData() {
|
|||
}
|
||||
|
||||
function getAddons() {
|
||||
const { Cu } = require('chrome');
|
||||
let { AddonManager } = Cu.import("resource://gre/modules/AddonManager.jsm");
|
||||
let addons = [];
|
||||
AddonManager.getAllAddons(function(addonList) {
|
||||
|
|
|
@ -157,6 +157,7 @@ function attachToLightbeamPage(worker) {
|
|||
}
|
||||
|
||||
function onPrefChanged(event) {
|
||||
console.debug("Received updated prefs", JSON.stringify(event));
|
||||
if ("contributeData" in event) {
|
||||
prefs.contributeData = event.contributeData;
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче