Merge pull request #51 from mozilla/addressing-review
Addressing Kris's AMO review comments. Closes bug 1117788
This commit is contained in:
Коммит
061d751430
|
@ -278,21 +278,21 @@ SpiderGraph.prototype = {
|
|||
|
||||
let minDate = d3.time.format('%m/%d/%Y')(new Date(daysPostEpochToDate(node.minDay)));
|
||||
return '<div class="centerNode">' +
|
||||
'<p id="totalInterests">' + node.numInterests + '</p>' +
|
||||
'<p id="totalInterests">' + html_sanitize(node.numInterests) + '</p>' +
|
||||
'<p id="activeInterestsLabel">Active Interests</p>' +
|
||||
'<p id="startDate">since ' + minDate + '</p>' +
|
||||
'<p id="startDate">since ' + html_sanitize(minDate) + '</p>' +
|
||||
'</div>';
|
||||
}
|
||||
|
||||
if (type != "hover") {
|
||||
return '<p class="nodeText">' + node.name + '</p>';
|
||||
return '<p class="nodeText">' + html_sanitize(node.name) + '</p>';
|
||||
}
|
||||
|
||||
// Type is hover
|
||||
if (!node.name) {
|
||||
return "";
|
||||
}
|
||||
return '<p class="nodeText">(' + node.recommendationCount + ')<br>' + node.name + '</p>';
|
||||
return '<p class="nodeText">(' + html_sanitize(node.recommendationCount) + ')<br>' + html_sanitize(node.name) + '</p>';
|
||||
},
|
||||
|
||||
_getFontSizeByRadius: function(radius) {
|
||||
|
|
|
@ -159,7 +159,8 @@ let AboutYou = {
|
|||
});
|
||||
|
||||
worker.port.on("chart_data_request", () => {
|
||||
if (storage.chartData) {
|
||||
// Make sure we have all the required data before attempting to populate charts.
|
||||
if (storage.chartData && storage.chartData.interestDashboardData && storage.chartData.spiderData) {
|
||||
storage.chartData.interestDashboardData.historyVisits = {};
|
||||
StudyApp.controller._streamObjects.interestDashboardDataProcessorBolt.getFaviconsForTopSites().then(() => {
|
||||
worker.port.emit("message", {content: {topic: "chart_init", data: storage.chartData}});
|
||||
|
@ -286,6 +287,13 @@ let StudyApp = {
|
|||
StudyApp.submitPromise = StudyApp.controller.submitHistory();
|
||||
}
|
||||
});
|
||||
tabs.on('open', function (tab) {
|
||||
tab.on('ready', function (tab) {
|
||||
if (tab.url == "about:you") {
|
||||
StudyApp.submitPromise = StudyApp.controller.submitHistory();
|
||||
}
|
||||
});
|
||||
});
|
||||
StudyApp.saveAddonInfo();
|
||||
|
||||
if (loadReason == "startup") {
|
||||
|
|
|
@ -171,8 +171,6 @@ let InterestDashboardDataProcessorBolt = {
|
|||
try {
|
||||
this.debugReport.push("~*~* interestDashboardDataProcessorBolt ingest() start *~*~");
|
||||
this.debugReport = this.debugReport.concat(message.errorData);
|
||||
DataProcessorHelper.initChartInStorage("interestDashboardData", this.storage);
|
||||
this.storage.chartData.interestDashboardData.sortedDomains = {"all": [], "byInterest": {}};
|
||||
|
||||
let ruleset = getRulesetPref();
|
||||
let interestDashboardTypeNamespace = message.chartData.rules[ruleset];
|
||||
|
@ -180,6 +178,9 @@ let InterestDashboardDataProcessorBolt = {
|
|||
return;
|
||||
}
|
||||
|
||||
DataProcessorHelper.initChartInStorage("interestDashboardData", this.storage);
|
||||
this.storage.chartData.interestDashboardData.sortedDomains = {"all": [], "byInterest": {}};
|
||||
|
||||
this.debugReport.push("Processing data for pie chart");
|
||||
let chartData = [];
|
||||
for (let interestData of interestDashboardTypeNamespace.sortedInterests) {
|
||||
|
|
|
@ -113,12 +113,12 @@ let SpiderDataProcessorBolt = {
|
|||
},
|
||||
|
||||
ingest: function _HSB_ingest(message) {
|
||||
DataProcessorHelper.initChartInStorage("spiderData", this.storage);
|
||||
let ruleset = getRulesetPref();
|
||||
let data = message.chartData.rules[ruleset];
|
||||
if (!data) {
|
||||
return;
|
||||
}
|
||||
DataProcessorHelper.initChartInStorage("spiderData", this.storage);
|
||||
let categories = data.categories;
|
||||
|
||||
this._mainNodes = [{"id": 0,
|
||||
|
|
Загрузка…
Ссылка в новой задаче