@saooti/octopus-sdk 40.2.19 → 41.0.0
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 +2 -1
- package/package.json +4 -3
- package/src/App.vue +71 -95
- package/src/components/composable/player/usePlayerLive.ts +13 -4
- package/src/components/composable/player/usePlayerLogic.ts +6 -6
- package/src/components/composable/player/usePlayerVast.ts +7 -7
- package/src/components/composable/podcasts/usePodcastView.ts +3 -3
- package/src/components/composable/route/useAdvancedParamInit.ts +1 -1
- package/src/components/composable/route/useRouteUpdateParams.ts +4 -4
- package/src/components/composable/route/useSimplePageParam.ts +15 -8
- package/src/components/composable/useInit.ts +2 -2
- package/src/components/composable/useMetaTitleWatch.ts +2 -2
- package/src/components/display/accessibility/AccessibilityModal.vue +56 -68
- package/src/components/display/categories/CategoryChooser.vue +144 -145
- package/src/components/display/categories/CategoryFilter.vue +172 -198
- package/src/components/display/categories/CategoryList.vue +122 -147
- package/src/components/display/comments/CommentInput.vue +100 -122
- package/src/components/display/comments/CommentList.vue +169 -191
- package/src/components/display/comments/CommentName.vue +35 -45
- package/src/components/display/comments/CommentParentInfo.vue +28 -34
- package/src/components/display/comments/CommentPlayer.vue +38 -50
- package/src/components/display/comments/CommentSection.vue +85 -103
- package/src/components/display/comments/item/CommentBasicView.vue +48 -61
- package/src/components/display/comments/item/CommentItem.vue +104 -115
- package/src/components/display/comments/item/CommentMoreActions.vue +174 -189
- package/src/components/display/comments/item/CommentMoreActionsAdmin.vue +1 -3
- package/src/components/display/comments/like/LikeButton.vue +36 -41
- package/src/components/display/comments/like/LikeSection.vue +128 -136
- package/src/components/display/comments/modal/CheckIdentityModal.vue +35 -40
- package/src/components/display/comments/modal/EditCommentModal.vue +72 -78
- package/src/components/display/comments/modal/RecaptchaModal.vue +58 -63
- package/src/components/display/comments/modal/ReportAbuseModal.vue +59 -66
- package/src/components/display/edit/EditBox.vue +9 -8
- package/src/components/display/edit/EditBoxRadio.vue +1 -5
- package/src/components/display/emission/EmissionInlineList.vue +82 -97
- package/src/components/display/emission/EmissionItem.vue +57 -69
- package/src/components/display/emission/EmissionList.vue +189 -218
- package/src/components/display/emission/EmissionPlayerItem.vue +47 -64
- package/src/components/display/emission/EmissionPresentationItem.vue +44 -54
- package/src/components/display/emission/EmissionPresentationList.vue +51 -61
- package/src/components/display/filter/AdvancedSearch.vue +151 -176
- package/src/components/display/filter/CategorySearchFilter.vue +43 -46
- package/src/components/display/filter/DateFilter.vue +76 -91
- package/src/components/display/filter/MonetizableFilter.vue +27 -30
- package/src/components/display/filter/ProductorSearch.vue +87 -90
- package/src/components/display/filter/RubriqueChoice.vue +58 -63
- package/src/components/display/filter/RubriqueFilter.vue +154 -169
- package/src/components/display/filter/SearchOrder.vue +35 -35
- package/src/components/display/list/ListPaginate.vue +72 -93
- package/src/components/display/list/PaginateParams.vue +36 -40
- package/src/components/display/list/PaginateSection.vue +113 -124
- package/src/components/display/list/SwiperList.vue +97 -109
- package/src/components/display/live/CountDown.vue +15 -9
- package/src/components/display/live/CountdownOctopus.vue +16 -10
- package/src/components/display/live/LiveHorizontalList.vue +95 -103
- package/src/components/display/live/LiveItem.vue +64 -73
- package/src/components/display/live/LiveList.vue +125 -137
- package/src/components/display/live/RadioCurrently.vue +66 -73
- package/src/components/display/live/RadioImage.vue +39 -50
- package/src/components/display/live/RadioItem.vue +9 -14
- package/src/components/display/live/RadioList.vue +39 -53
- package/src/components/display/live/RadioPlanning.vue +210 -222
- package/src/components/display/organisation/OrganisationChooser.vue +116 -122
- package/src/components/display/organisation/OrganisationChooserLight.vue +44 -52
- package/src/components/display/participant/ParticipantInlineList.vue +42 -58
- package/src/components/display/participant/ParticipantItem.vue +66 -74
- package/src/components/display/participant/ParticipantList.vue +116 -141
- package/src/components/display/playlist/PlaylistItem.vue +33 -46
- package/src/components/display/playlist/PlaylistList.vue +115 -144
- package/src/components/display/playlist/PodcastList.vue +90 -103
- package/src/components/display/playlist/PodcastPlaylistInlineList.vue +58 -70
- package/src/components/display/podcastmaker/PodcastmakerHeader.vue +21 -22
- package/src/components/display/podcasts/AnimatorsItem.vue +15 -16
- package/src/components/display/podcasts/DownloadPodcastButton.vue +21 -29
- package/src/components/display/podcasts/ParticipantDescription.vue +22 -24
- package/src/components/display/podcasts/PodcastFilterList.vue +62 -56
- package/src/components/display/podcasts/PodcastImage.vue +96 -99
- package/src/components/display/podcasts/PodcastInlineList.vue +30 -28
- package/src/components/display/podcasts/PodcastInlineListTemplate.vue +107 -114
- package/src/components/display/podcasts/PodcastIsPlaying.vue +4 -12
- package/src/components/display/podcasts/PodcastItem.vue +48 -63
- package/src/components/display/podcasts/PodcastItemInfo.vue +19 -35
- package/src/components/display/podcasts/PodcastList.vue +182 -206
- package/src/components/display/podcasts/PodcastModuleBox.vue +100 -137
- package/src/components/display/podcasts/PodcastPlannedSpinner.vue +4 -6
- package/src/components/display/podcasts/PodcastPlayBar.vue +50 -61
- package/src/components/display/podcasts/PodcastPlayBasicButton.vue +38 -41
- package/src/components/display/podcasts/PodcastPlayButton.vue +164 -175
- package/src/components/display/podcasts/PodcastRawTranscript.vue +69 -80
- package/src/components/display/podcasts/PodcastRubriqueList.vue +35 -38
- package/src/components/display/podcasts/PodcastSwiperList.vue +100 -110
- package/src/components/display/podcasts/TagList.vue +48 -50
- package/src/components/display/podcasts/VideoModuleBox.vue +13 -24
- package/src/components/display/rubriques/RubriqueChooser.vue +135 -140
- package/src/components/display/rubriques/RubriqueList.vue +140 -160
- package/src/components/display/sharing/ChooseEpisodesNumber.vue +34 -33
- package/src/components/display/sharing/FormatSwitch.vue +16 -11
- package/src/components/display/sharing/PlayerAnonymousModal.vue +24 -27
- package/src/components/display/sharing/PlayerCommonParameters.vue +20 -13
- package/src/components/display/sharing/PlayerParameters.vue +69 -71
- package/src/components/display/sharing/QrCode.vue +55 -67
- package/src/components/display/sharing/ShareAnonymous.vue +160 -178
- package/src/components/display/sharing/ShareDistribution.vue +103 -117
- package/src/components/display/sharing/ShareNewsletter.vue +154 -161
- package/src/components/display/sharing/SharePlayer.vue +273 -295
- package/src/components/display/sharing/SharePlayerColors.vue +25 -16
- package/src/components/display/sharing/SharePlayerRadio.vue +61 -69
- package/src/components/display/sharing/SharePlayerTypes.vue +176 -176
- package/src/components/display/sharing/ShareSocialsButtons.vue +63 -75
- package/src/components/display/sharing/SubscribeButtons.vue +184 -207
- package/src/components/display/studio/RecordingItemButton.vue +1 -4
- package/src/components/form/ClassicCheckbox.vue +26 -30
- package/src/components/form/ClassicContentEditable.vue +37 -33
- package/src/components/form/ClassicCopyButton.vue +40 -44
- package/src/components/form/ClassicDatePicker.vue +114 -114
- package/src/components/form/ClassicEmojiPicker.vue +20 -28
- package/src/components/form/ClassicInputText.vue +116 -120
- package/src/components/form/ClassicLoading.vue +7 -12
- package/src/components/form/ClassicMultiselect.vue +115 -117
- package/src/components/form/ClassicRadio.vue +21 -16
- package/src/components/form/ClassicRadioLabel.vue +23 -22
- package/src/components/form/ClassicSearch.vue +24 -19
- package/src/components/form/ClassicSelect.vue +47 -38
- package/src/components/form/ClassicWysiwyg.vue +116 -123
- package/src/components/icons/AmazonMusicIcon.vue +7 -10
- package/src/components/icons/ApplePodcastIcon.vue +7 -11
- package/src/components/icons/BlueSkyIcon.vue +8 -11
- package/src/components/icons/DeezerIcon.vue +8 -11
- package/src/components/icons/EditFtpIcon.vue +8 -11
- package/src/components/icons/IHeartIcon.vue +8 -11
- package/src/components/icons/PlayVideoIcon.vue +7 -10
- package/src/components/icons/PlayerFmIcon.vue +7 -10
- package/src/components/icons/PocketCastIcon.vue +8 -11
- package/src/components/icons/PodcastAddictIcon.vue +7 -10
- package/src/components/icons/RadiolineIcon.vue +8 -11
- package/src/components/icons/TuninIcon.vue +8 -11
- package/src/components/icons/XIcon.vue +7 -10
- package/src/components/misc/AcpmImage.vue +6 -7
- package/src/components/misc/ClassicAccordion.vue +26 -31
- package/src/components/misc/ClassicLazy.vue +86 -90
- package/src/components/misc/ClassicNav.vue +16 -20
- package/src/components/misc/ClassicPopover.vue +271 -282
- package/src/components/misc/ClassicSpinner.vue +5 -27
- package/src/components/misc/ErrorMessage.vue +11 -12
- package/src/components/misc/FooterGarSection.vue +33 -41
- package/src/components/misc/FooterSection.vue +94 -131
- package/src/components/misc/HomeDropdown.vue +83 -105
- package/src/components/misc/MobileMenu.vue +101 -111
- package/src/components/misc/ProgressBar.vue +53 -62
- package/src/components/misc/TopBar.vue +98 -120
- package/src/components/misc/TopBarMainContent.vue +114 -133
- package/src/components/misc/modal/ClassicModal.vue +40 -33
- package/src/components/misc/modal/ClassicModalInBody.vue +34 -28
- package/src/components/misc/modal/ClipboardModal.vue +27 -30
- package/src/components/misc/modal/ContractPreviewModal.vue +64 -62
- package/src/components/misc/modal/MessageModal.vue +50 -47
- package/src/components/misc/modal/NewsletterModal.vue +30 -31
- package/src/components/misc/modal/QrCodeModal.vue +21 -21
- package/src/components/misc/modal/ShareModalPlayer.vue +43 -52
- package/src/components/misc/player/PlayerCompact.vue +6 -4
- package/src/components/misc/player/PlayerComponent.vue +8 -9
- package/src/components/misc/player/PlayerLarge.vue +9 -8
- package/src/components/misc/player/ads/AdsProgressBar.vue +8 -11
- package/src/components/misc/player/ads/AdsSkipButton.vue +24 -30
- package/src/components/misc/player/chaptering/ChapteringModal.vue +44 -54
- package/src/components/misc/player/chaptering/PlayerChaptering.vue +50 -62
- package/src/components/misc/player/elements/PlayerImage.vue +51 -57
- package/src/components/misc/player/elements/PlayerPlayButton.vue +81 -92
- package/src/components/misc/player/elements/PlayerSpeedButton.vue +23 -27
- package/src/components/misc/player/elements/PlayerTitle.vue +85 -111
- package/src/components/misc/player/progressbar/PlayerProgressBar.vue +18 -29
- package/src/components/misc/player/progressbar/PodcastProgressBar.vue +45 -56
- package/src/components/misc/player/radio/RadioHistory.vue +80 -99
- package/src/components/misc/player/radio/RadioProgressBar.vue +43 -54
- package/src/components/misc/player/video/PlayerVideo.vue +27 -40
- package/src/components/misc/player/video/PlayerVideoDigiteka.vue +32 -37
- package/src/components/misc/player/video/PlayerVideoHls.vue +199 -198
- package/src/components/misc/player/video/PlayerYoutubeEmbed.vue +10 -12
- package/src/components/pages/CategoryPage.vue +28 -33
- package/src/components/pages/EmissionPage.vue +113 -132
- package/src/components/pages/EmissionsPage.vue +2 -0
- package/src/components/pages/Error403Page.vue +21 -20
- package/src/components/pages/HomePage.vue +91 -100
- package/src/components/pages/LivesPage.vue +35 -37
- package/src/components/pages/MapPage.vue +209 -241
- package/src/components/pages/PageLogout.vue +8 -11
- package/src/components/pages/PageNotFound.vue +9 -5
- package/src/components/pages/ParticipantPage.vue +96 -110
- package/src/components/pages/ParticipantsPage.vue +3 -0
- package/src/components/pages/PlaylistPage.vue +112 -117
- package/src/components/pages/PlaylistsPage.vue +9 -2
- package/src/components/pages/PodcastPage.vue +224 -238
- package/src/components/pages/PodcastsPage.vue +9 -2
- package/src/components/pages/RadioPage.vue +56 -70
- package/src/components/pages/RubriquePage.vue +7 -3
- package/src/components/pages/SearchPage.vue +31 -36
- package/src/components/pages/TagPage.vue +11 -9
- package/src/components/pages/VideoPage.vue +14 -11
- package/src/helper/displayHelper.ts +1 -1
- package/src/helper/loadScript.ts +4 -4
- package/src/i18n.ts +2 -2
- package/src/main.ts +1 -1
- package/src/router/router.ts +17 -4
- package/src/stores/AuthStore.ts +12 -12
- package/src/stores/FilterStore.ts +1 -1
- package/src/stores/VastStore.ts +2 -2
- package/src/stores/class/general/player.ts +1 -0
- package/public/css/fonts/icomoon.eot +0 -0
- package/public/css/fonts/icomoon.svg +0 -113
- package/public/css/fonts/icomoon.ttf +0 -0
- package/public/css/fonts/icomoon.woff +0 -0
- package/public/css/fonts/icomoon.woff2 +0 -0
- package/public/css/fonts/style.css +0 -352
- package/sonarqube-scanner.js +0 -10
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
<div ref="categoryListContainer" class="category-list-container">
|
|
7
7
|
<button
|
|
8
8
|
v-for="category in categories"
|
|
9
|
-
:
|
|
9
|
+
:id="'category' + category.id"
|
|
10
10
|
:key="category.id"
|
|
11
11
|
class="btn btn-primary btn-on-dark m-1"
|
|
12
12
|
@click="checkIfFilter(category)"
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
v-show="hidenCategories.length"
|
|
19
19
|
id="categories-dropdown"
|
|
20
20
|
class="btn btn-primary btn-on-dark m-1"
|
|
21
|
-
:title="
|
|
21
|
+
:title="t('See more')"
|
|
22
22
|
>
|
|
23
23
|
<PlusIcon />
|
|
24
24
|
</button>
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
</div>
|
|
41
41
|
</template>
|
|
42
42
|
|
|
43
|
-
<script lang="ts">
|
|
43
|
+
<script setup lang="ts">
|
|
44
44
|
import PlusIcon from "vue-material-design-icons/Plus.vue";
|
|
45
45
|
import { useRouteUpdateParams } from "../../composable/route/useRouteUpdateParams";
|
|
46
46
|
import classicApi from "../../../api/classicApi";
|
|
@@ -49,155 +49,130 @@ import ClassicPopover from "../../misc/ClassicPopover.vue";
|
|
|
49
49
|
import { Category } from "@/stores/class/general/category";
|
|
50
50
|
import { useFilterStore } from "../../../stores/FilterStore";
|
|
51
51
|
import { useGeneralStore } from "../../../stores/GeneralStore";
|
|
52
|
-
import {
|
|
53
|
-
import {
|
|
54
|
-
|
|
55
|
-
name: "CategoryList",
|
|
56
|
-
components: {
|
|
57
|
-
ClassicPopover,
|
|
58
|
-
PlusIcon,
|
|
59
|
-
},
|
|
52
|
+
import { computed, nextTick, onMounted, onUnmounted, Ref, ref, useTemplateRef, watch } from "vue";
|
|
53
|
+
import { useI18n } from "vue-i18n";
|
|
54
|
+
import { useRoute, useRouter } from "vue-router";
|
|
60
55
|
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
},
|
|
65
|
-
|
|
66
|
-
setup(){
|
|
67
|
-
const { updateFiltersParam } = useRouteUpdateParams();
|
|
68
|
-
return {updateFiltersParam }
|
|
69
|
-
},
|
|
56
|
+
//Props
|
|
57
|
+
const props = defineProps({
|
|
58
|
+
isFilter: { default: false, type: Boolean },
|
|
59
|
+
isDisplay: { default: false, type: Boolean },
|
|
60
|
+
})
|
|
70
61
|
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
hidenCategories: [] as Array<Category>,
|
|
74
|
-
};
|
|
75
|
-
},
|
|
62
|
+
//Emits
|
|
63
|
+
const emit = defineEmits(["categoriesLength"]);
|
|
76
64
|
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
isPodcastmaker(): boolean {
|
|
81
|
-
return state.generalParameters.podcastmaker as boolean;
|
|
82
|
-
},
|
|
83
|
-
categories(): Array<Category> {
|
|
84
|
-
let arrayCategories: Array<Category> = [];
|
|
85
|
-
if (this.filterOrgaId) {
|
|
86
|
-
arrayCategories = this.storedCategoriesOrga.filter((c: Category) => {
|
|
87
|
-
return c.podcastOrganisationCount;
|
|
88
|
-
});
|
|
89
|
-
} else {
|
|
90
|
-
arrayCategories = this.storedCategories.filter((c: Category) => {
|
|
91
|
-
if (this.isPodcastmaker) return c.podcastOrganisationCount;
|
|
92
|
-
return c.podcastCount;
|
|
93
|
-
});
|
|
94
|
-
}
|
|
95
|
-
this.$emit("categoriesLength", arrayCategories.length);
|
|
96
|
-
return arrayCategories;
|
|
97
|
-
},
|
|
98
|
-
watchVariable(): string {
|
|
99
|
-
return `${this.isDisplay}|${this.categories}`;
|
|
100
|
-
},
|
|
101
|
-
reloadVariable(): string {
|
|
102
|
-
return `${this.filterOrgaId}|${this.storedCategories}`;
|
|
103
|
-
},
|
|
104
|
-
},
|
|
105
|
-
watch: {
|
|
106
|
-
watchVariable: {
|
|
107
|
-
deep: true,
|
|
108
|
-
immediate: true,
|
|
109
|
-
handler() {
|
|
110
|
-
this.$nextTick(() => {
|
|
111
|
-
this.resizeWindow();
|
|
112
|
-
});
|
|
113
|
-
},
|
|
114
|
-
},
|
|
115
|
-
reloadVariable: {
|
|
116
|
-
deep: true,
|
|
117
|
-
immediate: true,
|
|
118
|
-
handler() {
|
|
119
|
-
if (this.filterOrgaId) {
|
|
120
|
-
this.fetchCategories(this.filterOrgaId);
|
|
121
|
-
}
|
|
122
|
-
},
|
|
123
|
-
},
|
|
124
|
-
},
|
|
125
|
-
mounted() {
|
|
126
|
-
window.addEventListener("resize", this.resizeWindow);
|
|
127
|
-
},
|
|
128
|
-
beforeUnmount(): void {
|
|
129
|
-
window.removeEventListener("resize", this.resizeWindow);
|
|
130
|
-
},
|
|
65
|
+
//Data
|
|
66
|
+
const hidenCategories: Ref<Array<Category>> = ref([]);
|
|
67
|
+
const categoryListRef = useTemplateRef('categoryListContainer');
|
|
131
68
|
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
const categoryList = this.$refs.categoryListContainer as HTMLElement;
|
|
156
|
-
if (null === categoryList || !categoryList) {
|
|
157
|
-
return;
|
|
158
|
-
}
|
|
159
|
-
categoryList.style.justifyContent = "flex-start";
|
|
160
|
-
this.hidenCategories.length = 0;
|
|
161
|
-
this.categories.forEach((element: Category) => {
|
|
162
|
-
const el = (
|
|
163
|
-
this.$refs["category" + element.id] as Array<HTMLElement>
|
|
164
|
-
)[0];
|
|
165
|
-
if (!el) return;
|
|
166
|
-
if (el.classList.contains("hid")) {
|
|
167
|
-
el.classList.remove("hid");
|
|
168
|
-
}
|
|
169
|
-
});
|
|
170
|
-
this.categories.forEach((element: Category) => {
|
|
171
|
-
const el = (
|
|
172
|
-
this.$refs["category" + element.id] as Array<HTMLElement>
|
|
173
|
-
)[0];
|
|
174
|
-
if (!el) return;
|
|
175
|
-
const parent = el.parentElement;
|
|
176
|
-
if (
|
|
177
|
-
parent &&
|
|
178
|
-
el.offsetLeft + el.clientWidth <= parent.clientWidth - 20
|
|
179
|
-
) {
|
|
180
|
-
return;
|
|
181
|
-
}
|
|
182
|
-
this.hidenCategories.push(element);
|
|
183
|
-
if (!el.classList.contains("hid")) {
|
|
184
|
-
el.className += " hid";
|
|
185
|
-
}
|
|
186
|
-
});
|
|
187
|
-
if (!this.hidenCategories.length) {
|
|
188
|
-
categoryList.style.justifyContent = "center";
|
|
189
|
-
}
|
|
190
|
-
},
|
|
191
|
-
async fetchCategories(organisationId: string): Promise<void> {
|
|
192
|
-
const data = await classicApi.fetchData<Array<Category>>({
|
|
193
|
-
api: 0,
|
|
194
|
-
path: `iab/list/${organisationId}`,
|
|
195
|
-
parameters: { lang: this.$i18n.locale },
|
|
196
|
-
});
|
|
197
|
-
this.storedUpdateCategoriesOrga(data);
|
|
198
|
-
},
|
|
199
|
-
},
|
|
69
|
+
//Composables
|
|
70
|
+
const { t, locale } = useI18n();
|
|
71
|
+
const { updateFiltersParam } = useRouteUpdateParams();
|
|
72
|
+
const generalStore = useGeneralStore();
|
|
73
|
+
const filterStore = useFilterStore();
|
|
74
|
+
const router = useRouter();
|
|
75
|
+
const route = useRoute();
|
|
76
|
+
|
|
77
|
+
//Computed
|
|
78
|
+
const categories = computed(() => {
|
|
79
|
+
let arrayCategories: Array<Category> = [];
|
|
80
|
+
if (filterStore.filterOrgaId) {
|
|
81
|
+
arrayCategories = generalStore.storedCategoriesOrga.filter((c: Category) => {
|
|
82
|
+
return c.podcastOrganisationCount;
|
|
83
|
+
});
|
|
84
|
+
} else {
|
|
85
|
+
arrayCategories = generalStore.storedCategories.filter((c: Category) => {
|
|
86
|
+
if (state.generalParameters.podcastmaker) return c.podcastOrganisationCount;
|
|
87
|
+
return c.podcastCount;
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
emit("categoriesLength", arrayCategories.length);
|
|
91
|
+
return arrayCategories;
|
|
200
92
|
});
|
|
93
|
+
const watchVariable = computed(() => `${props.isDisplay}|${categories.value}`);
|
|
94
|
+
const reloadVariable = computed(() => `${filterStore.filterOrgaId}|${generalStore.storedCategories}`);
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
//Watch
|
|
98
|
+
watch(watchVariable, () => {
|
|
99
|
+
nextTick(() => {
|
|
100
|
+
resizeWindow();
|
|
101
|
+
});
|
|
102
|
+
}, {deep: true, immediate: true});
|
|
103
|
+
watch(reloadVariable, () => {
|
|
104
|
+
if (filterStore.filterOrgaId) {
|
|
105
|
+
fetchCategories(filterStore.filterOrgaId);
|
|
106
|
+
}
|
|
107
|
+
}, {deep: true, immediate: true});
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
onMounted(()=>window.addEventListener("resize", resizeWindow))
|
|
111
|
+
onUnmounted(()=>window.removeEventListener("resize", resizeWindow))
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
//Methods
|
|
115
|
+
function checkIfFilter(category: Category): void {
|
|
116
|
+
if (!props.isFilter) {
|
|
117
|
+
router.push({
|
|
118
|
+
name: "category",
|
|
119
|
+
params: { iabId: category.id.toString() },
|
|
120
|
+
});
|
|
121
|
+
return;
|
|
122
|
+
}
|
|
123
|
+
const queries = route.query;
|
|
124
|
+
if (
|
|
125
|
+
!queries.iabId ||
|
|
126
|
+
("string" === typeof queries.iabId &&
|
|
127
|
+
parseInt(queries.iabId, 10) !== category.id)
|
|
128
|
+
) {
|
|
129
|
+
updateFiltersParam(
|
|
130
|
+
{ iabId: category.id.toString() },
|
|
131
|
+
{ i: category.id.toString() },
|
|
132
|
+
);
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
function resizeWindow(): void {
|
|
136
|
+
const categoryList = categoryListRef?.value as HTMLElement;
|
|
137
|
+
if (null === categoryList || !categoryList) {
|
|
138
|
+
return;
|
|
139
|
+
}
|
|
140
|
+
categoryList.style.justifyContent = "flex-start";
|
|
141
|
+
hidenCategories.value.length = 0;
|
|
142
|
+
categories.value.forEach((element: Category) => {
|
|
143
|
+
const el = categoryList.querySelector('#category' + element.id);
|
|
144
|
+
if (!el) return;
|
|
145
|
+
if (el.classList.contains("hid")) {
|
|
146
|
+
el.classList.remove("hid");
|
|
147
|
+
}
|
|
148
|
+
});
|
|
149
|
+
categories.value.forEach((element: Category) => {
|
|
150
|
+
const el = categoryList.querySelector('#category' + element.id);
|
|
151
|
+
if (!el) return;
|
|
152
|
+
const parent = el.parentElement;
|
|
153
|
+
if (
|
|
154
|
+
parent &&
|
|
155
|
+
el.offsetLeft + el.clientWidth <= parent.clientWidth - 20
|
|
156
|
+
) {
|
|
157
|
+
return;
|
|
158
|
+
}
|
|
159
|
+
hidenCategories.value.push(element);
|
|
160
|
+
if (!el.classList.contains("hid")) {
|
|
161
|
+
el.className += " hid";
|
|
162
|
+
}
|
|
163
|
+
});
|
|
164
|
+
if (!hidenCategories.value.length) {
|
|
165
|
+
categoryList.style.justifyContent = "center";
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
async function fetchCategories(organisationId: string): Promise<void> {
|
|
169
|
+
const data = await classicApi.fetchData<Array<Category>>({
|
|
170
|
+
api: 0,
|
|
171
|
+
path: `iab/list/${organisationId}`,
|
|
172
|
+
parameters: { lang: locale.value },
|
|
173
|
+
});
|
|
174
|
+
generalStore.storedUpdateCategoriesOrga(data);
|
|
175
|
+
}
|
|
201
176
|
</script>
|
|
202
177
|
<style lang="scss">
|
|
203
178
|
.octopus-app {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="d-flex flex-column comment-input-container mt-3">
|
|
3
|
-
<CommentName v-if="commentUser?.name" />
|
|
3
|
+
<CommentName v-if="commentStore.commentUser?.name" />
|
|
4
4
|
<ClassicContentEditable
|
|
5
5
|
ref="textarea"
|
|
6
6
|
v-model="newComment"
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
{{ countComment + " / " + maxComment }}
|
|
23
23
|
</p>
|
|
24
24
|
<button class="btn me-2" @mousedown="cancelAction">
|
|
25
|
-
{{
|
|
25
|
+
{{ t("Cancel") }}
|
|
26
26
|
</button>
|
|
27
27
|
<button
|
|
28
28
|
class="btn btn-primary"
|
|
@@ -40,25 +40,25 @@
|
|
|
40
40
|
/>
|
|
41
41
|
<MessageModal
|
|
42
42
|
v-if="postError"
|
|
43
|
-
:validatetext="
|
|
44
|
-
:title="
|
|
45
|
-
:message="
|
|
43
|
+
:validatetext="t('Close')"
|
|
44
|
+
:title="t('Error')"
|
|
45
|
+
:message="t('Error occurs while post your comment...')"
|
|
46
46
|
@close="postError = false"
|
|
47
47
|
@validate="postError = false"
|
|
48
48
|
/>
|
|
49
49
|
</div>
|
|
50
50
|
</template>
|
|
51
51
|
|
|
52
|
-
<script lang="ts">
|
|
52
|
+
<script setup lang="ts">
|
|
53
53
|
import classicApi from "../../../api/classicApi";
|
|
54
54
|
import { Podcast } from "@/stores/class/general/podcast";
|
|
55
|
-
import {
|
|
55
|
+
import { CommentPodcast } from "@/stores/class/general/comment";
|
|
56
56
|
import Constants from "../../../../public/config";
|
|
57
|
-
import {
|
|
58
|
-
import { defineComponent, defineAsyncComponent } from "vue";
|
|
57
|
+
import { defineAsyncComponent, ref, computed, watch, useTemplateRef } from "vue";
|
|
59
58
|
import { useCommentStore } from "../../../stores/CommentStore";
|
|
60
59
|
import { usePlayerStore } from "../../../stores/PlayerStore";
|
|
61
60
|
import { useAuthStore } from "../../../stores/AuthStore";
|
|
61
|
+
import { useI18n } from "vue-i18n";
|
|
62
62
|
const CheckIdentityModal = defineAsyncComponent(
|
|
63
63
|
() => import("./modal/CheckIdentityModal.vue"),
|
|
64
64
|
);
|
|
@@ -72,123 +72,101 @@ const ClassicEmojiPicker = defineAsyncComponent(
|
|
|
72
72
|
const ClassicContentEditable = defineAsyncComponent(
|
|
73
73
|
() => import("../../form/ClassicContentEditable.vue"),
|
|
74
74
|
);
|
|
75
|
-
export default defineComponent({
|
|
76
|
-
name: "CommentInput",
|
|
77
|
-
components: {
|
|
78
|
-
CheckIdentityModal,
|
|
79
|
-
MessageModal,
|
|
80
|
-
ClassicEmojiPicker,
|
|
81
|
-
ClassicContentEditable,
|
|
82
|
-
CommentName,
|
|
83
|
-
},
|
|
84
|
-
props: {
|
|
85
|
-
podcast: { default: undefined, type: Object as () => Podcast },
|
|
86
|
-
focus: { default: false, type: Boolean },
|
|
87
|
-
inAnswerComment: {
|
|
88
|
-
default: undefined,
|
|
89
|
-
type: Object as () => CommentPodcast,
|
|
90
|
-
},
|
|
91
|
-
},
|
|
92
|
-
emits: ["cancelAction", "newComment"],
|
|
93
75
|
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
};
|
|
76
|
+
//Props
|
|
77
|
+
const props = defineProps({
|
|
78
|
+
podcast: { default: undefined, type: Object as () => Podcast },
|
|
79
|
+
focus: { default: false, type: Boolean },
|
|
80
|
+
inAnswerComment: {
|
|
81
|
+
default: undefined,
|
|
82
|
+
type: Object as () => CommentPodcast,
|
|
102
83
|
},
|
|
84
|
+
})
|
|
103
85
|
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
86
|
+
//Emits
|
|
87
|
+
const emit = defineEmits(["cancelAction", "newComment"]);
|
|
88
|
+
|
|
89
|
+
//Data
|
|
90
|
+
const maxComment = Constants.MAX_COMMENT;
|
|
91
|
+
const newComment = ref("");
|
|
92
|
+
const isTextareaActive = ref(false);
|
|
93
|
+
const isCheckIdentity = ref(false);
|
|
94
|
+
const postError = ref(false);
|
|
95
|
+
const textareaRef = useTemplateRef('textarea');
|
|
96
|
+
|
|
97
|
+
//Composables
|
|
98
|
+
const { t } = useI18n();
|
|
99
|
+
const playerStore = usePlayerStore();
|
|
100
|
+
const commentStore = useCommentStore();
|
|
101
|
+
const authStore = useAuthStore();
|
|
102
|
+
|
|
103
|
+
//Computed
|
|
104
|
+
const commentTooLong = computed(() => countComment.value <= maxComment);
|
|
105
|
+
const countComment = computed(() => newComment.value.length);
|
|
106
|
+
const placeholder = computed(() => props.inAnswerComment?.commentId? t("Answer a comment"): t("Write a comment"));
|
|
107
|
+
const uniqueId = computed(() => "-comment"+(props.inAnswerComment?.commentId??"-parent"));
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
//Watch
|
|
111
|
+
watch(()=>props.focus, () => textareaRef?.value?.focus());
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
//Methods
|
|
115
|
+
function addEmojiSelected(emoji: string) {
|
|
116
|
+
newComment.value += emoji;
|
|
117
|
+
}
|
|
118
|
+
function requestToSend(): void {
|
|
119
|
+
if (commentStore.commentUser?.name) {
|
|
120
|
+
postComment();
|
|
121
|
+
} else {
|
|
122
|
+
isCheckIdentity.value = true;
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
function cancelAction(): void {
|
|
126
|
+
newComment.value = "";
|
|
127
|
+
isTextareaActive.value = false;
|
|
128
|
+
emit("cancelAction");
|
|
129
|
+
}
|
|
130
|
+
async function postComment(): Promise<void> {
|
|
131
|
+
try {
|
|
132
|
+
const commentReceived = await classicApi.postData<CommentPodcast>({
|
|
133
|
+
api: 2,
|
|
134
|
+
path: "comment/",
|
|
135
|
+
dataToSend: {
|
|
136
|
+
answerTo: props.inAnswerComment?.commentId,
|
|
137
|
+
content: newComment.value.trim(),
|
|
138
|
+
name: commentStore.commentUser?.name ?? "",
|
|
154
139
|
podcastId:
|
|
155
|
-
|
|
156
|
-
uuid:
|
|
157
|
-
timeline:
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
)
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
);
|
|
186
|
-
}
|
|
187
|
-
}
|
|
188
|
-
return timeline < 0 ? 0 : timeline;
|
|
189
|
-
},
|
|
190
|
-
},
|
|
191
|
-
});
|
|
140
|
+
props.podcast?.podcastId ?? props.inAnswerComment?.podcastId ?? 0,
|
|
141
|
+
uuid: commentStore.commentUser?.uuid ?? "",
|
|
142
|
+
timeline: defineTimelineValue(),
|
|
143
|
+
},
|
|
144
|
+
isNotAuth: undefined === authStore.authOrgaId,
|
|
145
|
+
});
|
|
146
|
+
emit("newComment", commentReceived);
|
|
147
|
+
newComment.value = "";
|
|
148
|
+
isTextareaActive.value = false;
|
|
149
|
+
} catch {
|
|
150
|
+
postError.value = true;
|
|
151
|
+
}
|
|
152
|
+
isCheckIdentity.value = false;
|
|
153
|
+
}
|
|
154
|
+
function defineTimelineValue(): number {
|
|
155
|
+
let timeline = 0;
|
|
156
|
+
if (
|
|
157
|
+
undefined !== props.podcast &&
|
|
158
|
+
(playerStore.playerPodcast?.podcastId === props.podcast.podcastId ||
|
|
159
|
+
playerStore.playerLive?.podcastId === props.podcast.podcastId)
|
|
160
|
+
) {
|
|
161
|
+
timeline = Math.round(playerStore.playerElapsed * playerStore.playerTotal);
|
|
162
|
+
if (props.podcast.duration && playerStore.playerPodcast) {
|
|
163
|
+
timeline = Math.round(
|
|
164
|
+
timeline - (playerStore.playerTotal - props.podcast.duration / 1000),
|
|
165
|
+
);
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
return timeline < 0 ? 0 : timeline;
|
|
169
|
+
}
|
|
192
170
|
</script>
|
|
193
171
|
|
|
194
172
|
<style lang="scss">
|