Anchors
This commit is contained in:
1 parent
495fdad5be
commit
5a8c5f74f1
4 files changed
+87
-2
No files matched your search
@@ -652,4 +652,15 @@ margin-left: -240px;
|
||||
.docs-command-result-message {
|
||||
font-size: 90%;
|
||||
color: #31708f;
|
||||
}
|
||||
|
||||
.docs-hidden-anchor {
|
||||
color: #b90d6c;
|
||||
background-color: #ee6db4;
|
||||
border-color: #830452;
|
||||
padding: 15px;
|
||||
border: 1px solid transparent;
|
||||
border-radius: 4px;
|
||||
margin: 20px 0;
|
||||
width: 95%;
|
||||
}
|
||||
@@ -125,6 +125,7 @@
|
||||
<li class="menu-item" onClick="window.contextMenu.toTable()">Table Style</li>
|
||||
<li class="menu-item" onClick="window.contextMenu.toGif()">Gif Style</li>
|
||||
<li class="menu-item" onClick="window.contextMenu.toPng()">Png Style</li>
|
||||
<li class="menu-item" onClick="window.contextMenu.toAnchor()">Anchor Style</li>
|
||||
</ul>
|
||||
|
||||
</body>
|
||||
|
||||
@@ -0,0 +1,50 @@
|
||||
{
|
||||
"type": "Vaina",
|
||||
"definition": "Write here the definition of this Concept.",
|
||||
"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": "Anchor",
|
||||
"text": "Anchor 1"
|
||||
},
|
||||
{
|
||||
"style": "Text",
|
||||
"text": "Vaina Paragraph 1"
|
||||
},
|
||||
{
|
||||
"style": "Note",
|
||||
"text": "Vaina Paragraph 2"
|
||||
},
|
||||
{
|
||||
"style": "Text",
|
||||
"text": "Vaina Paragraph 3"
|
||||
},
|
||||
{
|
||||
"style": "Anchor",
|
||||
"text": "Anchor 2"
|
||||
},
|
||||
{
|
||||
"style": "Text",
|
||||
"text": "Vaina Paragraph 4"
|
||||
},
|
||||
{
|
||||
"style": "Callout",
|
||||
"text": "Vaina Paragraph 5"
|
||||
},
|
||||
{
|
||||
"style": "Warning",
|
||||
"text": "Vaina Paragraph 6"
|
||||
},
|
||||
{
|
||||
"style": "Text",
|
||||
"text": "Vaina Paragraph 7"
|
||||
},
|
||||
{
|
||||
"style": "Text",
|
||||
"text": "Vaina Paragraph 8"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -78,7 +78,8 @@ function newSuperalgosDocSpace() {
|
||||
toList: toList,
|
||||
toTable: toTable,
|
||||
toGif: toGif,
|
||||
toPng: toPng
|
||||
toPng: toPng,
|
||||
toAnchor: toAnchor
|
||||
}
|
||||
|
||||
function editParagraph() {
|
||||
@@ -242,6 +243,13 @@ function newSuperalgosDocSpace() {
|
||||
contextMenuForceOutClick()
|
||||
renderDocumentPage()
|
||||
}
|
||||
|
||||
function toAnchor() {
|
||||
let docSchemaParagraph = paragraphMap.get(selectedParagraph.id)
|
||||
docSchemaParagraph.style = 'Anchor'
|
||||
contextMenuForceOutClick()
|
||||
renderDocumentPage()
|
||||
}
|
||||
}
|
||||
|
||||
function setUpMenuItemsMap() {
|
||||
@@ -570,6 +578,9 @@ function newSuperalgosDocSpace() {
|
||||
if (paragraphNode.id.indexOf('-summary') >= 0) {
|
||||
selectedParagraphData = paragraphNode.innerText.substring(9, paragraphNode.innerText.length)
|
||||
}
|
||||
if (paragraphNode.id.indexOf('-anchor') >= 0) {
|
||||
selectedParagraphData = paragraphNode.innerText
|
||||
}
|
||||
|
||||
selectedParagraph = paragraphNode
|
||||
selectedParagraphHeight = paragraphNode.getClientRects()[0].height
|
||||
@@ -1327,6 +1338,10 @@ function newSuperalgosDocSpace() {
|
||||
documentPoints = documentPoints + thisPhraseCount * 1
|
||||
break
|
||||
}
|
||||
case 'anchor': {
|
||||
documentPoints = documentPoints + thisPhraseCount * 1
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2572,6 +2587,14 @@ function newSuperalgosDocSpace() {
|
||||
innerHTML = paragraph.text
|
||||
break
|
||||
}
|
||||
case 'Anchor': {
|
||||
styleClass = 'class="docs-hidden-anchor"'
|
||||
prefix = ''
|
||||
role = ''
|
||||
key = key + '-anchor'
|
||||
innerHTML = paragraph.text
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
HTML = HTML + '<p><div id="' + key + '" ' + styleClass + ' ' + role + '>' + prefix + ' ' + innerHTML + sufix + '</div></p>'
|
||||
@@ -3105,7 +3128,7 @@ function newSuperalgosDocSpace() {
|
||||
if (UI.projects.superalgos.spaces.designSpace.workspace === undefined) { return }
|
||||
if (UI.projects.superalgos.spaces.designSpace.workspace.isInitialized === false) { return }
|
||||
|
||||
if (docsIndex.length === 0) {
|
||||
if (docsIndex && docsIndex.length === 0) {
|
||||
setUpWorkspaceSchemas()
|
||||
setUpSearchEngine()
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user