Compare commits
5 Commits
80dca6def3
...
e4b58b286d
| Author | SHA1 | Date |
|---|---|---|
|
|
e4b58b286d | |
|
|
568cfb507e | |
|
|
6364fc8374 | |
|
|
3533f776bd | |
|
|
e66c79f5fa |
|
|
@ -38,6 +38,7 @@ describe('Instruments on Module page', () => {
|
||||||
value: {
|
value: {
|
||||||
description:
|
description:
|
||||||
'<p>Ein Interview dient dazu, durch Befragung Informationen zu ermitteln. Bei journalistischen Interviews werden oft Expertinnen und Experten befragt, aber auch Personen.</p>',
|
'<p>Ein Interview dient dazu, durch Befragung Informationen zu ermitteln. Bei journalistischen Interviews werden oft Expertinnen und Experten befragt, aber auch Personen.</p>',
|
||||||
|
slug: 'interview',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
|
|
||||||
|
|
@ -100,7 +100,7 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { defineAsyncComponent, inject, onMounted, ref, computed, onUnmounted } from 'vue';
|
import { inject, onMounted, ref, computed, onUnmounted } from 'vue';
|
||||||
|
|
||||||
import { useMutation } from '@vue/apollo-composable';
|
import { useMutation } from '@vue/apollo-composable';
|
||||||
import AddContentButton from '@/components/AddContentButton.vue';
|
import AddContentButton from '@/components/AddContentButton.vue';
|
||||||
|
|
@ -109,6 +109,7 @@ import UserWidget from '@/components/UserWidget.vue';
|
||||||
import VisibilityAction from '@/components/visibility/VisibilityAction.vue';
|
import VisibilityAction from '@/components/visibility/VisibilityAction.vue';
|
||||||
import PopoverLink from '@/components/ui/PopoverLink.vue';
|
import PopoverLink from '@/components/ui/PopoverLink.vue';
|
||||||
import CopyLink from '@/components/CopyLink.vue';
|
import CopyLink from '@/components/CopyLink.vue';
|
||||||
|
import ContentComponent from '@/components/content-blocks/ContentComponent.vue';
|
||||||
import { useRoute, useRouter } from 'vue-router';
|
import { useRoute, useRouter } from 'vue-router';
|
||||||
import { hidden } from '@/helpers/visibility';
|
import { hidden } from '@/helpers/visibility';
|
||||||
import { insertAtIndex, removeAtIndex } from '@/graphql/immutable-operations';
|
import { insertAtIndex, removeAtIndex } from '@/graphql/immutable-operations';
|
||||||
|
|
@ -144,8 +145,6 @@ export interface Props {
|
||||||
editMode?: boolean;
|
editMode?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
const ContentComponent = defineAsyncComponent(() => import('@/components/content-blocks/ContentComponent.vue'));
|
|
||||||
|
|
||||||
const { me, schoolClass } = getMe();
|
const { me, schoolClass } = getMe();
|
||||||
|
|
||||||
const contentBlockDiv = ref<HTMLElement | null>(null);
|
const contentBlockDiv = ref<HTMLElement | null>(null);
|
||||||
|
|
|
||||||
|
|
@ -58,9 +58,9 @@ export interface Props {
|
||||||
saved: boolean;
|
saved: boolean;
|
||||||
placeholder: string;
|
placeholder: string;
|
||||||
action: string;
|
action: string;
|
||||||
readOnly: boolean;
|
readOnly?: boolean;
|
||||||
spellcheck: boolean;
|
spellcheck?: boolean;
|
||||||
spellcheckLoading: boolean;
|
spellcheckLoading?: boolean;
|
||||||
sharedMsg: string;
|
sharedMsg: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -48,7 +48,11 @@ const editText = ref(props.inputText);
|
||||||
const emit = defineEmits(['input']);
|
const emit = defineEmits(['input']);
|
||||||
|
|
||||||
const containsEmoji = (text: string) => {
|
const containsEmoji = (text: string) => {
|
||||||
|
if (!text) {
|
||||||
|
return false
|
||||||
|
}
|
||||||
const lastCharacter = Array.from(text)[Array.from(text).length - 1];
|
const lastCharacter = Array.from(text)[Array.from(text).length - 1];
|
||||||
|
|
||||||
if (lastCharacter && lastCharacter.charCodeAt(0)> 55000) //fix for the hand symbol 🖐️
|
if (lastCharacter && lastCharacter.charCodeAt(0)> 55000) //fix for the hand symbol 🖐️
|
||||||
return true
|
return true
|
||||||
const emojiRegex = /\p{Emoji}/u;
|
const emojiRegex = /\p{Emoji}/u;
|
||||||
|
|
@ -59,11 +63,9 @@ watch(
|
||||||
() => props.inputText,
|
() => props.inputText,
|
||||||
(newValue) => {
|
(newValue) => {
|
||||||
// TODO: Lorenz this is an ugly fix!
|
// TODO: Lorenz this is an ugly fix!
|
||||||
console.log(newValue)
|
|
||||||
|
|
||||||
if (containsEmoji(newValue)) {
|
if (containsEmoji(newValue)) {
|
||||||
console.log("emoji found", newValue)
|
|
||||||
editText.value = newValue;
|
editText.value = newValue;
|
||||||
|
emit('input', editText.value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue