1
0
Fork 0
mirror of https://github.com/FrankerFaceZ/FrankerFaceZ.git synced 2025-08-11 00:20:54 +00:00
* Added: Accent Color customization, in `Appearance > Theme`.
* Added: Previews for custom date/time formats in `Appearance > Localization`.
* Changed: Assume Twitch clip and video thumbnails are Safe-For-Work.
* Fixed: Changelog dates not using i18n formatting. (Closes #873)
* Fixed: Icon picker string not localizing properly.
* Removed `Gray (no Purple)` legacy CSS. It's been breaking more and more over time, and it's not necessary at all with the new Accent Color setting.
This commit is contained in:
SirStendec 2020-08-05 19:23:18 -04:00
parent 6310a2ed49
commit a5e2dd9ef2
10 changed files with 198 additions and 114 deletions

View file

@ -261,7 +261,7 @@ export const Clips = {
short: {
type: 'header',
image: {type: 'image', url: clip.thumbnailURL, sfw: false, aspect: 16/9},
image: {type: 'image', url: clip.thumbnailURL, sfw: true, aspect: 16/9},
title: clip.title,
subtitle,
extra
@ -332,7 +332,7 @@ export const Videos = {
url: token.url,
short: {
type: 'header',
image: {type: 'image', url: video.previewThumbnailURL, sfw: false, aspect: 16/9},
image: {type: 'image', url: video.previewThumbnailURL, sfw: true, aspect: 16/9},
title: video.title,
subtitle,
extra

View file

@ -186,9 +186,9 @@ export default {
is_today = date.toDateString() === today.toDateString();
if ( is_today )
return date.toLocaleTimeString();
return this.tTime(date);
return date.toLocaleDateString();
return this.tDate(date);
},
async fetchMore() {

View file

@ -0,0 +1,40 @@
<template>
<div class="tw-flex tw-align-items-start">
<label />
<div class="tw-c-text-alt tw-mg-b-05 tw-mg-x-05">
<code v-if="mode === 'date'">
{{ tDate(now, value) }}
</code>
<code v-else-if="mode === 'time'">
{{ tTime(now, value) }}
</code>
<code v-else>
{{ tDateTime(now, value) }}
</code>
</div>
</div>
</template>
<script>
export default {
props: ['context', 'item', 'value'],
data() {
return {
mode: this.item.extra.mode,
now: null
}
},
mounted() {
this.now = new Date;
this.timer = setInterval(() => this.now = new Date, 1000);
},
beforeDestroy() {
clearInterval(this.timer);
this.timer = null;
}
}
</script>

View file

@ -62,14 +62,18 @@
</button>
</div>
<section v-if="item.extra && item.extra.component && item.extra.before">
<component :is="item.extra.component" :context="context" :item="item" :value="value" />
</section>
<section
v-if="item.description"
class="tw-c-text-alt-2"
>
<markdown :source="t(item.desc_i18n_key || `${item.i18n_key}.description`, item.description)" />
</section>
<section v-if="item.extra">
<component :is="item.extra.component" :context="context" :item="item" />
<section v-if="item.extra && item.extra.component && ! item.extra.before">
<component :is="item.extra.component" :context="context" :item="item" :value="value" />
</section>
</div>
</template>

View file

@ -1,89 +0,0 @@
<template>
<div>
<error-tab v-if="errored" />
<loading-tab v-else-if="loading" />
<template v-else>
<ul>
<li
v-for="(entry, idx) in data"
:key="entry[1]"
:class="idx === 0 ? '' : 'tw-border-t'"
class="tw-pd-x-1 tw-pd-y-05"
>
<span
:data-title="fullTime(entry[0])"
data-tooltip-type="text"
class="ffz-tooltip tw-pd-r-1"
>{{ formatTime(entry[0]) }}: </span>
{{ entry[1] }}
</li>
</ul>
</template>
</div>
</template>
<script>
import LoadingTab from './loading-tab.vue';
import ErrorTab from './error-tab.vue';
export default {
components: {
'loading-tab': LoadingTab,
'error-tab': ErrorTab
},
props: ['tab', 'channel', 'user', 'self', 'getFFZ'],
data() {
return {
loading: true,
errored: false,
data: null
}
},
mounted() {
const socket = this.getFFZ().resolve('socket');
if ( ! socket ) {
this.errored = true;
return;
}
socket.call('get_name_history', this.user.login).then(data => {
this.loading = false;
if ( Array.isArray(data) )
data = data.reverse();
this.data = data;
}).catch(err => {
this.getFFZ().log.error('Error loading name history.', err);
this.errored = true;
})
},
methods: {
fullTime(time) {
try {
const date = new Date(time);
return date.toLocaleString();
} catch(err) {
return 'Unknown'
}
},
formatTime(time) {
try {
const date = new Date(time);
return date.toLocaleDateString();
} catch(err) {
return 'Unknown'
}
}
}
}
</script>