diff --git a/FloatingSpace/StrategyPartConstructor.js b/FloatingSpace/StrategyPartConstructor.js index 1b07a59c6..1ef4d4cce 100644 --- a/FloatingSpace/StrategyPartConstructor.js +++ b/FloatingSpace/StrategyPartConstructor.js @@ -81,6 +81,22 @@ function newStrategyPartConstructor () { } function addLeftIcons (menuItemsInitialValues, floatingObject) { + menuItemsInitialValues.push( + { + action: 'Pin / Unpin', + actionFunction: floatingObject.pinToggle, + actionStatus: floatingObject.getPinStatus, + currentStatus: false, + label: undefined, + visible: false, + iconPathOn: 'target', + iconPathOff: 'security', + rawRadius: 8, + targetRadius: 0, + currentRadius: 0, + angle: -135 + } + ) menuItemsInitialValues.push( { action: 'Tense / Untense', @@ -264,49 +280,8 @@ function newStrategyPartConstructor () { break } case 'Parameters': { - menuItemsInitialValues = [ - { - action: 'Pin / Unpin', - actionFunction: floatingObject.pinToggle, - actionStatus: floatingObject.getPinStatus, - currentStatus: true, - label: undefined, - visible: false, - iconPathOn: 'target', - iconPathOff: 'security', - rawRadius: 8, - targetRadius: 0, - currentRadius: 0, - angle: -135 - }, - { - action: 'Tense / Untense', - actionFunction: floatingObject.tensionToggle, - actionStatus: floatingObject.getTensionStatus, - currentStatus: false, - label: undefined, - visible: false, - iconPathOn: 'compass', - iconPathOff: 'headphones', - rawRadius: 8, - targetRadius: 0, - currentRadius: 0, - angle: 180 - }, - { - action: 'Freeze / Unfreeze', - actionFunction: floatingObject.freezeToggle, - actionStatus: floatingObject.getFreezeStatus, - currentStatus: true, - label: undefined, - visible: false, - iconPathOn: 'targeting', - iconPathOff: 'broken-link', - rawRadius: 8, - targetRadius: 0, - currentRadius: 0, - angle: 135 - }, + addLeftIcons(menuItemsInitialValues, floatingObject) + menuItemsInitialValues.push( { action: 'Delete Parameters', askConfirmation: true, @@ -320,7 +295,9 @@ function newStrategyPartConstructor () { targetRadius: 0, currentRadius: 0, angle: -40 - }, + } + ) + menuItemsInitialValues.push( { action: 'Add Missing Parameters', actionFunction: payload.onMenuItemClick, @@ -332,7 +309,9 @@ function newStrategyPartConstructor () { targetRadius: 0, currentRadius: 0, angle: 0 - }, + } + ) + menuItemsInitialValues.push( { action: 'Download', actionFunction: payload.onMenuItemClick, @@ -344,53 +323,13 @@ function newStrategyPartConstructor () { targetRadius: 0, currentRadius: 0, angle: 40 - }] + } + ) break } case 'Base Asset': { - menuItemsInitialValues = [ - { - action: 'Pin / Unpin', - actionFunction: floatingObject.pinToggle, - actionStatus: floatingObject.getPinStatus, - currentStatus: true, - label: undefined, - visible: false, - iconPathOn: 'target', - iconPathOff: 'security', - rawRadius: 8, - targetRadius: 0, - currentRadius: 0, - angle: -135 - }, - { - action: 'Tense / Untense', - actionFunction: floatingObject.tensionToggle, - actionStatus: floatingObject.getTensionStatus, - currentStatus: false, - label: undefined, - visible: false, - iconPathOn: 'compass', - iconPathOff: 'headphones', - rawRadius: 8, - targetRadius: 0, - currentRadius: 0, - angle: 180 - }, - { - action: 'Freeze / Unfreeze', - actionFunction: floatingObject.freezeToggle, - actionStatus: floatingObject.getFreezeStatus, - currentStatus: true, - label: undefined, - visible: false, - iconPathOn: 'targeting', - iconPathOff: 'broken-link', - rawRadius: 8, - targetRadius: 0, - currentRadius: 0, - angle: 135 - }, + addLeftIcons(menuItemsInitialValues, floatingObject) + menuItemsInitialValues.push( { action: 'Delete Base Asset', askConfirmation: true, @@ -404,7 +343,9 @@ function newStrategyPartConstructor () { targetRadius: 0, currentRadius: 0, angle: -40 - }, + } + ) + menuItemsInitialValues.push( { action: 'Add Formula', actionFunction: payload.onMenuItemClick, @@ -417,7 +358,9 @@ function newStrategyPartConstructor () { targetRadius: 0, currentRadius: 0, angle: 0 - }, + } + ) + menuItemsInitialValues.push( { action: 'Download', actionFunction: payload.onMenuItemClick, @@ -429,53 +372,13 @@ function newStrategyPartConstructor () { targetRadius: 0, currentRadius: 0, angle: 40 - }] + } + ) break } case 'Strategy': { - menuItemsInitialValues = [ - { - action: 'Pin / Unpin', - actionFunction: floatingObject.pinToggle, - actionStatus: floatingObject.getPinStatus, - currentStatus: false, - label: undefined, - visible: false, - iconPathOn: 'target', - iconPathOff: 'security', - rawRadius: 8, - targetRadius: 0, - currentRadius: 0, - angle: -135 - }, - { - action: 'Tense / Untense', - actionFunction: floatingObject.tensionToggle, - actionStatus: floatingObject.getTensionStatus, - currentStatus: false, - label: undefined, - visible: false, - iconPathOn: 'compass', - iconPathOff: 'headphones', - rawRadius: 8, - targetRadius: 0, - currentRadius: 0, - angle: 180 - }, - { - action: 'Freeze / Unfreeze', - actionFunction: floatingObject.freezeToggle, - actionStatus: floatingObject.getFreezeStatus, - currentStatus: true, - label: undefined, - visible: false, - iconPathOn: 'targeting', - iconPathOff: 'broken-link', - rawRadius: 8, - targetRadius: 0, - currentRadius: 0, - angle: 135 - }, + addLeftIcons(menuItemsInitialValues, floatingObject) + menuItemsInitialValues.push( { action: 'Add Missing Stages', actionFunction: payload.onMenuItemClick, @@ -487,7 +390,9 @@ function newStrategyPartConstructor () { targetRadius: 0, currentRadius: 0, angle: -40 - }, + } + ) + menuItemsInitialValues.push( { action: 'Delete Strategy', askConfirmation: true, @@ -501,7 +406,9 @@ function newStrategyPartConstructor () { targetRadius: 0, currentRadius: 0, angle: 0 - }, + } + ) + menuItemsInitialValues.push( { action: 'Download', actionFunction: payload.onMenuItemClick, @@ -513,7 +420,8 @@ function newStrategyPartConstructor () { targetRadius: 0, currentRadius: 0, angle: 40 - }] + } + ) break } case 'Trigger Stage': { @@ -601,49 +509,8 @@ function newStrategyPartConstructor () { break } case 'Open Stage': { - menuItemsInitialValues = [ - { - action: 'Pin / Unpin', - actionFunction: floatingObject.pinToggle, - actionStatus: floatingObject.getPinStatus, - currentStatus: false, - label: undefined, - visible: false, - iconPathOn: 'target', - iconPathOff: 'security', - rawRadius: 8, - targetRadius: 0, - currentRadius: 0, - angle: -135 - }, - { - action: 'Tense / Untense', - actionFunction: floatingObject.tensionToggle, - actionStatus: floatingObject.getTensionStatus, - currentStatus: false, - label: undefined, - visible: false, - iconPathOn: 'compass', - iconPathOff: 'headphones', - rawRadius: 8, - targetRadius: 0, - currentRadius: 0, - angle: 180 - }, - { - action: 'Freeze / Unfreeze', - actionFunction: floatingObject.freezeToggle, - actionStatus: floatingObject.getFreezeStatus, - currentStatus: true, - label: undefined, - visible: false, - iconPathOn: 'targeting', - iconPathOff: 'broken-link', - rawRadius: 8, - targetRadius: 0, - currentRadius: 0, - angle: 135 - }, + addLeftIcons(menuItemsInitialValues, floatingObject) + menuItemsInitialValues.push( { action: 'Add Initial Definition', actionFunction: payload.onMenuItemClick, @@ -655,7 +522,9 @@ function newStrategyPartConstructor () { targetRadius: 0, currentRadius: 0, angle: -40 - }, + } + ) + menuItemsInitialValues.push( { action: 'Delete Open Stage', askConfirmation: true, @@ -669,7 +538,9 @@ function newStrategyPartConstructor () { targetRadius: 0, currentRadius: 0, angle: 0 - }, + } + ) + menuItemsInitialValues.push( { action: 'Download', actionFunction: payload.onMenuItemClick, @@ -681,53 +552,13 @@ function newStrategyPartConstructor () { targetRadius: 0, currentRadius: 0, angle: 40 - }] + } + ) break } case 'Manage Stage': { - menuItemsInitialValues = [ - { - action: 'Pin / Unpin', - actionFunction: floatingObject.pinToggle, - actionStatus: floatingObject.getPinStatus, - currentStatus: false, - label: undefined, - visible: false, - iconPathOn: 'target', - iconPathOff: 'security', - rawRadius: 8, - targetRadius: 0, - currentRadius: 0, - angle: -135 - }, - { - action: 'Tense / Untense', - actionFunction: floatingObject.tensionToggle, - actionStatus: floatingObject.getTensionStatus, - currentStatus: false, - label: undefined, - visible: false, - iconPathOn: 'compass', - iconPathOff: 'headphones', - rawRadius: 8, - targetRadius: 0, - currentRadius: 0, - angle: 180 - }, - { - action: 'Freeze / Unfreeze', - actionFunction: floatingObject.freezeToggle, - actionStatus: floatingObject.getFreezeStatus, - currentStatus: true, - label: undefined, - visible: false, - iconPathOn: 'targeting', - iconPathOff: 'broken-link', - rawRadius: 8, - targetRadius: 0, - currentRadius: 0, - angle: 135 - }, + addLeftIcons(menuItemsInitialValues, floatingObject) + menuItemsInitialValues.push( { action: 'Add Missing Items', actionFunction: payload.onMenuItemClick, @@ -739,7 +570,9 @@ function newStrategyPartConstructor () { targetRadius: 0, currentRadius: 0, angle: -40 - }, + } + ) + menuItemsInitialValues.push( { action: 'Delete Manage Stage', askConfirmation: true, @@ -753,7 +586,9 @@ function newStrategyPartConstructor () { targetRadius: 0, currentRadius: 0, angle: 0 - }, + } + ) + menuItemsInitialValues.push( { action: 'Download', actionFunction: payload.onMenuItemClick, @@ -765,53 +600,13 @@ function newStrategyPartConstructor () { targetRadius: 0, currentRadius: 0, angle: 40 - }] + } + ) break } case 'Close Stage': { - menuItemsInitialValues = [ - { - action: 'Pin / Unpin', - actionFunction: floatingObject.pinToggle, - actionStatus: floatingObject.getPinStatus, - currentStatus: false, - label: undefined, - visible: false, - iconPathOn: 'target', - iconPathOff: 'security', - rawRadius: 8, - targetRadius: 0, - currentRadius: 0, - angle: -135 - }, - { - action: 'Tense / Untense', - actionFunction: floatingObject.tensionToggle, - actionStatus: floatingObject.getTensionStatus, - currentStatus: false, - label: undefined, - visible: false, - iconPathOn: 'compass', - iconPathOff: 'headphones', - rawRadius: 8, - targetRadius: 0, - currentRadius: 0, - angle: 180 - }, - { - action: 'Freeze / Unfreeze', - actionFunction: floatingObject.freezeToggle, - actionStatus: floatingObject.getFreezeStatus, - currentStatus: true, - label: undefined, - visible: false, - iconPathOn: 'targeting', - iconPathOff: 'broken-link', - rawRadius: 8, - targetRadius: 0, - currentRadius: 0, - angle: 135 - }, + addLeftIcons(menuItemsInitialValues, floatingObject) + menuItemsInitialValues.push( { action: 'Delete Close Stage', askConfirmation: true, @@ -825,7 +620,9 @@ function newStrategyPartConstructor () { targetRadius: 0, currentRadius: 0, angle: -20 - }, + } + ) + menuItemsInitialValues.push( { action: 'Download', actionFunction: payload.onMenuItemClick, @@ -837,53 +634,13 @@ function newStrategyPartConstructor () { targetRadius: 0, currentRadius: 0, angle: 20 - }] + } + ) break } case 'Position Size': { - menuItemsInitialValues = [ - { - action: 'Pin / Unpin', - actionFunction: floatingObject.pinToggle, - actionStatus: floatingObject.getPinStatus, - currentStatus: true, - label: undefined, - visible: false, - iconPathOn: 'target', - iconPathOff: 'security', - rawRadius: 8, - targetRadius: 0, - currentRadius: 0, - angle: -135 - }, - { - action: 'Tense / Untense', - actionFunction: floatingObject.tensionToggle, - actionStatus: floatingObject.getTensionStatus, - currentStatus: false, - label: undefined, - visible: false, - iconPathOn: 'compass', - iconPathOff: 'headphones', - rawRadius: 8, - targetRadius: 0, - currentRadius: 0, - angle: 180 - }, - { - action: 'Freeze / Unfreeze', - actionFunction: floatingObject.freezeToggle, - actionStatus: floatingObject.getFreezeStatus, - currentStatus: true, - label: undefined, - visible: false, - iconPathOn: 'targeting', - iconPathOff: 'broken-link', - rawRadius: 8, - targetRadius: 0, - currentRadius: 0, - angle: 135 - }, + addLeftIcons(menuItemsInitialValues, floatingObject) + menuItemsInitialValues.push( { action: 'Delete Position Size', askConfirmation: true, @@ -897,7 +654,9 @@ function newStrategyPartConstructor () { targetRadius: 0, currentRadius: 0, angle: -40 - }, + } + ) + menuItemsInitialValues.push( { action: 'Add Formula', actionFunction: payload.onMenuItemClick, @@ -910,7 +669,9 @@ function newStrategyPartConstructor () { targetRadius: 0, currentRadius: 0, angle: 0 - }, + } + ) + menuItemsInitialValues.push( { action: 'Download', actionFunction: payload.onMenuItemClick, @@ -922,53 +683,13 @@ function newStrategyPartConstructor () { targetRadius: 0, currentRadius: 0, angle: 40 - }] + } + ) break } case 'Position Rate': { - menuItemsInitialValues = [ - { - action: 'Pin / Unpin', - actionFunction: floatingObject.pinToggle, - actionStatus: floatingObject.getPinStatus, - currentStatus: true, - label: undefined, - visible: false, - iconPathOn: 'target', - iconPathOff: 'security', - rawRadius: 8, - targetRadius: 0, - currentRadius: 0, - angle: -135 - }, - { - action: 'Tense / Untense', - actionFunction: floatingObject.tensionToggle, - actionStatus: floatingObject.getTensionStatus, - currentStatus: false, - label: undefined, - visible: false, - iconPathOn: 'compass', - iconPathOff: 'headphones', - rawRadius: 8, - targetRadius: 0, - currentRadius: 0, - angle: 180 - }, - { - action: 'Freeze / Unfreeze', - actionFunction: floatingObject.freezeToggle, - actionStatus: floatingObject.getFreezeStatus, - currentStatus: true, - label: undefined, - visible: false, - iconPathOn: 'targeting', - iconPathOff: 'broken-link', - rawRadius: 8, - targetRadius: 0, - currentRadius: 0, - angle: 135 - }, + addLeftIcons(menuItemsInitialValues, floatingObject) + menuItemsInitialValues.push( { action: 'Delete Position Rate', askConfirmation: true, @@ -982,7 +703,9 @@ function newStrategyPartConstructor () { targetRadius: 0, currentRadius: 0, angle: -40 - }, + } + ) + menuItemsInitialValues.push( { action: 'Add Formula', actionFunction: payload.onMenuItemClick, @@ -995,7 +718,9 @@ function newStrategyPartConstructor () { targetRadius: 0, currentRadius: 0, angle: 0 - }, + } + ) + menuItemsInitialValues.push( { action: 'Download', actionFunction: payload.onMenuItemClick, @@ -1007,53 +732,13 @@ function newStrategyPartConstructor () { targetRadius: 0, currentRadius: 0, angle: 40 - }] + } + ) break } case 'Trigger On Event': { - menuItemsInitialValues = [ - { - action: 'Pin / Unpin', - actionFunction: floatingObject.pinToggle, - actionStatus: floatingObject.getPinStatus, - currentStatus: false, - label: undefined, - visible: false, - iconPathOn: 'target', - iconPathOff: 'security', - rawRadius: 8, - targetRadius: 0, - currentRadius: 0, - angle: -135 - }, - { - action: 'Tense / Untense', - actionFunction: floatingObject.tensionToggle, - actionStatus: floatingObject.getTensionStatus, - currentStatus: false, - label: undefined, - visible: false, - iconPathOn: 'compass', - iconPathOff: 'headphones', - rawRadius: 8, - targetRadius: 0, - currentRadius: 0, - angle: 180 - }, - { - action: 'Freeze / Unfreeze', - actionFunction: floatingObject.freezeToggle, - actionStatus: floatingObject.getFreezeStatus, - currentStatus: true, - label: undefined, - visible: false, - iconPathOn: 'targeting', - iconPathOff: 'broken-link', - rawRadius: 8, - targetRadius: 0, - currentRadius: 0, - angle: 135 - }, + addLeftIcons(menuItemsInitialValues, floatingObject) + menuItemsInitialValues.push( { action: 'Add Situation', actionFunction: payload.onMenuItemClick, @@ -1066,7 +751,9 @@ function newStrategyPartConstructor () { targetRadius: 0, currentRadius: 0, angle: -40 - }, + } + ) + menuItemsInitialValues.push( { action: 'Delete Event', askConfirmation: true, @@ -1080,7 +767,9 @@ function newStrategyPartConstructor () { targetRadius: 0, currentRadius: 0, angle: 0 - }, + } + ) + menuItemsInitialValues.push( { action: 'Download', actionFunction: payload.onMenuItemClick, @@ -1092,53 +781,13 @@ function newStrategyPartConstructor () { targetRadius: 0, currentRadius: 0, angle: 40 - }] + } + ) break } case 'Trigger Off Event': { - menuItemsInitialValues = [ - { - action: 'Pin / Unpin', - actionFunction: floatingObject.pinToggle, - actionStatus: floatingObject.getPinStatus, - currentStatus: false, - label: undefined, - visible: false, - iconPathOn: 'target', - iconPathOff: 'security', - rawRadius: 8, - targetRadius: 0, - currentRadius: 0, - angle: -135 - }, - { - action: 'Tense / Untense', - actionFunction: floatingObject.tensionToggle, - actionStatus: floatingObject.getTensionStatus, - currentStatus: false, - label: undefined, - visible: false, - iconPathOn: 'compass', - iconPathOff: 'headphones', - rawRadius: 8, - targetRadius: 0, - currentRadius: 0, - angle: 180 - }, - { - action: 'Freeze / Unfreeze', - actionFunction: floatingObject.freezeToggle, - actionStatus: floatingObject.getFreezeStatus, - currentStatus: true, - label: undefined, - visible: false, - iconPathOn: 'targeting', - iconPathOff: 'broken-link', - rawRadius: 8, - targetRadius: 0, - currentRadius: 0, - angle: 135 - }, + addLeftIcons(menuItemsInitialValues, floatingObject) + menuItemsInitialValues.push( { action: 'Add Situation', actionFunction: payload.onMenuItemClick, @@ -1151,7 +800,9 @@ function newStrategyPartConstructor () { targetRadius: 0, currentRadius: 0, angle: -40 - }, + } + ) + menuItemsInitialValues.push( { action: 'Delete Event', askConfirmation: true, @@ -1165,7 +816,9 @@ function newStrategyPartConstructor () { targetRadius: 0, currentRadius: 0, angle: 0 - }, + } + ) + menuItemsInitialValues.push( { action: 'Download', actionFunction: payload.onMenuItemClick, @@ -1177,53 +830,13 @@ function newStrategyPartConstructor () { targetRadius: 0, currentRadius: 0, angle: 40 - }] + } + ) break } case 'Take Position Event': { - menuItemsInitialValues = [ - { - action: 'Pin / Unpin', - actionFunction: floatingObject.pinToggle, - actionStatus: floatingObject.getPinStatus, - currentStatus: false, - label: undefined, - visible: false, - iconPathOn: 'target', - iconPathOff: 'security', - rawRadius: 8, - targetRadius: 0, - currentRadius: 0, - angle: -135 - }, - { - action: 'Tense / Untense', - actionFunction: floatingObject.tensionToggle, - actionStatus: floatingObject.getTensionStatus, - currentStatus: false, - label: undefined, - visible: false, - iconPathOn: 'compass', - iconPathOff: 'headphones', - rawRadius: 8, - targetRadius: 0, - currentRadius: 0, - angle: 180 - }, - { - action: 'Freeze / Unfreeze', - actionFunction: floatingObject.freezeToggle, - actionStatus: floatingObject.getFreezeStatus, - currentStatus: true, - label: undefined, - visible: false, - iconPathOn: 'targeting', - iconPathOff: 'broken-link', - rawRadius: 8, - targetRadius: 0, - currentRadius: 0, - angle: 135 - }, + addLeftIcons(menuItemsInitialValues, floatingObject) + menuItemsInitialValues.push( { action: 'Add Situation', actionFunction: payload.onMenuItemClick, @@ -1236,7 +849,9 @@ function newStrategyPartConstructor () { targetRadius: 0, currentRadius: 0, angle: -40 - }, + } + ) + menuItemsInitialValues.push( { action: 'Delete Event', askConfirmation: true, @@ -1250,7 +865,9 @@ function newStrategyPartConstructor () { targetRadius: 0, currentRadius: 0, angle: 0 - }, + } + ) + menuItemsInitialValues.push( { action: 'Download', actionFunction: payload.onMenuItemClick, @@ -1262,53 +879,13 @@ function newStrategyPartConstructor () { targetRadius: 0, currentRadius: 0, angle: 40 - }] + } + ) break } case 'Initial Definition': { - menuItemsInitialValues = [ - { - action: 'Pin / Unpin', - actionFunction: floatingObject.pinToggle, - actionStatus: floatingObject.getPinStatus, - currentStatus: false, - label: undefined, - visible: false, - iconPathOn: 'target', - iconPathOff: 'security', - rawRadius: 8, - targetRadius: 0, - currentRadius: 0, - angle: -135 - }, - { - action: 'Tense / Untense', - actionFunction: floatingObject.tensionToggle, - actionStatus: floatingObject.getTensionStatus, - currentStatus: false, - label: undefined, - visible: false, - iconPathOn: 'compass', - iconPathOff: 'headphones', - rawRadius: 8, - targetRadius: 0, - currentRadius: 0, - angle: 180 - }, - { - action: 'Freeze / Unfreeze', - actionFunction: floatingObject.freezeToggle, - actionStatus: floatingObject.getFreezeStatus, - currentStatus: true, - label: undefined, - visible: false, - iconPathOn: 'targeting', - iconPathOff: 'broken-link', - rawRadius: 8, - targetRadius: 0, - currentRadius: 0, - angle: 135 - }, + addLeftIcons(menuItemsInitialValues, floatingObject) + menuItemsInitialValues.push( { action: 'Add Missing Items', actionFunction: payload.onMenuItemClick, @@ -1320,7 +897,9 @@ function newStrategyPartConstructor () { targetRadius: 0, currentRadius: 0, angle: -40 - }, + } + ) + menuItemsInitialValues.push( { action: 'Delete Initial Definition', askConfirmation: true, @@ -1334,7 +913,9 @@ function newStrategyPartConstructor () { targetRadius: 0, currentRadius: 0, angle: 0 - }, + } + ) + menuItemsInitialValues.push( { action: 'Download', actionFunction: payload.onMenuItemClick, @@ -1346,53 +927,13 @@ function newStrategyPartConstructor () { targetRadius: 0, currentRadius: 0, angle: 40 - }] + } + ) break } case 'Stop': { - menuItemsInitialValues = [ - { - action: 'Pin / Unpin', - actionFunction: floatingObject.pinToggle, - actionStatus: floatingObject.getPinStatus, - currentStatus: false, - label: undefined, - visible: false, - iconPathOn: 'target', - iconPathOff: 'security', - rawRadius: 8, - targetRadius: 0, - currentRadius: 0, - angle: -135 - }, - { - action: 'Tense / Untense', - actionFunction: floatingObject.tensionToggle, - actionStatus: floatingObject.getTensionStatus, - currentStatus: false, - label: undefined, - visible: false, - iconPathOn: 'compass', - iconPathOff: 'headphones', - rawRadius: 8, - targetRadius: 0, - currentRadius: 0, - angle: 180 - }, - { - action: 'Freeze / Unfreeze', - actionFunction: floatingObject.freezeToggle, - actionStatus: floatingObject.getFreezeStatus, - currentStatus: true, - label: undefined, - visible: false, - iconPathOn: 'targeting', - iconPathOff: 'broken-link', - rawRadius: 8, - targetRadius: 0, - currentRadius: 0, - angle: 135 - }, + addLeftIcons(menuItemsInitialValues, floatingObject) + menuItemsInitialValues.push( { action: 'Add Phase', actionFunction: payload.onMenuItemClick, @@ -1405,7 +946,9 @@ function newStrategyPartConstructor () { targetRadius: 0, currentRadius: 0, angle: -40 - }, + } + ) + menuItemsInitialValues.push( { action: 'Delete Managed Item', askConfirmation: true, @@ -1419,7 +962,9 @@ function newStrategyPartConstructor () { targetRadius: 0, currentRadius: 0, angle: 0 - }, + } + ) + menuItemsInitialValues.push( { action: 'Download', actionFunction: payload.onMenuItemClick, @@ -1431,53 +976,13 @@ function newStrategyPartConstructor () { targetRadius: 0, currentRadius: 0, angle: 40 - }] + } + ) break } case 'Take Profit': { - menuItemsInitialValues = [ - { - action: 'Pin / Unpin', - actionFunction: floatingObject.pinToggle, - actionStatus: floatingObject.getPinStatus, - currentStatus: false, - label: undefined, - visible: false, - iconPathOn: 'target', - iconPathOff: 'security', - rawRadius: 8, - targetRadius: 0, - currentRadius: 0, - angle: -135 - }, - { - action: 'Tense / Untense', - actionFunction: floatingObject.tensionToggle, - actionStatus: floatingObject.getTensionStatus, - currentStatus: false, - label: undefined, - visible: false, - iconPathOn: 'compass', - iconPathOff: 'headphones', - rawRadius: 8, - targetRadius: 0, - currentRadius: 0, - angle: 180 - }, - { - action: 'Freeze / Unfreeze', - actionFunction: floatingObject.freezeToggle, - actionStatus: floatingObject.getFreezeStatus, - currentStatus: true, - label: undefined, - visible: false, - iconPathOn: 'targeting', - iconPathOff: 'broken-link', - rawRadius: 8, - targetRadius: 0, - currentRadius: 0, - angle: 135 - }, + addLeftIcons(menuItemsInitialValues, floatingObject) + menuItemsInitialValues.push( { action: 'Add Phase', actionFunction: payload.onMenuItemClick, @@ -1490,7 +995,9 @@ function newStrategyPartConstructor () { targetRadius: 0, currentRadius: 0, angle: -40 - }, + } + ) + menuItemsInitialValues.push( { action: 'Delete Managed Item', askConfirmation: true, @@ -1504,7 +1011,9 @@ function newStrategyPartConstructor () { targetRadius: 0, currentRadius: 0, angle: 0 - }, + } + ) + menuItemsInitialValues.push( { action: 'Download', actionFunction: payload.onMenuItemClick, @@ -1516,53 +1025,13 @@ function newStrategyPartConstructor () { targetRadius: 0, currentRadius: 0, angle: 40 - }] + } + ) break } case 'Phase': { - menuItemsInitialValues = [ - { - action: 'Pin / Unpin', - actionFunction: floatingObject.pinToggle, - actionStatus: floatingObject.getPinStatus, - currentStatus: false, - label: undefined, - visible: false, - iconPathOn: 'target', - iconPathOff: 'security', - rawRadius: 8, - targetRadius: 0, - currentRadius: 0, - angle: -135 - }, - { - action: 'Tense / Untense', - actionFunction: floatingObject.tensionToggle, - actionStatus: floatingObject.getTensionStatus, - currentStatus: false, - label: undefined, - visible: false, - iconPathOn: 'compass', - iconPathOff: 'headphones', - rawRadius: 8, - targetRadius: 0, - currentRadius: 0, - angle: 180 - }, - { - action: 'Freeze / Unfreeze', - actionFunction: floatingObject.freezeToggle, - actionStatus: floatingObject.getFreezeStatus, - currentStatus: true, - label: undefined, - visible: false, - iconPathOn: 'targeting', - iconPathOff: 'broken-link', - rawRadius: 8, - targetRadius: 0, - currentRadius: 0, - angle: 135 - }, + addLeftIcons(menuItemsInitialValues, floatingObject) + menuItemsInitialValues.push( { action: 'Add Formula', actionFunction: payload.onMenuItemClick, @@ -1575,7 +1044,9 @@ function newStrategyPartConstructor () { targetRadius: 0, currentRadius: 0, angle: -60 - }, + } + ) + menuItemsInitialValues.push( { action: 'Add Next Phase Event', actionFunction: payload.onMenuItemClick, @@ -1588,7 +1059,9 @@ function newStrategyPartConstructor () { targetRadius: 0, currentRadius: 0, angle: -20 - }, + } + ) + menuItemsInitialValues.push( { action: 'Delete Phase', askConfirmation: true, @@ -1602,7 +1075,9 @@ function newStrategyPartConstructor () { targetRadius: 0, currentRadius: 0, angle: 20 - }, + } + ) + menuItemsInitialValues.push( { action: 'Download', actionFunction: payload.onMenuItemClick, @@ -1614,7 +1089,8 @@ function newStrategyPartConstructor () { targetRadius: 0, currentRadius: 0, angle: 60 - }] + } + ) break } case 'Formula': { @@ -1623,49 +1099,8 @@ function newStrategyPartConstructor () { strategyPart.codeEditor.initialize() strategyPart.codeEditor.container.connectToParent(strategyPart.container, false, false, true, true, false, false, false, false) - menuItemsInitialValues = [ - { - action: 'Pin / Unpin', - actionFunction: floatingObject.pinToggle, - actionStatus: floatingObject.getPinStatus, - currentStatus: false, - label: undefined, - visible: false, - iconPathOn: 'target', - iconPathOff: 'security', - rawRadius: 8, - targetRadius: 0, - currentRadius: 0, - angle: -135 - }, - { - action: 'Tense / Untense', - actionFunction: floatingObject.tensionToggle, - actionStatus: floatingObject.getTensionStatus, - currentStatus: false, - label: undefined, - visible: false, - iconPathOn: 'compass', - iconPathOff: 'headphones', - rawRadius: 8, - targetRadius: 0, - currentRadius: 0, - angle: 180 - }, - { - action: 'Freeze / Unfreeze', - actionFunction: floatingObject.freezeToggle, - actionStatus: floatingObject.getFreezeStatus, - currentStatus: true, - label: undefined, - visible: false, - iconPathOn: 'targeting', - iconPathOff: 'broken-link', - rawRadius: 8, - targetRadius: 0, - currentRadius: 0, - angle: 135 - }, + addLeftIcons(menuItemsInitialValues, floatingObject) + menuItemsInitialValues.push( { action: 'Edit Formula', actionFunction: strategyPart.codeEditor.activate, @@ -1678,7 +1113,9 @@ function newStrategyPartConstructor () { currentRadius: 0, angle: -40, dontShowAtFullscreen: true - }, + } + ) + menuItemsInitialValues.push( { action: 'Delete Formula', askConfirmation: true, @@ -1692,7 +1129,9 @@ function newStrategyPartConstructor () { targetRadius: 0, currentRadius: 0, angle: 0 - }, + } + ) + menuItemsInitialValues.push( { action: 'Download', actionFunction: payload.onMenuItemClick, @@ -1704,53 +1143,13 @@ function newStrategyPartConstructor () { targetRadius: 0, currentRadius: 0, angle: 40 - }] + } + ) break } case 'Next Phase Event': { - menuItemsInitialValues = [ - { - action: 'Pin / Unpin', - actionFunction: floatingObject.pinToggle, - actionStatus: floatingObject.getPinStatus, - currentStatus: false, - label: undefined, - visible: false, - iconPathOn: 'target', - iconPathOff: 'security', - rawRadius: 8, - targetRadius: 0, - currentRadius: 0, - angle: -135 - }, - { - action: 'Tense / Untense', - actionFunction: floatingObject.tensionToggle, - actionStatus: floatingObject.getTensionStatus, - currentStatus: false, - label: undefined, - visible: false, - iconPathOn: 'compass', - iconPathOff: 'headphones', - rawRadius: 8, - targetRadius: 0, - currentRadius: 0, - angle: 180 - }, - { - action: 'Freeze / Unfreeze', - actionFunction: floatingObject.freezeToggle, - actionStatus: floatingObject.getFreezeStatus, - currentStatus: true, - label: undefined, - visible: false, - iconPathOn: 'targeting', - iconPathOff: 'broken-link', - rawRadius: 8, - targetRadius: 0, - currentRadius: 0, - angle: 135 - }, + addLeftIcons(menuItemsInitialValues, floatingObject) + menuItemsInitialValues.push( { action: 'Add Situation', actionFunction: payload.onMenuItemClick, @@ -1763,7 +1162,9 @@ function newStrategyPartConstructor () { targetRadius: 0, currentRadius: 0, angle: -40 - }, + } + ) + menuItemsInitialValues.push( { action: 'Delete Event', askConfirmation: true, @@ -1777,7 +1178,9 @@ function newStrategyPartConstructor () { targetRadius: 0, currentRadius: 0, angle: 0 - }, + } + ) + menuItemsInitialValues.push( { action: 'Download', actionFunction: payload.onMenuItemClick, @@ -1789,53 +1192,13 @@ function newStrategyPartConstructor () { targetRadius: 0, currentRadius: 0, angle: 40 - }] + } + ) break } case 'Situation': { - menuItemsInitialValues = [ - { - action: 'Pin / Unpin', - actionFunction: floatingObject.pinToggle, - actionStatus: floatingObject.getPinStatus, - currentStatus: false, - label: undefined, - visible: false, - iconPathOn: 'target', - iconPathOff: 'security', - rawRadius: 8, - targetRadius: 0, - currentRadius: 0, - angle: -135 - }, - { - action: 'Tense / Untense', - actionFunction: floatingObject.tensionToggle, - actionStatus: floatingObject.getTensionStatus, - currentStatus: false, - label: undefined, - visible: false, - iconPathOn: 'compass', - iconPathOff: 'headphones', - rawRadius: 8, - targetRadius: 0, - currentRadius: 0, - angle: 180 - }, - { - action: 'Freeze / Unfreeze', - actionFunction: floatingObject.freezeToggle, - actionStatus: floatingObject.getFreezeStatus, - currentStatus: true, - label: undefined, - visible: false, - iconPathOn: 'targeting', - iconPathOff: 'broken-link', - rawRadius: 8, - targetRadius: 0, - currentRadius: 0, - angle: 135 - }, + addLeftIcons(menuItemsInitialValues, floatingObject) + menuItemsInitialValues.push( { action: 'Add Condition', actionFunction: payload.onMenuItemClick, @@ -1848,7 +1211,9 @@ function newStrategyPartConstructor () { targetRadius: 0, currentRadius: 0, angle: -40 - }, + } + ) + menuItemsInitialValues.push( { action: 'Delete Situation', askConfirmation: true, @@ -1862,7 +1227,9 @@ function newStrategyPartConstructor () { targetRadius: 0, currentRadius: 0, angle: 0 - }, + } + ) + menuItemsInitialValues.push( { action: 'Download', actionFunction: payload.onMenuItemClick, @@ -1874,53 +1241,13 @@ function newStrategyPartConstructor () { targetRadius: 0, currentRadius: 0, angle: 40 - }] + } + ) break } case 'Condition': { - menuItemsInitialValues = [ - { - action: 'Pin / Unpin', - actionFunction: floatingObject.pinToggle, - actionStatus: floatingObject.getPinStatus, - currentStatus: false, - label: undefined, - visible: false, - iconPathOn: 'target', - iconPathOff: 'security', - rawRadius: 8, - targetRadius: 0, - currentRadius: 0, - angle: -135 - }, - { - action: 'Tense / Untense', - actionFunction: floatingObject.tensionToggle, - actionStatus: floatingObject.getTensionStatus, - currentStatus: false, - label: undefined, - visible: false, - iconPathOn: 'compass', - iconPathOff: 'headphones', - rawRadius: 8, - targetRadius: 0, - currentRadius: 0, - angle: 180 - }, - { - action: 'Freeze / Unfreeze', - actionFunction: floatingObject.freezeToggle, - actionStatus: floatingObject.getFreezeStatus, - currentStatus: true, - label: undefined, - visible: false, - iconPathOn: 'targeting', - iconPathOff: 'broken-link', - rawRadius: 8, - targetRadius: 0, - currentRadius: 0, - angle: 135 - }, + addLeftIcons(menuItemsInitialValues, floatingObject) + menuItemsInitialValues.push( { action: 'Add Code', actionFunction: payload.onMenuItemClick, @@ -1933,7 +1260,9 @@ function newStrategyPartConstructor () { targetRadius: 0, currentRadius: 0, angle: -40 - }, + } + ) + menuItemsInitialValues.push( { action: 'Delete Condition', askConfirmation: true, @@ -1947,7 +1276,9 @@ function newStrategyPartConstructor () { targetRadius: 0, currentRadius: 0, angle: 0 - }, + } + ) + menuItemsInitialValues.push( { action: 'Download', actionFunction: payload.onMenuItemClick, @@ -1959,7 +1290,8 @@ function newStrategyPartConstructor () { targetRadius: 0, currentRadius: 0, angle: 40 - }] + } + ) break } case 'Code': { @@ -1968,49 +1300,8 @@ function newStrategyPartConstructor () { strategyPart.codeEditor.initialize() strategyPart.codeEditor.container.connectToParent(strategyPart.container, false, false, true, true, false, false, false, false) - menuItemsInitialValues = [ - { - action: 'Pin / Unpin', - actionFunction: floatingObject.pinToggle, - actionStatus: floatingObject.getPinStatus, - currentStatus: false, - label: undefined, - visible: false, - iconPathOn: 'target', - iconPathOff: 'security', - rawRadius: 8, - targetRadius: 0, - currentRadius: 0, - angle: -135 - }, - { - action: 'Tense / Untense', - actionFunction: floatingObject.tensionToggle, - actionStatus: floatingObject.getTensionStatus, - currentStatus: false, - label: undefined, - visible: false, - iconPathOn: 'compass', - iconPathOff: 'headphones', - rawRadius: 8, - targetRadius: 0, - currentRadius: 0, - angle: 180 - }, - { - action: 'Freeze / Unfreeze', - actionFunction: floatingObject.freezeToggle, - actionStatus: floatingObject.getFreezeStatus, - currentStatus: true, - label: undefined, - visible: false, - iconPathOn: 'targeting', - iconPathOff: 'broken-link', - rawRadius: 8, - targetRadius: 0, - currentRadius: 0, - angle: 135 - }, + addLeftIcons(menuItemsInitialValues, floatingObject) + menuItemsInitialValues.push( { action: 'Edit Code', actionFunction: strategyPart.codeEditor.activate, @@ -2023,7 +1314,9 @@ function newStrategyPartConstructor () { currentRadius: 0, angle: -40, dontShowAtFullscreen: true - }, + } + ) + menuItemsInitialValues.push( { action: 'Delete Code', askConfirmation: true, @@ -2037,7 +1330,9 @@ function newStrategyPartConstructor () { targetRadius: 0, currentRadius: 0, angle: 0 - }, + } + ) + menuItemsInitialValues.push( { action: 'Download', actionFunction: payload.onMenuItemClick, @@ -2049,7 +1344,8 @@ function newStrategyPartConstructor () { targetRadius: 0, currentRadius: 0, angle: 40 - }] + } + ) break } default: {