cooying to clipboard done

This commit is contained in:
Luis Fernando Molina committed 2020-12-24 12:14:54 +01:00
1 parent 045f55cebb
commit 413732375f
2 files changed
+25 -1

No files matched your search

+1
View File
@@ -128,6 +128,7 @@
<li class="menu-item" onClick="window.contextMenu.toAnchor()">Anchor</li>
<li class="menu-item" onClick="window.contextMenu.toBlock()">Block</li>
<li class="menu-item" onClick="window.contextMenu.toInclude()">Include</li>
<li class="menu-item" onClick="window.contextMenu.copyLink()">Copy</li>
</ul>
</body>
@@ -82,7 +82,8 @@ function newSuperalgosDocSpace() {
toPng: toPng,
toAnchor: toAnchor,
toBlock: toBlock,
toInclude: toInclude
toInclude: toInclude,
copyLink: copyLink
}
function editParagraph() {
@@ -277,6 +278,28 @@ function newSuperalgosDocSpace() {
contextMenuForceOutClick()
renderDocumentPage()
}
function copyLink() {
let docSchemaParagraph = paragraphMap.get(selectedParagraph.id)
let clipboard
switch (docSchemaParagraph.style) {
case 'Anchor': {
clipboard = "docs.goto " + objectBeingRendered.project + '->' + objectBeingRendered.category + '->' + objectBeingRendered.type + '->' + docSchemaParagraph.text
break
}
case 'Block': {
clipboard = objectBeingRendered.project + '->' + objectBeingRendered.category + '->' + objectBeingRendered.type + '->' + docSchemaParagraph.text
break
}
default: {
clipboard = docSchemaParagraph.text
break
}
}
UI.projects.superalgos.utilities.clipboard.copyTextToClipboard(clipboard)
contextMenuForceOutClick()
}
}
function setUpMenuItemsMap() {