Compare commits

...

1 Commits

Author SHA1 Message Date
Julius Härtl
96ce840808 Use dev version of @nextcloud/text
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2020-04-05 22:28:25 +02:00

View File

@@ -29,7 +29,8 @@
<AppSidebarTab id="details" <AppSidebarTab id="details"
:order="0" :order="0"
:name="t('deck', 'Details')" :name="t('deck', 'Details')"
icon="icon-home"> icon="icon-home"
ref="detailsSidebar">
<div class="section-wrapper"> <div class="section-wrapper">
<div v-tooltip="t('deck', 'Tags')" class="section-label icon-tag"> <div v-tooltip="t('deck', 'Tags')" class="section-label icon-tag">
<span class="hidden-visually">{{ t('deck', 'Tags') }}</span> <span class="hidden-visually">{{ t('deck', 'Tags') }}</span>
@@ -119,15 +120,12 @@
type="deck-card" /> type="deck-card" />
</div> </div>
<h5> <Editor v-if="copiedCard.id" :content="copiedCard.description" ref="editor" type="markdown" @update="updateText">
{{ t('deck', 'Description') }}
<a v-tooltip="t('deck', 'Formatting help')" <a v-tooltip="t('deck', 'Formatting help')"
href="https://deck.readthedocs.io/en/latest/Markdown/" href="https://deck.readthedocs.io/en/latest/Markdown/"
target="_blank" target="_blank"
class="icon icon-info" /> class="icon icon-info" />
</h5> </Editor>
<!-- FIXME: make sure the editor is disabled when canEdit is false -->
<VueEasymde ref="markdownEditor" v-model="copiedCard.description" :configs="mdeConfig" />
</AppSidebarTab> </AppSidebarTab>
<AppSidebarTab id="attachments" <AppSidebarTab id="attachments"
@@ -164,7 +162,7 @@ import { CollectionList } from 'nextcloud-vue-collections'
import CardSidebarTabAttachments from './CardSidebarTabAttachments' import CardSidebarTabAttachments from './CardSidebarTabAttachments'
import CardSidebarTabComments from './CardSidebarTabComments' import CardSidebarTabComments from './CardSidebarTabComments'
import CardSidebarTabActivity from './CardSidebarTabActivity' import CardSidebarTabActivity from './CardSidebarTabActivity'
import Editor from '@nextcloud/text'
const capabilities = window.OC.getCapabilities() const capabilities = window.OC.getCapabilities()
export default { export default {
@@ -182,6 +180,7 @@ export default {
CardSidebarTabAttachments, CardSidebarTabAttachments,
CardSidebarTabComments, CardSidebarTabComments,
CardSidebarTabActivity, CardSidebarTabActivity,
Editor,
}, },
mixins: [ mixins: [
Color, Color,
@@ -288,6 +287,11 @@ export default {
clearInterval(this.updateRelativeTimestamps) clearInterval(this.updateRelativeTimestamps)
}, },
methods: { methods: {
updateText(text) {
console.log(text)
this.copiedCard.description = text
this.$store.dispatch('updateCardDesc', this.copiedCard)
},
updateRelativeTimestamps() { updateRelativeTimestamps() {
this.lastModifiedRelative = OC.Util.relativeModifiedDate(this.currentCard.lastModified * 1000) this.lastModifiedRelative = OC.Util.relativeModifiedDate(this.currentCard.lastModified * 1000)
this.lastCreatedRemative = OC.Util.relativeModifiedDate(this.currentCard.createdAt * 1000) this.lastCreatedRemative = OC.Util.relativeModifiedDate(this.currentCard.createdAt * 1000)