@@ -41,28 +49,35 @@ import {
NcAppContent,
NcAppNavigation,
NcAppNavigationNew,
+ NcAppNavigationItem,
NcContent,
} from '@nextcloud/vue'
import { showSuccess, TOAST_UNDO_TIMEOUT, TOAST_PERMANENT_TIMEOUT } from '@nextcloud/dialogs'
import '@nextcloud/dialogs/styles/toast.scss'
+import InfoIcon from 'vue-material-design-icons/Information.vue'
import PlusIcon from 'vue-material-design-icons/Plus.vue'
+import AppSettings from './components/AppSettings.vue'
+import NavigationList from './components/NavigationList.vue'
+import AppHelp from './components/AppHelp.vue'
+
import { config } from './config.js'
import { fetchNotes, noteExists, createNote, undoDeleteNote } from './NotesService.js'
-import AppSettings from './components/AppSettings.vue'
-import NavigationList from './components/NavigationList.vue'
import store from './store.js'
export default {
name: 'App',
components: {
+ AppHelp,
AppSettings,
+ InfoIcon,
NavigationList,
NcAppContent,
NcAppNavigation,
NcAppNavigationNew,
+ NcAppNavigationItem,
NcContent,
PlusIcon,
},
@@ -81,6 +96,7 @@ export default {
undoTimer: null,
deletedNotes: [],
refreshTimer: null,
+ helpVisible: false,
}
},
@@ -227,6 +243,10 @@ export default {
}
},
+ openHelp() {
+ this.helpVisible = true
+ },
+
onNewNote() {
if (this.loading.create) {
return
diff --git a/src/NotesService.js b/src/NotesService.js
index 04c6a58f..0e927da5 100644
--- a/src/NotesService.js
+++ b/src/NotesService.js
@@ -177,9 +177,13 @@ export const setTitle = (noteId, title) => {
})
}
-export const createNote = category => {
+export const createNote = (category, title, content) => {
return axios
- .post(url('/notes'), { category: category || '' })
+ .post(url('/notes'), {
+ category: category || '',
+ content: content || '',
+ title: title || '',
+ })
.then(response => {
_updateLocalNote(response.data)
return response.data
diff --git a/src/Util.js b/src/Util.js
index c8c58c2c..f95098cc 100644
--- a/src/Util.js
+++ b/src/Util.js
@@ -27,3 +27,37 @@ export const categoryLabel = (category) => {
export const routeIsNewNote = ($route) => {
return {}.hasOwnProperty.call($route.query, 'new')
}
+
+export const getDefaultSampleNoteTitle = () => {
+ return t('notes', 'Sample note')
+}
+
+export const getDefaultSampleNote = () => {
+ return '# ' + getDefaultSampleNoteTitle() + `
+
+* 📅 ` + t('notes', '15 January 2021, via Nextcloud Notes') + `
+* 👥 ` + t('notes', 'Me, you, and all our friends!') + `
+
+## ` + t('notes', 'Tasks') + ` ✅
+
+* [ ] ` + t('notes', 'Write nice todo lists') + `
+* [ ] ` + t('notes', 'Buy Fries') + `
+* [ ] …
+
+## ` + t('notes', 'Birthdays') + `
+
+* ` + t('notes', 'Jen, in three days!') + `
+* ` + t('notes', 'Moss, 21.03.1973') + `
+* ` + t('notes', 'Roy, 1979') + `
+
+## ` + t('notes', 'Review Steps') + ` 🔁
+
+1. ` + t('notes', 'Turn PC off') + `
+2. ` + t('notes', 'Turn PC on') + `
+3. ` + t('notes', 'Then call IT') + `
+
+## ` + t('notes', 'Quotes') + ` 💬
+
+> ` + t('notes', 'Nextcloud, a safe home for all your data') + `
+`
+}
diff --git a/src/components/AppHelp.vue b/src/components/AppHelp.vue
new file mode 100644
index 00000000..868b0c7d
--- /dev/null
+++ b/src/components/AppHelp.vue
@@ -0,0 +1,188 @@
+
+
+
+
+
+ {{ t('notes', 'Start writing a note by clicking on “{newnote}” in the app navigation.', { newnote: t('notes', 'New note') }) }}
+
+
+ {{ t('notes', 'Write down your thoughts without any distractions.') }}
+
+
+ {{ t('notes', 'Organize your notes in categories.') }}
+
+
+
+
+ {{ t('notes', 'Use Markdown markups to style your text.') }}
+
+
+
+
+
+
+
+
+ {{ t('notes', 'Sequence') }}
+ |
+
+ {{ t('notes', 'Result') }}
+ |
+
+ {{ t('notes', 'Visualized') }}
+ |
+
+
+
+ |
+
+ {{ item.result }}
+ |
+
+ |
+
+
+
+
+
+ {{ t('notes', 'Use shortcuts to quickly navigate this app.') }}
+
+
+
+ {{ t('notes', 'Shortcut') }} |
+ {{ t('notes', 'Action') }} |
+
+
+ {{ item.shortcut }} |
+ {{ item.action }} |
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/components/CreateSampleButton.vue b/src/components/CreateSampleButton.vue
new file mode 100644
index 00000000..046b98fa
--- /dev/null
+++ b/src/components/CreateSampleButton.vue
@@ -0,0 +1,38 @@
+
+
+
+ {{ t('notes', 'Create a sample note with markdown') }}
+
+
+
diff --git a/src/components/HelpMobile.vue b/src/components/HelpMobile.vue
new file mode 100644
index 00000000..79d015c1
--- /dev/null
+++ b/src/components/HelpMobile.vue
@@ -0,0 +1,77 @@
+
+
+
+ {{ t('notes', 'Install the app for your mobile phone in order to access your notes from everywhere.') }}
+
+
+
+
+
+
+
diff --git a/src/components/Welcome.vue b/src/components/Welcome.vue
index 9dbd19f7..fc4643dd 100644
--- a/src/components/Welcome.vue
+++ b/src/components/Welcome.vue
@@ -5,22 +5,25 @@
{{ t('notes', 'Start writing a note by clicking on “{newnote}” in the app navigation.', { newnote: t('notes', 'New note') }) }}
+
+
+
+ {{ t('notes', 'New note') }}
+
+
{{ t('notes', 'Write down your thoughts without any distractions.') }}
{{ t('notes', 'Use Markdown markups to style your text.') }}
+
+
+
{{ t('notes', 'Organize your notes in categories.') }}
-
- {{ t('notes', 'Install the app for your mobile phone in order to access your notes from everywhere.') }}
-
-
+
@@ -28,20 +31,44 @@
import {
NcAppContent,
+ NcButton,
} from '@nextcloud/vue'
+import PlusIcon from 'vue-material-design-icons/Plus.vue'
+
+import CreateSampleButton from './CreateSampleButton.vue'
+import HelpMobile from './HelpMobile.vue'
+
+import { createNote } from '../NotesService.js'
+
export default {
name: 'Welcome',
components: {
+ CreateSampleButton,
+ HelpMobile,
NcAppContent,
+ NcButton,
+ PlusIcon,
+ },
+
+ methods: {
+ onNewNote() {
+ createNote()
+ .then(note => {
+ this.$router.push({
+ name: 'note',
+ params: { noteId: note.id.toString() },
+ })
+ })
+ },
},
}
-