diff --git a/Globals.js b/Globals.js index cb98311a1..7ee83a508 100644 --- a/Globals.js +++ b/Globals.js @@ -94,7 +94,7 @@ function convertTimePeriodToName(pTimePeriod) { window.AT_BREAKPOINT = false; -const INITIAL_DEFAULT_MARKET = 2; // This is the market that will be shown when loading the site for the first time. +const SUPPORTED_EXCHANGES = ["Poloniex", "Coss"]; const DEFAULT_EXCHANGE = "Poloniex"; const DEFAULT_MARKET = { assetA: "USDT", diff --git a/PlottersManager.js b/PlottersManager.js index 215529a45..b24381dc9 100644 --- a/PlottersManager.js +++ b/PlottersManager.js @@ -33,6 +33,8 @@ function newPlottersManager () { let initializationReady = false let productsPanel + let exchange + let market return thisObject @@ -97,13 +99,15 @@ function newPlottersManager () { } } - function initialize (pProductsPanel, callBackFunction) { + function initialize (pProductsPanel, pExchange, pMarket, callBackFunction) { try { if (INFO_LOG === true) { logger.write('[INFO] initialize -> Entering function.') } /* Remember the Products Panel */ productsPanel = pProductsPanel + exchange = pExchange + market = pMarket /* Listen to the event of change of status */ @@ -222,7 +226,7 @@ function newPlottersManager () { let host = ecosystem.getHost(COMPETITION_HOST) let competition = ecosystem.getCompetition(host, COMPETITION) - storage.initialize(host, competition, DEFAULT_EXCHANGE, DEFAULT_MARKET, onCompetitionStorageInitialized) + storage.initialize(host, competition, exchange, market, onCompetitionStorageInitialized) function onCompetitionStorageInitialized (err) { try { @@ -461,7 +465,7 @@ function newPlottersManager () { } } - storage.initialize(pProductCard.devTeam, pProductCard.bot, pProductCard.product, DEFAULT_EXCHANGE, DEFAULT_MARKET, datetime, timePeriod, onProductStorageInitialized) + storage.initialize(pProductCard.devTeam, pProductCard.bot, pProductCard.product, exchange, market, datetime, timePeriod, onProductStorageInitialized) function onProductStorageInitialized (err) { try { @@ -505,7 +509,7 @@ function newPlottersManager () { plotter.container.frame.position.x = thisObject.container.frame.width / 2 - plotter.container.frame.width / 2 plotter.container.frame.position.y = thisObject.container.frame.height / 2 - plotter.container.frame.height / 2 - plotter.initialize(storage, DEFAULT_EXCHANGE, DEFAULT_MARKET, datetime, timePeriod, onPlotterInizialized) + plotter.initialize(storage, exchange, market, datetime, timePeriod, onPlotterInizialized) function onPlotterInizialized () { try { diff --git a/TimeMachine.js b/TimeMachine.js index ffd545090..619e28635 100644 --- a/TimeMachine.js +++ b/TimeMachine.js @@ -78,7 +78,7 @@ function newTimeMachine () { timelineChart.container.frame.position.x = thisObject.container.frame.width / 2 - timelineChart.container.frame.width / 2 timelineChart.container.frame.position.y = timelineChart.container.frame.height * 1.5 * iteration - timelineChart.initialize(productsPanel, onDefaultMarketInitialized) + timelineChart.initialize(productsPanel, DEFAULT_EXCHANGE, DEFAULT_MARKET, onDefaultMarketInitialized) iteration++ @@ -110,7 +110,7 @@ function newTimeMachine () { function initializeTimelineChart (item, key, mapObj) { if (INFO_LOG === true) { logger.write('[INFO] initialize -> initializeTheRestOfTheMarkets -> initializeTimelineChart -> Entering function.') } - if (key === INITIAL_DEFAULT_MARKET) { + if (key === DEFAULT_MARKET.assetA + '.' + DEFAULT_MARKET.assetB) { // We skip this market since it has already been initialized. return diff --git a/TimelineChart.js b/TimelineChart.js index 7d6d1179d..e36a9ee6f 100644 --- a/TimelineChart.js +++ b/TimelineChart.js @@ -45,6 +45,8 @@ let canDrawLogoAA = false let plotterManager + let exchange + let market return thisObject @@ -58,11 +60,13 @@ } } - function initialize (pProductsPanel, callBackFunction) { + function initialize (pProductsPanel, pExchange, pMarket, callBackFunction) { try { if (INFO_LOG === true) { logger.write('[INFO] initialize -> Entering function.') } /* We load the logow we will need for the background. */ + exchange = pExchange + market = pMarket logoA = new Image() logoB = new Image() @@ -135,7 +139,7 @@ plotterManager.container.frame.position.x = thisObject.container.frame.position.x plotterManager.container.frame.position.y = thisObject.container.frame.position.y - plotterManager.initialize(pProductsPanel, onPlotterManagerReady) + plotterManager.initialize(pProductsPanel, pExchange, pMarket, onPlotterManagerReady) function onPlotterManagerReady (err) { if (INFO_LOG === true) { logger.write('[INFO] initialize -> onPlotterManagerReady -> Entering function.') }