Merge branch 'develop' of https://github.com/Superalgos/Superalgos into Superalgos-develop

This commit is contained in:
Ferrox85 committed 2021-09-12 10:02:21 +02:00
commit ea7e27ad6f
8 files changed
+114 -10

No files matched your search

@@ -287,18 +287,28 @@ function newEducationTutorialSpace() {
function checkImage() {
let tutorialImageDiv = document.getElementById('tutorialImageDiv')
if (tutorialImageDiv !== null && tutorialImageDiv !== undefined) {
if (tutorialImageDiv !== null && tutorialImageDiv !== undefined) {
tutorialImageDiv.appendChild(htmlImage)
}
if (newImageName === undefined) { return }
if (currentImageName === newImageName) { return }
currentImageName = newImageName
let webParam = 'Icons/' + newImageProject + '/' + newImageName + '.png'
htmlImage.src = webParam
htmlImage.width = "100"
htmlImage.height = "100"
// If gathering Icon by Project and Name get it now
let icon = UI.projects.foundations.spaces.designSpace.getIconByProjectAndName(newImageProject, newImageName)
if (icon !== undefined) {
htmlImage.src = icon.src
htmlImage.width = "100"
htmlImage.height = "100"
} else if (icon === undefined) {
// Legacy Code to handle icons being fetched by literal path
// Note: This if statment should be removed once all tutoials have been refactored
let webParam = 'Icons/' + newImageProject + '/' + newImageName + '.png'
htmlImage.src = webParam
htmlImage.width = "100"
htmlImage.height = "100"
}
}
function checkDocumentation() {
@@ -0,0 +1,8 @@
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="350" height="350" viewBox="0 0 350 350" xml:space="preserve">
<desc>Created with Fabric.js 1.7.22</desc>
<defs>
</defs>
<g id="icon" style="stroke: none; stroke-width: 1; stroke-dasharray: none; stroke-linecap: butt; stroke-linejoin: miter; stroke-miterlimit: 10; fill: none; fill-rule: nonzero; opacity: 1;" transform="translate(-1.9444444444444287 -1.9444444444444287) scale(3.89 3.89)" >
<path d="M 45 0 C 25.463 0 9.625 15.838 9.625 35.375 c 0 8.722 3.171 16.693 8.404 22.861 L 45 90 l 26.97 -31.765 c 5.233 -6.167 8.404 -14.139 8.404 -22.861 C 80.375 15.838 64.537 0 45 0 z M 45 48.705 c -8.035 0 -14.548 -6.513 -14.548 -14.548 c 0 -8.035 6.513 -14.548 14.548 -14.548 s 14.548 6.513 14.548 14.548 C 59.548 42.192 53.035 48.705 45 48.705 z" style="stroke: none; stroke-width: 1; stroke-dasharray: none; stroke-linecap: butt; stroke-linejoin: miter; stroke-miterlimit: 10; fill: rgb(204,88,53); fill-rule: nonzero; opacity: 1;" transform=" matrix(1 0 0 1 0 0) " stroke-linecap="round" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.1 KiB

@@ -0,0 +1,10 @@
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="350" height="350" viewBox="0 0 350 350" xml:space="preserve">
<desc>Created with Fabric.js 1.7.22</desc>
<defs>
</defs>
<g id="icon" style="stroke: none; stroke-width: 1; stroke-dasharray: none; stroke-linecap: butt; stroke-linejoin: miter; stroke-miterlimit: 10; fill: none; fill-rule: nonzero; opacity: 1;" transform="translate(-1.9444444444444287 -1.9444444444444287) scale(3.89 3.89)" >
<path d="M 77.127 81.457 h -0.373 v -2 h 0.373 c 1.239 0 2.432 -0.371 3.446 -1.072 l 1.137 1.645 C 80.36 80.964 78.775 81.457 77.127 81.457 z M 72.11 81.457 h -4.645 v -2 h 4.645 V 81.457 z M 62.822 81.457 h -4.645 v -2 h 4.645 V 81.457 z M 53.534 81.457 H 48.89 v -2 h 4.645 V 81.457 z M 44.246 81.457 h -4.644 v -2 h 4.644 V 81.457 z M 34.958 81.457 h -4.644 v -2 h 4.644 V 81.457 z M 84.813 75.85 l -1.904 -0.609 c 0.19 -0.596 0.287 -1.218 0.287 -1.852 c 0 -0.708 -0.121 -1.403 -0.36 -2.064 l 1.881 -0.68 c 0.318 0.88 0.479 1.804 0.479 2.744 C 85.195 74.229 85.066 75.058 84.813 75.85 z M 80.386 68.269 c -0.972 -0.62 -2.099 -0.948 -3.259 -0.948 h -0.634 v -2 h 0.634 c 1.542 0 3.041 0.437 4.335 1.263 L 80.386 68.269 z M 71.849 67.32 h -4.644 v -2 h 4.644 V 67.32 z M 62.561 67.32 h -4.408 c -0.092 0 -0.183 -0.001 -0.272 -0.005 l 0.074 -1.998 l 0.198 0.003 h 4.408 V 67.32 z M 53.016 65.474 c -1.37 -1.132 -2.34 -2.705 -2.732 -4.43 l 1.951 -0.443 c 0.294 1.296 1.024 2.479 2.055 3.332 L 53.016 65.474 z M 52.642 56.707 l -1.814 -0.84 c 0.744 -1.607 2.02 -2.945 3.59 -3.768 l 0.928 1.771 C 54.162 54.49 53.202 55.497 52.642 56.707 z M 64.038 53.184 h -4.645 v -2 h 4.645 V 53.184 z" style="stroke: none; stroke-width: 1; stroke-dasharray: none; stroke-linecap: butt; stroke-linejoin: miter; stroke-miterlimit: 10; fill: rgb(240,162,2); fill-rule: nonzero; opacity: 1;" transform=" matrix(1 0 0 1 0 0) " stroke-linecap="round" />
<path d="M 21.094 27.868 C 9.444 27.868 0 37.311 0 48.961 c 0 5.201 1.891 9.954 5.011 13.632 l 16.082 18.941 l 16.082 -18.941 c 3.12 -3.678 5.011 -8.431 5.011 -13.632 C 42.187 37.311 32.743 27.868 21.094 27.868 z M 21.094 56.91 c -4.791 0 -8.675 -3.884 -8.675 -8.675 c 0 -4.791 3.884 -8.675 8.675 -8.675 s 8.675 3.884 8.675 8.675 C 29.768 53.026 25.885 56.91 21.094 56.91 z" style="stroke: none; stroke-width: 1; stroke-dasharray: none; stroke-linecap: butt; stroke-linejoin: miter; stroke-miterlimit: 10; fill: rgb(240,162,2); fill-rule: nonzero; opacity: 1;" transform=" matrix(1 0 0 1 0 0) " stroke-linecap="round" />
<path d="M 73.577 11.624 c -9.015 0 -16.323 7.308 -16.323 16.323 c 0 4.025 1.463 7.703 3.878 10.549 l 12.445 14.657 l 12.445 -14.657 c 2.415 -2.846 3.878 -6.524 3.878 -10.549 C 89.9 18.932 82.592 11.624 73.577 11.624 z M 73.577 34.098 c -3.707 0 -6.713 -3.006 -6.713 -6.713 c 0 -3.707 3.005 -6.713 6.713 -6.713 c 3.707 0 6.713 3.006 6.713 6.713 C 80.29 31.093 77.285 34.098 73.577 34.098 z" style="stroke: none; stroke-width: 1; stroke-dasharray: none; stroke-linecap: butt; stroke-linejoin: miter; stroke-miterlimit: 10; fill: rgb(240,162,2); fill-rule: nonzero; opacity: 1;" transform=" matrix(1 0 0 1 0 0) " stroke-linecap="round" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

@@ -160,8 +160,8 @@
},
{
"style": "Javascript",
"text": "productPluralVariable[tradingEngine.tradingCurrent.tradingEpisode.candle.index.value-n].propertyName",
"updated": 1624868076284
"text": "productName[tradingEngine.tradingCurrent.tradingEpisode.candle.index.value-n].propertyName",
"updated": 1625193412334
},
{
"style": "Text",
@@ -175,8 +175,8 @@
},
{
"style": "Javascript",
"text": "chart.at01hs.candles[tradingEngine.tradingCurrent.tradingEpisode.candle.index.value-5].max",
"updated": 1624868093927
"text": "chart.at01hs.candle[tradingEngine.tradingCurrent.tradingEpisode.candle.index.value-5].max",
"updated": 1625193408514
},
{
"style": "Text",
@@ -779,6 +779,50 @@ function newFoundationsActionSwitch() {
UI.projects.foundations.functionLibraries.socialBotsFunctions.sendSlackTestMessage(action.node, action.callBackFunction)
}
break
case 'Copy Position':
{
UI.projects.foundations.utilities.clipboard.copyTextToClipboard( action.node.payload.position.x + ';' + action.node.payload.position.y)
action.node.payload.uiObject.setInfoMessage('Position copied')
}
break
case 'Snap to Position':
{
navigator.clipboard.readText()
.then(text => {
//console.log('Pasted content: ', text);
let newPosition = {
x: 0,
y: 0
}
let newVector = {
x: 0,
y: 0
}
let positionArray = text.split(";",2)
newPosition.x = positionArray[0]
newPosition.y = positionArray[1]
if (newPosition.x >= 0 && newPosition.x <= UI.projects.foundations.spaces.floatingSpace.container.frame.width) {
newVector.x = newPosition.x - action.node.payload.position.x
if (newPosition.y >= 0 && newPosition.y <= UI.projects.foundations.spaces.floatingSpace.container.frame.height) {
newVector.y = newPosition.y - action.node.payload.position.y
action.node.payload.floatingObject.container.displace(newVector)
action.node.payload.uiObject.setInfoMessage('Snapped to new position')
}
}
else {
action.node.payload.uiObject.setErrorMessage('[Error]:Failed to read clipboard contents')
}
})
.catch(err => {
console.error('[Error]:Failed to read clipboard contents: ', err);
action.node.payload.uiObject.setErrorMessage('[Error]:Failed to read clipboard contents')
});
}
break
}
}
}
@@ -365,6 +365,38 @@ function newUiObjectConstructor() {
}
)
}
menuItemsInitialValues.push(
{
action: 'Copy Position',
actionFunction: floatingObject.payload.executeAction,
actionProject: 'Foundations',
label: undefined,
visible: true,
//placeholder icon : https://www.iconpacks.net/free-icon/pin-48.html
iconPathOn: 'copy-position',
iconPathOff: 'copy-position',
rawRadius: 12,
targetRadius: 0,
currentRadius: 0,
ring: 2
}
)
menuItemsInitialValues.push(
{
action: 'Snap to Position',
actionFunction: floatingObject.payload.executeAction,
actionProject: 'Foundations',
label: undefined,
visible: true,
//placeholder icon: https://www.iconpacks.net/free-icon/pins-53.html
iconPathOn: 'snap-position',
iconPathOff: 'snap-position',
rawRadius: 12,
targetRadius: 0,
currentRadius: 0,
ring: 2
}
)
menuItemsInitialValues.push(
{
action: 'Parent Detach',