@saooti/octopus-sdk 39.0.22 → 39.0.24

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@saooti/octopus-sdk",
3
- "version": "39.0.22",
3
+ "version": "39.0.24",
4
4
  "private": false,
5
5
  "description": "Javascript SDK for using octopus",
6
6
  "author": "Saooti",
@@ -16,62 +16,86 @@
16
16
  <span>{{ day.title }}</span>
17
17
  </button>
18
18
  </div>
19
+ <div class="d-flex align-items-center justify-content-center border-bottom">
20
+ <button
21
+ v-for="period in periodOfDay"
22
+ :key="period.id"
23
+ class="btn btn-underline mb-2"
24
+ @click="scrollToElement('planning-period-'+period.id)"
25
+ >
26
+ {{period.title}}
27
+ </button>
28
+ <button
29
+ class="btn btn-underline mb-2"
30
+ @click="changePeriodNow"
31
+ >
32
+ {{$t('Now')}}
33
+ </button>
34
+ </div>
35
+
19
36
  <div class="d-flex flex-column p-3">
20
37
  <ClassicLoading
21
38
  :loading-text="loading ? $t('Loading content ...') : undefined"
22
39
  :error-text="error ? $t(`Error`) : undefined"
23
40
  />
24
41
  <template v-if="!loading && !error">
25
- <div v-if="!planning[daySelected].length" class="text-center">
42
+ <div v-if="!planningLength[daySelected]" class="text-center">
26
43
  {{ $t("No programming") }}
27
44
  </div>
28
45
  <div
29
- v-for="planningItem in planning[daySelected]"
30
46
  v-else
31
- :key="planningItem.occurrenceId + '' + planningItem.liveId"
32
- class="d-flex align-items-center mb-3"
47
+ v-for="period in periodOfDay"
48
+ :key="period.id"
33
49
  >
34
- <div class="program-item-date fw-bold flex-shrink-0">
35
- {{ dateDisplay(planningItem.startDate) }}
36
- </div>
37
- <router-link
38
- class="d-flex align-items-center text-dark"
39
- :to="{
40
- name: 'podcast',
41
- params: { podcastId: planningItem.podcastId },
42
- query: { productor: filterOrgaId },
43
- }"
44
- >
45
- <img
46
- v-lazy="proxyImageUrl(planningItem.podcastData.imageUrl, '150')"
47
- width="150"
48
- height="150"
49
- class="m-2"
50
- :title="
51
- $t('Episode name image', {
52
- name: planningItem.podcastData.title,
53
- })
54
- "
55
- :alt="
56
- $t('Episode name image', {
57
- name: planningItem.podcastData.title,
58
- })
59
- "
60
- />
61
- <div class="d-flex flex-column">
62
- <div class="d-flex align-items-center mb-2">
63
- <div
64
- v-if="planningItem.liveId"
65
- class="bg-complementary text-white p-1 me-1"
66
- >
67
- {{ $t("Live") }}
68
- </div>
69
- <div class="flex-grow-1 text-truncate fw-bold">
70
- {{ planningItem.podcastData.title }}
71
- </div>
50
+ <template v-if="planning[daySelected][period.id].length">
51
+ <div
52
+ :id="'planning-period-'+period.id"
53
+ class="fw-bold my-3 pb-2 border-bottom border-primary text-primary"
54
+ >{{period.title}}</div>
55
+ <div
56
+ v-for="planningItem in planning[daySelected][period.id]"
57
+ :key="planningItem.occurrenceId + '' + planningItem.liveId"
58
+ :id="'planning-occurrence-'+planningItem.occurrenceId + '' + planningItem.liveId"
59
+ class="d-flex align-items-center mb-3"
60
+ >
61
+ <div class="program-item-date fw-bold flex-shrink-0">
62
+ {{ dateDisplay(planningItem.startDate) }}
72
63
  </div>
64
+ <router-link
65
+ class="d-flex align-items-center text-dark"
66
+ :to="{
67
+ name: 'podcast',
68
+ params: { podcastId: planningItem.podcastId },
69
+ query: { productor: filterOrgaId },
70
+ }"
71
+ >
72
+ <img
73
+ v-lazy="proxyImageUrl(planningItem.podcastData.imageUrl, '150')"
74
+ width="150"
75
+ height="150"
76
+ class="m-2"
77
+ :title="
78
+ $t('Episode name image', {
79
+ name: planningItem.podcastData.title,
80
+ })
81
+ "
82
+ />
83
+ <div class="d-flex flex-column">
84
+ <div class="d-flex align-items-center mb-2">
85
+ <div
86
+ v-if="planningItem.liveId"
87
+ class="bg-complementary text-white p-1 me-1"
88
+ >
89
+ {{ $t("Live") }}
90
+ </div>
91
+ <div class="flex-grow-1 text-truncate fw-bold">
92
+ {{ planningItem.podcastData.title }}
93
+ </div>
94
+ </div>
95
+ </div>
96
+ </router-link>
73
97
  </div>
