@saooti/octopus-sdk 31.0.8 → 31.0.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -2
- package/package.json +2 -1
- package/src/App.vue +7 -12
- package/src/assets/general.scss +1 -0
- package/src/components/display/emission/EmissionItem.vue +3 -3
- package/src/components/display/emission/EmissionPlayerItem.vue +4 -4
- package/src/components/display/organisation/OrganisationChooser.vue +2 -2
- package/src/components/display/participant/ParticipantItem.vue +3 -3
- package/src/components/display/playlist/PlaylistItem.vue +3 -6
- package/src/components/display/podcasts/AnimatorsItem.vue +1 -2
- package/src/components/display/podcasts/PodcastImage.vue +4 -1
- package/src/components/display/podcasts/PodcastItem.vue +15 -173
- package/src/components/display/podcasts/PodcastItemInfo.vue +170 -0
- package/src/components/display/podcasts/PodcastList.vue +35 -34
- package/src/components/display/podcasts/PodcastPlayBar.vue +6 -6
- package/src/components/misc/PlayerButtons.vue +1 -1
- package/src/components/pages/Emission.vue +1 -1
- package/src/components/pages/Participant.vue +3 -5
- package/src/components/pages/Playlist.vue +1 -1
- package/src/main.ts +2 -0
package/README.md
CHANGED
|
@@ -569,7 +569,7 @@ See [Configuration Reference](https://cli.vuejs.org/config/).
|
|
|
569
569
|
* 30.0.70 Améliorations 30
|
|
570
570
|
* 30.0.71 Parlement européen
|
|
571
571
|
* 30.0.72 Ajout des traductions
|
|
572
|
-
|
|
572
|
+
* 30.0.73 Ajout classe css
|
|
573
573
|
|
|
574
574
|
* 31.0.0 Passage en 31
|
|
575
575
|
* 31.0.1 Ajout pocket casts
|
|
@@ -580,7 +580,8 @@ See [Configuration Reference](https://cli.vuejs.org/config/).
|
|
|
580
580
|
* 31.0.6 Erreur de Merge 30
|
|
581
581
|
* 31.0.7 Sécurisation
|
|
582
582
|
* 31.0.8 Dropdown Lang + classicSelect
|
|
583
|
-
|
|
583
|
+
* 31.0.9 LazyLoad image
|
|
584
584
|
|
|
585
585
|
|
|
586
586
|
|
|
587
|
+
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@saooti/octopus-sdk",
|
|
3
|
-
"version": "31.0.
|
|
3
|
+
"version": "31.0.9",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Javascript SDK for using octopus",
|
|
6
6
|
"author": "Saooti",
|
|
@@ -37,6 +37,7 @@
|
|
|
37
37
|
"vue-multiselect": "^3.0.0-alpha.2",
|
|
38
38
|
"vue-recaptcha-v3": "^2.0.1",
|
|
39
39
|
"vue-router": "^4.0.12",
|
|
40
|
+
"vue3-lazyload": "^0.2.5-beta",
|
|
40
41
|
"vue3-swatches": "^1.0.5",
|
|
41
42
|
"vuex": "^4.0.2",
|
|
42
43
|
"webpack": "^5.66.0"
|
package/src/App.vue
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div
|
|
2
|
+
<div
|
|
3
|
+
v-if="isInit"
|
|
3
4
|
id="app"
|
|
4
5
|
:key="reload"
|
|
5
6
|
class="octopus-app"
|
|
@@ -45,27 +46,21 @@ export default defineComponent({
|
|
|
45
46
|
data() {
|
|
46
47
|
return {
|
|
47
48
|
displayMenu: false as boolean,
|
|
48
|
-
initQueryRouter: false,
|
|
49
49
|
reload: false as boolean,
|
|
50
|
+
isInit: false as boolean,
|
|
50
51
|
};
|
|
51
52
|
},
|
|
52
53
|
|
|
53
54
|
watch: {
|
|
54
|
-
'$route': {
|
|
55
|
-
deep: true,
|
|
56
|
-
handler(){
|
|
57
|
-
if(!this.initQueryRouter){
|
|
58
|
-
this.initQueryRouter = true;
|
|
59
|
-
this.initApp();
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
},
|
|
63
55
|
'$i18n.locale'(){
|
|
64
56
|
this.$forceUpdate();
|
|
65
57
|
this.reload = !this.reload;
|
|
66
58
|
}
|
|
67
59
|
},
|
|
68
|
-
|
|
60
|
+
async created(){
|
|
61
|
+
await this.initApp();
|
|
62
|
+
this.isInit =true;
|
|
63
|
+
},
|
|
69
64
|
methods:{
|
|
70
65
|
async initApp(){
|
|
71
66
|
await this.initSdk();
|
package/src/assets/general.scss
CHANGED
|
@@ -11,10 +11,10 @@
|
|
|
11
11
|
:title="$t('Emission')"
|
|
12
12
|
class="d-flex text-dark"
|
|
13
13
|
>
|
|
14
|
-
<
|
|
14
|
+
<img
|
|
15
|
+
v-lazy="emission.imageUrl"
|
|
15
16
|
class="img-box"
|
|
16
|
-
|
|
17
|
-
/>
|
|
17
|
+
>
|
|
18
18
|
<div class="emission-item-text">
|
|
19
19
|
<div
|
|
20
20
|
class="emission-name"
|
|
@@ -18,11 +18,11 @@
|
|
|
18
18
|
</div>
|
|
19
19
|
<div
|
|
20
20
|
class="img-box rounded-0"
|
|
21
|
-
:style="{
|
|
22
|
-
'background-image':
|
|
23
|
-
'url(\'' + emission.imageUrl + '?dummy=' + dummyParam + '\')',
|
|
24
|
-
}"
|
|
25
21
|
>
|
|
22
|
+
<img
|
|
23
|
+
v-lazy="emission.imageUrl"
|
|
24
|
+
class="img-box rounded-0"
|
|
25
|
+
>
|
|
26
26
|
<div
|
|
27
27
|
v-if="titleInImage"
|
|
28
28
|
class="titleInImage"
|
|
@@ -44,8 +44,8 @@
|
|
|
44
44
|
<div class="multiselect-octopus-proposition">
|
|
45
45
|
<img
|
|
46
46
|
v-if="!light"
|
|
47
|
+
v-lazy="option.imageUrl"
|
|
47
48
|
class="option__image"
|
|
48
|
-
:src="option.imageUrl"
|
|
49
49
|
:alt="option.name"
|
|
50
50
|
>
|
|
51
51
|
<span
|
|
@@ -64,8 +64,8 @@
|
|
|
64
64
|
>
|
|
65
65
|
<img
|
|
66
66
|
v-if="!light"
|
|
67
|
+
v-lazy="option.imageUrl"
|
|
67
68
|
class="option__image"
|
|
68
|
-
:src="option.imageUrl"
|
|
69
69
|
:alt="option.name"
|
|
70
70
|
>
|
|
71
71
|
<span
|
|
@@ -12,10 +12,10 @@
|
|
|
12
12
|
class="mt-3 text-dark"
|
|
13
13
|
:title="$t('Participant')"
|
|
14
14
|
>
|
|
15
|
-
<
|
|
15
|
+
<img
|
|
16
|
+
v-lazy="participant.imageUrl"
|
|
16
17
|
class="img-box-circle"
|
|
17
|
-
|
|
18
|
-
/>
|
|
18
|
+
>
|
|
19
19
|
<div class="participant-name">
|
|
20
20
|
<img
|
|
21
21
|
v-if="!activeParticipant && !isPodcastmaker && editRight"
|
|
@@ -12,13 +12,10 @@
|
|
|
12
12
|
:title="$t('Playlist')"
|
|
13
13
|
class="text-dark"
|
|
14
14
|
>
|
|
15
|
-
<
|
|
15
|
+
<img
|
|
16
|
+
v-lazy="playlist.imageUrl"
|
|
16
17
|
class="img-box"
|
|
17
|
-
|
|
18
|
-
'background-image':
|
|
19
|
-
'url(\'' + playlist.imageUrl + '?dummy=' + dummyParam + '\')',
|
|
20
|
-
}"
|
|
21
|
-
/>
|
|
18
|
+
>
|
|
22
19
|
</router-link>
|
|
23
20
|
<div class="emission-item-text">
|
|
24
21
|
<router-link
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div
|
|
3
3
|
v-if="animators && 0 !== animators.length"
|
|
4
|
-
class="d-flex align-items-center justify-content-start"
|
|
4
|
+
class="d-flex align-items-center justify-content-start animators-item"
|
|
5
5
|
>
|
|
6
6
|
<router-link
|
|
7
7
|
v-for="(animator, index) in animators"
|
|
@@ -36,7 +36,6 @@ export default defineComponent({
|
|
|
36
36
|
visibleIndex: 0 as number,
|
|
37
37
|
};
|
|
38
38
|
},
|
|
39
|
-
|
|
40
39
|
methods: {
|
|
41
40
|
getAnimatorName(animator: Participant): string {
|
|
42
41
|
const first = animator.firstName || '';
|
|
@@ -2,8 +2,11 @@
|
|
|
2
2
|
<div
|
|
3
3
|
v-if="podcast"
|
|
4
4
|
class="img-box d-flex flex-column justify-content-start align-items-start position-relative justify rounded-lg flex-shrink-0 float-start"
|
|
5
|
-
:style="{ 'background-image': 'url(\'' + podcast.imageUrl + '\')' }"
|
|
6
5
|
>
|
|
6
|
+
<img
|
|
7
|
+
v-lazy="podcast.imageUrl"
|
|
8
|
+
class="img-box"
|
|
9
|
+
>
|
|
7
10
|
<template v-if="isPodcastmaker">
|
|
8
11
|
<div
|
|
9
12
|
:class="mainRubrique? 'mainRubrique' : 'notMainRubrique'"
|
|
@@ -31,78 +31,34 @@
|
|
|
31
31
|
/>
|
|
32
32
|
<!-- eslint-enable -->
|
|
33
33
|
</div>
|
|
34
|
-
<
|
|
35
|
-
|
|
34
|
+
<PodcastItemInfo
|
|
35
|
+
:podcast-id="podcast.podcastId"
|
|
36
|
+
:title="podcast.title"
|
|
37
|
+
:pub-date="podcast.pubDate"
|
|
38
|
+
:podcast-organisation-id="podcast.organisation.id"
|
|
39
|
+
:podcast-organisation-name="podcast.organisation.name"
|
|
40
|
+
:podcast-order="podcast.order"
|
|
41
|
+
:duration="podcast.duration"
|
|
42
|
+
:animators="podcast.animators"
|
|
36
43
|
@mouseenter="showDescription"
|
|
37
44
|
@mouseleave="hideDescription"
|
|
38
|
-
|
|
39
|
-
<div class="d-flex justify-content-between flex-wrap text-secondary mb-3">
|
|
40
|
-
<div class="me-3 small-text">
|
|
41
|
-
{{ date }}
|
|
42
|
-
</div>
|
|
43
|
-
<div
|
|
44
|
-
v-if="0 !== duration.length"
|
|
45
|
-
class="small-text"
|
|
46
|
-
>
|
|
47
|
-
{{ duration }}
|
|
48
|
-
</div>
|
|
49
|
-
</div>
|
|
50
|
-
<AnimatorsItem :animators="podcast.animators" />
|
|
51
|
-
<router-link
|
|
52
|
-
:to="{
|
|
53
|
-
name: 'podcast',
|
|
54
|
-
params: { podcastId: podcast.podcastId },
|
|
55
|
-
query: { productor: $store.state.filter.organisationId },
|
|
56
|
-
}"
|
|
57
|
-
class="text-dark d-flex flex-column flex-grow-1"
|
|
58
|
-
>
|
|
59
|
-
<div class="title-podcast-item">
|
|
60
|
-
{{ title }}
|
|
61
|
-
</div>
|
|
62
|
-
</router-link>
|
|
63
|
-
<PodcastPlayBar
|
|
64
|
-
:podcast="podcast"
|
|
65
|
-
class="mx-2"
|
|
66
|
-
/>
|
|
67
|
-
<div class="d-flex justify-content-between">
|
|
68
|
-
<router-link
|
|
69
|
-
v-if="!isPodcastmaker"
|
|
70
|
-
:to="{
|
|
71
|
-
name: 'productor',
|
|
72
|
-
params: { productorId: podcast.organisation.id },
|
|
73
|
-
query: { productor: $store.state.filter.organisationId },
|
|
74
|
-
}"
|
|
75
|
-
class="text-dark producer-podcast-item"
|
|
76
|
-
>
|
|
77
|
-
<div>{{ '© ' + podcast.organisation.name }}</div>
|
|
78
|
-
</router-link>
|
|
79
|
-
<span
|
|
80
|
-
v-if="editRight && podcast.order && podcast.order > 1"
|
|
81
|
-
class="saooti-star-bounty text-danger pe-2"
|
|
82
|
-
/>
|
|
83
|
-
</div>
|
|
84
|
-
</div>
|
|
45
|
+
/>
|
|
85
46
|
</li>
|
|
86
47
|
</template>
|
|
87
48
|
|
|
88
49
|
<script lang="ts">
|
|
89
|
-
import
|
|
50
|
+
import PodcastItemInfo from './PodcastItemInfo.vue';
|
|
90
51
|
import PodcastImage from './PodcastImage.vue';
|
|
91
52
|
import { state } from '../../../store/paramStore';
|
|
92
53
|
import moment from 'moment';
|
|
93
|
-
// @ts-ignore
|
|
94
|
-
import humanizeDuration from 'humanize-duration';
|
|
95
|
-
import PodcastPlayBar from '../podcasts/PodcastPlayBar.vue';
|
|
96
54
|
import { Podcast } from '@/store/class/general/podcast';
|
|
97
|
-
import { Category } from '@/store/class/general/category';
|
|
98
55
|
import { defineComponent } from 'vue'
|
|
99
56
|
export default defineComponent({
|
|
100
57
|
name: 'PodcastItem',
|
|
101
58
|
|
|
102
59
|
components: {
|
|
103
|
-
|
|
60
|
+
PodcastItemInfo,
|
|
104
61
|
PodcastImage,
|
|
105
|
-
PodcastPlayBar
|
|
106
62
|
},
|
|
107
63
|
|
|
108
64
|
props: {
|
|
@@ -116,113 +72,24 @@ export default defineComponent({
|
|
|
116
72
|
isDescriptionBig: false as boolean,
|
|
117
73
|
};
|
|
118
74
|
},
|
|
119
|
-
|
|
75
|
+
|
|
120
76
|
computed: {
|
|
121
|
-
isPodcastmaker(): boolean {
|
|
122
|
-
return (state.generalParameters.podcastmaker as boolean);
|
|
123
|
-
},
|
|
124
77
|
podcastShadow(): boolean {
|
|
125
78
|
return (state.podcastsPage.podcastShadow as boolean);
|
|
126
79
|
},
|
|
127
80
|
podcastBorderBottom(): boolean {
|
|
128
81
|
return (state.podcastsPage.podcastBorderBottom as boolean);
|
|
129
82
|
},
|
|
130
|
-
date(): string {
|
|
131
|
-
return moment(this.podcast.pubDate).format('D MMMM YYYY, HH[h]mm');
|
|
132
|
-
},
|
|
133
83
|
displayDate(): string {
|
|
134
84
|
return moment(this.podcast.pubDate).format('X');
|
|
135
85
|
},
|
|
136
|
-
category(): string {
|
|
137
|
-
const catIds = this.podcast.emission.iabIds;
|
|
138
|
-
return this.$store.state.categories
|
|
139
|
-
.filter((c: Category) => {
|
|
140
|
-
return catIds && catIds.includes(c.id);
|
|
141
|
-
})
|
|
142
|
-
.map((c: Category) => {
|
|
143
|
-
return c.name;
|
|
144
|
-
})
|
|
145
|
-
.join(', ');
|
|
146
|
-
},
|
|
147
86
|
description(): string {
|
|
148
87
|
if (!this.podcast.description) return '';
|
|
149
88
|
return this.podcast.description;
|
|
150
89
|
},
|
|
151
|
-
title(): string {
|
|
152
|
-
return this.podcast.title;
|
|
153
|
-
},
|
|
154
|
-
organisationId(): string|undefined {
|
|
155
|
-
return state.generalParameters.organisationId;
|
|
156
|
-
},
|
|
157
|
-
authenticated(): boolean {
|
|
158
|
-
return (state.generalParameters.authenticated as boolean);
|
|
159
|
-
},
|
|
160
|
-
editRight(): boolean {
|
|
161
|
-
if (
|
|
162
|
-
(this.authenticated &&
|
|
163
|
-
this.organisationId === this.podcast.organisation.id) ||
|
|
164
|
-
state.generalParameters.isAdmin
|
|
165
|
-
)
|
|
166
|
-
return true;
|
|
167
|
-
return false;
|
|
168
|
-
},
|
|
169
|
-
duration(): string {
|
|
170
|
-
if (this.podcast.duration <= 1) return '';
|
|
171
|
-
if (this.podcast.duration > 600000) {
|
|
172
|
-
return humanizeDuration(this.podcast.duration, {
|
|
173
|
-
language: 'short'+this.$i18n.locale.charAt(0).toUpperCase() + this.$i18n.locale.slice(1),
|
|
174
|
-
largest: 1,
|
|
175
|
-
round: true,
|
|
176
|
-
languages: {
|
|
177
|
-
shortFr: {
|
|
178
|
-
y: () => 'années',
|
|
179
|
-
mo: () => 'mois',
|
|
180
|
-
w: () => 'semaines',
|
|
181
|
-
d: () => 'jours',
|
|
182
|
-
h: () => 'h',
|
|
183
|
-
m: () => 'min',
|
|
184
|
-
s: () => 'sec',
|
|
185
|
-
ms: () => 'ms',
|
|
186
|
-
},
|
|
187
|
-
shortEn: {
|
|
188
|
-
y: () => 'years',
|
|
189
|
-
mo: () => 'months',
|
|
190
|
-
w: () => 'weeks',
|
|
191
|
-
d: () => 'days',
|
|
192
|
-
h: () => 'h',
|
|
193
|
-
m: () => 'min',
|
|
194
|
-
s: () => 'sec',
|
|
195
|
-
ms: () => 'ms',
|
|
196
|
-
},
|
|
197
|
-
shortIt: {
|
|
198
|
-
y: () => 'anni',
|
|
199
|
-
mo: () => 'mesi',
|
|
200
|
-
w: () => 'settimane',
|
|
201
|
-
d: () => 'giorni',
|
|
202
|
-
h: () => 'h',
|
|
203
|
-
m: () => 'min',
|
|
204
|
-
s: () => 'sec',
|
|
205
|
-
ms: () => 'ms',
|
|
206
|
-
},
|
|
207
|
-
},
|
|
208
|
-
});
|
|
209
|
-
}
|
|
210
|
-
return humanizeDuration(this.podcast.duration, {
|
|
211
|
-
language: 'short',
|
|
212
|
-
largest: 2,
|
|
213
|
-
round: true,
|
|
214
|
-
languages: {
|
|
215
|
-
short: {
|
|
216
|
-
m: () => 'min',
|
|
217
|
-
s: () => 'sec',
|
|
218
|
-
ms: () => 'ms',
|
|
219
|
-
},
|
|
220
|
-
},
|
|
221
|
-
});
|
|
222
|
-
},
|
|
223
90
|
},
|
|
224
91
|
|
|
225
|
-
|
|
92
|
+
created() {
|
|
226
93
|
const podcastDesc = document.getElementById(
|
|
227
94
|
'description-podcast-' + this.podcast.podcastId
|
|
228
95
|
);
|
|
@@ -262,26 +129,7 @@ export default defineComponent({
|
|
|
262
129
|
text-align: left;
|
|
263
130
|
background: #fff;
|
|
264
131
|
flex-shrink: 0;
|
|
265
|
-
|
|
266
|
-
margin: 0.5rem !important;
|
|
267
|
-
}
|
|
268
|
-
.saooti-star-bounty {
|
|
269
|
-
font-size: 22px;
|
|
270
|
-
}
|
|
271
|
-
|
|
272
|
-
.title-podcast-item {
|
|
273
|
-
font-weight: 700;
|
|
274
|
-
margin: 0.25rem 0.5rem 0.5rem;
|
|
275
|
-
overflow: hidden;
|
|
276
|
-
display: -webkit-box;
|
|
277
|
-
flex-grow: 1;
|
|
278
|
-
font-size: 0.7rem;
|
|
279
|
-
-webkit-line-clamp: 3;
|
|
280
|
-
-webkit-box-orient: vertical;
|
|
281
|
-
min-height: 3rem;
|
|
282
|
-
line-height: 1rem;
|
|
283
|
-
word-break: break-word;
|
|
284
|
-
}
|
|
132
|
+
|
|
285
133
|
.description-podcast-item {
|
|
286
134
|
padding: 1rem;
|
|
287
135
|
color: #333;
|
|
@@ -306,12 +154,6 @@ export default defineComponent({
|
|
|
306
154
|
background: linear-gradient(to bottom, rgba(255, 255, 255, 0), #fff 40%);
|
|
307
155
|
}
|
|
308
156
|
}
|
|
309
|
-
.producer-podcast-item {
|
|
310
|
-
margin: 0.2rem 0.5rem 0.5rem;
|
|
311
|
-
font-size: 0.55rem;
|
|
312
|
-
color: #666;
|
|
313
|
-
}
|
|
314
|
-
|
|
315
157
|
@media (max-width: 960px) {
|
|
316
158
|
margin: 0.5rem !important;
|
|
317
159
|
}
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="d-contents podcast-item-info">
|
|
3
|
+
<div class="d-flex justify-content-between flex-wrap text-secondary mb-3">
|
|
4
|
+
<div class="me-3 small-text">
|
|
5
|
+
{{ date }}
|
|
6
|
+
</div>
|
|
7
|
+
<div
|
|
8
|
+
v-if="0 !== durationString.length"
|
|
9
|
+
class="small-text"
|
|
10
|
+
>
|
|
11
|
+
{{ durationString }}
|
|
12
|
+
</div>
|
|
13
|
+
</div>
|
|
14
|
+
<AnimatorsItem :animators="animators" />
|
|
15
|
+
<router-link
|
|
16
|
+
:to="{
|
|
17
|
+
name: 'podcast',
|
|
18
|
+
params: { podcastId: podcastId },
|
|
19
|
+
query: { productor: $store.state.filter.organisationId },
|
|
20
|
+
}"
|
|
21
|
+
class="text-dark d-flex flex-column flex-grow-1"
|
|
22
|
+
>
|
|
23
|
+
<div class="title-podcast-item">
|
|
24
|
+
{{ title }}
|
|
25
|
+
</div>
|
|
26
|
+
</router-link>
|
|
27
|
+
<PodcastPlayBar
|
|
28
|
+
:podcast-id="podcastId"
|
|
29
|
+
:duration="duration"
|
|
30
|
+
class="mx-2"
|
|
31
|
+
/>
|
|
32
|
+
<div class="d-flex justify-content-between">
|
|
33
|
+
<router-link
|
|
34
|
+
v-if="!isPodcastmaker"
|
|
35
|
+
:to="{
|
|
36
|
+
name: 'productor',
|
|
37
|
+
params: { productorId: podcastOrganisationId },
|
|
38
|
+
query: { productor: $store.state.filter.organisationId },
|
|
39
|
+
}"
|
|
40
|
+
class="text-dark producer-podcast-item"
|
|
41
|
+
>
|
|
42
|
+
<div>{{ '© ' + podcastOrganisationName }}</div>
|
|
43
|
+
</router-link>
|
|
44
|
+
<span
|
|
45
|
+
v-if="editRight && podcastOrder && podcastOrder > 1"
|
|
46
|
+
class="saooti-star-bounty text-danger pe-2"
|
|
47
|
+
/>
|
|
48
|
+
</div>
|
|
49
|
+
</div>
|
|
50
|
+
</template>
|
|
51
|
+
|
|
52
|
+
<script lang="ts">
|
|
53
|
+
import AnimatorsItem from './AnimatorsItem.vue';
|
|
54
|
+
import { state } from '../../../store/paramStore';
|
|
55
|
+
import moment from 'moment';
|
|
56
|
+
// @ts-ignore
|
|
57
|
+
import humanizeDuration from 'humanize-duration';
|
|
58
|
+
import PodcastPlayBar from './PodcastPlayBar.vue';
|
|
59
|
+
import { defineComponent } from 'vue'
|
|
60
|
+
import { Participant } from '@/store/class/general/participant';
|
|
61
|
+
export default defineComponent({
|
|
62
|
+
name: 'PodcastItemInfo',
|
|
63
|
+
|
|
64
|
+
components: {
|
|
65
|
+
AnimatorsItem,
|
|
66
|
+
PodcastPlayBar
|
|
67
|
+
},
|
|
68
|
+
|
|
69
|
+
props: {
|
|
70
|
+
podcastId: { default: undefined, type: Number},
|
|
71
|
+
title: { default: "", type: String},
|
|
72
|
+
pubDate: { default: "", type: String},
|
|
73
|
+
podcastOrganisationId: { default: "", type: String},
|
|
74
|
+
podcastOrganisationName: { default: "", type: String},
|
|
75
|
+
podcastOrder: { default: undefined, type: Number},
|
|
76
|
+
duration: { default: 0, type: Number},
|
|
77
|
+
animators: { default: undefined, type: Object as ()=> Array<Participant>},
|
|
78
|
+
},
|
|
79
|
+
|
|
80
|
+
computed: {
|
|
81
|
+
isPodcastmaker(): boolean {
|
|
82
|
+
return (state.generalParameters.podcastmaker as boolean);
|
|
83
|
+
},
|
|
84
|
+
date(): string {
|
|
85
|
+
return moment(this.pubDate).format('D MMMM YYYY, HH[h]mm');
|
|
86
|
+
},
|
|
87
|
+
organisationId(): string|undefined {
|
|
88
|
+
return state.generalParameters.organisationId;
|
|
89
|
+
},
|
|
90
|
+
authenticated(): boolean {
|
|
91
|
+
return (state.generalParameters.authenticated as boolean);
|
|
92
|
+
},
|
|
93
|
+
editRight(): boolean {
|
|
94
|
+
if (
|
|
95
|
+
(this.authenticated &&
|
|
96
|
+
this.organisationId === this.podcastOrganisationId) ||
|
|
97
|
+
state.generalParameters.isAdmin
|
|
98
|
+
)
|
|
99
|
+
return true;
|
|
100
|
+
return false;
|
|
101
|
+
},
|
|
102
|
+
durationString(): string {
|
|
103
|
+
if (this.duration <= 1) return '';
|
|
104
|
+
if (this.duration > 600000) {
|
|
105
|
+
return humanizeDuration(this.duration, {
|
|
106
|
+
language: 'short',
|
|
107
|
+
largest: 1,
|
|
108
|
+
round: true,
|
|
109
|
+
languages: {
|
|
110
|
+
short: {
|
|
111
|
+
y: () => 'years',
|
|
112
|
+
mo: () => 'months',
|
|
113
|
+
w: () => 'weeks',
|
|
114
|
+
d: () => 'days',
|
|
115
|
+
h: () => 'h',
|
|
116
|
+
m: () => 'min',
|
|
117
|
+
s: () => 'sec',
|
|
118
|
+
ms: () => 'ms',
|
|
119
|
+
},
|
|
120
|
+
},
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
return humanizeDuration(this.duration, {
|
|
124
|
+
language: 'short',
|
|
125
|
+
largest: 2,
|
|
126
|
+
round: true,
|
|
127
|
+
languages: {
|
|
128
|
+
short: {
|
|
129
|
+
m: () => 'min',
|
|
130
|
+
s: () => 'sec',
|
|
131
|
+
ms: () => 'ms',
|
|
132
|
+
},
|
|
133
|
+
},
|
|
134
|
+
});
|
|
135
|
+
},
|
|
136
|
+
},
|
|
137
|
+
})
|
|
138
|
+
</script>
|
|
139
|
+
|
|
140
|
+
<style lang="scss">
|
|
141
|
+
.octopus-app{
|
|
142
|
+
.podcast-item-info {
|
|
143
|
+
.text-secondary {
|
|
144
|
+
margin: 0.5rem !important;
|
|
145
|
+
}
|
|
146
|
+
.saooti-star-bounty {
|
|
147
|
+
font-size: 22px;
|
|
148
|
+
}
|
|
149
|
+
.title-podcast-item {
|
|
150
|
+
font-weight: 700;
|
|
151
|
+
margin: 0.25rem 0.5rem 0.5rem;
|
|
152
|
+
overflow: hidden;
|
|
153
|
+
display: -webkit-box;
|
|
154
|
+
flex-grow: 1;
|
|
155
|
+
font-size: 0.7rem;
|
|
156
|
+
-webkit-line-clamp: 3;
|
|
157
|
+
-webkit-box-orient: vertical;
|
|
158
|
+
min-height: 3rem;
|
|
159
|
+
line-height: 1rem;
|
|
160
|
+
word-break: break-word;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
.producer-podcast-item {
|
|
164
|
+
margin: 0.2rem 0.5rem 0.5rem;
|
|
165
|
+
font-size: 0.55rem;
|
|
166
|
+
color: #666;
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
</style>
|
|
@@ -4,38 +4,39 @@
|
|
|
4
4
|
:loading-text="loading?$t('Loading podcasts ...'):undefined"
|
|
5
5
|
:error-text="loaded && !podcasts.length?$t(`No podcast match your query`):undefined"
|
|
6
6
|
/>
|
|
7
|
-
<
|
|
8
|
-
v-if="showCount && loaded && podcasts.length > 1"
|
|
9
|
-
class="text-secondary mb-2"
|
|
10
|
-
>
|
|
11
|
-
{{ $t('Number podcasts', { nb: totalCount }) + sortText }}
|
|
12
|
-
</div>
|
|
13
|
-
<ul
|
|
14
|
-
v-show="loaded"
|
|
15
|
-
class="podcast-list"
|
|
16
|
-
>
|
|
17
|
-
<PodcastItem
|
|
18
|
-
v-for="p in podcasts"
|
|
19
|
-
:key="p.podcastId"
|
|
20
|
-
:podcast="p"
|
|
21
|
-
/>
|
|
22
|
-
</ul>
|
|
23
|
-
<button
|
|
24
|
-
v-show="!allFetched && loaded"
|
|
25
|
-
class="btn"
|
|
26
|
-
:class="buttonPlus ? 'btn-link align-self-center width-fit-content m-4' : 'btn-more'"
|
|
27
|
-
:disabled="inFetching"
|
|
28
|
-
:title="$t('See more')"
|
|
29
|
-
@click="displayMore"
|
|
30
|
-
>
|
|
31
|
-
<template v-if="buttonPlus">
|
|
32
|
-
{{ $t('See more') }}
|
|
33
|
-
</template>
|
|
7
|
+
<template v-if="loaded">
|
|
34
8
|
<div
|
|
35
|
-
|
|
36
|
-
class="
|
|
37
|
-
|
|
38
|
-
|
|
9
|
+
v-if="showCount && podcasts.length > 1"
|
|
10
|
+
class="text-secondary mb-2"
|
|
11
|
+
>
|
|
12
|
+
{{ $t('Number podcasts', { nb: totalCount }) + sortText }}
|
|
13
|
+
</div>
|
|
14
|
+
<ul
|
|
15
|
+
class="podcast-list"
|
|
16
|
+
>
|
|
17
|
+
<PodcastItem
|
|
18
|
+
v-for="p in podcasts"
|
|
19
|
+
:key="p.podcastId"
|
|
20
|
+
:podcast="p"
|
|
21
|
+
/>
|
|
22
|
+
</ul>
|
|
23
|
+
<button
|
|
24
|
+
v-show="!allFetched"
|
|
25
|
+
class="btn"
|
|
26
|
+
:class="buttonPlus ? 'btn-link align-self-center width-fit-content m-4' : 'btn-more'"
|
|
27
|
+
:disabled="inFetching"
|
|
28
|
+
:title="$t('See more')"
|
|
29
|
+
@click="displayMore"
|
|
30
|
+
>
|
|
31
|
+
<template v-if="buttonPlus">
|
|
32
|
+
{{ $t('See more') }}
|
|
33
|
+
</template>
|
|
34
|
+
<div
|
|
35
|
+
:class="buttonPlus?'ms-1':''"
|
|
36
|
+
class="saooti-more"
|
|
37
|
+
/>
|
|
38
|
+
</button>
|
|
39
|
+
</template>
|
|
39
40
|
</div>
|
|
40
41
|
</template>
|
|
41
42
|
|
|
@@ -93,7 +94,7 @@ export default defineComponent({
|
|
|
93
94
|
inFetching: false as boolean,
|
|
94
95
|
};
|
|
95
96
|
},
|
|
96
|
-
|
|
97
|
+
|
|
97
98
|
computed: {
|
|
98
99
|
allFetched(): boolean {
|
|
99
100
|
return this.dfirst >= this.totalCount;
|
|
@@ -144,8 +145,8 @@ export default defineComponent({
|
|
|
144
145
|
},
|
|
145
146
|
},
|
|
146
147
|
|
|
147
|
-
created() {
|
|
148
|
-
this.fetchContent(true);
|
|
148
|
+
async created() {
|
|
149
|
+
await this.fetchContent(true);
|
|
149
150
|
},
|
|
150
151
|
methods: {
|
|
151
152
|
async fetchContent(reset: boolean): Promise<void> {
|
|
@@ -32,7 +32,6 @@
|
|
|
32
32
|
</template>
|
|
33
33
|
|
|
34
34
|
<script lang="ts">
|
|
35
|
-
import { Podcast } from '@/store/class/general/podcast';
|
|
36
35
|
import DurationHelper from '../../../helper/duration';
|
|
37
36
|
import { displayMethods } from '../../mixins/functions';
|
|
38
37
|
import { state } from '../../../store/paramStore';
|
|
@@ -41,21 +40,22 @@ export default defineComponent({
|
|
|
41
40
|
name: 'PodcastPlayBar',
|
|
42
41
|
mixins: [displayMethods],
|
|
43
42
|
props: {
|
|
44
|
-
|
|
43
|
+
podcastId: { default: undefined, type: Number},
|
|
44
|
+
duration: { default: 0, type: Number},
|
|
45
45
|
},
|
|
46
46
|
computed: {
|
|
47
47
|
isProgressBar(): boolean{
|
|
48
48
|
return (state.emissionsPage.progressBar as boolean);
|
|
49
49
|
},
|
|
50
50
|
percentProgress(): number{
|
|
51
|
-
if(!this.$store.state.player.podcast || this.
|
|
51
|
+
if(!this.$store.state.player.podcast || this.podcastId !== this.$store.state.player.podcast.podcastId){
|
|
52
52
|
return 0;
|
|
53
53
|
}
|
|
54
54
|
if(!this.$store.state.player.elapsed){return 0;}
|
|
55
55
|
return this.$store.state.player.elapsed * 100;
|
|
56
56
|
},
|
|
57
57
|
playedTime(): string{
|
|
58
|
-
if(this.$store.state.player.podcast && this.
|
|
58
|
+
if(this.$store.state.player.podcast && this.podcastId === this.$store.state.player.podcast.podcastId){
|
|
59
59
|
if (this.$store.state.player.elapsed && this.$store.state.player.elapsed > 0 && this.$store.state.player.total && this.$store.state.player.total > 0) {
|
|
60
60
|
return DurationHelper.formatDuration(
|
|
61
61
|
Math.round(this.$store.state.player.elapsed * this.$store.state.player.total)
|
|
@@ -65,12 +65,12 @@ export default defineComponent({
|
|
|
65
65
|
return '00:00';
|
|
66
66
|
},
|
|
67
67
|
totalTime(): string {
|
|
68
|
-
return DurationHelper.formatDuration(Math.round(this.
|
|
68
|
+
return DurationHelper.formatDuration(Math.round(this.duration/1000));
|
|
69
69
|
},
|
|
70
70
|
},
|
|
71
71
|
methods: {
|
|
72
72
|
seekTo(event: MouseEvent): void {
|
|
73
|
-
if(!this.$store.state.player.podcast || this.
|
|
73
|
+
if(!this.$store.state.player.podcast || this.podcastId !== this.$store.state.player.podcast.podcastId){return;}
|
|
74
74
|
const rect = (event.currentTarget as Element).getBoundingClientRect();
|
|
75
75
|
const barWidth = (event.currentTarget as Element).clientWidth;
|
|
76
76
|
const x = event.clientX - rect.left;
|
|
@@ -14,12 +14,10 @@
|
|
|
14
14
|
<div
|
|
15
15
|
class="d-flex flex-column align-items-center mb-3"
|
|
16
16
|
>
|
|
17
|
-
<
|
|
17
|
+
<img
|
|
18
|
+
v-lazy="participant.imageUrl"
|
|
18
19
|
class="img-box-circle mb-3"
|
|
19
|
-
|
|
20
|
-
'background-image': 'url(\'' + participant.imageUrl + '\')',
|
|
21
|
-
}"
|
|
22
|
-
/>
|
|
20
|
+
>
|
|
23
21
|
<h2 class="text-capitalize">
|
|
24
22
|
{{ name }}
|
|
25
23
|
</h2>
|
package/src/main.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { createApp } from 'vue';
|
|
2
2
|
import { VueReCaptcha } from 'vue-recaptcha-v3';
|
|
3
|
+
import VueLazyLoad from 'vue3-lazyload';
|
|
3
4
|
import App from './App.vue';
|
|
4
5
|
import { createI18n, VueMessageType } from 'vue-i18n';
|
|
5
6
|
import I18nResources from './locale/messages';
|
|
@@ -66,5 +67,6 @@ createApp(App)
|
|
|
66
67
|
.use(i18n)
|
|
67
68
|
.use(store)
|
|
68
69
|
.use(router)
|
|
70
|
+
.use(VueLazyLoad)
|
|
69
71
|
.use(VueReCaptcha, { siteKey: '6LfyP_4ZAAAAAPODj8nov2LvosIwcX0GYeBSungh' })
|
|
70
72
|
.mount('#app');
|