diff --git a/Projects/Superalgos/Schemas/Docs-Topics/app-commands-messages-001-app-message-contribution-succeed.json b/Projects/Superalgos/Schemas/Docs-Topics/app-commands-messages-001-app-message-contribution-succeed.json index 136031d48..e339b19d0 100644 --- a/Projects/Superalgos/Schemas/Docs-Topics/app-commands-messages-001-app-message-contribution-succeed.json +++ b/Projects/Superalgos/Schemas/Docs-Topics/app-commands-messages-001-app-message-contribution-succeed.json @@ -3,12 +3,14 @@ "pageNumber": "1", "type": "App Message Contribution Succeed", "definition": { - "text": "Write here a summary for this topic page." + "text": "Your contributions where uploaded to your Superalgos Fork and from there a Pull Request was submitted to the main Superalgos repository.", + "updated": 1610461472544 }, "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": "Success", + "text": "There is no further action from you required. Someone will review your changes and merge them into the latest version of the software. If your changes are rejected for any reason, you will have to follow the issue at the Github.com wen site. ", + "updated": 1610461544661 } ] } \ No newline at end of file diff --git a/Projects/Superalgos/UI/Spaces/Docs-Space/ContextMenu.js b/Projects/Superalgos/UI/Spaces/Docs-Space/ContextMenu.js index c18337129..8614e01a2 100644 --- a/Projects/Superalgos/UI/Spaces/Docs-Space/ContextMenu.js +++ b/Projects/Superalgos/UI/Spaces/Docs-Space/ContextMenu.js @@ -1,8 +1,8 @@ function newSuperalgosDocsContextMenu() { let thisObject = { - selectedParagraph: undefined, + selectedParagraph: undefined, getSelection: getSelection, - forceOutClick: forceOutClick, + forceOutClick: forceOutClick, initialize: initialize, finalize: finalize } @@ -123,170 +123,122 @@ function newSuperalgosDocsContextMenu() { function toJavascript() { let docSchemaParagraph = UI.projects.superalgos.spaces.docsSpace.paragraphMap.get(UI.projects.superalgos.spaces.docsSpace.contextMenu.selectedParagraph.id) - docSchemaParagraph.style = 'Javascript' - forceOutClick() - UI.projects.superalgos.spaces.docsSpace.documentPage.render() + replaceStyle(docSchemaParagraph, 'Javascript') } function toJson() { let docSchemaParagraph = UI.projects.superalgos.spaces.docsSpace.paragraphMap.get(UI.projects.superalgos.spaces.docsSpace.contextMenu.selectedParagraph.id) - docSchemaParagraph.style = 'Json' - forceOutClick() - UI.projects.superalgos.spaces.docsSpace.documentPage.render() + replaceStyle(docSchemaParagraph, 'Json') } function toText() { let docSchemaParagraph = UI.projects.superalgos.spaces.docsSpace.paragraphMap.get(UI.projects.superalgos.spaces.docsSpace.contextMenu.selectedParagraph.id) - docSchemaParagraph.style = 'Text' - forceOutClick() - UI.projects.superalgos.spaces.docsSpace.documentPage.render() + replaceStyle(docSchemaParagraph, 'Text') } function toTitle() { let docSchemaParagraph = UI.projects.superalgos.spaces.docsSpace.paragraphMap.get(UI.projects.superalgos.spaces.docsSpace.contextMenu.selectedParagraph.id) - docSchemaParagraph.style = 'Title' - forceOutClick() - UI.projects.superalgos.spaces.docsSpace.documentPage.render() + replaceStyle(docSchemaParagraph, 'Title') } function toSubtitle() { let docSchemaParagraph = UI.projects.superalgos.spaces.docsSpace.paragraphMap.get(UI.projects.superalgos.spaces.docsSpace.contextMenu.selectedParagraph.id) - docSchemaParagraph.style = 'Subtitle' - forceOutClick() - UI.projects.superalgos.spaces.docsSpace.documentPage.render() + replaceStyle(docSchemaParagraph, 'Subtitle') } function toNote() { let docSchemaParagraph = UI.projects.superalgos.spaces.docsSpace.paragraphMap.get(UI.projects.superalgos.spaces.docsSpace.contextMenu.selectedParagraph.id) - docSchemaParagraph.style = 'Note' - forceOutClick() - UI.projects.superalgos.spaces.docsSpace.documentPage.render() + replaceStyle(docSchemaParagraph, 'Note') } function toWarning() { let docSchemaParagraph = UI.projects.superalgos.spaces.docsSpace.paragraphMap.get(UI.projects.superalgos.spaces.docsSpace.contextMenu.selectedParagraph.id) - docSchemaParagraph.style = 'Warning' - forceOutClick() - UI.projects.superalgos.spaces.docsSpace.documentPage.render() + replaceStyle(docSchemaParagraph, 'Warning') } function toError() { let docSchemaParagraph = UI.projects.superalgos.spaces.docsSpace.paragraphMap.get(UI.projects.superalgos.spaces.docsSpace.contextMenu.selectedParagraph.id) - docSchemaParagraph.style = 'Error' - forceOutClick() - UI.projects.superalgos.spaces.docsSpace.documentPage.render() + replaceStyle(docSchemaParagraph, 'Error') } function toImportant() { let docSchemaParagraph = UI.projects.superalgos.spaces.docsSpace.paragraphMap.get(UI.projects.superalgos.spaces.docsSpace.contextMenu.selectedParagraph.id) - docSchemaParagraph.style = 'Important' - forceOutClick() - UI.projects.superalgos.spaces.docsSpace.documentPage.render() + replaceStyle(docSchemaParagraph, 'Important') } function toSuccess() { let docSchemaParagraph = UI.projects.superalgos.spaces.docsSpace.paragraphMap.get(UI.projects.superalgos.spaces.docsSpace.contextMenu.selectedParagraph.id) - docSchemaParagraph.style = 'Success' - forceOutClick() - UI.projects.superalgos.spaces.docsSpace.documentPage.render() + replaceStyle(docSchemaParagraph, 'Success') } function toCallout() { let docSchemaParagraph = UI.projects.superalgos.spaces.docsSpace.paragraphMap.get(UI.projects.superalgos.spaces.docsSpace.contextMenu.selectedParagraph.id) - docSchemaParagraph.style = 'Callout' - forceOutClick() - UI.projects.superalgos.spaces.docsSpace.documentPage.render() + replaceStyle(docSchemaParagraph, 'Callout') } function toSummary() { let docSchemaParagraph = UI.projects.superalgos.spaces.docsSpace.paragraphMap.get(UI.projects.superalgos.spaces.docsSpace.contextMenu.selectedParagraph.id) - docSchemaParagraph.style = 'Summary' - forceOutClick() - UI.projects.superalgos.spaces.docsSpace.documentPage.render() + replaceStyle(docSchemaParagraph, 'Summary') } function toSection() { let docSchemaParagraph = UI.projects.superalgos.spaces.docsSpace.paragraphMap.get(UI.projects.superalgos.spaces.docsSpace.contextMenu.selectedParagraph.id) - docSchemaParagraph.style = 'Section' - forceOutClick() - UI.projects.superalgos.spaces.docsSpace.documentPage.render() + replaceStyle(docSchemaParagraph, 'Section') } function toList() { let docSchemaParagraph = UI.projects.superalgos.spaces.docsSpace.paragraphMap.get(UI.projects.superalgos.spaces.docsSpace.contextMenu.selectedParagraph.id) - docSchemaParagraph.style = 'List' - forceOutClick() - UI.projects.superalgos.spaces.docsSpace.documentPage.render() + replaceStyle(docSchemaParagraph, 'List') } function toTable() { let docSchemaParagraph = UI.projects.superalgos.spaces.docsSpace.paragraphMap.get(UI.projects.superalgos.spaces.docsSpace.contextMenu.selectedParagraph.id) - docSchemaParagraph.style = 'Table' - forceOutClick() - UI.projects.superalgos.spaces.docsSpace.documentPage.render() + replaceStyle(docSchemaParagraph, 'Table') } function toHierarchy() { let docSchemaParagraph = UI.projects.superalgos.spaces.docsSpace.paragraphMap.get(UI.projects.superalgos.spaces.docsSpace.contextMenu.selectedParagraph.id) - docSchemaParagraph.style = 'Hierarchy' - forceOutClick() - UI.projects.superalgos.spaces.docsSpace.documentPage.render() + replaceStyle(docSchemaParagraph, 'Hierarchy') } function toGif() { let docSchemaParagraph = UI.projects.superalgos.spaces.docsSpace.paragraphMap.get(UI.projects.superalgos.spaces.docsSpace.contextMenu.selectedParagraph.id) - docSchemaParagraph.style = 'Gif' - forceOutClick() - UI.projects.superalgos.spaces.docsSpace.documentPage.render() + replaceStyle(docSchemaParagraph, 'Gif') } function toPng() { let docSchemaParagraph = UI.projects.superalgos.spaces.docsSpace.paragraphMap.get(UI.projects.superalgos.spaces.docsSpace.contextMenu.selectedParagraph.id) - docSchemaParagraph.style = 'Png' - forceOutClick() - UI.projects.superalgos.spaces.docsSpace.documentPage.render() + replaceStyle(docSchemaParagraph, 'Png') } function toAnchor() { let docSchemaParagraph = UI.projects.superalgos.spaces.docsSpace.paragraphMap.get(UI.projects.superalgos.spaces.docsSpace.contextMenu.selectedParagraph.id) - docSchemaParagraph.style = 'Anchor' - forceOutClick() - UI.projects.superalgos.spaces.docsSpace.documentPage.render() + replaceStyle(docSchemaParagraph, 'Anchor') } function toBlock() { let docSchemaParagraph = UI.projects.superalgos.spaces.docsSpace.paragraphMap.get(UI.projects.superalgos.spaces.docsSpace.contextMenu.selectedParagraph.id) - docSchemaParagraph.style = 'Block' - forceOutClick() - UI.projects.superalgos.spaces.docsSpace.documentPage.render() + replaceStyle(docSchemaParagraph, 'Block') } function toInclude() { let docSchemaParagraph = UI.projects.superalgos.spaces.docsSpace.paragraphMap.get(UI.projects.superalgos.spaces.docsSpace.contextMenu.selectedParagraph.id) - docSchemaParagraph.style = 'Include' - forceOutClick() - UI.projects.superalgos.spaces.docsSpace.documentPage.render() + replaceStyle(docSchemaParagraph, 'Include') } function toChapter() { let docSchemaParagraph = UI.projects.superalgos.spaces.docsSpace.paragraphMap.get(UI.projects.superalgos.spaces.docsSpace.contextMenu.selectedParagraph.id) - docSchemaParagraph.style = 'Chapter' - forceOutClick() - UI.projects.superalgos.spaces.docsSpace.documentPage.render() + replaceStyle(docSchemaParagraph, 'Chapter') } function toWebPageLink() { let docSchemaParagraph = UI.projects.superalgos.spaces.docsSpace.paragraphMap.get(UI.projects.superalgos.spaces.docsSpace.contextMenu.selectedParagraph.id) - docSchemaParagraph.style = 'Link' - forceOutClick() - UI.projects.superalgos.spaces.docsSpace.documentPage.render() + replaceStyle(docSchemaParagraph, 'Link') } function toYouTubeVideo() { let docSchemaParagraph = UI.projects.superalgos.spaces.docsSpace.paragraphMap.get(UI.projects.superalgos.spaces.docsSpace.contextMenu.selectedParagraph.id) - docSchemaParagraph.style = 'Youtube' - forceOutClick() - UI.projects.superalgos.spaces.docsSpace.documentPage.render() + replaceStyle(docSchemaParagraph, 'Youtube') } function copyLink() { @@ -310,6 +262,15 @@ function newSuperalgosDocsContextMenu() { UI.projects.superalgos.utilities.clipboard.copyTextToClipboard(clipboard) forceOutClick() } + + function replaceStyle(docSchemaParagraph, style) { + if (docSchemaParagraph.style !== style) { + UI.projects.superalgos.spaces.docsSpace.documentPage.docsSchemaDocument.updated = true + docSchemaParagraph.style = style + forceOutClick() + UI.projects.superalgos.spaces.docsSpace.documentPage.render() + } + } } function forceOutClick() { diff --git a/Projects/Superalgos/UI/Spaces/Docs-Space/DocumentPage.js b/Projects/Superalgos/UI/Spaces/Docs-Space/DocumentPage.js index 661ff43f6..339adaab4 100644 --- a/Projects/Superalgos/UI/Spaces/Docs-Space/DocumentPage.js +++ b/Projects/Superalgos/UI/Spaces/Docs-Space/DocumentPage.js @@ -1618,10 +1618,7 @@ function newSuperalgosDocsDocumentPage() { } function hightlightEmbeddedCode() { - _self.Prism.highlightAllUnder(docsContentDiv, true, onHighlighted) - function onHighlighted() { - // nothing to do here - } + _self.Prism.highlightAllUnder(docsContentDiv, true) } function parseHierarchy(params) { @@ -1921,6 +1918,7 @@ function newSuperalgosDocsDocumentPage() { Deleting paragarphs is only possible in the default language. */ if (UI.projects.superalgos.spaces.docsSpace.language === UI.projects.superalgos.globals.docs.DEFAULT_LANGUAGE) { + UI.projects.superalgos.spaces.docsSpace.documentPage.docsSchemaDocument.updated = true thisObject.docsSchemaDocument.paragraphs.splice(selectededitableParagraphIndex, 1) if (thisObject.docsSchemaDocument.paragraphs.length === 0) { let newParagraph = { @@ -1947,6 +1945,7 @@ function newSuperalgosDocsDocumentPage() { text: paragraphs[i] } thisObject.docsSchemaDocument.paragraphs.splice(selectededitableParagraphIndex + i, 0, newParagraph) + UI.projects.superalgos.spaces.docsSpace.documentPage.docsSchemaDocument.updated = true } } } diff --git a/Projects/Superalgos/UI/Spaces/Tutorial-Space/TutorialSpace.js b/Projects/Superalgos/UI/Spaces/Tutorial-Space/TutorialSpace.js index c571f8507..86a486c5d 100644 --- a/Projects/Superalgos/UI/Spaces/Tutorial-Space/TutorialSpace.js +++ b/Projects/Superalgos/UI/Spaces/Tutorial-Space/TutorialSpace.js @@ -1272,7 +1272,7 @@ function newSuperalgosTutorialSpace() { } case 'Javascript': { let text = UI.projects.superalgos.utilities.docs.getTextBasedOnLanguage(paragraph) - html = html + '
' + text + ''
+ html = html + '' + text + ''
break
}
case 'List': {
@@ -1342,6 +1342,7 @@ function newSuperalgosTutorialSpace() {
html = html + ''
tutorialDiv.innerHTML = html
+ _self.Prism.highlightAllUnder(tutorialDiv, true)
}
}