mirror of
https://github.com/documize/community.git
synced 2025-08-02 20:15:26 +02:00
link persistence
This commit is contained in:
parent
4a17acce11
commit
c27de6bcab
11 changed files with 160 additions and 104 deletions
|
@ -115,7 +115,3 @@ export default Ember.Component.extend({
|
|||
}
|
||||
}
|
||||
});
|
||||
|
||||
// editor.insertContent(' <b>It\'s my button!</b> ');
|
||||
// Selects the first paragraph found
|
||||
// tinyMCE.activeEditor.selection.select(tinyMCE.activeEditor.dom.select('p')[0]);
|
||||
|
|
|
@ -39,34 +39,41 @@ export default Ember.Service.extend({
|
|||
href = `/link/${link.linkType}/${link.id}`;
|
||||
}
|
||||
if (link.linkType === "file") {
|
||||
href = `${endpoint}/public/attachments/${orgId}/${link.attachmentId}`;
|
||||
href = `${endpoint}/public/attachments/${orgId}/${link.targetId}`;
|
||||
}
|
||||
if (link.linkType === "document") {
|
||||
href = `/link/${link.linkType}/${link.id}`;
|
||||
}
|
||||
|
||||
result = `<a data-link-id='${link.id}' data-link-type='${link.linkType}' href='${href}'>${link.title}</a>`;
|
||||
result = `<a data-documize='true' data-link-id='${link.id}' data-link-document-id='${link.documentId}' data-link-target-id='${link.targetId}' data-link-type='${link.linkType}' href='${href}'>${link.title}</a>`;
|
||||
|
||||
console.log(link);
|
||||
console.log(result);
|
||||
return result;
|
||||
}
|
||||
});
|
||||
|
||||
/*
|
||||
|
||||
link handler
|
||||
- implement link redirect handler --
|
||||
- for documents: client-side detect
|
||||
- for sections:
|
||||
- for attachments: direct link
|
||||
-
|
||||
|
||||
onDelete document/section/file:
|
||||
- mark link table row as ORPHAN
|
||||
- doc view: meta data fetch to load orphaned content
|
||||
|
||||
Keyword search results - docs, section, files
|
||||
|
||||
we should not redirect to a link that is in the same document!
|
||||
|
||||
what happens if we delete attachment?
|
||||
|
||||
UpdatePage(): find and persist links from saved content
|
||||
|
||||
|
||||
|
||||
|
||||
1. We need to deal with links server-side
|
||||
2. We need to click on links in the browser and 'navigate' to linked content
|
||||
|
||||
|
||||
|
||||
editor.insertContent(' <b>It\'s my button!</b> ');
|
||||
Selects the first paragraph found
|
||||
tinyMCE.activeEditor.selection.select(tinyMCE.activeEditor.dom.select('p')[0]);
|
||||
*/
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
|
||||
.link-item {
|
||||
margin: 0;
|
||||
padding: 5px 0;
|
||||
padding: 2px 0;
|
||||
font-size: 0.9rem;
|
||||
color: $color-gray;
|
||||
cursor: pointer;
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
{{#each candidates.attachments as |a|}}
|
||||
<li class="link-item" {{ action 'setSelection' a }}>
|
||||
{{#ui/ui-checkbox selected=a.selected}}
|
||||
<img class="icon" src="/assets/img/attachments/{{document/file-icon a.attachmentExtension}}" />
|
||||
<img class="icon" src="/assets/img/attachments/{{document/file-icon a.context}}" />
|
||||
{{ a.title }}
|
||||
{{/ui/ui-checkbox}}
|
||||
</li>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue