Merge pull request #344 from Luis-Fernando-Molina/in-app-documentation

Contribution: Minor Fixes
This commit is contained in:
Luis Fernando Molina authored and GitHub committed 2021-01-12 17:23:34 +01:00
commit 38a1aa52c9
4 files changed
+45 -82

No files matched your search

@@ -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
}
]
}
@@ -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() {
@@ -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
}
}
}
@@ -1272,7 +1272,7 @@ function newSuperalgosTutorialSpace() {
}
case 'Javascript': {
let text = UI.projects.superalgos.utilities.docs.getTextBasedOnLanguage(paragraph)
html = html + '<pre><code class="language-json">' + text + '</code></pre>'
html = html + '<pre><code class="language-javascript">' + text + '</code></pre>'
break
}
case 'List': {
@@ -1342,6 +1342,7 @@ function newSuperalgosTutorialSpace() {
html = html + '</div>'
tutorialDiv.innerHTML = html
_self.Prism.highlightAllUnder(tutorialDiv, true)
}
}