diff options
author | Julius Härtl <jus@bitgrid.net> | 2022-08-14 20:25:34 +0300 |
---|---|---|
committer | Julius Härtl <jus@bitgrid.net> | 2022-08-25 12:04:53 +0300 |
commit | a84270bb37d5bfffe1162ae4da74e5bd9c06c043 (patch) | |
tree | a3b866368805fa1c64873611dcda65a739a9d691 /src | |
parent | edca2da80b1a2d3b3d4db39743a8764c41f484ed (diff) |
Fix linting
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Diffstat (limited to 'src')
-rw-r--r-- | src/components/Mention/AutoCompleteResult.vue | 2 | ||||
-rw-r--r-- | src/components/Mention/List.vue | 7 | ||||
-rw-r--r-- | src/components/Mention/suggestion.js | 6 | ||||
-rw-r--r-- | src/extensions/Mention.js | 26 | ||||
-rw-r--r-- | src/extensions/index.js | 2 |
5 files changed, 21 insertions, 22 deletions
diff --git a/src/components/Mention/AutoCompleteResult.vue b/src/components/Mention/AutoCompleteResult.vue index a8d11fbd9..8dc7e1750 100644 --- a/src/components/Mention/AutoCompleteResult.vue +++ b/src/components/Mention/AutoCompleteResult.vue @@ -164,4 +164,4 @@ $autocomplete-padding: 10px; } } -</style>
\ No newline at end of file +</style> diff --git a/src/components/Mention/List.vue b/src/components/Mention/List.vue index 1774d2648..2e54d732e 100644 --- a/src/components/Mention/List.vue +++ b/src/components/Mention/List.vue @@ -4,8 +4,7 @@ <div v-for="({ id, label }, index) in items" :key="index" :class="id === selectedIndex ? 'highlight' : null"> - <AutoCompleteResult - :id="id" + <AutoCompleteResult :id="id" :label="label" icon="icon-user" source="users" @@ -20,7 +19,7 @@ </template> <script> -import AutoCompleteResult from "./AutoCompleteResult.vue"; +import AutoCompleteResult from './AutoCompleteResult.vue' export default { components: { AutoCompleteResult, @@ -120,4 +119,4 @@ export default { border-color: #000; } } -</style>
\ No newline at end of file +</style> diff --git a/src/components/Mention/suggestion.js b/src/components/Mention/suggestion.js index 385c18a30..711ab0b12 100644 --- a/src/components/Mention/suggestion.js +++ b/src/components/Mention/suggestion.js @@ -4,14 +4,14 @@ import { generateUrl } from '@nextcloud/router' import tippy from 'tippy.js' import List from './List.vue' -const USERS_LIST_ENDPOINT_URL = generateUrl('apps/text/api/v1/users'); +const USERS_LIST_ENDPOINT_URL = generateUrl('apps/text/api/v1/users') export default { items: async ({ query }) => { const params = { filter: query } const response = await axios.post(USERS_LIST_ENDPOINT_URL, params) const users = JSON.parse(JSON.stringify(response.data)) - let result = [] + const result = [] Object.keys(users).map(key => result.push({ id: key, @@ -75,4 +75,4 @@ export default { }, } }, -}
\ No newline at end of file +} diff --git a/src/extensions/Mention.js b/src/extensions/Mention.js index 38024e141..0fcc64753 100644 --- a/src/extensions/Mention.js +++ b/src/extensions/Mention.js @@ -7,15 +7,15 @@ const getAvatarUrl = (user, size) => { user, size, }) -}; +} export default TipTapMention.extend({ parseHTML() { return [ { - tag: `span[data-type="user"]`, - getAttrs: element => ((element.getAttribute('data-type') === "user") - && (element.getAttribute('class') === "mention") + tag: 'span[data-type="user"]', + getAttrs: element => ((element.getAttribute('data-type') === 'user') + && (element.getAttribute('class') === 'mention') && null), priority: 100, }, @@ -29,13 +29,13 @@ export default TipTapMention.extend({ 'span', mergeAttributes(this.options.HTMLAttributes, HTMLAttributes, { 'data-type': this.name, - 'class': 'mention-bubble mention-bubble--primary', - 'contenteditable': false, + class: 'mention-bubble mention-bubble--primary', + contenteditable: false, }), [ 'span', { - 'class': 'mention-bubble__wrapper', + class: 'mention-bubble__wrapper', }, [ 'span', @@ -45,16 +45,16 @@ export default TipTapMention.extend({ [ 'span', { - 'class': `mention-bubble__icon mention-bubble__icon--with-avatar`, - 'style': avatarUrl ? `background-image: url('${avatarUrl}')` : '', + class: 'mention-bubble__icon mention-bubble__icon--with-avatar', + style: avatarUrl ? `background-image: url('${avatarUrl}')` : '', }, ], [ 'span', { - 'role': 'heading', - 'class': 'mention-bubble__title', - 'title': node.attrs.id, + role: 'heading', + class: 'mention-bubble__title', + title: node.attrs.id, }, ], ], @@ -67,4 +67,4 @@ export default TipTapMention.extend({ state.write(`@[${node.attrs.id}](mention://user/${node.attrs.id})`) state.write(' ') }, -});
\ No newline at end of file +}) diff --git a/src/extensions/index.js b/src/extensions/index.js index 02c16b3ff..e15259814 100644 --- a/src/extensions/index.js +++ b/src/extensions/index.js @@ -29,7 +29,7 @@ import Markdown from './Markdown.js' import PlainText from './PlainText.js' import RichText from './RichText.js' import KeepSyntax from './KeepSyntax.js' -import Mention from './Mention' +import Mention from './Mention.js' export { Emoji, |