Two random words as the name of anonymous collaborators; no z-order change when read-only
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -447,7 +447,7 @@ async function onSample() {
|
|||||||
:key="p.clientId"
|
:key="p.clientId"
|
||||||
class="avatar peer"
|
class="avatar peer"
|
||||||
:style="{ background: p.color }"
|
:style="{ background: p.color }"
|
||||||
>{{ p.name.replace(/^Anonym \(/, '').slice(0, 1).toUpperCase() }}</span>
|
>{{ p.name.slice(0, 1).toUpperCase() }}</span>
|
||||||
<span v-if="library.peers.value.length > 5" class="more">+{{ library.peers.value.length - 5 }}</span>
|
<span v-if="library.peers.value.length > 5" class="more">+{{ library.peers.value.length - 5 }}</span>
|
||||||
</span>
|
</span>
|
||||||
|
|
||||||
|
|||||||
@@ -90,7 +90,8 @@ function onDrop(e: DragEvent) {
|
|||||||
|
|
||||||
function selectObj(id: string) {
|
function selectObj(id: string) {
|
||||||
store.selectObject(id);
|
store.selectObject(id);
|
||||||
store.bringToFront(id);
|
// z-order is document content: read-only viewers just select
|
||||||
|
if (!store.ui.readOnly) store.bringToFront(id);
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
@@ -39,7 +39,9 @@ const CHANNEL = 'numolus:library';
|
|||||||
const DEFAULT_TITLE = 'Unbenannt';
|
const DEFAULT_TITLE = 'Unbenannt';
|
||||||
const APP_TITLE = 'numolus';
|
const APP_TITLE = 'numolus';
|
||||||
const ANON_COLORS = ['#e67e22', '#2980b9', '#27ae60', '#8e44ad', '#c0392b', '#16a085'];
|
const ANON_COLORS = ['#e67e22', '#2980b9', '#27ae60', '#8e44ad', '#c0392b', '#16a085'];
|
||||||
const ANON_NAMES = ['Fuchs', 'Dachs', 'Luchs', 'Otter', 'Eule', 'Biber', 'Reh', 'Igel'];
|
/** Anonymous people are shown as two random words, e.g. "Kiesel Komet". */
|
||||||
|
const ANON_WORDS_A = ['Kiesel', 'Wolke', 'Anker', 'Nebel', 'Kompass', 'Laterne', 'Moos', 'Feder', 'Bernstein', 'Brise', 'Quelle', 'Funke'];
|
||||||
|
const ANON_WORDS_B = ['Komet', 'Fuchs', 'Welle', 'Ahorn', 'Leuchtturm', 'Otter', 'Gipfel', 'Mond', 'Dachs', 'Birke', 'Falke', 'Stern'];
|
||||||
|
|
||||||
export type DocSource = 'local' | 'server';
|
export type DocSource = 'local' | 'server';
|
||||||
export interface DocRef {
|
export interface DocRef {
|
||||||
@@ -84,7 +86,7 @@ function writeLinks(links: LinkDoc[]) {
|
|||||||
function presenceIdentity(user: { name: string; color: string } | null) {
|
function presenceIdentity(user: { name: string; color: string } | null) {
|
||||||
if (user) return { name: user.name, color: user.color };
|
if (user) return { name: user.name, color: user.color };
|
||||||
const pick = <T>(a: T[]) => a[Math.floor(Math.random() * a.length)];
|
const pick = <T>(a: T[]) => a[Math.floor(Math.random() * a.length)];
|
||||||
return { name: `Anonym (${pick(ANON_NAMES)})`, color: pick(ANON_COLORS) };
|
return { name: `${pick(ANON_WORDS_A)} ${pick(ANON_WORDS_B)}`, color: pick(ANON_COLORS) };
|
||||||
}
|
}
|
||||||
|
|
||||||
function createLibrary() {
|
function createLibrary() {
|
||||||
|
|||||||
Reference in New Issue
Block a user