This commit is contained in:
dethe 2013-12-20 16:18:19 -08:00
Родитель ac94ca7a2d
Коммит a18b964949
5 изменённых файлов: 34 добавлений и 9 удалений

Просмотреть файл

@ -479,13 +479,37 @@ function switchFilter(name){
aggregate.switchFilter = switchFilter; aggregate.switchFilter = switchFilter;
aggregate.update = function update(){ // Underscore debounce function
//
// Returns a function, that, as long as it continues to be invoked, will not
// be triggered. The function will be called after it stops being called for
// N milliseconds. If `immediate` is passed, trigger the function on the
// leading edge, instead of the trailing.
var debounce = function debounce(func, wait, immediate) {
var timeout;
return function() {
var context = this, args = arguments;
var later = function() {
timeout = null;
if (!immediate) func.apply(context, args);
};
var callNow = immediate && !timeout;
clearTimeout(timeout);
timeout = setTimeout(later, wait);
if (callNow) func.apply(context, args);
};
};
aggregate.update = debounce(function update(){
// FIXME: Don't do this for clock view, maybe not for list view // FIXME: Don't do this for clock view, maybe not for list view
if (currentVisualization.name !== 'graph'){
console.log('do not update aggregate for %s view', currentVisualization.name);
}
if (aggregate.initialized){ if (aggregate.initialized){
global.filteredAggregate = currentFilter(); global.filteredAggregate = currentFilter();
aggregate.emit('update'); aggregate.emit('update');
} }
updateStatsBar(); updateStatsBar();
} });
})(this); })(this);

Просмотреть файл

@ -154,6 +154,9 @@ function addDialogEventHandlers(modal,options,callback){
function addToDoNotShowAgainList(dialogName){ function addToDoNotShowAgainList(dialogName){
var dnsPref = localStorage.dnsDialogs || "[]"; var dnsPref = localStorage.dnsDialogs || "[]";
if (dnsPref === 'undefined'){
dnsPref = "[]";
}
dnsPref = JSON.parse(dnsPref); dnsPref = JSON.parse(dnsPref);
dnsPref.push(dialogName); dnsPref.push(dialogName);
localStorage.dnsDialogs = JSON.stringify(dnsPref); localStorage.dnsDialogs = JSON.stringify(dnsPref);

Просмотреть файл

@ -11,9 +11,7 @@ try{
}catch(e){ }catch(e){
userSettings = {}; userSettings = {};
} }
// FIXME: Read this from config file var uploadServer = 'https://lightbeamdb.org/shareData';
//var uploadServer = 'http://collusiondb.mofostaging.net/shareData';
var uploadServer = 'http://collusiondb.mofoprod.net/shareData';
var isRobot = false; // Used for spidering the web only var isRobot = false; // Used for spidering the web only
var uploadTimer; var uploadTimer;
var saveTimer; var saveTimer;
@ -90,7 +88,7 @@ function elem(name, attributes, children){
}; };
window.addEventListener('load', function(evt){ window.addEventListener('load', function(evt){
localStorage.numLaunch = parseInt(localStorage.numLaunch)+1 || 1; localStorage.numLaunch = parseInt(localStorage.numLaunch, 10)+1 || 1;
// Wire up events // Wire up events
document.querySelector('[data-value=' + (localStorage.visualization || 'Graph') + ']').setAttribute("data-selected", true); document.querySelector('[data-value=' + (localStorage.visualization || 'Graph') + ']').setAttribute("data-selected", true);
var visualization = localStorage.visualization ? ( localStorage.visualization.toLowerCase() ) : "graph"; var visualization = localStorage.visualization ? ( localStorage.visualization.toLowerCase() ) : "graph";

Просмотреть файл

@ -527,7 +527,7 @@ function showPromptToShareDialog(){
today = formattedDate(Date.now()); today = formattedDate(Date.now());
shownToday = showTimes.indexOf(today) > -1; shownToday = showTimes.indexOf(today) > -1;
belowLimit = showTimes.length < promptToShareDialogShowLimit; belowLimit = showTimes.length < promptToShareDialogShowLimit;
if ( localStorage.numLaunch > 1 && !doNotShowDialog(dialogNames.promptToShare) && !shownToday && belowLimit){ if ( Number(localStorage.numLaunch) > 1 && !doNotShowDialog(dialogNames.promptToShare) && !shownToday && belowLimit){
showTimes.push(today); showTimes.push(today);
localStorage.promptToShareDialogShowTimes = JSON.stringify(showTimes); localStorage.promptToShareDialogShowTimes = JSON.stringify(showTimes);
showPromptToShareDialog(function(confirmed){ showPromptToShareDialog(function(confirmed){

Просмотреть файл

@ -4,7 +4,7 @@
"description": "Lightbeam is a Firefox add-on that allows you to see the third parties that are collecting information about your browsing activity, with and without your consent. Using interactive visualizations, Lightbeam shows you the relationships between these third parties and the sites you visit.", "description": "Lightbeam is a Firefox add-on that allows you to see the third parties that are collecting information about your browsing activity, with and without your consent. Using interactive visualizations, Lightbeam shows you the relationships between these third parties and the sites you visit.",
"author": "Mozilla Foundation", "author": "Mozilla Foundation",
"license": "MPL 2.0", "license": "MPL 2.0",
"version": "1.0.4", "version": "1.0.5",
"id": "jid1-F9UJ2thwoAm5gQ", "id": "jid1-F9UJ2thwoAm5gQ",
"permissions": { "permissions": {
"private-browsing": true "private-browsing": true