mirror of
https://github.com/MrUnknownDE/VRCX.git
synced 2026-05-01 20:53:45 +02:00
add get avatar info by clicking avatar image in feed (closes #79)
This commit is contained in:
@@ -6689,6 +6689,59 @@ CefSharp.BindObjectAsync(
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
$app.methods.showAvatarAuthorDialog = function (refUserId, currentAvatarImageUrl) {
|
||||||
|
var id = extractFileId(currentAvatarImageUrl);
|
||||||
|
if (id) {
|
||||||
|
API.call(`file/${id}`).then(({ ownerId }) => {
|
||||||
|
for (var ref of API.cachedAvatars.values()) {
|
||||||
|
if (ref.imageUrl === currentAvatarImageUrl) {
|
||||||
|
this.showAvatarDialog(ref.id);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
var params = {
|
||||||
|
n: 100,
|
||||||
|
offset: 0,
|
||||||
|
sort: 'updated',
|
||||||
|
order: 'descending',
|
||||||
|
// user: 'friends',
|
||||||
|
userId: ownerId,
|
||||||
|
releaseStatus: 'public'
|
||||||
|
};
|
||||||
|
if (params.userId === API.currentUser.id) {
|
||||||
|
params.user = 'me';
|
||||||
|
params.releaseStatus = 'all';
|
||||||
|
}
|
||||||
|
API.bulk({
|
||||||
|
fn: 'getAvatars',
|
||||||
|
N: -1,
|
||||||
|
params,
|
||||||
|
done: () => {
|
||||||
|
for (var ref2 of API.cachedAvatars.values()) {
|
||||||
|
if (ref2.imageUrl === currentAvatarImageUrl) {
|
||||||
|
this.showAvatarDialog(ref2.id);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (ownerId === refUserId) {
|
||||||
|
this.$message({
|
||||||
|
message: 'It\'s personal (own) avatar',
|
||||||
|
type: 'warning'
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.showUserDialog(ownerId);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
this.$message({
|
||||||
|
message: 'Sorry, the author is unknown',
|
||||||
|
type: 'error'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
$app.methods.refreshAvatarDialogTreeData = function () {
|
$app.methods.refreshAvatarDialogTreeData = function () {
|
||||||
var D = this.avatarDialog;
|
var D = this.avatarDialog;
|
||||||
D.treeData = buildTreeData(D.ref);
|
D.treeData = buildTreeData(D.ref);
|
||||||
|
|||||||
+2
-2
@@ -80,12 +80,12 @@ html
|
|||||||
//- high resolution (v2) 2020.07.12~
|
//- high resolution (v2) 2020.07.12~
|
||||||
el-popover(placement="right" width="500px" trigger="click")
|
el-popover(placement="right" width="500px" trigger="click")
|
||||||
img.x-link(slot="reference" v-lazy="scope.row.avatar[1].currentAvatarThumbnailImageUrl" style="flex:none;width:160px;height:120px;border-radius:4px")
|
img.x-link(slot="reference" v-lazy="scope.row.avatar[1].currentAvatarThumbnailImageUrl" style="flex:none;width:160px;height:120px;border-radius:4px")
|
||||||
img(v-lazy="scope.row.avatar[1].currentAvatarImageUrl" style="width:500px;height:375px")
|
img.x-link(v-lazy="scope.row.avatar[1].currentAvatarImageUrl" style="width:500px;height:375px" @click="showAvatarAuthorDialog(scope.row.userId, scope.row.avatar[1].currentAvatarImageUrl)")
|
||||||
span(style="position:relative;top:-50px;margin:0 5px")
|
span(style="position:relative;top:-50px;margin:0 5px")
|
||||||
i.el-icon-right
|
i.el-icon-right
|
||||||
el-popover(placement="right" width="500px" trigger="click")
|
el-popover(placement="right" width="500px" trigger="click")
|
||||||
img.x-link(slot="reference" v-lazy="scope.row.avatar[0].currentAvatarThumbnailImageUrl" style="flex:none;width:160px;height:120px;border-radius:4px")
|
img.x-link(slot="reference" v-lazy="scope.row.avatar[0].currentAvatarThumbnailImageUrl" style="flex:none;width:160px;height:120px;border-radius:4px")
|
||||||
img(v-lazy="scope.row.avatar[0].currentAvatarImageUrl" style="width:500px;height:375px")
|
img.x-link(v-lazy="scope.row.avatar[0].currentAvatarImageUrl" style="width:500px;height:375px" @click="showAvatarAuthorDialog(scope.row.userId, scope.row.avatar[0].currentAvatarImageUrl)")
|
||||||
template(v-else)
|
template(v-else)
|
||||||
//- legacy
|
//- legacy
|
||||||
el-popover(placement="right" width="500px" trigger="click")
|
el-popover(placement="right" width="500px" trigger="click")
|
||||||
|
|||||||
Reference in New Issue
Block a user