From c9d8af5c4aebd16fca40d7fa3cd4ece29555844d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20N=C3=BCsse?= Date: Tue, 18 Oct 2022 08:53:18 +0200 Subject: [PATCH] add help --- css/notes.css | 19 +++ img/badge_applestore.svg | 46 +++++++ img/badge_fdroid.svg | 1 + img/badge_playstore.svg | 113 ++++++++++++++++ lib/Controller/NotesController.php | 9 +- src/App.vue | 24 +++- src/NotesService.js | 8 +- src/Util.js | 34 +++++ src/components/AppHelp.vue | 188 ++++++++++++++++++++++++++ src/components/CreateSampleButton.vue | 38 ++++++ src/components/HelpMobile.vue | 77 +++++++++++ src/components/Welcome.vue | 56 +++++--- 12 files changed, 586 insertions(+), 27 deletions(-) create mode 100644 img/badge_applestore.svg create mode 100644 img/badge_fdroid.svg create mode 100644 img/badge_playstore.svg create mode 100644 src/components/AppHelp.vue create mode 100644 src/components/CreateSampleButton.vue create mode 100644 src/components/HelpMobile.vue diff --git a/css/notes.css b/css/notes.css index 520192ff..4b2079c7 100644 --- a/css/notes.css +++ b/css/notes.css @@ -26,6 +26,25 @@ li:focus .app-navigation-entry__utils .action-item { visibility: visible; } +/* Welcome / Help */ +.feature { + background-position: left center; + width: 100%; + min-height: 32px; + line-height: 32px; + padding-left: 32px; + margin-top: 0.3em !important; + margin-bottom: 0.3em !important; + display: inline-block; + vertical-align: middle; +} + +.feature ul { + list-style: circle outside; + padding-left: 2em; +} + + @media print { #header, .app-navigation, diff --git a/img/badge_applestore.svg b/img/badge_applestore.svg new file mode 100644 index 00000000..92fa58f0 --- /dev/null +++ b/img/badge_applestore.svg @@ -0,0 +1,46 @@ + + Download_on_the_App_Store_Badge_US-UK_RGB_blk_4SVG_092917 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/img/badge_fdroid.svg b/img/badge_fdroid.svg new file mode 100644 index 00000000..6f98b41a --- /dev/null +++ b/img/badge_fdroid.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/img/badge_playstore.svg b/img/badge_playstore.svg new file mode 100644 index 00000000..a01a8d87 --- /dev/null +++ b/img/badge_playstore.svg @@ -0,0 +1,113 @@ + + + + + + + + + + +]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/lib/Controller/NotesController.php b/lib/Controller/NotesController.php index 15460398..36635a2d 100644 --- a/lib/Controller/NotesController.php +++ b/lib/Controller/NotesController.php @@ -149,9 +149,12 @@ class NotesController extends Controller { /** * @NoAdminRequired */ - public function create(string $category) : JSONResponse { - return $this->helper->handleErrorResponse(function () use ($category) { - $note = $this->notesService->create($this->helper->getUID(), '', $category); + public function create(string $category = '', string $content = '', string $title = '') : JSONResponse { + return $this->helper->handleErrorResponse(function () use ($category, $content, $title) { + $note = $this->notesService->create($this->helper->getUID(), $title, $category); + if ($content) { + $note->setContent($content); + } return $this->helper->getNoteData($note); }); } diff --git a/src/App.vue b/src/App.vue index 656e9d25..d36b2616 100644 --- a/src/App.vue +++ b/src/App.vue @@ -16,6 +16,14 @@ @category-selected="onSelectCategory" @note-deleted="onNoteDeleted" /> + + + + @@ -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() }, + }) + }) + }, }, } -