From f59bd0eba949eca782083b3637b2c6d6dbb85f94 Mon Sep 17 00:00:00 2001 From: rainu Date: Wed, 11 Dec 2019 14:57:30 +0100 Subject: [PATCH] [#22] make note titles optional --- components/note/form/Camera.vue | 8 ++++---- components/note/form/Credentials.vue | 30 ++++++++++++++-------------- components/note/form/Picture.vue | 10 +++++----- components/note/form/Reminder.vue | 10 +++++----- components/note/form/Template.vue | 10 +++++----- components/note/form/Text.vue | 10 +++++----- locales/de.json | 1 + locales/en.json | 1 + 8 files changed, 41 insertions(+), 39 deletions(-) diff --git a/components/note/form/Camera.vue b/components/note/form/Camera.vue index 8b5c660..7154d39 100644 --- a/components/note/form/Camera.vue +++ b/components/note/form/Camera.vue @@ -52,7 +52,7 @@ - + @@ -110,7 +110,7 @@ } if(this.data) { - note.title = this.data.title + note.title = this.data.title === this.$t('note.untitled') ? null : this.data.title note.tags = this.data.tags note.description = this.data.content.description note.image = this.data.content.image @@ -182,7 +182,7 @@ let data = { content: {} } - data.title = this.note.title + data.title = this.note.title ? this.note.title : this.$t('note.untitled') data.tags = this.note.tags data.content.description = this.note.description data.content.image = this.note.image @@ -209,7 +209,7 @@ } }, data(newData) { - this.note.title = newData.title + this.note.title = newData.title === this.$t('note.untitled') ? null : newData.title this.note.tags = newData.tags this.note.description = newData.content.description this.note.image = newData.content.image diff --git a/components/note/form/Credentials.vue b/components/note/form/Credentials.vue index dd62658..154fa41 100644 --- a/components/note/form/Credentials.vue +++ b/components/note/form/Credentials.vue @@ -8,22 +8,12 @@ - - - - - - - - - - - + - + + + + + + + + + + + @@ -81,7 +81,7 @@ } if(this.data) { - note.title = this.data.title + note.title = this.data.title === this.$t('note.untitled') ? null : this.data.title note.tags = this.data.tags note.url = this.data.content.url note.description = this.data.content.description @@ -124,7 +124,7 @@ let data = { content: {} } - data.title = this.note.title + data.title = this.note.title ? this.note.title : this.$t('note.untitled') data.tags = this.note.tags data.content.url = this.note.url data.content.description = this.note.description @@ -140,7 +140,7 @@ }, watch: { data(newData) { - this.note.title = newData.title + this.note.title = newData.title === this.$t('note.untitled') ? null : newData.title this.note.tags = newData.tags this.note.url = newData.content.url this.note.description = newData.content.description diff --git a/components/note/form/Picture.vue b/components/note/form/Picture.vue index 05f2ca8..5049ad7 100644 --- a/components/note/form/Picture.vue +++ b/components/note/form/Picture.vue @@ -3,10 +3,10 @@ - + - + @@ -49,7 +49,7 @@ } if(this.data) { - note.title = this.data.title + note.title = this.data.title === this.$t('note.untitled') ? null : this.data.title note.tags = this.data.tags note.url = this.data.content.url } @@ -85,7 +85,7 @@ let data = { content: {} } - data.title = this.note.title + data.title = this.note.title ? this.note.title : this.$t('note.untitled') data.tags = this.note.tags data.content.url = this.note.url @@ -98,7 +98,7 @@ }, watch: { data(newData) { - this.note.title = newData.title + this.note.title = newData.title === this.$t('note.untitled') ? null : newData.title this.note.tags = newData.tags this.note.url = newData.content.url } diff --git a/components/note/form/Reminder.vue b/components/note/form/Reminder.vue index 40be751..a0c90bb 100644 --- a/components/note/form/Reminder.vue +++ b/components/note/form/Reminder.vue @@ -3,7 +3,7 @@ - + @@ -70,7 +70,7 @@ - + @@ -121,7 +121,7 @@ } if(this.data) { - note.title = this.data.title + note.title = this.data.title === this.$t('note.untitled') ? null : this.data.title note.tags = this.data.tags note.date = this.data.content.date note.markdown = !!this.data.content.markdown @@ -181,7 +181,7 @@ if(!this.valid) return let data = {} - data.title = this.note.title + data.title = this.note.title ? this.note.title : this.$t('note.untitled') data.tags = this.note.tags data.content = {} data.content.date = this.note.date @@ -209,7 +209,7 @@ this.recalcNoteDate() }, data(newData) { - this.note.title = newData.title + this.note.title = newData.title === this.$t('note.untitled') ? null : newData.title this.note.tags = newData.tags this.note.date = newData.content.date this.note.markdown = !!newData.content.markdown diff --git a/components/note/form/Template.vue b/components/note/form/Template.vue index fdb348e..639a0d9 100644 --- a/components/note/form/Template.vue +++ b/components/note/form/Template.vue @@ -3,7 +3,7 @@ - + @@ -38,7 +38,7 @@ - + @@ -230,7 +230,7 @@ } if(this.data) { - note.title = this.data.title + note.title = this.data.title === this.$t('note.untitled') ? null : this.data.title note.tags = this.data.tags note.template = this.data.content.template note.placeholder = cloneDataObject(this.data.content.placeholder) @@ -359,7 +359,7 @@ let data = { content: {} } - data.title = this.note.title + data.title = this.note.title ? this.note.title : this.$t('note.untitled') data.tags = this.note.tags data.content.template = this.note.template data.content.placeholder = cloneDataObject(this.note.placeholder) @@ -393,7 +393,7 @@ }, watch: { data(newData) { - this.note.title = newData.title + this.note.title = newData.title === this.$t('note.untitled') ? null : newData.title this.note.tags = newData.tags this.note.template = newData.content.template diff --git a/components/note/form/Text.vue b/components/note/form/Text.vue index 31a65f3..81262a7 100644 --- a/components/note/form/Text.vue +++ b/components/note/form/Text.vue @@ -3,10 +3,10 @@ - + - + @@ -49,7 +49,7 @@ } if(this.data) { - note.title = this.data.title + note.title = this.data.title === this.$t('note.untitled') ? null : this.data.title note.tags = this.data.tags note.markdown = !!this.data.content.markdown note.content = note.markdown ? this.data.content.markdown : this.data.content.text @@ -84,7 +84,7 @@ if(!this.valid) return let data = {} - data.title = this.note.title + data.title = this.note.title ? this.note.title : this.$t('note.untitled') data.tags = this.note.tags data.content = {} if(this.note.markdown) data.content.markdown = this.note.content @@ -99,7 +99,7 @@ }, watch: { data(newData) { - this.note.title = newData.title + this.note.title = newData.title === this.$t('note.untitled') ? null : newData.title this.note.tags = newData.tags this.note.markdown = !!newData.content.markdown this.note.content = this.note.markdown ? newData.content.markdown : newData.content.text diff --git a/locales/de.json b/locales/de.json index 53c213e..93a5030 100644 --- a/locales/de.json +++ b/locales/de.json @@ -66,6 +66,7 @@ }, "note": { "title": "Titel", + "untitled": "Unbenannt", "help": { "first-steps": { "title": "Willkommen in {appName}", diff --git a/locales/en.json b/locales/en.json index 9bfabc8..aecc8e0 100644 --- a/locales/en.json +++ b/locales/en.json @@ -66,6 +66,7 @@ }, "note": { "title": "Title", + "untitled": "Untitled", "help": { "first-steps": { "title": "Welcome to {appName}",