ui tweaks
This commit is contained in:
@@ -1,7 +1,5 @@
|
|||||||
export default class IpcAdapter {
|
export default class IpcAdapter {
|
||||||
constructor() {
|
constructor() {}
|
||||||
this._methods = ['init', 'getAll', 'create', 'update', 'delete']
|
|
||||||
}
|
|
||||||
|
|
||||||
async init() {
|
async init() {
|
||||||
return await window.api.adapterCall('init')
|
return await window.api.adapterCall('init')
|
||||||
|
|||||||
@@ -65,8 +65,6 @@ export const initializeCore = async (runtime, { plugins }) => {
|
|||||||
|
|
||||||
if (!initPromise) {
|
if (!initPromise) {
|
||||||
initPromise = (async () => {
|
initPromise = (async () => {
|
||||||
const config = await configManager.loadConfig()
|
|
||||||
|
|
||||||
let encryptionKey = config?.encryptionKey
|
let encryptionKey = config?.encryptionKey
|
||||||
|
|
||||||
if (!encryptionKey) {
|
if (!encryptionKey) {
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
<router-link class="menu-item" to="/instructions">
|
<router-link class="menu-item" to="/instructions">
|
||||||
Instructio
|
Instructio
|
||||||
</router-link>
|
</router-link>
|
||||||
<button class="menu-item">Import</button>
|
<!-- <button class="menu-item">Import</button> -->
|
||||||
<button class="menu-item" @click="handleExport">Export</button>
|
<button class="menu-item" @click="handleExport">Export</button>
|
||||||
<router-link class="menu-item" to="/preferences">
|
<router-link class="menu-item" to="/preferences">
|
||||||
Preferences
|
Preferences
|
||||||
|
|||||||
@@ -5,6 +5,8 @@
|
|||||||
<script setup>
|
<script setup>
|
||||||
import useOpenNote from '@/composables/useOpenNote'
|
import useOpenNote from '@/composables/useOpenNote'
|
||||||
import useNotes from '@/composables/useNotes'
|
import useNotes from '@/composables/useNotes'
|
||||||
|
import { useMagicKeys } from '@vueuse/core'
|
||||||
|
import { watchEffect } from 'vue'
|
||||||
|
|
||||||
const props = defineProps({ category: String })
|
const props = defineProps({ category: String })
|
||||||
const emit = defineEmits(['noteOpened'])
|
const emit = defineEmits(['noteOpened'])
|
||||||
@@ -22,9 +24,12 @@ const onClick = async () => {
|
|||||||
openNote(note.id)
|
openNote(note.id)
|
||||||
emit('noteOpened')
|
emit('noteOpened')
|
||||||
}
|
}
|
||||||
</script>
|
|
||||||
|
|
||||||
<style lang="scss">
|
// Add keyboard shortcut
|
||||||
.new-note {
|
const { ctrl, n } = useMagicKeys()
|
||||||
}
|
watchEffect(() => {
|
||||||
</style>
|
if (ctrl.value && n.value) {
|
||||||
|
onClick()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
</script>
|
||||||
|
|||||||
@@ -62,7 +62,9 @@ const onUpdate = _debounce(async ({ editor }) => {
|
|||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
const note = await loadNote(props.id)
|
const note = await loadNote(props.id)
|
||||||
|
|
||||||
title.value = note.title || ''
|
if (note.title !== 'Untitled') {
|
||||||
|
title.value = note.title || ''
|
||||||
|
}
|
||||||
|
|
||||||
editor.value = new Editor({
|
editor.value = new Editor({
|
||||||
extensions,
|
extensions,
|
||||||
@@ -76,6 +78,7 @@ onMounted(async () => {
|
|||||||
await nextTick()
|
await nextTick()
|
||||||
if (titleInput.value) {
|
if (titleInput.value) {
|
||||||
titleInput.value.textContent = title.value
|
titleInput.value.textContent = title.value
|
||||||
|
titleInput.value.focus()
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
onBeforeUnmount(() => {
|
onBeforeUnmount(() => {
|
||||||
@@ -101,6 +104,11 @@ const onTitleChange = (e) => {
|
|||||||
updateTitle(title.value)
|
updateTitle(title.value)
|
||||||
}
|
}
|
||||||
const onTitleKeydown = (e) => {
|
const onTitleKeydown = (e) => {
|
||||||
|
if (e.key === 'Enter') {
|
||||||
|
e.preventDefault()
|
||||||
|
editor.value?.commands?.focus()
|
||||||
|
}
|
||||||
|
|
||||||
if (title.value.length >= TITLE_CHAR_LIMIT && e.key.length === 1) {
|
if (title.value.length >= TITLE_CHAR_LIMIT && e.key.length === 1) {
|
||||||
e.preventDefault()
|
e.preventDefault()
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,12 +11,9 @@ Tabula = Index/Overview
|
|||||||
|
|
||||||
Program Key Commands
|
Program Key Commands
|
||||||
|
|
||||||
cmd + s = save\
|
|
||||||
cmd + t = new capitulum\
|
cmd + t = new capitulum\
|
||||||
cmd + n = new nota\
|
cmd + n = new nota\
|
||||||
cmd + x = close window\
|
cmd + x = close window
|
||||||
dbl click = change name / open nota\
|
|
||||||
paste hyperlink twice = activated url
|
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
@@ -25,4 +22,9 @@ Text Markdowns
|
|||||||
cmd + b = Bold\
|
cmd + b = Bold\
|
||||||
cmd + u = underline\
|
cmd + u = underline\
|
||||||
--- = ---------- (ruled line break)\
|
--- = ---------- (ruled line break)\
|
||||||
/_text_/ = Desaturated text
|
\# = Heading\
|
||||||
|
\> = Blockquote\
|
||||||
|
\- = Unordered List\
|
||||||
|
\1. = Ordered List\
|
||||||
|
\` = Inline Code\
|
||||||
|
\``` = Code Block
|
||||||
|
|||||||
@@ -18,6 +18,6 @@
|
|||||||
@mixin p {
|
@mixin p {
|
||||||
font-family: var(--font-mono);
|
font-family: var(--font-mono);
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
line-height: 1;
|
line-height: 1.4;
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,14 +21,17 @@
|
|||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import useNotes from '@/composables/useNotes'
|
import useNotes from '@/composables/useNotes'
|
||||||
import { onMounted, ref, watch } from 'vue'
|
import { onMounted, ref, watch, watchEffect } from 'vue'
|
||||||
import CategoryRow from '@/components/CategoryRow.vue'
|
import CategoryRow from '@/components/CategoryRow.vue'
|
||||||
import NoteRow from '@/components/NoteRow.vue'
|
import NoteRow from '@/components/NoteRow.vue'
|
||||||
import PageLoading from '@/components/PageLoading.vue'
|
import PageLoading from '@/components/PageLoading.vue'
|
||||||
import NewNote from '@/components/NewNote.vue'
|
import NewNote from '@/components/NewNote.vue'
|
||||||
|
import { useMagicKeys } from '@vueuse/core'
|
||||||
|
import { useRouter } from 'vue-router'
|
||||||
|
|
||||||
const { categories, loadCategories, loadCategoryNotes, notesChangeCount } =
|
const { categories, loadCategories, loadCategoryNotes, notesChangeCount } =
|
||||||
useNotes()
|
useNotes()
|
||||||
|
const router = useRouter()
|
||||||
|
|
||||||
const notes = ref()
|
const notes = ref()
|
||||||
const loaded = ref(false)
|
const loaded = ref(false)
|
||||||
@@ -47,6 +50,14 @@ onMounted(async () => {
|
|||||||
watch(notesChangeCount, async () => {
|
watch(notesChangeCount, async () => {
|
||||||
await refreshNotes()
|
await refreshNotes()
|
||||||
})
|
})
|
||||||
|
|
||||||
|
// New category keyboard shortcut
|
||||||
|
const { ctrl, t } = useMagicKeys()
|
||||||
|
watchEffect(() => {
|
||||||
|
if (ctrl.value && t.value) {
|
||||||
|
router.push('/category')
|
||||||
|
}
|
||||||
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
|
|||||||
Reference in New Issue
Block a user