itube-specs 0.0.515 → 0.0.517
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/components/page-components/s-expand-row.vue +8 -2
- package/components/page-components/s-footer-models.vue +1 -1
- package/components/page-components/s-report.vue +1 -1
- package/components/page-components/s-share.vue +13 -5
- package/components/playlist/s-playlist-private-toggle.vue +2 -2
- package/package.json +1 -1
- package/runtime/utils/converters/convert-date-to-timestamp.ts +4 -4
- package/runtime/utils/format-date.ts +3 -3
|
@@ -98,7 +98,13 @@ onMounted(() => {
|
|
|
98
98
|
checkIsElementOverflow();
|
|
99
99
|
});
|
|
100
100
|
|
|
101
|
+
let checkTimer: ReturnType<typeof setTimeout> | null = null;
|
|
102
|
+
|
|
101
103
|
watch(() => useRoute().query, () => {
|
|
102
|
-
setTimeout(() => checkIsElementOverflow(), 100)
|
|
103
|
-
})
|
|
104
|
+
checkTimer = setTimeout(() => checkIsElementOverflow(), 100);
|
|
105
|
+
});
|
|
106
|
+
|
|
107
|
+
onBeforeUnmount(() => {
|
|
108
|
+
if (checkTimer) clearTimeout(checkTimer);
|
|
109
|
+
});
|
|
104
110
|
</script>
|
|
@@ -203,7 +203,7 @@ async function submit() {
|
|
|
203
203
|
if (!valid) return;
|
|
204
204
|
|
|
205
205
|
try {
|
|
206
|
-
const baseURL = window.location.origin;
|
|
206
|
+
const baseURL = process.client ? window.location.origin : '';
|
|
207
207
|
loading.value = true;
|
|
208
208
|
form.value.token = await getRecaptchaToken('contact_form');
|
|
209
209
|
form.value.url = `${baseURL}/videos/${reportedVideoCard.value.id}`;
|
|
@@ -55,13 +55,17 @@ const {isSharePopupOpen, closeSharePopup, sharedVideoCard} = useSharePopup();
|
|
|
55
55
|
const route = useRoute();
|
|
56
56
|
|
|
57
57
|
const isCopied = ref(false);
|
|
58
|
+
let copyTimeout: ReturnType<typeof setTimeout> | null = null;
|
|
58
59
|
|
|
59
|
-
const fullUrl = computed(() =>
|
|
60
|
+
const fullUrl = computed(() =>
|
|
61
|
+
(process.client ? window.location.origin : '') + route.fullPath
|
|
62
|
+
);
|
|
60
63
|
|
|
61
64
|
function copyUrl() {
|
|
65
|
+
if (!process.client) return;
|
|
62
66
|
navigator.clipboard.writeText(fullUrl.value).then(() => {
|
|
63
|
-
isCopied.value = true
|
|
64
|
-
})
|
|
67
|
+
isCopied.value = true;
|
|
68
|
+
});
|
|
65
69
|
}
|
|
66
70
|
|
|
67
71
|
const copyIcon = computed(() => isCopied.value ? 'check' : 'copy');
|
|
@@ -69,9 +73,13 @@ const inputText = computed(() => isCopied.value ? t('link_copied') : t('link'));
|
|
|
69
73
|
|
|
70
74
|
watch(() => isCopied.value, (value) => {
|
|
71
75
|
if (value) {
|
|
72
|
-
setTimeout(() => isCopied.value = false, 3000)
|
|
76
|
+
copyTimeout = setTimeout(() => isCopied.value = false, 3000);
|
|
73
77
|
}
|
|
74
|
-
})
|
|
78
|
+
});
|
|
79
|
+
|
|
80
|
+
onBeforeUnmount(() => {
|
|
81
|
+
if (copyTimeout) clearTimeout(copyTimeout);
|
|
82
|
+
});
|
|
75
83
|
|
|
76
84
|
const { t } = useI18n()
|
|
77
85
|
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
<SToggle
|
|
4
4
|
class="s-playlist-private-toggle__toggler"
|
|
5
5
|
:model-value="modelValue"
|
|
6
|
-
@update:model-value="(
|
|
6
|
+
@update:model-value="(value: boolean) => emit('update:modelValue', value)"
|
|
7
7
|
/>
|
|
8
8
|
<p class="s-playlist-private-toggle__text">{{ $t('playlist.private_playlist')}}</p>
|
|
9
9
|
</div>
|
|
@@ -15,6 +15,6 @@ defineProps<{
|
|
|
15
15
|
}>()
|
|
16
16
|
|
|
17
17
|
const emit = defineEmits<{
|
|
18
|
-
(eventName: 'update:modelValue', value:
|
|
18
|
+
(eventName: 'update:modelValue', value: boolean): void
|
|
19
19
|
}>()
|
|
20
20
|
</script>
|
package/package.json
CHANGED
|
@@ -8,7 +8,7 @@ export const convertDateToTimestamp = () => {
|
|
|
8
8
|
return null;
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
-
const date = new Date(year, month - 1, day);
|
|
11
|
+
const date = new Date(Date.UTC(year, month - 1, day));
|
|
12
12
|
if (isNaN(date.getTime())) {
|
|
13
13
|
return null;
|
|
14
14
|
}
|
|
@@ -23,9 +23,9 @@ export const convertDateToTimestamp = () => {
|
|
|
23
23
|
const fromUnix = (timestamp: number): string => {
|
|
24
24
|
const date = new Date(timestamp * 1000);
|
|
25
25
|
|
|
26
|
-
const yyyy = date.
|
|
27
|
-
const mm = String(date.
|
|
28
|
-
const dd = String(date.
|
|
26
|
+
const yyyy = date.getUTCFullYear();
|
|
27
|
+
const mm = String(date.getUTCMonth() + 1).padStart(2, '0');
|
|
28
|
+
const dd = String(date.getUTCDate()).padStart(2, '0');
|
|
29
29
|
|
|
30
30
|
return `${yyyy}-${mm}-${dd}`;
|
|
31
31
|
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
export function formatDate(seconds: number): string {
|
|
2
2
|
const date = new Date(1000 * seconds);
|
|
3
3
|
|
|
4
|
-
const day = date.
|
|
5
|
-
const month = date.
|
|
6
|
-
const year = date.
|
|
4
|
+
const day = date.getUTCDate();
|
|
5
|
+
const month = date.getUTCMonth() + 1;
|
|
6
|
+
const year = date.getUTCFullYear();
|
|
7
7
|
|
|
8
8
|
const formattedDay = String(day).padStart(2, '0');
|
|
9
9
|
const formattedMonth = String(month).padStart(2, '0');
|