ui: support @[user]()

This commit is contained in:
undefined committed 2021-05-19 23:12:07 +08:00
1 parent b272598685
commit c5b2552f59
8 files changed
+48 -13

No files matched your search

@@ -0,0 +1,15 @@
import { AutoloadPage } from 'vj/misc/Page';
import request from 'vj/utils/request';
export default new AutoloadPage('media', async () => {
const items = [];
const resolvers = [];
const users = $('div[data-user]');
users.get().forEach((ele) => {
items.push({ type: 'user', id: $(ele).text() });
resolvers.push((html) => $(ele).replaceWith($(html)));
});
if (!items.length) return;
const res = await request.post('/media', { items });
for (let i = 0; i < res.length; i++) resolvers[i](res[i]);
});
@@ -1,14 +1,14 @@
.user-profile-avatar
border-radius: 50%
border-radius: 50% !important
.user-profile-badge
display: inline-block
font-size: rem(12px)
padding: rem(3px 4px)
line-height: 1
display: inline-block !important
font-size: rem(12px) !important
padding: rem(3px 4px) !important
line-height: 1 !important
&:hover
text-decoration: none
text-decoration: none !important
for n in (1..21)
.user-profile-bg--{n}