Skip to content

Commit d1fdb0f

Browse files
mejo-backportbot[bot]
authored andcommitted
chore(SessionList): Convert CRLF newlines to LF newlines
Signed-off-by: Jonas <jonas@freesources.org>
1 parent 140f037 commit d1fdb0f

1 file changed

Lines changed: 197 additions & 197 deletions

File tree

Lines changed: 197 additions & 197 deletions
Original file line numberDiff line numberDiff line change
@@ -1,197 +1,197 @@
1-
<!--
2-
- SPDX-FileCopyrightText: 2019 Nextcloud GmbH and Nextcloud contributors
3-
- SPDX-License-Identifier: AGPL-3.0-or-later
4-
-->
5-
6-
<template>
7-
<NcPopover class="session-list" placement="bottom">
8-
<template #trigger="{ attrs }">
9-
<div>
10-
<button :title="label"
11-
:aria-label="label"
12-
class="avatar-list"
13-
v-bind="attrs">
14-
<div class="avatardiv icon-group" />
15-
<AvatarWrapper v-for="session in sessionsVisible"
16-
:key="session.id"
17-
:session="session"
18-
:size="30" />
19-
</button>
20-
</div>
21-
</template>
22-
<template #default>
23-
<div class="session-menu">
24-
<slot name="lastSaved" />
25-
<ul>
26-
<slot />
27-
<li v-for="session in participantsPopover"
28-
:key="session.id"
29-
:style="avatarStyle(session)">
30-
<AvatarWrapper :session="session" :size="36" />
31-
<span class="session-label">
32-
{{
33-
session.userId ? session.displayName : (session.guestName ? session.guestName : t('text', 'Guest'))
34-
}}
35-
</span>
36-
<span v-if="session.userId === null" class="guest-label">({{ t('text', 'guest') }})</span>
37-
</li>
38-
<li>
39-
<NcCheckboxRadioSwitch :checked="isFullWidth" @update:checked="onWidthToggle">
40-
{{ t('text', 'Full width editor') }}
41-
</NcCheckboxRadioSwitch>
42-
</li>
43-
</ul>
44-
</div>
45-
</template>
46-
</NcPopover>
47-
</template>
48-
49-
<script>
50-
import { NcCheckboxRadioSwitch, NcPopover } from '@nextcloud/vue'
51-
import AvatarWrapper from './AvatarWrapper.vue'
52-
import { COLLABORATOR_DISCONNECT_TIME, COLLABORATOR_IDLE_TIME } from '../../services/SyncService.js'
53-
import { loadState } from '@nextcloud/initial-state'
54-
import axios from '@nextcloud/axios'
55-
import { generateUrl } from '@nextcloud/router'
56-
57-
export default {
58-
name: 'SessionList',
59-
components: {
60-
AvatarWrapper,
61-
NcPopover,
62-
NcCheckboxRadioSwitch,
63-
},
64-
props: {
65-
sessions: {
66-
type: Object,
67-
default: () => {
68-
return {}
69-
},
70-
},
71-
},
72-
data() {
73-
const isFullWidth = loadState('text', 'is_full_width_editor', false)
74-
return {
75-
myName: '',
76-
isFullWidth,
77-
}
78-
},
79-
computed: {
80-
label() {
81-
return t('text', 'Active people')
82-
},
83-
participantsPopover() {
84-
if (this.currentSession?.guestName) {
85-
return this.participantsWithoutCurrent
86-
}
87-
return this.participants
88-
},
89-
participantsWithoutCurrent() {
90-
return this.participants.filter((session) => !session.isCurrent)
91-
},
92-
participants() {
93-
return Object.values(this.sessions).filter((session) =>
94-
session.lastContact > Date.now() / 1000 - COLLABORATOR_DISCONNECT_TIME
95-
&& (session.userId !== null || session.guestName !== null),
96-
).sort((a, b) => a.lastContact < b.lastContact)
97-
},
98-
currentSession() {
99-
return Object.values(this.sessions).find((session) => session.isCurrent)
100-
},
101-
avatarStyle() {
102-
return (session) => {
103-
return {
104-
opacity: session.lastContact > Date.now() / 1000 - COLLABORATOR_IDLE_TIME ? 1 : 0.5,
105-
}
106-
}
107-
},
108-
sessionsVisible() {
109-
return this.participantsWithoutCurrent.slice(0, 3)
110-
},
111-
},
112-
methods: {
113-
onWidthToggle(checked) {
114-
this.isFullWidth = checked
115-
this.$emit('editor-width-change', checked ? '100%' : '80ch')
116-
117-
axios.post(generateUrl('/apps/text/settings'), {
118-
key: 'is_full_width_editor',
119-
value: checked ? '1' : '0',
120-
})
121-
},
122-
},
123-
}
124-
</script>
125-
126-
<style scoped lang="scss">
127-
.session-list {
128-
height: var(--default-clickable-area);
129-
}
130-
131-
.avatar-list {
132-
border: none;
133-
background-color: var(--color-main-background);
134-
padding: 0;
135-
margin: 0;
136-
padding-left: 3px;
137-
display: inline-flex;
138-
flex-direction: row-reverse;
139-
140-
.avatar-wrapper {
141-
margin: 0 -12px 0 0;
142-
z-index: 1;
143-
border-radius: 50%;
144-
overflow: hidden;
145-
box-sizing: content-box !important;
146-
height: calc(var(--default-clickable-area) - 4px);
147-
width: calc(var(--default-clickable-area) - 4px);
148-
}
149-
150-
.icon-more, .icon-group, .icon-settings-dark {
151-
width: var(--default-clickable-area);
152-
height: var(--default-clickable-area);
153-
margin: 0 3px 0 0;
154-
155-
&:hover {
156-
background-color: var(--color-background-hover);
157-
}
158-
}
159-
}
160-
161-
.session-menu {
162-
max-width: 280px;
163-
padding-top: 6px;
164-
padding-bottom: 6px;
165-
166-
ul li {
167-
align-items: center;
168-
display: flex;
169-
padding: 6px;
170-
171-
.avatar-wrapper {
172-
height: 36px;
173-
width: 36px;
174-
margin-right: 6px;
175-
}
176-
177-
.session-label {
178-
padding-right: 3px;
179-
}
180-
181-
.guest-label {
182-
padding-left: 3px;
183-
color: var(--color-text-maxcontrast);
184-
}
185-
}
186-
}
187-
188-
label {
189-
display: block;
190-
margin: 8px;
191-
}
192-
193-
.hint {
194-
margin: 8px;
195-
color: var(--color-text-maxcontrast);
196-
}
197-
</style>
1+
<!--
2+
- SPDX-FileCopyrightText: 2019 Nextcloud GmbH and Nextcloud contributors
3+
- SPDX-License-Identifier: AGPL-3.0-or-later
4+
-->
5+
6+
<template>
7+
<NcPopover class="session-list" placement="bottom">
8+
<template #trigger="{ attrs }">
9+
<div>
10+
<button :title="label"
11+
:aria-label="label"
12+
class="avatar-list"
13+
v-bind="attrs">
14+
<div class="avatardiv icon-group" />
15+
<AvatarWrapper v-for="session in sessionsVisible"
16+
:key="session.id"
17+
:session="session"
18+
:size="30" />
19+
</button>
20+
</div>
21+
</template>
22+
<template #default>
23+
<div class="session-menu">
24+
<slot name="lastSaved" />
25+
<ul>
26+
<slot />
27+
<li v-for="session in participantsPopover"
28+
:key="session.id"
29+
:style="avatarStyle(session)">
30+
<AvatarWrapper :session="session" :size="36" />
31+
<span class="session-label">
32+
{{
33+
session.userId ? session.displayName : (session.guestName ? session.guestName : t('text', 'Guest'))
34+
}}
35+
</span>
36+
<span v-if="session.userId === null" class="guest-label">({{ t('text', 'guest') }})</span>
37+
</li>
38+
<li>
39+
<NcCheckboxRadioSwitch :checked="isFullWidth" @update:checked="onWidthToggle">
40+
{{ t('text', 'Full width editor') }}
41+
</NcCheckboxRadioSwitch>
42+
</li>
43+
</ul>
44+
</div>
45+
</template>
46+
</NcPopover>
47+
</template>
48+
49+
<script>
50+
import { NcCheckboxRadioSwitch, NcPopover } from '@nextcloud/vue'
51+
import AvatarWrapper from './AvatarWrapper.vue'
52+
import { COLLABORATOR_DISCONNECT_TIME, COLLABORATOR_IDLE_TIME } from '../../services/SyncService.js'
53+
import { loadState } from '@nextcloud/initial-state'
54+
import axios from '@nextcloud/axios'
55+
import { generateUrl } from '@nextcloud/router'
56+
57+
export default {
58+
name: 'SessionList',
59+
components: {
60+
AvatarWrapper,
61+
NcPopover,
62+
NcCheckboxRadioSwitch,
63+
},
64+
props: {
65+
sessions: {
66+
type: Object,
67+
default: () => {
68+
return {}
69+
},
70+
},
71+
},
72+
data() {
73+
const isFullWidth = loadState('text', 'is_full_width_editor', false)
74+
return {
75+
myName: '',
76+
isFullWidth,
77+
}
78+
},
79+
computed: {
80+
label() {
81+
return t('text', 'Active people')
82+
},
83+
participantsPopover() {
84+
if (this.currentSession?.guestName) {
85+
return this.participantsWithoutCurrent
86+
}
87+
return this.participants
88+
},
89+
participantsWithoutCurrent() {
90+
return this.participants.filter((session) => !session.isCurrent)
91+
},
92+
participants() {
93+
return Object.values(this.sessions).filter((session) =>
94+
session.lastContact > Date.now() / 1000 - COLLABORATOR_DISCONNECT_TIME
95+
&& (session.userId !== null || session.guestName !== null),
96+
).sort((a, b) => a.lastContact < b.lastContact)
97+
},
98+
currentSession() {
99+
return Object.values(this.sessions).find((session) => session.isCurrent)
100+
},
101+
avatarStyle() {
102+
return (session) => {
103+
return {
104+
opacity: session.lastContact > Date.now() / 1000 - COLLABORATOR_IDLE_TIME ? 1 : 0.5,
105+
}
106+
}
107+
},
108+
sessionsVisible() {
109+
return this.participantsWithoutCurrent.slice(0, 3)
110+
},
111+
},
112+
methods: {
113+
onWidthToggle(checked) {
114+
this.isFullWidth = checked
115+
this.$emit('editor-width-change', checked ? '100%' : '80ch')
116+
117+
axios.post(generateUrl('/apps/text/settings'), {
118+
key: 'is_full_width_editor',
119+
value: checked ? '1' : '0',
120+
})
121+
},
122+
},
123+
}
124+
</script>
125+
126+
<style scoped lang="scss">
127+
.session-list {
128+
height: var(--default-clickable-area);
129+
}
130+
131+
.avatar-list {
132+
border: none;
133+
background-color: var(--color-main-background);
134+
padding: 0;
135+
margin: 0;
136+
padding-left: 3px;
137+
display: inline-flex;
138+
flex-direction: row-reverse;
139+
140+
.avatar-wrapper {
141+
margin: 0 -12px 0 0;
142+
z-index: 1;
143+
border-radius: 50%;
144+
overflow: hidden;
145+
box-sizing: content-box !important;
146+
height: calc(var(--default-clickable-area) - 4px);
147+
width: calc(var(--default-clickable-area) - 4px);
148+
}
149+
150+
.icon-more, .icon-group, .icon-settings-dark {
151+
width: var(--default-clickable-area);
152+
height: var(--default-clickable-area);
153+
margin: 0 3px 0 0;
154+
155+
&:hover {
156+
background-color: var(--color-background-hover);
157+
}
158+
}
159+
}
160+
161+
.session-menu {
162+
max-width: 280px;
163+
padding-top: 6px;
164+
padding-bottom: 6px;
165+
166+
ul li {
167+
align-items: center;
168+
display: flex;
169+
padding: 6px;
170+
171+
.avatar-wrapper {
172+
height: 36px;
173+
width: 36px;
174+
margin-right: 6px;
175+
}
176+
177+
.session-label {
178+
padding-right: 3px;
179+
}
180+
181+
.guest-label {
182+
padding-left: 3px;
183+
color: var(--color-text-maxcontrast);
184+
}
185+
}
186+
}
187+
188+
label {
189+
display: block;
190+
margin: 8px;
191+
}
192+
193+
.hint {
194+
margin: 8px;
195+
color: var(--color-text-maxcontrast);
196+
}
197+
</style>

0 commit comments

Comments
 (0)