This commit is contained in:
syuilo 2020-12-26 10:47:36 +09:00
parent 9d81d06853
commit 5a8cc7851b
200 changed files with 1562 additions and 1533 deletions

View file

@ -58,31 +58,31 @@ export default defineComponent({
text: this.to,
}, {
icon: faWindowMaximize,
text: this.$t('openInWindow'),
text: this.$ts.openInWindow,
action: () => {
os.pageWindow(this.to);
}
}, this.sideViewHook ? {
icon: faColumns,
text: this.$t('openInSideView'),
text: this.$ts.openInSideView,
action: () => {
this.sideViewHook(this.to);
}
} : undefined, {
icon: faExpandAlt,
text: this.$t('showInPage'),
text: this.$ts.showInPage,
action: () => {
this.$router.push(this.to);
}
}, null, {
icon: faExternalLinkAlt,
text: this.$t('openInNewTab'),
text: this.$ts.openInNewTab,
action: () => {
window.open(this.to, '_blank');
}
}, {
icon: faLink,
text: this.$t('copyLink'),
text: this.$ts.copyLink,
action: () => {
copyToClipboard(`${url}${this.to}`);
}

View file

@ -2,8 +2,8 @@
<transition :name="$store.state.animation ? 'zoom' : ''" appear>
<div class="mjndxjcg">
<img src="https://xn--931a.moe/assets/error.jpg" class="_ghost"/>
<p><Fa :icon="faExclamationTriangle"/> {{ $t('somethingHappened') }}</p>
<MkButton @click="() => $emit('retry')" class="button">{{ $t('retry') }}</MkButton>
<p><Fa :icon="faExclamationTriangle"/> {{ $ts.somethingHappened }}</p>
<MkButton @click="() => $emit('retry')" class="button">{{ $ts.retry }}</MkButton>
</div>
</transition>
</template>

View file

@ -1,15 +1,37 @@
import { h, Fragment, defineComponent } from 'vue';
import type { SetupContext, VNodeChild, RenderFunction } from 'vue';
import { h, defineComponent } from 'vue';
export default defineComponent({
props: {
src: {
type: String,
required: true
required: true,
},
tag: {
type: String,
required: false,
default: 'span',
},
},
render() {
// TODO
return h('span', this.src);
let str = this.src;
const parsed = [] as (string | { arg: string; })[];
while (true) {
const nextBracketOpen = str.indexOf('{');
const nextBracketClose = str.indexOf('}');
if (nextBracketOpen === -1) {
parsed.push(str);
break;
} else {
if (nextBracketOpen > 0) parsed.push(str.substr(0, nextBracketOpen));
parsed.push({
arg: str.substring(nextBracketOpen + 1, nextBracketClose)
});
}
str = str.substr(nextBracketClose + 1);
}
return h(this.tag, parsed.map(x => typeof x === 'string' ? x : this.$slots[x.arg]()));
}
});

View file

@ -44,9 +44,9 @@ export default defineComponent({
ago >= 3600 ? this.$t('_ago.hoursAgo', { n: (~~(ago / 3600)).toString() }) :
ago >= 60 ? this.$t('_ago.minutesAgo', { n: (~~(ago / 60)).toString() }) :
ago >= 10 ? this.$t('_ago.secondsAgo', { n: (~~(ago % 60)).toString() }) :
ago >= -1 ? this.$t('_ago.justNow') :
ago < -1 ? this.$t('_ago.future') :
this.$t('_ago.unknown'));
ago >= -1 ? this.$ts._ago.justNow :
ago < -1 ? this.$ts._ago.future :
this.$ts._ago.unknown);
}
},
created() {