@saooti/octopus-sdk 40.1.21 → 40.2.0-SNAPSHOT
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/index.ts +7 -1
- package/package.json +1 -1
- package/plateform.conf +1 -1
- package/src/components/composable/player/usePlayerLive.ts +1 -1
- package/src/components/display/accessibility/AccessibilityModal.vue +7 -7
- package/src/components/display/comments/CommentSection.vue +1 -1
- package/src/components/display/emission/EmissionPlayerItem.vue +1 -1
- package/src/components/display/list/SwiperList.vue +1 -1
- package/src/components/display/podcasts/PodcastItemInfo.vue +1 -1
- package/src/components/display/podcasts/PodcastModuleBox.vue +9 -4
- package/src/components/display/podcasts/PodcastRawTranscript.vue +5 -18
- package/src/components/display/sharing/PlayerAnonymousModal.vue +54 -0
- package/src/components/display/sharing/QrCode.vue +26 -28
- package/src/components/display/sharing/ShareAnonymous.vue +291 -0
- package/src/components/display/sharing/ShareNewsletter.vue +216 -0
- package/src/components/display/sharing/ShareSocialsButtons.vue +140 -0
- package/src/components/display/sharing/SubscribeButtons.vue +2 -0
- package/src/components/misc/ClassicNav.vue +9 -3
- package/src/components/misc/ClassicPopover.vue +1 -1
- package/src/components/misc/modal/NewsletterModal.vue +14 -192
- package/src/components/misc/modal/QrCodeModal.vue +2 -1
- package/src/components/pages/EmissionPage.vue +14 -26
- package/src/components/pages/ParticipantPage.vue +17 -7
- package/src/components/pages/PlaylistPage.vue +12 -8
- package/src/components/pages/PodcastPage.vue +15 -38
- package/src/components/pages/RadioPage.vue +12 -7
- package/src/components/pages/VideoPage.vue +0 -2
- package/src/locale/de.ts +2 -2
- package/src/locale/en.ts +2 -2
- package/src/locale/es.ts +2 -2
- package/src/locale/fr.ts +6 -6
- package/src/locale/it.ts +2 -2
- package/src/locale/sl.ts +2 -2
- package/src/router/router.ts +3 -8
- package/src/stores/class/config/commentsConfig.ts +2 -2
- package/src/components/display/sharing/ShareButtons.vue +0 -351
package/index.ts
CHANGED
|
@@ -49,7 +49,13 @@ export const getOrganisationChooser = () => import("./src/components/display/org
|
|
|
49
49
|
export const getPodcastFilterList = () => import("./src/components/display/podcasts/PodcastFilterList.vue");
|
|
50
50
|
export const getPodcastInlineList = () => import("./src/components/display/podcasts/PodcastInlineList.vue");
|
|
51
51
|
export const getPodcastList = () => import("./src/components/display/podcasts/PodcastList.vue");
|
|
52
|
-
export const getShareButtons = () => import("./src/components/display/sharing/
|
|
52
|
+
export const getShareButtons = () => import("./src/components/display/sharing/ShareSocialsButtons.vue");
|
|
53
|
+
export const getShareAnonymous = () => import("./src/components/display/sharing/ShareAnonymous.vue");
|
|
54
|
+
export const getShareNewsletter = () => import("./src/components/display/sharing/ShareNewsletter.vue");
|
|
55
|
+
export const getQrCode = () => import("./src/components/display/sharing/QrCode.vue");
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
|
|
53
59
|
export const getEmissionInlineList = () => import("./src/components/display/emission/EmissionInlineList.vue");
|
|
54
60
|
export const getRubriqueChooser = () => import("./src/components/display/rubriques/RubriqueChooser.vue");
|
|
55
61
|
export const getCommentList = () => import("./src/components/display/comments/CommentList.vue");
|
package/package.json
CHANGED
package/plateform.conf
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
preprod.saooti.org
|
|
@@ -8,7 +8,7 @@ import dayjs from "dayjs";
|
|
|
8
8
|
let Hls:any = null;
|
|
9
9
|
/* eslint-enable*/
|
|
10
10
|
const maxMinutesSessionId = 1;
|
|
11
|
-
export const usePlayerLive = (hlsReady: Ref<
|
|
11
|
+
export const usePlayerLive = (hlsReady: Ref<boolean>)=>{
|
|
12
12
|
|
|
13
13
|
const { listenTime, initLiveDownloadId, setDownloadId, onTimeUpdateProgress } = usePlayerLogicProgress();
|
|
14
14
|
|
|
@@ -75,6 +75,13 @@ export default defineComponent({
|
|
|
75
75
|
},
|
|
76
76
|
|
|
77
77
|
emits: ["close", "save"],
|
|
78
|
+
data() {
|
|
79
|
+
return {
|
|
80
|
+
fontSize :16 as number,
|
|
81
|
+
background: "white" as string,
|
|
82
|
+
color: "black" as string,
|
|
83
|
+
};
|
|
84
|
+
},
|
|
78
85
|
computed:{
|
|
79
86
|
isMaxSize(){
|
|
80
87
|
return this.fontSize>=30;
|
|
@@ -86,13 +93,6 @@ export default defineComponent({
|
|
|
86
93
|
return 'font-size:'+this.fontSize+'px; background:'+this.background+'; color:'+this.color;
|
|
87
94
|
}
|
|
88
95
|
},
|
|
89
|
-
data() {
|
|
90
|
-
return {
|
|
91
|
-
fontSize :16 as number,
|
|
92
|
-
background: "white" as string,
|
|
93
|
-
color: "black" as string,
|
|
94
|
-
};
|
|
95
|
-
},
|
|
96
96
|
created(){
|
|
97
97
|
this.initAccessibility();
|
|
98
98
|
},
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
@slide-change="slideChange"
|
|
15
15
|
>
|
|
16
16
|
<swiper-slide v-for="(obj, index) in listObject" :key="obj">
|
|
17
|
-
<slot name="octopusSlide" :option="obj" :index="index"
|
|
17
|
+
<slot v-if="composableInit" name="octopusSlide" :option="obj" :index="index" />
|
|
18
18
|
</swiper-slide>
|
|
19
19
|
</swiper>
|
|
20
20
|
</template>
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
params: { podcastId: podcast.podcastId },
|
|
12
12
|
}"
|
|
13
13
|
class="text-dark flex-grow-1 title-podcast-item basic-line-clamp three-line"
|
|
14
|
-
:
|
|
14
|
+
:title="$t('Episode name page', { name: podcast.title })"
|
|
15
15
|
>
|
|
16
16
|
{{ podcast.title }}
|
|
17
17
|
</router-link>
|
|
@@ -24,12 +24,15 @@
|
|
|
24
24
|
:datetime="podcast.pubDate">
|
|
25
25
|
{{ date }}
|
|
26
26
|
</time>
|
|
27
|
-
<time :datetime="durationIso">
|
|
28
|
-
{{ duration }}
|
|
29
|
-
</time>
|
|
30
27
|
<div v-if="isLiveReady" class="text-danger">
|
|
31
28
|
{{ $t("Episode record in live") }}
|
|
32
29
|
</div>
|
|
30
|
+
<div class="d-flex flex-column align-items-end flex-grow-1">
|
|
31
|
+
<time :datetime="durationIso">
|
|
32
|
+
{{ duration }}
|
|
33
|
+
</time>
|
|
34
|
+
<ShareAnonymous v-if="!editRight" :podcast="podcast" :organisation-id="podcast.organisation.id"/>
|
|
35
|
+
</div>
|
|
33
36
|
</div>
|
|
34
37
|
<h2 class="mb-3">
|
|
35
38
|
{{ podcast.title }}
|
|
@@ -188,6 +191,7 @@ const PodcastPlannedSpinner = defineAsyncComponent(
|
|
|
188
191
|
);
|
|
189
192
|
const Countdown = defineAsyncComponent(() => import("../live/CountDown.vue"));
|
|
190
193
|
const TagList = defineAsyncComponent(() => import("./TagList.vue"));
|
|
194
|
+
const ShareAnonymous = defineAsyncComponent(() => import("../sharing/ShareAnonymous.vue"));
|
|
191
195
|
const PodcastRubriqueList = defineAsyncComponent(() => import("./PodcastRubriqueList.vue"));
|
|
192
196
|
import { mapState } from "pinia";
|
|
193
197
|
export default defineComponent({
|
|
@@ -207,7 +211,8 @@ export default defineComponent({
|
|
|
207
211
|
DownloadPodcastButton,
|
|
208
212
|
NewspaperVariantOutlineIcon,
|
|
209
213
|
PodcastPlannedSpinner,
|
|
210
|
-
PodcastRubriqueList
|
|
214
|
+
PodcastRubriqueList,
|
|
215
|
+
ShareAnonymous
|
|
211
216
|
},
|
|
212
217
|
|
|
213
218
|
props: {
|
|
@@ -80,15 +80,15 @@ export default defineComponent({
|
|
|
80
80
|
},
|
|
81
81
|
methods: {
|
|
82
82
|
getAccessibility(){
|
|
83
|
-
|
|
83
|
+
const fontSize = cookiesHelper.getCookie("octopus-font-size");
|
|
84
84
|
if (null !== fontSize) {
|
|
85
85
|
this.setCssProperty('--octopus-accessibility-font-size', fontSize);
|
|
86
86
|
}
|
|
87
|
-
|
|
87
|
+
const background = cookiesHelper.getCookie("octopus-background");
|
|
88
88
|
if (null !== background) {
|
|
89
89
|
this.setCssProperty('--octopus-accessibility-background', background);
|
|
90
90
|
}
|
|
91
|
-
|
|
91
|
+
const color = cookiesHelper.getCookie("octopus-color");
|
|
92
92
|
if (null !== color) {
|
|
93
93
|
this.setCssProperty('--octopus-accessibility-color', color);
|
|
94
94
|
}
|
|
@@ -212,25 +212,12 @@ export default defineComponent({
|
|
|
212
212
|
white-space: pre-wrap;
|
|
213
213
|
background: var(--octopus-accessibility-background);
|
|
214
214
|
color: var(--octopus-accessibility-color);
|
|
215
|
+
border: 2px solid var(--octopus-border-default);
|
|
216
|
+
border-radius: var(--octopus-border-radius);
|
|
215
217
|
|
|
216
218
|
.transcription-text {
|
|
217
219
|
overflow: hidden auto;
|
|
218
220
|
}
|
|
219
|
-
|
|
220
|
-
&::before {
|
|
221
|
-
content: "";
|
|
222
|
-
position: absolute;
|
|
223
|
-
inset: 0;
|
|
224
|
-
padding: 3px;
|
|
225
|
-
background: repeating-conic-gradient(
|
|
226
|
-
var(--octopus-secondary) 0 25%,
|
|
227
|
-
var(--octopus-primary) 0 50%
|
|
228
|
-
)
|
|
229
|
-
0 0/30px 30px round;
|
|
230
|
-
mask:linear-gradient(black 0 0) content-box, linear-gradient(black 0 0);
|
|
231
|
-
mask-composite: exclude;
|
|
232
|
-
pointer-events: none;
|
|
233
|
-
}
|
|
234
221
|
}
|
|
235
222
|
}
|
|
236
223
|
</style>
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<ClassicModal
|
|
3
|
+
id-modal="player-anonymous-modal"
|
|
4
|
+
:title-modal="$t('Share the player')"
|
|
5
|
+
@close="closePopup"
|
|
6
|
+
>
|
|
7
|
+
<template #body>
|
|
8
|
+
<SharePlayer
|
|
9
|
+
:podcast="podcast"
|
|
10
|
+
:emission="emission"
|
|
11
|
+
:exclusive="exclusive"
|
|
12
|
+
:not-exclusive="notExclusive"
|
|
13
|
+
:organisation-id="authOrgaId"
|
|
14
|
+
/>
|
|
15
|
+
</template>
|
|
16
|
+
<template #footer>
|
|
17
|
+
<button class="btn btn-primary m-1" @click="closePopup">
|
|
18
|
+
{{ $t("Close") }}
|
|
19
|
+
</button>
|
|
20
|
+
</template>
|
|
21
|
+
</ClassicModal>
|
|
22
|
+
</template>
|
|
23
|
+
|
|
24
|
+
<script lang="ts">
|
|
25
|
+
import { Podcast } from "@/stores/class/general/podcast";
|
|
26
|
+
import ClassicModal from "../../misc/modal/ClassicModal.vue";
|
|
27
|
+
import SharePlayer from "./SharePlayer.vue";
|
|
28
|
+
import { useAuthStore } from "../../../stores/AuthStore";
|
|
29
|
+
import { defineComponent } from "vue";
|
|
30
|
+
import { Emission } from "@/stores/class/general/emission";
|
|
31
|
+
import { mapState } from "pinia";
|
|
32
|
+
export default defineComponent({
|
|
33
|
+
name: "PlayerAnonymousModal",
|
|
34
|
+
components: {
|
|
35
|
+
ClassicModal,
|
|
36
|
+
SharePlayer
|
|
37
|
+
},
|
|
38
|
+
props: {
|
|
39
|
+
podcast: { default: undefined, type: Object as () => Podcast },
|
|
40
|
+
emission: { default: undefined, type: Object as () => Emission },
|
|
41
|
+
exclusive: { default: false, type: Boolean },
|
|
42
|
+
notExclusive: { default: true, type: Boolean },
|
|
43
|
+
},
|
|
44
|
+
emits: ["close"],
|
|
45
|
+
computed:{
|
|
46
|
+
...mapState(useAuthStore, ["authOrgaId"]),
|
|
47
|
+
},
|
|
48
|
+
methods: {
|
|
49
|
+
closePopup(): void {
|
|
50
|
+
this.$emit("close");
|
|
51
|
+
},
|
|
52
|
+
},
|
|
53
|
+
});
|
|
54
|
+
</script>
|
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="d-flex flex-column align-items-center">
|
|
3
|
+
<div class="d-flex align-items-center mb-3">
|
|
4
|
+
<div class="form-label me-3">
|
|
5
|
+
{{ $t("Choose color") }}
|
|
6
|
+
</div>
|
|
7
|
+
<VSwatches
|
|
8
|
+
v-model:model-value="color"
|
|
9
|
+
class="c-hand"
|
|
10
|
+
show-fallback
|
|
11
|
+
fallback-input-type="color"
|
|
12
|
+
colors="text-advanced"
|
|
13
|
+
popover-to="right"
|
|
14
|
+
popover-y="bottom"
|
|
15
|
+
:data-color="color"
|
|
16
|
+
/>
|
|
17
|
+
</div>
|
|
3
18
|
<qrcode-vue
|
|
4
19
|
:value="url"
|
|
5
20
|
:size="size"
|
|
@@ -8,14 +23,7 @@
|
|
|
8
23
|
class="myQrCode"
|
|
9
24
|
:margin="2"
|
|
10
25
|
/>
|
|
11
|
-
<
|
|
12
|
-
v-if="'#000000' !== otherColor"
|
|
13
|
-
v-model:text-init="isNotBlack"
|
|
14
|
-
class="flex-shrink-0"
|
|
15
|
-
id-checkbox="is-black-qr-code"
|
|
16
|
-
:label="$t('Use organization color')"
|
|
17
|
-
/>
|
|
18
|
-
<button class="btn m-3" @click="download">
|
|
26
|
+
<button class="btn btn-primary my-3" @click="download">
|
|
19
27
|
{{ $t("Download") }}
|
|
20
28
|
</button>
|
|
21
29
|
<SnackBar ref="snackbar" position="bottom-left" />
|
|
@@ -23,12 +31,12 @@
|
|
|
23
31
|
</template>
|
|
24
32
|
|
|
25
33
|
<script lang="ts">
|
|
26
|
-
import
|
|
34
|
+
import { VSwatches } from "vue3-swatches";
|
|
35
|
+
import "vue3-swatches/dist/style.css";
|
|
27
36
|
import SnackBar from "../../misc/SnackBar.vue";
|
|
28
37
|
import QrcodeVue from "qrcode.vue";
|
|
29
38
|
import { useSaveFetchStore } from "../../../stores/SaveFetchStore";
|
|
30
|
-
import {
|
|
31
|
-
import { mapState, mapActions } from "pinia";
|
|
39
|
+
import { mapActions } from "pinia";
|
|
32
40
|
import { defineComponent } from "vue";
|
|
33
41
|
export default defineComponent({
|
|
34
42
|
name: "QrCode",
|
|
@@ -36,29 +44,20 @@ export default defineComponent({
|
|
|
36
44
|
components: {
|
|
37
45
|
SnackBar,
|
|
38
46
|
QrcodeVue,
|
|
39
|
-
|
|
47
|
+
VSwatches,
|
|
40
48
|
},
|
|
41
49
|
props: {
|
|
42
50
|
url: { default: "", type: String },
|
|
51
|
+
orgaForColor: { default: undefined, type: String },
|
|
43
52
|
},
|
|
44
53
|
data() {
|
|
45
54
|
return {
|
|
46
55
|
size: 200 as number,
|
|
47
56
|
color: "#000000" as string,
|
|
48
|
-
otherColor: "#000000" as string,
|
|
49
|
-
isNotBlack: false as boolean,
|
|
50
57
|
};
|
|
51
58
|
},
|
|
52
|
-
computed: {
|
|
53
|
-
...mapState(useAuthStore, ["authOrganisation", "authOrgaId"]),
|
|
54
|
-
},
|
|
55
|
-
watch: {
|
|
56
|
-
isNotBlack() {
|
|
57
|
-
this.color = this.isNotBlack ? this.otherColor : "#000000";
|
|
58
|
-
},
|
|
59
|
-
},
|
|
60
59
|
created() {
|
|
61
|
-
this.
|
|
60
|
+
this.initDefaultColor();
|
|
62
61
|
},
|
|
63
62
|
methods: {
|
|
64
63
|
...mapActions(useSaveFetchStore, ["getOrgaAttributes"]),
|
|
@@ -74,12 +73,11 @@ export default defineComponent({
|
|
|
74
73
|
);
|
|
75
74
|
}
|
|
76
75
|
},
|
|
77
|
-
async
|
|
78
|
-
if (undefined === this.
|
|
79
|
-
const
|
|
80
|
-
const attributes = await this.getOrgaAttributes(orgaId ?? "");
|
|
76
|
+
async initDefaultColor(): Promise<void> {
|
|
77
|
+
if (undefined === this.orgaForColor) return;
|
|
78
|
+
const attributes = await this.getOrgaAttributes(this.orgaForColor);
|
|
81
79
|
if (Object.hasOwn(attributes, "COLOR")) {
|
|
82
|
-
this.
|
|
80
|
+
this.color = attributes.COLOR as string;
|
|
83
81
|
}
|
|
84
82
|
},
|
|
85
83
|
},
|
|
@@ -0,0 +1,291 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div v-if="!isLoading && !noSharing">
|
|
3
|
+
<button
|
|
4
|
+
id="anonymous-share-button"
|
|
5
|
+
:class="btnClass"
|
|
6
|
+
:title="$t('Share')"
|
|
7
|
+
>
|
|
8
|
+
<DotsHorizontalIcon />
|
|
9
|
+
</button>
|
|
10
|
+
<ClassicPopover
|
|
11
|
+
target="anonymous-share-button"
|
|
12
|
+
:relative-class="relativeClass"
|
|
13
|
+
:is-fixed="true"
|
|
14
|
+
:left-pos="true"
|
|
15
|
+
:only-click="true"
|
|
16
|
+
>
|
|
17
|
+
<div
|
|
18
|
+
v-for="button in dropdownButtons"
|
|
19
|
+
:key="button.icon"
|
|
20
|
+
class="d-flex flex-column"
|
|
21
|
+
>
|
|
22
|
+
<button
|
|
23
|
+
v-if="button.condition"
|
|
24
|
+
:key="button.title"
|
|
25
|
+
class="btn-transparent d-flex flex-nowrap justify-content-start align-items-center octopus-dropdown-item py-2"
|
|
26
|
+
:title="button.title"
|
|
27
|
+
@mousedown="clickButton(button.emitName)"
|
|
28
|
+
@keydown.enter="clickButton(button.emitName)"
|
|
29
|
+
>
|
|
30
|
+
<component :is="button.icon" />
|
|
31
|
+
<div class="ms-1">{{ button.title }}</div>
|
|
32
|
+
</button>
|
|
33
|
+
</div>
|
|
34
|
+
</ClassicPopover>
|
|
35
|
+
<QrCodeModal
|
|
36
|
+
v-if="isQrCodeModal"
|
|
37
|
+
:url-page="urlPage"
|
|
38
|
+
:orga-for-color="organisationId"
|
|
39
|
+
@close="isQrCodeModal = false"
|
|
40
|
+
/>
|
|
41
|
+
<PlayerAnonymousModal
|
|
42
|
+
v-if="isPlayerModal"
|
|
43
|
+
:podcast="podcast"
|
|
44
|
+
:emission="emission ?? podcast?.emission"
|
|
45
|
+
:exclusive="!playerCanBeSharedOthers"
|
|
46
|
+
:not-exclusive="playerCanBeSharedAnonymous"
|
|
47
|
+
@close="isPlayerModal = false"
|
|
48
|
+
/>
|
|
49
|
+
<NewsletterModal
|
|
50
|
+
v-if="isNewsletterModal"
|
|
51
|
+
:closable="true"
|
|
52
|
+
:podcast="podcast"
|
|
53
|
+
:emission="emission"
|
|
54
|
+
:playlist="playlist"
|
|
55
|
+
@close="isNewsletterModal = false"
|
|
56
|
+
/>
|
|
57
|
+
<ClipboardModal
|
|
58
|
+
v-if="isRssModal"
|
|
59
|
+
:link="rssUrl"
|
|
60
|
+
@close="isRssModal = false"
|
|
61
|
+
@copy="afterCopy"
|
|
62
|
+
/>
|
|
63
|
+
<SnackBar
|
|
64
|
+
v-if="lazyLoadingSnackbar"
|
|
65
|
+
ref="snackbar"
|
|
66
|
+
position="bottom-left"
|
|
67
|
+
/>
|
|
68
|
+
</div>
|
|
69
|
+
</template>
|
|
70
|
+
|
|
71
|
+
<script lang="ts">
|
|
72
|
+
import QrcodeIcon from "vue-material-design-icons/Qrcode.vue";
|
|
73
|
+
import LinkVariantIcon from "vue-material-design-icons/LinkVariant.vue";
|
|
74
|
+
import DotsHorizontalIcon from "vue-material-design-icons/DotsHorizontal.vue";
|
|
75
|
+
import ClassicPopover from "../../misc/ClassicPopover.vue";
|
|
76
|
+
import displayHelper from "../../../helper/displayHelper";
|
|
77
|
+
import { defineAsyncComponent, defineComponent } from "vue";
|
|
78
|
+
import { useApiStore } from "../../../stores/ApiStore";
|
|
79
|
+
import { useSaveFetchStore } from "../../../stores/SaveFetchStore";
|
|
80
|
+
import { useAuthStore } from "../../../stores/AuthStore";
|
|
81
|
+
import { Podcast } from "@/stores/class/general/podcast";
|
|
82
|
+
import { Emission } from "@/stores/class/general/emission";
|
|
83
|
+
import { Playlist } from "@/stores/class/general/playlist";
|
|
84
|
+
import { mapActions, mapState } from "pinia";
|
|
85
|
+
import { state } from "../../../stores/ParamSdkStore";
|
|
86
|
+
import classicApi from "../../../api/classicApi";
|
|
87
|
+
const SnackBar = defineAsyncComponent(() => import("../../misc/SnackBar.vue"));
|
|
88
|
+
const NewsletterModal = defineAsyncComponent(
|
|
89
|
+
() => import("../../misc/modal/NewsletterModal.vue"),
|
|
90
|
+
);
|
|
91
|
+
const QrCodeModal = defineAsyncComponent(
|
|
92
|
+
() => import("../../misc/modal/QrCodeModal.vue"),
|
|
93
|
+
);
|
|
94
|
+
const ClipboardModal = defineAsyncComponent(
|
|
95
|
+
() => import("../../misc/modal/ClipboardModal.vue"),
|
|
96
|
+
);
|
|
97
|
+
const PlayerAnonymousModal = defineAsyncComponent(
|
|
98
|
+
() => import("../sharing/PlayerAnonymousModal.vue"),
|
|
99
|
+
);
|
|
100
|
+
const CodeTagsIcon = defineAsyncComponent(
|
|
101
|
+
() => import("vue-material-design-icons/CodeTags.vue"),
|
|
102
|
+
);
|
|
103
|
+
const EmailNewsletterIcon = defineAsyncComponent(
|
|
104
|
+
() => import("vue-material-design-icons/EmailNewsletter.vue"),
|
|
105
|
+
);
|
|
106
|
+
const RssIcon = defineAsyncComponent(
|
|
107
|
+
() => import("vue-material-design-icons/Rss.vue"),
|
|
108
|
+
);
|
|
109
|
+
export default defineComponent({
|
|
110
|
+
name: "PodcastShareAnonymous",
|
|
111
|
+
components: {
|
|
112
|
+
ClassicPopover,
|
|
113
|
+
DotsHorizontalIcon,
|
|
114
|
+
LinkVariantIcon,
|
|
115
|
+
EmailNewsletterIcon,
|
|
116
|
+
QrcodeIcon,
|
|
117
|
+
CodeTagsIcon,
|
|
118
|
+
RssIcon,
|
|
119
|
+
SnackBar,
|
|
120
|
+
NewsletterModal,
|
|
121
|
+
QrCodeModal,
|
|
122
|
+
ClipboardModal,
|
|
123
|
+
PlayerAnonymousModal
|
|
124
|
+
},
|
|
125
|
+
|
|
126
|
+
props: {
|
|
127
|
+
podcast: { default: undefined, type: Object as () => Podcast },
|
|
128
|
+
emission: { default: undefined, type: Object as () => Emission },
|
|
129
|
+
playlist: { default: undefined, type: Object as () => Playlist },
|
|
130
|
+
participantId: { default: undefined, type: Number },
|
|
131
|
+
organisationId: { default: undefined, type: String },
|
|
132
|
+
relativeClass: { default: "page-element", type: String },
|
|
133
|
+
btnClass: { default: "btn btn-transparent", type: String },
|
|
134
|
+
},
|
|
135
|
+
|
|
136
|
+
data() {
|
|
137
|
+
return {
|
|
138
|
+
lazyLoadingSnackbar: false as boolean,
|
|
139
|
+
isNewsletterModal: false as boolean,
|
|
140
|
+
isQrCodeModal: false as boolean,
|
|
141
|
+
displayRss: false as boolean,
|
|
142
|
+
noSharing: true as boolean,
|
|
143
|
+
playerCanBeSharedAnonymous: false as boolean,
|
|
144
|
+
playerCanBeSharedOthers: false as boolean,
|
|
145
|
+
isLoading: true as boolean,
|
|
146
|
+
isRssModal: false as boolean,
|
|
147
|
+
isPlayerModal: false as boolean
|
|
148
|
+
};
|
|
149
|
+
},
|
|
150
|
+
computed:{
|
|
151
|
+
...mapState(useAuthStore, ["isGarRole","authOrgaId"]),
|
|
152
|
+
...mapState(useApiStore, ["apiUrl"]),
|
|
153
|
+
urlPage(): string {
|
|
154
|
+
return window.location.href;
|
|
155
|
+
},
|
|
156
|
+
isPodcastmaker(): boolean {
|
|
157
|
+
return state.generalParameters.podcastmaker as boolean;
|
|
158
|
+
},
|
|
159
|
+
rssUrl(): string {
|
|
160
|
+
const api = this.apiUrl + "rss/";
|
|
161
|
+
if (
|
|
162
|
+
(!this.isPodcastmaker && this.playlist) ||
|
|
163
|
+
this.podcast ||
|
|
164
|
+
this.emission
|
|
165
|
+
) {
|
|
166
|
+
return "";
|
|
167
|
+
}
|
|
168
|
+
if (this.participantId) {
|
|
169
|
+
return api + "participant/" + this.participantId + ".rss";
|
|
170
|
+
}
|
|
171
|
+
if (this.playlist) {
|
|
172
|
+
return api + "playlist/" + this.playlist.playlistId + ".rss";
|
|
173
|
+
}
|
|
174
|
+
if (this.organisationId) {
|
|
175
|
+
return api + "productor/" + this.organisationId + ".rss";
|
|
176
|
+
}
|
|
177
|
+
return "";
|
|
178
|
+
},
|
|
179
|
+
titleRssButton(): string {
|
|
180
|
+
if (this.participantId) {
|
|
181
|
+
return this.$t("Subscribe to this participant");
|
|
182
|
+
}
|
|
183
|
+
if (this.emission) {
|
|
184
|
+
return this.$t("Subscribe to this emission");
|
|
185
|
+
}
|
|
186
|
+
return this.$t("Subscribe to this RSS feed");
|
|
187
|
+
},
|
|
188
|
+
dropdownButtons() {
|
|
189
|
+
return [
|
|
190
|
+
{
|
|
191
|
+
title: this.$t("Copy this page URL"),
|
|
192
|
+
icon: "LinkVariantIcon",
|
|
193
|
+
condition:true,
|
|
194
|
+
emitName: "link",
|
|
195
|
+
},
|
|
196
|
+
{
|
|
197
|
+
title: this.$t("Share the player"),
|
|
198
|
+
icon: "CodeTagsIcon",
|
|
199
|
+
condition: !this.isPodcastmaker && (this.playerCanBeSharedAnonymous || (this.playerCanBeSharedOthers && this.authOrgaId)),
|
|
200
|
+
emitName: "player",
|
|
201
|
+
},
|
|
202
|
+
{
|
|
203
|
+
title: this.$t("Share newsletter"),
|
|
204
|
+
icon: "EmailNewsletterIcon",
|
|
205
|
+
condition: this.podcast || this.emission || this.playlist,
|
|
206
|
+
emitName: "newsletter",
|
|
207
|
+
},
|
|
208
|
+
{
|
|
209
|
+
title: this.$t("Share QR Code"),
|
|
210
|
+
icon: "QrcodeIcon",
|
|
211
|
+
condition: true,
|
|
212
|
+
emitName: "qrcode",
|
|
213
|
+
},
|
|
214
|
+
{
|
|
215
|
+
title: this.titleRssButton,
|
|
216
|
+
icon: "RssIcon",
|
|
217
|
+
condition: '' !== this.rssUrl && this.displayRss && !this.isGarRole,
|
|
218
|
+
emitName: "rss",
|
|
219
|
+
},
|
|
220
|
+
];
|
|
221
|
+
},
|
|
222
|
+
},
|
|
223
|
+
created() {
|
|
224
|
+
this.initShareButtons();
|
|
225
|
+
},
|
|
226
|
+
methods:{
|
|
227
|
+
...mapActions(useSaveFetchStore, ["getOrgaAttributes"]),
|
|
228
|
+
async initShareButtons() {
|
|
229
|
+
if (undefined !== this.participantId) {
|
|
230
|
+
this.displayRss = await classicApi.fetchData<boolean>({
|
|
231
|
+
api: 0,
|
|
232
|
+
path: `rss/participants/allowed/${this.organisationId}`,
|
|
233
|
+
isNotAuth: true,
|
|
234
|
+
});
|
|
235
|
+
} else {
|
|
236
|
+
this.displayRss = true;
|
|
237
|
+
}
|
|
238
|
+
this.determinePlayerCanBeShared();
|
|
239
|
+
if (!this.organisationId) {
|
|
240
|
+
return;
|
|
241
|
+
}
|
|
242
|
+
const attributes = await this.getOrgaAttributes(this.organisationId);
|
|
243
|
+
this.noSharing = "true" === attributes.noSharing;
|
|
244
|
+
this.isLoading = false;
|
|
245
|
+
},
|
|
246
|
+
determinePlayerCanBeShared() {
|
|
247
|
+
const emissionAnnot = this.podcast?.emission.annotations ?? this.emission?.annotations;
|
|
248
|
+
if (!emissionAnnot) { return }
|
|
249
|
+
if (emissionAnnot.exclusive) {
|
|
250
|
+
this.playerCanBeSharedOthers = "true" !== emissionAnnot.exclusive;
|
|
251
|
+
}
|
|
252
|
+
if (emissionAnnot.notExclusive) {
|
|
253
|
+
this.playerCanBeSharedAnonymous = "true" === emissionAnnot.notExclusive;
|
|
254
|
+
}
|
|
255
|
+
},
|
|
256
|
+
clickButton(name: string) {
|
|
257
|
+
switch (name) {
|
|
258
|
+
case "link":
|
|
259
|
+
displayHelper.onCopyCode(this.urlPage, this.afterCopy);
|
|
260
|
+
break;
|
|
261
|
+
case "newsletter":
|
|
262
|
+
this.isNewsletterModal = true;
|
|
263
|
+
break;
|
|
264
|
+
case "qrcode":
|
|
265
|
+
this.isQrCodeModal = true;
|
|
266
|
+
break;
|
|
267
|
+
case "rss":
|
|
268
|
+
this.isRssModal = true;
|
|
269
|
+
break;
|
|
270
|
+
case "player":
|
|
271
|
+
this.isPlayerModal = true;
|
|
272
|
+
break;
|
|
273
|
+
default:
|
|
274
|
+
break;
|
|
275
|
+
}
|
|
276
|
+
},
|
|
277
|
+
afterCopy(): void {
|
|
278
|
+
if (!this.lazyLoadingSnackbar) {
|
|
279
|
+
this.lazyLoadingSnackbar = true;
|
|
280
|
+
setTimeout(() => {
|
|
281
|
+
this.afterCopy();
|
|
282
|
+
}, 500);
|
|
283
|
+
} else {
|
|
284
|
+
(this.$refs.snackbar as InstanceType<typeof SnackBar>).open(
|
|
285
|
+
this.$t("Link in clipboard"),
|
|
286
|
+
);
|
|
287
|
+
}
|
|
288
|
+
},
|
|
289
|
+
}
|
|
290
|
+
});
|
|
291
|
+
</script>
|