From 8d29849bdc7d896c205cd64af0bcf4943569327b Mon Sep 17 00:00:00 2001 From: Luis Fernando Molina Date: Mon, 18 Jan 2021 10:07:50 +0100 Subject: [PATCH 1/3] function processStopped() standarized --- .../Bot-Modules/Sensor-Bot/SingleMarketSensorBot.js | 12 +++++++++++- .../Trading-Bot/SingleMarketTradingBot.js | 12 +++++++++++- .../TS/Function-Libraries/NodeJSFunctions.js | 10 +++++++++- .../TS/Function-Libraries/TaskFunctions.js | 5 +++-- 4 files changed, 34 insertions(+), 5 deletions(-) diff --git a/Projects/Superalgos/TS/Bot-Modules/Sensor-Bot/SingleMarketSensorBot.js b/Projects/Superalgos/TS/Bot-Modules/Sensor-Bot/SingleMarketSensorBot.js index 94f9a7845..cfa60ada6 100644 --- a/Projects/Superalgos/TS/Bot-Modules/Sensor-Bot/SingleMarketSensorBot.js +++ b/Projects/Superalgos/TS/Bot-Modules/Sensor-Bot/SingleMarketSensorBot.js @@ -551,7 +551,17 @@ function processStopped() { if (TS.projects.superalgos.globals.taskVariables.FATAL_ERROR_MESSAGE !== undefined) { - TS.projects.superalgos.functionLibraries.processFunctions.processError(TS.projects.superalgos.globals.processVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).PROCESS_KEY, undefined, "An unexpected error caused the Process to stop.") + TS.projects.superalgos.functionLibraries.processFunctions.processError + ( + TS.projects.superalgos.globals.processVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).PROCESS_KEY, + undefined, + "An unexpected error caused the Process to stop.", + { + project: 'Superalgos', + category: 'Topic', + type: 'TS Process Error - Unexpected Error' + } + ) } else { TS.projects.superalgos.globals.taskConstants.EVENT_SERVER_CLIENT_MODULE_OBJECT.raiseEvent(TS.projects.superalgos.globals.processVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).PROCESS_KEY, 'Stopped') } diff --git a/Projects/Superalgos/TS/Bot-Modules/Trading-Bot/SingleMarketTradingBot.js b/Projects/Superalgos/TS/Bot-Modules/Trading-Bot/SingleMarketTradingBot.js index 3b9fd15bf..372b0967c 100644 --- a/Projects/Superalgos/TS/Bot-Modules/Trading-Bot/SingleMarketTradingBot.js +++ b/Projects/Superalgos/TS/Bot-Modules/Trading-Bot/SingleMarketTradingBot.js @@ -681,7 +681,17 @@ function processStopped() { if (TS.projects.superalgos.globals.taskVariables.FATAL_ERROR_MESSAGE !== undefined) { - TS.projects.superalgos.functionLibraries.processFunctions.processError(TS.projects.superalgos.globals.processVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).PROCESS_KEY, undefined, "An unexpected error caused the Process to stop.") + TS.projects.superalgos.functionLibraries.processFunctions.processError + ( + TS.projects.superalgos.globals.processVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).PROCESS_KEY, + undefined, + "An unexpected error caused the Process to stop.", + { + project: 'Superalgos', + category: 'Topic', + type: 'TS Process Error - Unexpected Error' + } + ) } else { TS.projects.superalgos.globals.taskConstants.EVENT_SERVER_CLIENT_MODULE_OBJECT.raiseEvent(TS.projects.superalgos.globals.processVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).PROCESS_KEY, 'Stopped') } diff --git a/Projects/Superalgos/TS/Function-Libraries/NodeJSFunctions.js b/Projects/Superalgos/TS/Function-Libraries/NodeJSFunctions.js index fdf919982..4648486e2 100644 --- a/Projects/Superalgos/TS/Function-Libraries/NodeJSFunctions.js +++ b/Projects/Superalgos/TS/Function-Libraries/NodeJSFunctions.js @@ -10,7 +10,15 @@ exports.newSuperalgosFunctionLibrariesNodeJSFunctions = function () { function exitProcess() { if (TS.projects.superalgos.globals.taskVariables.FATAL_ERROR_MESSAGE !== undefined) { - TS.projects.superalgos.functionLibraries.taskFunctions.taskError(undefined, "An unexpected error caused the Task to stop. " + TS.projects.superalgos.globals.taskVariables.FATAL_ERROR_MESSAGE) + TS.projects.superalgos.functionLibraries.taskFunctions.taskError( + undefined, + "An unexpected error caused the Task to stop. " + TS.projects.superalgos.globals.taskVariables.FATAL_ERROR_MESSAGE, + { + project: 'Superalgos', + category: 'Topic', + type: 'TS Task Error - Unexpected Error' + } + ) } if (isNodeJsProcessShuttingDown === true) { return } diff --git a/Projects/Superalgos/TS/Function-Libraries/TaskFunctions.js b/Projects/Superalgos/TS/Function-Libraries/TaskFunctions.js index d431bc7bb..6fd9cdabb 100644 --- a/Projects/Superalgos/TS/Function-Libraries/TaskFunctions.js +++ b/Projects/Superalgos/TS/Function-Libraries/TaskFunctions.js @@ -7,14 +7,15 @@ exports.newSuperalgosFunctionLibrariesTaskFunctions = function () { return thisObject - function taskError(node, errorMessage) { + function taskError(node, errorMessage, docs) { let event if (node !== undefined) { event = { nodeName: node.name, nodeType: node.type, nodeId: node.id, - errorMessage: errorMessage + errorMessage: errorMessage, + docs: docs } } else { event = { From f9461ee29b1dc06923d011e6208deb91c34ba521 Mon Sep 17 00:00:00 2001 From: Luis Fernando Molina Date: Mon, 18 Jan 2021 10:53:08 +0100 Subject: [PATCH 2/3] Placeholder implementation part 1 --- Client/WebServer/css/docs.css | 443 +++++++++--------- Client/WebServer/index.html | 58 +-- ...aph-styles-025-docs-placeholder-style.json | 38 ++ .../UI/Spaces/Docs-Space/ContextMenu.js | 10 + .../UI/Spaces/Docs-Space/DocumentPage.js | 8 + .../UI/Spaces/Docs-Space/SearchResultsPage.js | 4 + 6 files changed, 311 insertions(+), 250 deletions(-) create mode 100644 Projects/Superalgos/Schemas/Docs-Topics/docs-paragraph-styles-025-docs-placeholder-style.json diff --git a/Client/WebServer/css/docs.css b/Client/WebServer/css/docs.css index 8e4d568a3..3c378553e 100644 --- a/Client/WebServer/css/docs.css +++ b/Client/WebServer/css/docs.css @@ -43,9 +43,9 @@ margin: 20 20 20 30px; */ #docs-common-style-container-div ul { - padding: 0px; - margin-left: 35px; - list-style-position: outside; +padding: 0px; +margin-left: 35px; +list-style-position: outside; } .docs-font-normal { @@ -70,8 +70,8 @@ margin-right: 20px; } .docs-table-cell{ - display: table-cell; - width: 100%; +display: table-cell; +width: 100%; } .docs-definition-table { @@ -93,9 +93,9 @@ margin-right: 20px; } .docs-definition-text { - display: table-cell; - vertical-align: middle; - padding: 0 20px; +display: table-cell; +vertical-align: middle; +padding: 0 20px; } .docs-image-container { @@ -179,18 +179,18 @@ opacity: 1; /* Headings */ .docs-h1 { - font-size:210%; - margin-top: 40px; - padding-bottom: 5px; +font-size:210%; +margin-top: 40px; +padding-bottom: 5px; } .docs-h2 { - font-weight:700; - font-size:170%; - line-height: 170%; - margin-top: 30px; - padding-bottom: 5px; - overflow:hidden; +font-weight:700; +font-size:170%; +line-height: 170%; +margin-top: 30px; +padding-bottom: 5px; +overflow:hidden; } .docs-h2::after{ @@ -203,18 +203,18 @@ margin-left: 20px; } .docs-h3 { - font-weight:500; - font-size:150%; - margin-top: 40px; - margin-bottom: 20px; +font-weight:500; +font-size:150%; +margin-top: 40px; +margin-bottom: 20px; } .docs-h4 { - font-weight:400; - font-style: italic; - font-size:135%; - margin-top: 30px; - margin-bottom: 20px; +font-weight:400; +font-style: italic; +font-size:135%; +margin-top: 30px; +margin-bottom: 20px; } /* DELETE candidate @@ -300,7 +300,7 @@ box-sizing: border-box; } .docs-callout { - background-color:white; +background-color:white; padding: 20px; margin: 20px 0; border: 1px solid rgba(54, 85, 88, .3); @@ -325,33 +325,33 @@ box-sizing: border-box; } .docs-topic-index h2 { - font-size: 130%; - font-weight: 300; - margin: 10px 0 35 -5; - padding: 0px; +font-size: 130%; +font-weight: 300; +margin: 10px 0 35 -5; +padding: 0px; } .docs-topic-index h3 { - font-size: 150%; - font-weight: 300; - margin: 25px 0; - padding: 0px; +font-size: 150%; +font-weight: 300; +margin: 25px 0; +padding: 0px; } .docs-topic-index p { - font-size: 100%; - padding: 0px; - margin: 2px 0; +font-size: 100%; +padding: 0px; +margin: 2px 0; } .docs-topic-index a { - color: #365558; +color: #365558; } .docs-topic-index a:hover { - text-decoration: underline; - cursor: pointer; - color: #0295aa; +text-decoration: underline; +cursor: pointer; +color: #0295aa; } .docs-summary { @@ -425,89 +425,89 @@ width: 100%; /* Topic Navigation */ .docs-topic-navigation { - display: table; - width: 100%; - vertical-align: middle; - margin: 80px 0 0 0; - /* - border-top: 1px solid rgba(54, 85, 88, .3); - margin: 60px 0 0 0; - padding-top: 20px; - */ +display: table; +width: 100%; +vertical-align: middle; +margin: 80px 0 0 0; +/* +border-top: 1px solid rgba(54, 85, 88, .3); +margin: 60px 0 0 0; +padding-top: 20px; +*/ } .docs-topic-navigation div { - display: table-cell; - width: 50%; - max-width: 50%; - text-align: center; - vertical-align: top; - padding: 10px; - /* - height: 40px; - */ +display: table-cell; +width: 50%; +max-width: 50%; +text-align: center; +vertical-align: top; +padding: 10px; +/* +height: 40px; +*/ } .docs-topic-navigation div button{ - border-radius: 50px; - border: 0px; - color: #e6eaea; - background-color: #365558; - padding: 10px; - margin: 0 0 10 10px; - font-size: 100%; - line-height: 150%; - width: 150px; - height:100%; +border-radius: 50px; +border: 0px; +color: #e6eaea; +background-color: #365558; +padding: 10px; +margin: 0 0 10 10px; +font-size: 100%; +line-height: 150%; +width: 150px; +height:100%; } .docs-topic-navigation div button:hover { - background-color: #0295aa; - cursor: pointer; +background-color: #0295aa; +cursor: pointer; } /* Footer */ .docs-node-html-footer-table { - display: table; - width: 100%; - border-collapse: separate; - border-spacing: 6px; - } +display: table; +width: 100%; +border-collapse: separate; +border-spacing: 6px; +} .docs-footer-row { - display: table-row; +display: table-row; } .docs-footer-cell { - padding: 5px 15px 0px 30px; - display: table-cell; - width: 33%; +padding: 5px 15px 0px 30px; +display: table-cell; +width: 33%; } #docs-footer h3 { - font-size: 180%; - font-weight: 300; - padding: 10px 0 0 0; - } +font-size: 180%; +font-weight: 300; +padding: 10px 0 0 0; +} #docs-footer h4 { - font-size: 120%; - font-weight: 300; - } +font-size: 120%; +font-weight: 300; +} - #docs-footer button{ - border: 1px outset #e6eaea; - border-radius: 20px; - background-color: transparent; - color: e6eaea; - padding: 10px; - margin: 0 0 0 10px; +#docs-footer button{ +border: 1px outset #e6eaea; +border-radius: 20px; +background-color: transparent; +color: e6eaea; +padding: 10px; +margin: 0 0 0 10px; } #docs-footer button:hover { - border: 1px inset #e6eaea; - cursor: pointer; +border: 1px inset #e6eaea; +cursor: pointer; } #docs-footer a:hover { @@ -561,9 +561,6 @@ text-decoration: none; padding-left: 3px; } - - - /* Tags */ kbd.docs-kbd { @@ -618,27 +615,27 @@ box-sizing: border-box; } .docs-collapsible-element img { - vertical-align: middle; - display: inline-block; - margin: 0 20px 0 0; - width: 40px; - height: 40px; - } +vertical-align: middle; +display: inline-block; +margin: 0 20px 0 0; +width: 40px; +height: 40px; +} /* This definition is redundant with .docs-collapsible-element img but affects some images. Investigation required to delete it.*/ - .docs-collapsible-image { - vertical-align: middle; - display: inline-block; - margin: 0 20px 0 0; - width: 40px; - height: 40px; - } +.docs-collapsible-image { +vertical-align: middle; +display: inline-block; +margin: 0 20px 0 0; +width: 40px; +height: 40px; +} /* Add a background color to the button if it is clicked on (add the .active class with JS), and when you move the mouse over it (hover) */ .active, .docs-collapsible-element:hover { - border: 1px solid #0295aa; - background-color: #eff; +border: 1px solid #0295aa; +background-color: #eff; } /* Style the docs-collapsible-element content. Note: hidden by default */ @@ -674,7 +671,7 @@ content: "\2796"; /* Unicode character for "minus" sign (-) */ /* This is the same Style as the collapsible counter part but will not hold any collapsed content inside. */ .docs-non-collapsible-element { - /* +/* background-color: #fdfdfd; color: #444; padding: 15px; @@ -795,7 +792,7 @@ background-color: transparent; /* Search Results Page Header*/ .docs-search-results-header { - display: table; +display: table; } .docs-image-logo-search-results { @@ -803,7 +800,7 @@ vertical-align: middle; display: table-cell; padding-right: 25px; } - + .docs-search-results-box { height: 45px; border-radius: 30px; @@ -815,34 +812,34 @@ width: 100%; } .docs-search-results-header-tabs-container { - display: table; - padding-left: 180px; - margin-top: 20px; +display: table; +padding-left: 180px; +margin-top: 20px; } .docs-search-results-header-tabs-container > input { - display: none; +display: none; } .docs-search-results-header-tabs-container > label { - display: inline-block; - vertical-align: bottom; - padding: 0 15px 3px 15px; - color: #365558; - font-size: 90%; +display: inline-block; +vertical-align: bottom; +padding: 0 15px 3px 15px; +color: #365558; +font-size: 90%; } .docs-search-results-header-tabs-container > label:hover { - color: #0295aa; - padding-bottom: 3px; - cursor: pointer; +color: #0295aa; +padding-bottom: 3px; +cursor: pointer; } .docs-search-results-header-tabs-container > input:checked + label { - color: #0295aa; - padding-bottom: 2px; - border-bottom: 3px solid #0295aa; +color: #0295aa; +padding-bottom: 2px; +border-bottom: 3px solid #0295aa; } /* Search Results Page Content */ @@ -852,7 +849,7 @@ margin-left: -180px; } .docs-search-result-content > div { - display: none; +display: none; } #tab1:checked ~ .docs-search-result-content #content1, @@ -862,69 +859,67 @@ margin-left: -180px; #tab5:checked ~ .docs-search-result-content #content5, #tab6:checked ~ .docs-search-result-content #content6, #tab7:checked ~ .docs-search-result-content #content7 { - display: block; +display: block; } /* Search Results Page Record */ .docs-search-result-content-record-container { - margin: 20px 0; +margin: 20px 0; } .docs-search-result-content-record-container > p { - margin: 1px; +margin: 1px; } .docs-search-result-content-record-project-category { - font-size: 90%; - color: #31708f; +font-size: 90%; +color: #31708f; } .docs-search-result-content-record-project-category-link { - font-size: 90%; - color: #31708f; +font-size: 90%; +color: #31708f; } a:hover.docs-search-result-content-record-project-category-link { - text-decoration: underline; - cursor: pointer; +text-decoration: underline; +cursor: pointer; } .docs-search-result-content-record-title { - font-size: 120%; - font-weight: 500; - text-decoration: none; - color: #e44d40; +font-size: 120%; +font-weight: 500; +text-decoration: none; +color: #e44d40; } a:link.docs-search-result-content-record-title { - text-decoration: none; - color: #e44d40; +text-decoration: none; +color: #e44d40; } - + a:visited.docs-search-result-content-record-title { - text-decoration: none; - color: #fd6a33; +text-decoration: none; +color: #fd6a33; } a:hover.docs-search-result-content-record-title { - text-decoration: underline; - cursor: pointer; +text-decoration: underline; +cursor: pointer; } a:active.docs-search-result-content-record-title { - text-decoration: none; - color: #fd6a33; +text-decoration: none; +color: #fd6a33; } .docs-search-result-content-record-extract { - font-size: 100%; - color: #333; - margin-top: 5px!important; +font-size: 100%; +color: #333; +margin-top: 5px!important; } - - /* Command Results Page Content */ .docs-command-result-content { /* border-top: 1px solid #cdcdcd; DELETE Candidate*/ @@ -938,26 +933,26 @@ color: #31708f; } .docs-hidden-anchor { - border-top: 1px solid #eee; - padding: 0px; - margin: -20px 0px -40px 0; - width: 100%; - text-align: right; - color: transparent; - font-size: 75%; - } - - .docs-hidden-anchor::after{ - content:' \2693'; - color: transparent; - font-size: 130%; - } - - .docs-hidden-anchor:hover::after{ - content:' \2693'; - color: #365558; - font-size: 130%; - } +border-top: 1px solid #eee; +padding: 0px; +margin: -20px 0px -40px 0; +width: 100%; +text-align: right; +color: transparent; +font-size: 75%; +} + +.docs-hidden-anchor::after{ +content:' \2693'; +color: transparent; +font-size: 130%; +} + +.docs-hidden-anchor:hover::after{ +content:' \2693'; +color: #365558; +font-size: 130%; +} .docs-hidden-block { border-top: 1px solid #eee; @@ -982,26 +977,48 @@ font-size: 150%; } .docs-hidden-include { - border-top: 1px solid #eee; - padding: 0px; - margin: -5px 0px -30px 0; - width: 100%; - text-align: right; - color: transparent; - font-size: 75%; +border-top: 1px solid #eee; +padding: 0px; +margin: -5px 0px -30px 0; +width: 100%; +text-align: right; +color: transparent; +font-size: 75%; } .docs-hidden-include::after{ - content:' \275E'; - color: #e6e6e6; - font-size: 200%; - } +content:' \275E'; +color: #e6e6e6; +font-size: 200%; +} - .docs-hidden-include:hover::after{ - content:' \275E'; - color: #365558; - font-size: 200%; - } +.docs-hidden-include:hover::after{ +content:' \275E'; +color: #365558; +font-size: 200%; +} + +.docs-hidden-placeholder { +border-top: 1px solid #eee; +padding: 0px; +margin: -5px 0px -30px 0; +width: 100%; +text-align: right; +color: transparent; +font-size: 75%; +} + +.docs-hidden-placeholder::after{ +content:' \275E'; +color: #e6e6e6; +font-size: 200%; +} + +.docs-hidden-placeholder:hover::after{ +content:' \275E'; +color: #365558; +font-size: 200%; +} /* Hierarchy Table */ .docs-hierarchy-table { @@ -1032,32 +1049,16 @@ color: #31708f; } .docs-chapter { - border-top: 1px solid #eee; - padding: 0px; - margin: -5px 0px -30px 0; - width: 100%; - height: 40px; - text-align: right; - color: transparent; - font-size: 75%; +border-top: 1px solid #eee; +padding: 0px; +margin: -5px 0px -30px 0; +width: 100%; +height: 40px; +text-align: right; +color: transparent; +font-size: 75%; } -/* DELETE Candidate -.docs-chapter::after{ - content:' \24b8'; - color: #e6e6e6; - font-size: 150%; - position: relative; - top: -15px; - } -.docs-chapter:hover::after{ -content:' \1f152'; -color: #365558; -font-size: 150%; -position: relative; -top: -15px; -} -*/ .docs-youtube-video-container{ background-color: white; box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19); diff --git a/Client/WebServer/index.html b/Client/WebServer/index.html index b7d9789ef..b5f2ff818 100644 --- a/Client/WebServer/index.html +++ b/Client/WebServer/index.html @@ -109,94 +109,94 @@ ' // Clickeable Container Ends - - if (UI.projects.superalgos.spaces.docsSpace.currentDocumentBeingRendered.category === 'Topic') { - - orderedTopicPageIndexArray = UI.projects.superalgos.utilities.docs.buildOrderedPageIndex( - UI.projects.superalgos.spaces.docsSpace.currentDocumentBeingRendered.project, - 'Topic', - thisObject.docsSchemaDocument.topic - ) - - /* Topic Title - - titleLabel = thisObject.docsSchemaDocument.topic + ' Topic Navigation' - HTML = HTML + '

' + titleLabel + '

' - - */ - generateTopicPreviousAndNextPageNavigation() - - HTML = HTML + '
' // Container for Topic Navigation including buttons, title and index - - HTML = HTML + '

' + thisObject.docsSchemaDocument.topic + ' — TOC

' - - HTML = HTML + '

You just read page ' + thisObject.docsSchemaDocument.pageNumber + ' in the topic.

' - - generateTopicMultiPageIndex() - - HTML = HTML + '
' // END Container for Topic Navigation - } - - if (UI.projects.superalgos.spaces.docsSpace.currentDocumentBeingRendered.category === 'Tutorial') { - - orderedTutorialPageIndexArray = UI.projects.superalgos.utilities.docs.buildOrderedPageIndex( - UI.projects.superalgos.spaces.docsSpace.currentDocumentBeingRendered.project, - 'Tutorial', - thisObject.docsSchemaDocument.tutorial - ) - - /* Tutorial Title - titleLabel = thisObject.docsSchemaDocument.tutorial + ' Tutorial Navigation' - HTML = HTML + '

' + titleLabel + '

' - */ - - generateTutorialPreviousAndNextPageNavigation() - - HTML = HTML + '
' // Container for Tutorial Navigation including buttons, title and index - - HTML = HTML + '

' + thisObject.docsSchemaDocument.tutorial + ' — TOC

' - - HTML = HTML + '

You just did step ' + thisObject.docsSchemaDocument.pageNumber + ' in the tutorial.

' - - generateTutorialMultiPageIndex() - - HTML = HTML + '
' // END Container for Tutorial Navigation - } - - if (UI.projects.superalgos.spaces.docsSpace.currentDocumentBeingRendered.category === 'Review') { - - orderedReviewPageIndexArray = UI.projects.superalgos.utilities.docs.buildOrderedPageIndex( - UI.projects.superalgos.spaces.docsSpace.currentDocumentBeingRendered.project, - 'Review', - thisObject.docsSchemaDocument.review - ) - - /* Review Title - titleLabel = thisObject.docsSchemaDocument.review + ' Review Navigation' - HTML = HTML + '

' + titleLabel + '

' - */ - - generateReviewPreviousAndNextPageNavigation() - - HTML = HTML + '
' // Container for Review Navigation including buttons, title and index - - HTML = HTML + '

' + thisObject.docsSchemaDocument.review + ' — TOC

' - - HTML = HTML + '

You just read page ' + thisObject.docsSchemaDocument.pageNumber + ' of this review collection.

' - - generateReviewMultiPageIndex() - - HTML = HTML + '
' // END Container for Review Navigation - } + generateNavigationAndTableOfContents() HTML = HTML + '' // Common Style Container Ends @@ -267,6 +189,87 @@ function newSuperalgosDocsDocumentPage() { */ addImages() + function generateNavigationAndTableOfContents() { + if (UI.projects.superalgos.spaces.docsSpace.currentDocumentBeingRendered.category === 'Topic') { + + orderedTopicPageIndexArray = UI.projects.superalgos.utilities.docs.buildOrderedPageIndex( + UI.projects.superalgos.spaces.docsSpace.currentDocumentBeingRendered.project, + 'Topic', + thisObject.docsSchemaDocument.topic + ) + + /* Topic Title + + titleLabel = thisObject.docsSchemaDocument.topic + ' Topic Navigation' + HTML = HTML + '

' + titleLabel + '

' + + */ + generateTopicPreviousAndNextPageNavigation() + + HTML = HTML + '
' // Container for Topic Navigation including buttons, title and index + + HTML = HTML + '

' + thisObject.docsSchemaDocument.topic + ' — TOC

' + + HTML = HTML + '

You just read page ' + thisObject.docsSchemaDocument.pageNumber + ' in the topic.

' + + generateTopicMultiPageIndex() + + HTML = HTML + '
' // END Container for Topic Navigation + } + + if (UI.projects.superalgos.spaces.docsSpace.currentDocumentBeingRendered.category === 'Tutorial') { + + orderedTutorialPageIndexArray = UI.projects.superalgos.utilities.docs.buildOrderedPageIndex( + UI.projects.superalgos.spaces.docsSpace.currentDocumentBeingRendered.project, + 'Tutorial', + thisObject.docsSchemaDocument.tutorial + ) + + /* Tutorial Title + titleLabel = thisObject.docsSchemaDocument.tutorial + ' Tutorial Navigation' + HTML = HTML + '

' + titleLabel + '

' + */ + + generateTutorialPreviousAndNextPageNavigation() + + HTML = HTML + '
' // Container for Tutorial Navigation including buttons, title and index + + HTML = HTML + '

' + thisObject.docsSchemaDocument.tutorial + ' — TOC

' + + HTML = HTML + '

You just did step ' + thisObject.docsSchemaDocument.pageNumber + ' in the tutorial.

' + + generateTutorialMultiPageIndex() + + HTML = HTML + '
' // END Container for Tutorial Navigation + } + + if (UI.projects.superalgos.spaces.docsSpace.currentDocumentBeingRendered.category === 'Review') { + + orderedReviewPageIndexArray = UI.projects.superalgos.utilities.docs.buildOrderedPageIndex( + UI.projects.superalgos.spaces.docsSpace.currentDocumentBeingRendered.project, + 'Review', + thisObject.docsSchemaDocument.review + ) + + /* Review Title + titleLabel = thisObject.docsSchemaDocument.review + ' Review Navigation' + HTML = HTML + '

' + titleLabel + '

' + */ + + generateReviewPreviousAndNextPageNavigation() + + HTML = HTML + '
' // Container for Review Navigation including buttons, title and index + + HTML = HTML + '

' + thisObject.docsSchemaDocument.review + ' — TOC

' + + HTML = HTML + '

You just read page ' + thisObject.docsSchemaDocument.pageNumber + ' of this review collection.

' + + generateReviewMultiPageIndex() + + HTML = HTML + '
' // END Container for Review Navigation + } + } + function addDefinitionTable(docsSchemaDocument, idPrefix, category, project, type) { if (docsSchemaDocument.definition === undefined) { docsSchemaDocument.definition = { @@ -290,7 +293,7 @@ function newSuperalgosDocsDocumentPage() { each node will have an icon. For the rest only if we could load an image we use a table, otherwise we will render the definitaion as a Summary. */ - if ((category === 'Topic' || category === 'Tutorial' || category === 'Review' || category === 'Concept' || category === 'Book') && testElement === undefined) { + if ((category === 'Topic' || category === 'Tutorial' || category === 'Review' || category === 'Concept' || category === 'Book') && testElement === undefined) { HTML = HTML + '
Summary: ' + UI.projects.superalgos.utilities.docs.addToolTips(definitionText, UI.projects.superalgos.spaces.docsSpace.currentDocumentBeingRendered.type) + '
' } else { HTML = HTML + '
' @@ -470,6 +473,21 @@ function newSuperalgosDocsDocumentPage() { } break } + case "Placeholder": { + renderParagraph(paragraph, key) + editableParagraphIndex++ + let error = addPlaceholdedParagraph(paragraph.text) + if (error !== undefined) { + paragraph = { + style: "Error", + text: error + } + key = 'error-paragraph-' + autoGeneratedParagraphIndex + renderParagraph(paragraph, key) + autoGeneratedParagraphIndex++ + } + break + } case "Chapter": { renderParagraph(paragraph, key) editableParagraphIndex++ @@ -590,6 +608,32 @@ function newSuperalgosDocsDocumentPage() { } } + function addPlaceholdedParagraph(propertyName) { + if (UI.projects.superalgos.spaces.docsSpace.currentDocumentBeingRendered.placeholder !== undefined) { + let placeholder = UI.projects.superalgos.spaces.docsSpace.currentDocumentBeingRendered.placeholder[propertyName] + + if (placeholder !== undefined) { + let paragraph = { + style: placeholder.style, + text: placeholder.text + } + let key = 'placeholded-paragraph-' + autoGeneratedParagraphIndex + renderParagraph(paragraph, key) + autoGeneratedParagraphIndex++ + return + } else { + let paragraph = { + type: "Json", + text: JSON.stringify(UI.projects.superalgos.spaces.docsSpace.currentDocumentBeingRendered.placeholder, undefined, 4) + } + let key = 'placeholded-paragraph-' + autoGeneratedParagraphIndex + renderParagraph(paragraph, key) + autoGeneratedParagraphIndex++ + return 'Property ' + propertyName + ' not found at the placeholder object.' + } + } + } + function addChapterIndex(chapterText) { let splittedChapterText = chapterText.split('->') let chapterNumber = splittedChapterText[0] diff --git a/Projects/Superalgos/UI/Spaces/Floating-Space/UiObjectMessage.js b/Projects/Superalgos/UI/Spaces/Floating-Space/UiObjectMessage.js index ba10d5505..7f35302d2 100644 --- a/Projects/Superalgos/UI/Spaces/Floating-Space/UiObjectMessage.js +++ b/Projects/Superalgos/UI/Spaces/Floating-Space/UiObjectMessage.js @@ -88,7 +88,9 @@ function newUiObjectMessage() { thisObject.docs.project, thisObject.docs.category, thisObject.docs.type, - thisObject.docs.anchor + thisObject.docs.anchor, + thisObject.docs.nodeId, + thisObject.docs.placeholder ) } }