74
- </router-link>
98
+ </template>
75
99
  </div>
76
100
  </template>
77
101
  </div>
@@ -108,8 +132,13 @@ export default defineComponent({
108
132
  data() {
109
133
  return {
110
134
  planning: {} as {
111
- [key: number]: Array<PlanningOccurrence | PlanningLive>;
135
+ [key: number]: {
136
+ morning:Array<PlanningOccurrence | PlanningLive>,
137
+ afternoon:Array<PlanningOccurrence | PlanningLive>,
138
+ evening:Array<PlanningOccurrence | PlanningLive>
139
+ };
112
140
  },
141
+ planningLength: {} as {[key:number]: number},
113
142
  daySelected: dayjs().valueOf(),
114
143
  arrayDays: [] as Array<{
115
144
  title: string;
@@ -124,10 +153,17 @@ export default defineComponent({
124
153
  computed: {
125
154
  ...mapState(useFilterStore, ["filterOrgaId"]),
126
155
  startOfDay(): string {
127
- return dayjs(this.daySelected).utcOffset(0).startOf("date").toISOString();
156
+ return dayjs(this.daySelected).startOf("date").toISOString();
128
157
  },
129
158
  endOfDay(): string {
130
- return dayjs(this.daySelected).utcOffset(0).endOf("date").toISOString();
159
+ return dayjs(this.daySelected).endOf("date").toISOString();
160
+ },
161
+ periodOfDay(){
162
+ return [
163
+ {id:"morning", title: this.$t('Morning'), end: dayjs(this.daySelected).hour(14).minute(0).second(0).millisecond(0)},
164
+ {id:"afternoon", title: this.$t('Afternoon'), end: dayjs(this.daySelected).hour(19).minute(0).second(0).millisecond(0)},
165
+ {id:"evening", title: this.$t('Evening'), end: dayjs(this.daySelected).endOf("date")},
166
+ ]
131
167
  },
132
168
  },
133
169
 
@@ -137,6 +173,32 @@ export default defineComponent({
137
173
  },
138
174
 
139
175
  methods: {
176
+ scrollToElement(id: string){
177
+ const element = document.getElementById(id);
178
+ if(element){
179
+ const yOffset = -110;
180
+ const y = element.getBoundingClientRect().top + window.pageYOffset + yOffset;
181
+ window.scrollTo({top: y, behavior: 'smooth'});
182
+ }
183
+ },
184
+ changePeriodNow(){
185
+ const now = dayjs();
186
+ if(!dayjs(this.daySelected).isSame(now, 'day')){
187
+ this.changeDate(this.arrayDays[7].date);
188
+ }
189
+ this.$nextTick(() => {
190
+ if(!this.planningLength[this.daySelected]){return;}
191
+ const arrayOccurrences = Object.values(this.planning[this.daySelected]).reduce((r,c) => r.concat(c), [])
192
+ let selectedOccurrence = arrayOccurrences[0];
193
+ for (let index = 0; index < arrayOccurrences.length; index++) {
194
+ selectedOccurrence = arrayOccurrences[index];
195
+ if(dayjs(arrayOccurrences[index].endDate).isAfter(now)){
196
+ break;
197
+ }
198
+ }
199
+ this.scrollToElement('planning-occurrence-'+selectedOccurrence.occurrenceId + '' + selectedOccurrence.liveId);
200
+ });
201
+ },
140
202
  createArrayDays() {
141
203
  for (let index = -7; index < 3; index++) {
142
204
  const dayToAdd = dayjs().add(index, "day");
@@ -154,6 +216,8 @@ export default defineComponent({
154
216
  if (this.planning[this.daySelected]) {
155
217
  return;
156
218
  }
219
+ this.planning[this.daySelected] = {morning:[], afternoon:[], evening: []};
220
+ this.planningLength[this.daySelected] = 0;
157
221
  this.loading = true;
158
222
  this.error = false;
159
223
  try {
@@ -180,9 +244,20 @@ export default defineComponent({
180
244
  return b.startDate > a.startDate ? -1 : 0;
181
245
  });
182
246
  }
183
- this.planning[this.daySelected] = occurrences.filter(
184
- (oc) => oc.podcastId,
185
- );
247
+ let periodDayIndex = 0;
248
+ for (let index = 0; index < occurrences.length; index++) {
249
+ if(!occurrences[index].podcastId){continue;}
250
+ if(!dayjs(occurrences[index].startDate).isBefore(this.periodOfDay[periodDayIndex].end)){
251
+ periodDayIndex+=1;
252
+ }
253
+ switch (this.periodOfDay[periodDayIndex].id) {
254
+ case "morning": this.planning[this.daySelected].morning.push(occurrences[index]); break;
255
+ case "afternoon": this.planning[this.daySelected].afternoon.push(occurrences[index]); break;
256
+ case "evening": this.planning[this.daySelected].evening.push(occurrences[index]); break;
257
+ default:break;
258
+ }
259
+ this.planningLength[this.daySelected]+=1;
260
+ }
186
261
  } catch {
187
262
  this.error = true;
188
263
  }
@@ -7,7 +7,7 @@
7
7
  class="octopus-popover"
8
8
  :class="[onlyClick ? 'octopus-dropdown' : '', popoverClass]"
9
9
  :style="positionInlineStyle"
10
- @focusout="clearDataBlur"
10
+ @blur="clearDataBlur"
11
11
  @mouseenter="overPopover = true"
12
12
  @mouseleave="
13
13
  overPopover = false;
@@ -40,6 +40,7 @@ export default defineComponent({
40
40
  topPos: { type: Boolean, default: false },
41
41
  popoverClass: { type: String, default: undefined },
42
42
  },
43
+ emits: ["updateVisibility"],
43
44
  data() {
44
45
  return {
45
46
  show: false as boolean,
@@ -58,6 +59,11 @@ export default defineComponent({
58
59
  return `left: ${this.posX}px; top: ${this.posY}px;`;
59
60
  },
60
61
  },
62
+ watch:{
63
+ show(){
64
+ this.$emit('updateVisibility', this.show);
65
+ }
66
+ },
61
67
  mounted() {
62
68
  this.init();
63
69
  },
@@ -190,7 +190,6 @@ export const playerStitching = defineComponent({
190
190
  }
191
191
  const parameters = this.getUriSearchParams({
192
192
  adCount: 1,
193
- ua:navigator.userAgent,
194
193
  pageUrl:document.referrer,
195
194
  keywords:keywords
196
195
  });
@@ -1,5 +1,6 @@
1
1
  <template>
2
2
  <div class="page-box">
3
+ <slot name="new-emission"/>
3
4
  <ProductorSearch
4
5
  v-model:organisationId="organisationId"
5
6
  v-model:search-pattern="searchPattern"
package/src/locale/de.ts CHANGED
@@ -358,4 +358,8 @@ export default {
358
358
  "Skip ad":"Überspringen",
359
359
  "Skip ad in seconds":"Anzeige in {seconds} Sekunden überspringen",
360
360
  "Insert custom code":"Fügen Sie benutzerdefinierten Code ein",
361
+ "Morning":"Morgen",
362
+ "Afternoon":"Nachmittag",
363
+ "Evening":"Abend",
364
+ "Now":"Jetzt",
361
365
  }
package/src/locale/en.ts CHANGED
@@ -359,4 +359,8 @@ export default {
359
359
  "Skip ad":"Skip ad",
360
360
  "Skip ad in seconds":"Skip ad in {seconds} seconds",
361
361
  "Insert custom code":"Insert custom code",
362
+ "Morning":"Morning",
363
+ "Afternoon":"Afternoon",
364
+ "Evening":"Evening",
365
+ "Now":"Now",
362
366
  };
package/src/locale/es.ts CHANGED
@@ -359,4 +359,8 @@ export default {
359
359
  "Skip ad":"Omitir aviso publicitario",
360
360
  "Skip ad in seconds":"Saltar anuncio en {segundos} segundos",
361
361
  "Insert custom code":"Insertar código personalizado",
362
+ "Morning":"Mañana",
363
+ "Afternoon":"Tarde",
364
+ "Evening":"Noche",
365
+ "Now":"Ahora",
362
366
  }
package/src/locale/fr.ts CHANGED
@@ -366,4 +366,8 @@ export default {
366
366
  "Skip ad":"Ignorer l'annonce",
367
367
  "Skip ad in seconds":"Ignorer l'annonce dans {seconds} secondes",
368
368
  "Insert custom code":"Insérer le code personnalisé",
369
+ "Morning":"Matinée",
370
+ "Afternoon":"Après-midi",
371
+ "Evening":"Soirée",
372
+ "Now":"Maintenant",
369
373
  };
package/src/locale/it.ts CHANGED
@@ -352,4 +352,8 @@ export default{
352
352
  "Skip ad":"Salta annuncio",
353
353
  "Skip ad in seconds":"Salta l'annuncio tra {seconds} secondi",
354
354
  "Insert custom code":"Inserisci il codice personalizzato",
355
+ "Morning":"Mattina",
356
+ "Afternoon":"Pomeriggio",
357
+ "Evening":"Sera",
358
+ "Now":"Ora",
355
359
  };
package/src/locale/sl.ts CHANGED
@@ -349,4 +349,8 @@ export default {
349
349
  "Skip ad":"Preskočite oglas",
350
350
  "Skip ad in seconds":"Preskoči oglas čez {seconds} sekund",
351
351
  "Insert custom code":"Vstavite kodo po meri",
352
+ "Morning":"Jutro",
353
+ "Afternoon":"Popoldan",
354
+ "Evening":"Večer",
355
+ "Now":"Zdaj",
352
356
  }