diff --git a/FloatingSpace/FloatingLayer.js b/FloatingSpace/FloatingLayer.js index 0f83cf7e8..7a37e67d6 100644 --- a/FloatingSpace/FloatingLayer.js +++ b/FloatingSpace/FloatingLayer.js @@ -78,17 +78,9 @@ function newFloatingLayer () { } } - function initialize (callBackFunction) { - try { - if (INFO_LOG === true) { logger.write('[INFO] initialize -> Entering function.') } + function initialize () { - /* We dont need to initialize anything right now. */ - - if (callBackFunction !== undefined) { callBackFunction(GLOBAL.DEFAULT_OK_RESPONSE) } - } catch (err) { - if (ERROR_LOG === true) { logger.write('[ERROR] initialize -> err.message = ' + err.message) } - if (callBackFunction !== undefined) { callBackFunction(GLOBAL.DEFAULT_FAIL_RESPONSE) } - } + /* We dont need to initialize anything right now. */ } function addFloatingObject (pFloatingObject, callBackFunction) { diff --git a/FloatingSpace/NoteSets.js b/FloatingSpace/NoteSets.js index d3e2ce42e..4db399504 100644 --- a/FloatingSpace/NoteSets.js +++ b/FloatingSpace/NoteSets.js @@ -31,21 +31,8 @@ function newNoteSets () { return thisObject - function initialize (pFloatingLayer, callBackFunction) { - /* - During the initialization process, we receive the floatingLayer where all the floatingObjects we will be creating here will live at. - */ - - try { - if (INFO_LOG === true) { logger.write('[INFO] initialize -> Entering function.') } - - floatingLayer = pFloatingLayer - - callBackFunction(GLOBAL.CUSTOM_OK_RESPONSE) - } catch (err) { - if (ERROR_LOG === true) { logger.write('[ERROR] initialize -> err = ' + err.stack) } - callBackFunction(GLOBAL.DEFAULT_FAIL_RESPONSE) - } + function initialize (pFloatingLayer) { + floatingLayer = pFloatingLayer } function createNoteSet (pPayload, pEventHandler, callBackFunction) { diff --git a/FloatingSpace/ProfileBalls.js b/FloatingSpace/ProfileBalls.js index de67bfca6..0501269ba 100644 --- a/FloatingSpace/ProfileBalls.js +++ b/FloatingSpace/ProfileBalls.js @@ -35,17 +35,8 @@ function newProfileBalls () { } } - function initialize (pFloatingLayer, callBackFunction) { - try { - if (INFO_LOG === true) { logger.write('[INFO] initialize -> Entering function.') } - - floatingLayer = pFloatingLayer - - callBackFunction(GLOBAL.CUSTOM_OK_RESPONSE) - } catch (err) { - if (ERROR_LOG === true) { logger.write('[ERROR] initialize -> err = ' + err.stack) } - callBackFunction(GLOBAL.DEFAULT_FAIL_RESPONSE) - } + function initialize (pFloatingLayer) { + floatingLayer = pFloatingLayer } function createNewProfileBall (pPayload, callBackFunction) { diff --git a/FloatingSpace/StrategyParts.js b/FloatingSpace/StrategyParts.js index fcd42b795..a8c4bb0ee 100644 --- a/FloatingSpace/StrategyParts.js +++ b/FloatingSpace/StrategyParts.js @@ -28,15 +28,8 @@ function newStrategyParts () { floatingLayer.finalize() } - function initialize (pFloatingLayer, callBackFunction) { - try { - floatingLayer = pFloatingLayer - - callBackFunction(GLOBAL.CUSTOM_OK_RESPONSE) - } catch (err) { - if (ERROR_LOG === true) { logger.write('[ERROR] initialize -> err = ' + err.stack) } - callBackFunction(GLOBAL.DEFAULT_FAIL_RESPONSE) - } + function initialize (pFloatingLayer) { + floatingLayer = pFloatingLayer } function createNewStrategyPart (pPayload, callBackFunction) { diff --git a/Spaces/FloatingSpace.js b/Spaces/FloatingSpace.js index 0e0010638..e7f6e494d 100644 --- a/Spaces/FloatingSpace.js +++ b/Spaces/FloatingSpace.js @@ -11,6 +11,7 @@ function newFloatingSpace () { let thisObject = { floatingLayer: undefined, // This is the array of floatingObjects being displayed profileBalls: undefined, + strategyParts: undefined, noteSets: undefined, initialize: initialize, finalize: finalize @@ -24,6 +25,7 @@ function newFloatingSpace () { thisObject.floatingLayer.finalize() thisObject.profileBalls.finalize() + thisObject.strategyParts.finalize() } catch (err) { if (ERROR_LOG === true) { logger.write('[ERROR] finalize -> err = ' + err.stack) } } @@ -31,21 +33,16 @@ function newFloatingSpace () { function initialize (callBackFunction) { thisObject.floatingLayer = newFloatingLayer() - thisObject.floatingLayer.initialize(onFloatingLayerInitialized) + thisObject.floatingLayer.initialize() - function onFloatingLayerInitialized (err) { - thisObject.profileBalls = newProfileBalls() - thisObject.profileBalls.initialize(thisObject.floatingLayer, onProfileBallsInitialized) + thisObject.profileBalls = newProfileBalls() + thisObject.profileBalls.initialize(thisObject.floatingLayer) - function onProfileBallsInitialized (err) { - thisObject.noteSets = newNoteSets() - thisObject.noteSets.initialize(thisObject.floatingLayer, onNoteSetsInitialized) + thisObject.noteSets = newNoteSets() + thisObject.noteSets.initialize(thisObject.floatingLayer) - function onNoteSetsInitialized (err) { - - } - } - } + thisObject.strategyParts = newStrategyParts() + thisObject.strategyParts.initialize(thisObject.floatingLayer) } } diff --git a/StrategySpace/StrategyCollectionItem.js b/StrategySpace/StrategyCollectionItem.js index a17c1900b..9abf2644c 100644 --- a/StrategySpace/StrategyCollectionItem.js +++ b/StrategySpace/StrategyCollectionItem.js @@ -37,7 +37,22 @@ function newStrategyCollectionItem () { } function onMouseClick (event) { - console.log('ITEM CLICKED') + if (productPlotter.plotter.payload !== undefined) { + let imageId = pProductCard.bot.devTeam + '.' + pProductCard.bot.profilePicture + + productPlotter.plotter.payload.profile.upLabel = pProductCard.product.shortDisplayName + productPlotter.plotter.payload.profile.downLabel = pProductCard.bot.displayName + productPlotter.plotter.payload.profile.imageId = imageId + productPlotter.plotter.payload.profile.botAvatar = pProductCard.bot.avatar + + canvas.floatingSpace.profileBalls.createNewProfileBall(productPlotter.plotter.payload, onProfileBallCreated) + + function onProfileBallCreated (err, pProfileHandle) { + productPlotter.profile = pProfileHandle + + /* There is no policy yet of what to do if this fails. */ + } + } } function getContainer (point) {