diff --git a/Projects/Superalgos/Schemas/Docs-Books/how-to-trade-.json b/Projects/Superalgos/Schemas/Docs-Books/how-to-trade-.json
deleted file mode 100644
index c4dff2daf..000000000
--- a/Projects/Superalgos/Schemas/Docs-Books/how-to-trade-.json
+++ /dev/null
@@ -1,16 +0,0 @@
-{
- "type": "How To Trade ",
- "definition": {
- "text": "Write here the summary / definition of this Book."
- },
- "paragraphs": [
- {
- "style": "Text",
- "text": "Left click and Edit to enter edit mode and change this text. ENTER to write new paragraphs. ESC to exit edit mode."
- },
- {
- "style": "Chapter",
- "text": "Superalgos->Docs Styles"
- }
- ]
-}
\ No newline at end of file
diff --git a/Projects/Superalgos/Schemas/Docs-Topics/docs-basics-015-docs-books.json b/Projects/Superalgos/Schemas/Docs-Topics/docs-basics-015-docs-books.json
new file mode 100644
index 000000000..faefe0fda
--- /dev/null
+++ b/Projects/Superalgos/Schemas/Docs-Topics/docs-basics-015-docs-books.json
@@ -0,0 +1,15 @@
+{
+ "topic": "Docs Basics",
+ "pageNumber": "15",
+ "type": "Docs Books",
+ "definition": {
+ "text": "A book is page in the Docs that contains chapters. Chapters points to a Docs Topics and are rendered as the index table of the topic they point to.",
+ "updated": 1609771773385
+ },
+ "paragraphs": [
+ {
+ "style": "Text",
+ "text": "Left click and Edit to enter edit mode and change this text. ENTER to write new paragraphs. ESC to exit edit mode."
+ }
+ ]
+}
\ No newline at end of file
diff --git a/Projects/Superalgos/Schemas/Docs-Topics/docs-basics-015-docs-paragraph-styles.json b/Projects/Superalgos/Schemas/Docs-Topics/docs-basics-016-docs-paragraph-styles.json
similarity index 95%
rename from Projects/Superalgos/Schemas/Docs-Topics/docs-basics-015-docs-paragraph-styles.json
rename to Projects/Superalgos/Schemas/Docs-Topics/docs-basics-016-docs-paragraph-styles.json
index 9e41030ed..f7c9f1087 100644
--- a/Projects/Superalgos/Schemas/Docs-Topics/docs-basics-015-docs-paragraph-styles.json
+++ b/Projects/Superalgos/Schemas/Docs-Topics/docs-basics-016-docs-paragraph-styles.json
@@ -1,6 +1,6 @@
{
"topic": "Docs Basics",
- "pageNumber": "15",
+ "pageNumber": "16",
"type": "Docs Paragraph Styles",
"definition": {
"text": "Each paragraph at a Docs Page, need to be assigend a style. The most commonly used style is the Docs Text Style.",
diff --git a/Projects/Superalgos/Schemas/Docs-Topics/docs-paragraph-styles-024-docs-chapter-style.json b/Projects/Superalgos/Schemas/Docs-Topics/docs-paragraph-styles-024-docs-chapter-style.json
new file mode 100644
index 000000000..c0b79711f
--- /dev/null
+++ b/Projects/Superalgos/Schemas/Docs-Topics/docs-paragraph-styles-024-docs-chapter-style.json
@@ -0,0 +1,15 @@
+{
+ "topic": "Docs Paragraph Styles",
+ "pageNumber": "24",
+ "type": "Docs Chapter Style",
+ "definition": {
+ "text": "This style is used in Docs Books to define a new chapeter for that book. The style renders in the book's page the index of the Docs Topics referenced.",
+ "updated": 1609771567815
+ },
+ "paragraphs": [
+ {
+ "style": "Text",
+ "text": "Left click and Edit to enter edit mode and change this text. ENTER to write new paragraphs. ESC to exit edit mode."
+ }
+ ]
+}
\ No newline at end of file
diff --git a/Projects/Superalgos/UI/Spaces/Docs-Space/DocsSpace.js b/Projects/Superalgos/UI/Spaces/Docs-Space/DocsSpace.js
index 7956e897b..088e66322 100644
--- a/Projects/Superalgos/UI/Spaces/Docs-Space/DocsSpace.js
+++ b/Projects/Superalgos/UI/Spaces/Docs-Space/DocsSpace.js
@@ -11,16 +11,17 @@ function newSuperalgosDocSpace() {
documentPage: undefined,
commandInterface: undefined,
contextMenu: undefined,
- language: undefined,
+ language: undefined,
menuLabelsMap: undefined,
- currentDocumentBeingRendered: undefined,
- previousDocumentBeingRendered: undefined,
+ currentDocumentBeingRendered: undefined,
+ previousDocumentBeingRendered: undefined,
+ currentBookBeingRendered: undefined,
paragraphMap: undefined, // Here we will store a map of paragraphs from the Docs Node, Concept, Topics or Books Schema in order to find it when we need to update them.
textArea: undefined,
- setUpWorkspaceSchemas: setUpWorkspaceSchemas,
+ setUpWorkspaceSchemas: setUpWorkspaceSchemas,
changeLanguage: changeLanguage,
- enterEditMode: enterEditMode,
- exitEditMode: exitEditMode,
+ enterEditMode: enterEditMode,
+ exitEditMode: exitEditMode,
openSpaceAreaAndNavigateTo: openSpaceAreaAndNavigateTo,
navigateTo: navigateTo,
scrollToElement: scrollToElement,
@@ -47,7 +48,7 @@ function newSuperalgosDocSpace() {
let browserResizedEventSubscriptionId
let openingEventSubscriptionId
let closingEventSubscriptionId
-
+
return thisObject
function initialize() {
@@ -70,7 +71,7 @@ function newSuperalgosDocSpace() {
thisObject.searchResultsPage.initialize()
thisObject.documentPage.initialize()
thisObject.footer.initialize()
- thisObject.commandInterface.initialize()
+ thisObject.commandInterface.initialize()
thisObject.contextMenu.initialize()
isInitialized = true
@@ -133,13 +134,13 @@ function newSuperalgosDocSpace() {
thisObject.footer.finalize()
thisObject.commandInterface.finalize()
thisObject.contextMenu.finalize()
-
+
thisObject.searchEngine = undefined
thisObject.mainSearchPage = undefined
thisObject.searchResultsPage = undefined
thisObject.documentPage = undefined
thisObject.footer = undefined
- thisObject.commandInterface = undefined
+ thisObject.commandInterface = undefined
thisObject.contextMenu = undefined
thisObject.currentDocumentBeingRendered = undefined
@@ -281,23 +282,7 @@ function newSuperalgosDocSpace() {
function openSpaceAreaAndNavigateTo(project, category, type, anchor, nodeId) {
- if (UI.projects.superalgos.spaces.docsSpace.currentDocumentBeingRendered !== undefined) {
- UI.projects.superalgos.spaces.docsSpace.previousDocumentBeingRendered = {
- project: UI.projects.superalgos.spaces.docsSpace.currentDocumentBeingRendered.project,
- category: UI.projects.superalgos.spaces.docsSpace.currentDocumentBeingRendered.category,
- type: UI.projects.superalgos.spaces.docsSpace.currentDocumentBeingRendered.type,
- anchor: UI.projects.superalgos.spaces.docsSpace.currentDocumentBeingRendered.anchor,
- nodeId: UI.projects.superalgos.spaces.docsSpace.currentDocumentBeingRendered.nodeId
- }
- }
-
- UI.projects.superalgos.spaces.docsSpace.currentDocumentBeingRendered = {
- project: project,
- category: category,
- type: type.replace('AMPERSAND', '\''),
- anchor: anchor,
- nodeId: nodeId
- }
+ getReadyToNavigate(project, category, type, anchor, nodeId)
thisObject.sidePanelTab.open()
}
@@ -307,24 +292,7 @@ function newSuperalgosDocSpace() {
EDITOR_ON_FOCUS = false // forced exit
UI.projects.superalgos.spaces.docsSpace.paragraphMap = new Map()
- /* Replace the current object with this */
- if (UI.projects.superalgos.spaces.docsSpace.currentDocumentBeingRendered !== undefined) {
- UI.projects.superalgos.spaces.docsSpace.previousDocumentBeingRendered = {
- project: UI.projects.superalgos.spaces.docsSpace.currentDocumentBeingRendered.project,
- category: UI.projects.superalgos.spaces.docsSpace.currentDocumentBeingRendered.category,
- type: UI.projects.superalgos.spaces.docsSpace.currentDocumentBeingRendered.type,
- anchor: UI.projects.superalgos.spaces.docsSpace.currentDocumentBeingRendered.anchor,
- nodeId: UI.projects.superalgos.spaces.docsSpace.currentDocumentBeingRendered.nodeId
- }
- }
-
- UI.projects.superalgos.spaces.docsSpace.currentDocumentBeingRendered = {
- project: project,
- category: category,
- type: type.replace('AMPERSAND', '\''),
- anchor: anchor,
- nodeId: nodeId
- }
+ getReadyToNavigate(project, category, type, anchor, nodeId)
UI.projects.superalgos.spaces.docsSpace.documentPage.render()
@@ -339,6 +307,37 @@ function newSuperalgosDocSpace() {
}
}
+ function getReadyToNavigate(project, category, type, anchor, nodeId) {
+ /* Replace the current object with this */
+ if (UI.projects.superalgos.spaces.docsSpace.currentDocumentBeingRendered !== undefined) {
+ UI.projects.superalgos.spaces.docsSpace.previousDocumentBeingRendered = {
+ project: UI.projects.superalgos.spaces.docsSpace.currentDocumentBeingRendered.project,
+ category: UI.projects.superalgos.spaces.docsSpace.currentDocumentBeingRendered.category,
+ type: UI.projects.superalgos.spaces.docsSpace.currentDocumentBeingRendered.type,
+ anchor: UI.projects.superalgos.spaces.docsSpace.currentDocumentBeingRendered.anchor,
+ nodeId: UI.projects.superalgos.spaces.docsSpace.currentDocumentBeingRendered.nodeId
+ }
+ }
+
+ if (category === 'Book') {
+ UI.projects.superalgos.spaces.docsSpace.currentBookBeingRendered = {
+ project: project,
+ category: category,
+ type: type.replace('AMPERSAND', '\''),
+ anchor: anchor,
+ nodeId: nodeId
+ }
+ }
+
+ UI.projects.superalgos.spaces.docsSpace.currentDocumentBeingRendered = {
+ project: project,
+ category: category,
+ type: type.replace('AMPERSAND', '\''),
+ anchor: anchor,
+ nodeId: nodeId
+ }
+ }
+
function resize() {
thisObject.container.frame.width = UI.projects.superalgos.globals.docs.DOCS_SPACE_WIDTH
thisObject.container.frame.height = browserCanvas.height // - TOP_SPACE_HEIGHT
diff --git a/Projects/Superalgos/UI/Spaces/Docs-Space/DocumentPage.js b/Projects/Superalgos/UI/Spaces/Docs-Space/DocumentPage.js
index 42556247b..9d461bee4 100644
--- a/Projects/Superalgos/UI/Spaces/Docs-Space/DocumentPage.js
+++ b/Projects/Superalgos/UI/Spaces/Docs-Space/DocumentPage.js
@@ -429,6 +429,10 @@ function newSuperalgosDocsDocumentPage() {
buildOrderedTopicPageIndex(chapterName)
+ if (orderedTopicPageIndexArray.length === 0) {
+ return 'Chapter paragraph style Syntax Error. The Topic ' + chapterName + ' could not be found. Check the Docs Chapter Style Syntax. This error message will dissapear as soon as you fix the problem.'
+ }
+
let key = 'auto-generated-paragraph-' + autoGeneratedParagraphIndex
paragraph = {
style: "Title",
diff --git a/Projects/Superalgos/UI/Spaces/Docs-Space/Footer.js b/Projects/Superalgos/UI/Spaces/Docs-Space/Footer.js
index c4aba254f..da679058e 100644
--- a/Projects/Superalgos/UI/Spaces/Docs-Space/Footer.js
+++ b/Projects/Superalgos/UI/Spaces/Docs-Space/Footer.js
@@ -33,6 +33,9 @@ function newSuperalgosDocsFooter() {
if (UI.projects.superalgos.spaces.docsSpace.previousDocumentBeingRendered !== undefined ) {
HTML = HTML + ''
}
+ if (UI.projects.superalgos.spaces.docsSpace.currentBookBeingRendered !== undefined ) {
+ HTML = HTML + ''
+ }
HTML = HTML + ''
HTML = HTML + ''
HTML = HTML + ''
diff --git a/Projects/Superalgos/UI/Spaces/Docs-Space/MainSearchPage.js b/Projects/Superalgos/UI/Spaces/Docs-Space/MainSearchPage.js
index 20e77a36f..7361caa12 100644
--- a/Projects/Superalgos/UI/Spaces/Docs-Space/MainSearchPage.js
+++ b/Projects/Superalgos/UI/Spaces/Docs-Space/MainSearchPage.js
@@ -51,6 +51,7 @@ function newSuperalgosDocsMainSearchPage() {
}
element.addEventListener("keyup", function (event) {
if (event.key === "Enter" || event.keyCode === 13) {
+ UI.projects.superalgos.spaces.docsSpace.currentBookBeingRendered = undefined
UI.projects.superalgos.spaces.docsSpace.contextMenu.forceOutClick()
UI.projects.superalgos.spaces.docsSpace.commandInterface.command = element.value
UI.projects.superalgos.spaces.docsSpace.commandInterface.detectCommands()
diff --git a/Projects/Superalgos/UI/Spaces/Docs-Space/SearchResultsPage.js b/Projects/Superalgos/UI/Spaces/Docs-Space/SearchResultsPage.js
index 7027c2a0c..55c63ea1c 100644
--- a/Projects/Superalgos/UI/Spaces/Docs-Space/SearchResultsPage.js
+++ b/Projects/Superalgos/UI/Spaces/Docs-Space/SearchResultsPage.js
@@ -150,6 +150,10 @@ function newSuperalgosDocsSearchResultsPage() {
documentPoints = documentPoints + thisPhraseCount * 1
break
}
+ case 'chapter': {
+ documentPoints = documentPoints + thisPhraseCount * 8
+ break
+ }
}
}