Tutorials Auto Starts

This commit is contained in:
Luis Fernando Molina committed 2020-09-21 13:23:46 +02:00
1 parent f1b49fbe04
commit 51d81286cf
13 files changed
+65 -21

No files matched your search

@@ -0,0 +1,4 @@
/*!
* Font Awesome 4.7.0 by @davegandy - http://fontawesome.io - @fontawesome
* License - http://fontawesome.io/license (Font: SIL OFL 1.1, CSS: MIT License)
*/@font-face{font-family:'FontAwesome';src:url('../Fonts/fontawesome-webfont.eot?v=4.7.0');src:url('../Fonts/fontawesome-webfont.eot?#iefix&v=4.7.0') format('embedded-opentype'),url('../Fonts/fontawesome-webfont.woff2?v=4.7.0') format('woff2'),url('../Fonts/fontawesome-webfont.woff?v=4.7.0') format('woff'),url('../Fonts/fontawesome-webfont.ttf?v=4.7.0') format('truetype'),url('../Fonts/fontawesome-webfont.svg?v=4.7.0#fontawesomeregular') format('svg');font-weight:normal;font-style:normal}.fa{display:inline-block;font:normal normal normal 14px/1 FontAwesome;font-size:inherit;text-rendering:auto;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.fa-lg{font-size:1.33333333em;line-height:.75em;vertical-align:-15%}.fa-2x{font-size:2em}.fa-3x{font-size:3em}.fa-4x{font-size:4em}.fa-5x{font-size:5em}.fa-fw{width:1.28571429em;text-align:center}.fa-ul{padding-left:0;margin-left:2.14285714em;list-style-type:none}.fa-ul>li{position:relative}.fa-li{position:absolute;left:-2.14285714em;width:2.14285714em;top:.14285714em;text-align:center}.fa-li.fa-lg{left:-1.85714286em}.fa-border{padding:.2em .25em .15em;border:solid .08em #eee;border-radius:.1em}.fa-pull-left{float:left}.fa-pull-right{float:right}.fa.fa-pull-left{margin-right:.3em}.fa.fa-pull-right{margin-left:.3em}.pull-right{float:right}.pull-left{float:left}.fa.pull-left{margin-right:.3em}.fa.pull-right{margin-left:.3em}.fa-spin{-webkit-animation:fa-spin 2s infinite linear;animation:fa-spin 2s infinite linear}.fa-pulse{-webkit-animation:fa-spin 1s infinite steps(8);animation:fa-spin 1s infinite steps(8)}@-webkit-keyframes fa-spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}100%{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}@keyframes fa-spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}100%{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}.fa-rotate-90{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=1)";-webkit-transform:rotate(90deg);-ms-transform:rotate(90deg);transform:rotate(90deg)}.fa-rotate-180{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=2)";-webkit-transform:rotate(180deg);-ms-transform:rotate(180deg);transform:rotate(180deg)}.fa-rotate-270{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=3)";-webkit-transform:rotate(270deg);-ms-transform:rotate(270deg);transform:rotate(270deg)}.fa-flip-horizontal{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=0, mirror=1)";-webkit-transform:scale(-1, 1);-ms-transform:scale(-1, 1);transform:scale(-1, 1)}.fa-flip-vertical{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=2, mirror=1)";-webkit-transform:scale(1, -1);-ms-transform:scale(1, -1);transform:scale(1, -1)}:root .fa-rotate-90,:root .fa-rotate-180,:root .fa-rotate-270,:root .fa-flip-horizontal,:root .fa-flip-vertical{filter:none}.fa-stack{position:relative;display:inline-block;width:2em;height:2em;line-height:2em;vertical-align:middle}.fa-stack-1x,.fa-stack-2x{position:absolute;left:0;width:100%;text-align:center}.fa-stack-1x{line-height:inherit}.fa-stack-2x{font-size:2em}.fa-inverse{color:#fff}.fa-glass:before{content:"\f000"}.fa-music:before{content:"\f001"}.fa-search:before{content:"\f002"}.fa-envelope-o:before{content:"\f003"}.fa-heart:before{content:"\f004"}.fa-star:before{content:"\f005"}.fa-star-o:before{content:"\f006"}.fa-user:before{content:"\f007"}.fa-film:before{content:"\f008"}.fa-th-large:before{content:"\f009"}.fa-th:before{content:"\f00a"}.fa-th-list:before{content:"\f00b"}.fa-check:before{content:"\f00c"}.fa-remove:before,.fa-close:before,.fa-times:before{content:"\f00d"}.fa-search-plus:before{content:"\f00e"}.fa-search-minus:before{content:"\f010"}.fa-power-off:before{content:"\f011"}.fa-signal:before{content:"\f012"}.fa-gear:before,.fa-cog:before{content:"\f013"}.fa-trash-o:before{content:"\f014"}.fa-home:before{content:"\f015"}.fa-file-o:before{content:"\f016"}.fa-clock-o:before{content:"\f017"}.fa-road:before{content:"\f018"}.fa-download:before{content:"\f019"}.fa-arrow-circle-o-down:before{content:"\f01a"}.fa-arrow-circle-o-up:before{content:"\f01b"}.fa-inbox:before{content:"\f01c"}.fa-play-circle-o:before{content:"\f01d"}.fa-rotate-right:before,.fa-repeat:before{content:"\f01e"}.fa-refresh:before{content:"\f021"}.fa-list-alt:before{content:"\f022"}.fa-lock:before{content:"\f023"}.fa-flag:before{content:"\f024"}.fa-headphones:before{content:"\f025"}.fa-volume-off:before{content:"\f026"}.fa-volume-down:before{content:"\f027"}.fa-volume-up:before{content:"\f028"}.fa-qrcode:before{content:"\f029"}.fa-barcode:before{content:"\f02a"}.fa-tag:before{content:"\f02b"}.fa-tags:before{content:"\f02c"}.fa-book:before{content:"\f02d"}.fa-bookmark:before{content:"\f02e"}.fa-print:before{content:"\f02f"}.fa-camera:before{content:"\f030"}.fa-font:before{content:"\f031"}.fa-bold:before{content:"\f032"}.fa-italic:before{content:"\f033"}.fa-text-height:before{content:"\f034"}.fa-text-width:before{content:"\f03Line truncated
+12 -10
View File
@@ -5,6 +5,7 @@
<title>Superalgos</title>
<meta name="description" content="Free and Open Source Crypto Trading Tools">
<link rel="stylesheet" href="main.css" type="text/css" charset="utf-8" />
<link rel="stylesheet" href="font-awasome.css" type="text/css" />
<link rel="shortcut icon" type="image/png/ico" href="Images/favicon.ico" />
<script type="text/javascript" src="WebServer/require.js"></script>
<script type="text/javascript" src="WebServer/AppPreLoader.js"></script>
@@ -12,8 +13,6 @@
<!-- Documentation Style Sheets -->
<!-- -->
<link rel="stylesheet" type="text/css"
href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">
<script type="text/javascript">
function loadCanvas() {
@@ -43,7 +42,7 @@
<div id="canvasApp"></div>
<div id="docApp" style="position:fixed; top:100000px; left:100000px">
<iframe id="docIFrame" style="border:none; " height="2000" src="https://julian-molina.github.io/Documentation/"
width="900" ></iframe>
width="900"></iframe>
</div> <!-- -->
<div id="textAreaDiv"></div>
<div id="inputDiv" style="font-family:saira condensed;">&nbsp;</div>
@@ -54,18 +53,21 @@
<form>
<table class="tutorial-buttonsTable">
<tr>
<td>
<label class="tutorial-font-small tutorial-stop-button" onclick="canvas.tutorialSpace.stop()" value="">Stop Tutorial</label>
<td align = "center">
<label class="tutorial-font-small tutorial-stop-button" onclick="canvas.tutorialSpace.stop()"
value="">Stop</label>
</td>
<td>
<label class="tutorial-font-small tutorial-skip-button" onclick="canvas.tutorialSpace.skip()" value="">Skip / Later</label>
<td align = "center">
<label class="tutorial-font-small tutorial-skip-button" onclick="canvas.tutorialSpace.skip()"
value="">Skip</label>
</td>
<td>
<label class="tutorial-font-small tutorial-done-button" onclick="canvas.tutorialSpace.done()" value="">Done / Next</label>
<td align = "center">
<label class="tutorial-font-small tutorial-done-button" onclick="canvas.tutorialSpace.done()"
value="">Next</label>
</td>
</tr>
</table>
</form>
</form>
</div>
</body>
+5 -5
View File
@@ -34,7 +34,7 @@
.tutorial-form {
padding: 15px;
margin-bottom: 20px;
width: 105%;
width: 100%;
}
.tutorial-summary {
@@ -193,7 +193,7 @@
border-radius: 4px;
margin: 20px 0;
border-top-color: #e4b9c0;
width: 20%;
min-width: 100px;
}
.tutorial-skip-button {
@@ -205,7 +205,7 @@
border-radius: 4px;
margin: 20px 0;
border-top-color: #f7e1b5;
width: 20%;
min-width: 100px;
}
.tutorial-done-button {
@@ -217,7 +217,7 @@
border-radius: 4px;
margin: 20px 0;
border-top-color: #c9e2b3;
width: 20%;
min-width: 100px;
}
.tutorial-buttonsTable {
@@ -227,5 +227,5 @@
border: solid 0px;
vertical-align: middle;
min-width: 100px;
width: 105%;
width: 100%;
}
+10 -4
View File
@@ -692,7 +692,13 @@ exports.newWebServer = function newWebServer(EVENTS_SERVER) {
case 'main.css':
{
mainCSS()
sendStyleSheet('main.css')
}
break
case 'font-awasome.css':
{
sendStyleSheet('font-awasome.css')
}
break
@@ -702,11 +708,11 @@ exports.newWebServer = function newWebServer(EVENTS_SERVER) {
}
}
function mainCSS() {
function sendStyleSheet(fileName) {
let fs = require('fs')
try {
let fileName = process.env.PATH_TO_WEB_SERVER + 'WebServer/main.css'
fs.readFile(fileName, onFileRead)
let filePath = process.env.PATH_TO_WEB_SERVER + 'WebServer/' + fileName
fs.readFile(filePath, onFileRead)
function onFileRead(err, file) {
try {
@@ -152,6 +152,7 @@ function newNodeCloning() {
arrangementStyle: (node.payload.floatingObject.arrangementStyle)
},
uiObject: {
isPlaying: node.payload.uiObject.isPlaying,
isRunning: node.payload.uiObject.isRunning,
shortcutKey: node.payload.uiObject.shortcutKey
}
@@ -162,6 +162,7 @@ function newProtocolNode() {
arrangementStyle: (node.payload.floatingObject.arrangementStyle)
},
uiObject: {
isPlaying: node.payload.uiObject.isPlaying,
isRunning: node.payload.uiObject.isRunning,
shortcutKey: node.payload.uiObject.shortcutKey
}
@@ -2,6 +2,7 @@ function newUiObjectsFromNodes() {
thisObject = {
runTasks: runTasks,
runSessions: runSessions,
playTutorials: playTutorials,
recreateWorkspace: recreateWorkspace,
getNodeById: getNodeById,
tryToConnectChildrenWithReferenceParents: tryToConnectChildrenWithReferenceParents,
@@ -14,6 +15,7 @@ function newUiObjectsFromNodes() {
let mapOfNodes
let tasksToRun
let sessionsToRun
let tutorialsToPlay
return thisObject
@@ -25,6 +27,7 @@ function newUiObjectsFromNodes() {
mapOfNodes = new Map()
tasksToRun = []
sessionsToRun = []
tutorialsToPlay = []
removeNullRootNodes()
@@ -163,6 +166,14 @@ function newUiObjectsFromNodes() {
sessionsToRun = undefined
}
function playTutorials() {
for (let i = 0; i < tutorialsToPlay.length; i++) {
let node = tutorialsToPlay[i]
node.payload.uiObject.menu.internalClick('Play Tutorial')
}
tutorialsToPlay = undefined
}
function tryToConnectChildrenWithReferenceParents() {
/* We reconstruct here the reference relationships. */
for (const [key, node] of mapOfNodes) {
@@ -637,5 +648,16 @@ function newUiObjectsFromNodes() {
}
}
}
/* Check if there are tutorials to play */
if (userAddingNew === false && node.savedPayload !== undefined) {
if (uiObjectType === 'Tutorial') {
if (node.savedPayload.uiObject.isPlaying === true) {
if (tutorialsToPlay !== undefined) { // it might be undefined when you are spawning a tutorial that was playing while backed up
tutorialsToPlay.push(node)
}
}
}
}
}
}
+6 -2
View File
@@ -140,10 +140,14 @@ function newWorkspace() {
setTimeout(functionLibraryUiObjectsFromNodes.runTasks, 70000)
// We give a few seconds for the tasks to start
setTimeout(functionLibraryUiObjectsFromNodes.runSessions, 80000)
// We give a few seconds
setTimeout(functionLibraryUiObjectsFromNodes.playTutorials, 3000)
} else {
functionLibraryUiObjectsFromNodes.runTasks()
// We give a few seconds for the tasks to start
setTimeout(functionLibraryUiObjectsFromNodes.runSessions, 10000)
// We give a few seconds
setTimeout(functionLibraryUiObjectsFromNodes.playTutorials, 1000)
}
}
@@ -412,7 +416,7 @@ function newWorkspace() {
function replaceWorkspaceByLoadingOne(name) {
let webCommand
let webCommand
if (name.indexOf('Included -> ') >= 0) {
name = name.replace('Included -> ', '')
webCommand = 'LoadIncludedWorkspace'
@@ -420,7 +424,7 @@ function newWorkspace() {
webCommand = 'LoadWorkspace'
}
let blobService = newFileStorage()
let blobService = newFileStorage()
blobService.getFileFromHost(webCommand + '/' + name, onFileReceived, true)
function onFileReceived(err, text, response) {
if (err && err.result !== GLOBAL.DEFAULT_OK_RESPONSE.result) {
+1
View File
@@ -21,6 +21,7 @@ function newUiObject() {
uiObjectTitle: undefined,
circularProgressBar: undefined,
isRunning: undefined,
isPlaying: undefined,
shortcutKey: undefined,
isShowing: undefined,
hasError: undefined,
+3
View File
@@ -300,6 +300,7 @@ function newTutorialSpace() {
}
function playTutorial(node) {
node.payload.uiObject.isPlaying = true
tutorialRootNode = node
currentNode = node
currentStatus = 'Playing Tutorial'
@@ -307,6 +308,7 @@ function newTutorialSpace() {
}
function resumeTutorial(node) {
node.payload.uiObject.isPlaying = true
tutorialRootNode = node
currentNode = node
currentStatus = 'Playing Tutorial'
@@ -315,6 +317,7 @@ function newTutorialSpace() {
}
function stop() {
tutorialRootNode.payload.uiObject.isPlaying = false
tutorialRootNode = undefined
currentStatus = 'Stopped'
}