mirror of
https://github.com/MrUnknownDE/VRCX.git
synced 2026-05-07 14:56:06 +02:00
Direct access User/Avatar URL's, zoom previous images
This commit is contained in:
+60
-9
@@ -7711,7 +7711,7 @@ speechSynthesis.getVoices();
|
|||||||
};
|
};
|
||||||
|
|
||||||
$app.methods.promptUserDialog = function () {
|
$app.methods.promptUserDialog = function () {
|
||||||
this.$prompt('Enter a User ID (UUID)', 'Direct Access', {
|
this.$prompt('Enter a User URL or ID (UUID)', 'Direct Access', {
|
||||||
distinguishCancelAndClose: true,
|
distinguishCancelAndClose: true,
|
||||||
confirmButtonText: 'OK',
|
confirmButtonText: 'OK',
|
||||||
cancelButtonText: 'Cancel',
|
cancelButtonText: 'Cancel',
|
||||||
@@ -7720,7 +7720,21 @@ speechSynthesis.getVoices();
|
|||||||
callback: (action, instance) => {
|
callback: (action, instance) => {
|
||||||
if (action === 'confirm' &&
|
if (action === 'confirm' &&
|
||||||
instance.inputValue) {
|
instance.inputValue) {
|
||||||
this.showUserDialog(instance.inputValue);
|
var testUrl = instance.inputValue.substring(0, 15);
|
||||||
|
if (testUrl === 'https://vrchat.') {
|
||||||
|
var userId = this.parseUserUrl(instance.inputValue);
|
||||||
|
if (userId) {
|
||||||
|
this.showUserDialog(userId);
|
||||||
|
} else {
|
||||||
|
this.$message({
|
||||||
|
message: 'Invalid URL',
|
||||||
|
type: 'error'
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
this.showUserDialog(instance.inputValue);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -7746,6 +7760,7 @@ speechSynthesis.getVoices();
|
|||||||
message: 'Invalid URL',
|
message: 'Invalid URL',
|
||||||
type: 'error'
|
type: 'error'
|
||||||
});
|
});
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
this.showWorldDialog(instance.inputValue);
|
this.showWorldDialog(instance.inputValue);
|
||||||
@@ -7908,11 +7923,25 @@ speechSynthesis.getVoices();
|
|||||||
callback: (action, instance) => {
|
callback: (action, instance) => {
|
||||||
if (action === 'confirm' &&
|
if (action === 'confirm' &&
|
||||||
instance.inputValue) {
|
instance.inputValue) {
|
||||||
if (API.cachedAvatars.has(instance.inputValue)) {
|
var avatarId = instance.inputValue;
|
||||||
this.showAvatarDialog(instance.inputValue);
|
var testUrl = instance.inputValue.substring(0, 15);
|
||||||
|
if (testUrl === 'https://vrchat.') {
|
||||||
|
var urlAvatarId = this.parseAvatarUrl(instance.inputValue);
|
||||||
|
if (urlAvatarId) {
|
||||||
|
avatarId = urlAvatarId;
|
||||||
|
} else {
|
||||||
|
this.$message({
|
||||||
|
message: 'Invalid URL',
|
||||||
|
type: 'error'
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (API.cachedAvatars.has(avatarId)) {
|
||||||
|
this.showAvatarDialog(avatarId);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
this.showFavoriteDialog('avatar', instance.inputValue);
|
this.showFavoriteDialog('avatar', avatarId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -8001,6 +8030,7 @@ speechSynthesis.getVoices();
|
|||||||
}
|
}
|
||||||
D.ref = ref;
|
D.ref = ref;
|
||||||
$app.applyUserDialogLocation();
|
$app.applyUserDialogLocation();
|
||||||
|
$app.getAvatarName(ref.currentAvatarImageUrl);
|
||||||
});
|
});
|
||||||
|
|
||||||
API.$on('WORLD', function (args) {
|
API.$on('WORLD', function (args) {
|
||||||
@@ -8230,7 +8260,7 @@ speechSynthesis.getVoices();
|
|||||||
if (args.cache) {
|
if (args.cache) {
|
||||||
API.getUser(args.params);
|
API.getUser(args.params);
|
||||||
}
|
}
|
||||||
this.getAvatarName(args);
|
this.getAvatarName(args.ref.currentAvatarImageUrl);
|
||||||
var L = API.parseLocation(D.ref.location);
|
var L = API.parseLocation(D.ref.location);
|
||||||
if ((L.worldId) &&
|
if ((L.worldId) &&
|
||||||
(this.lastLocation.location !== L.tag)) {
|
(this.lastLocation.location !== L.tag)) {
|
||||||
@@ -8590,7 +8620,7 @@ speechSynthesis.getVoices();
|
|||||||
API.getFriendStatus({
|
API.getFriendStatus({
|
||||||
userId: D.id
|
userId: D.id
|
||||||
});
|
});
|
||||||
this.getAvatarName(args);
|
this.getAvatarName(args.ref.currentAvatarImageUrl);
|
||||||
var L = API.parseLocation(D.ref.location);
|
var L = API.parseLocation(D.ref.location);
|
||||||
if ((L.worldId) &&
|
if ((L.worldId) &&
|
||||||
(this.lastLocation.location !== L.tag)) {
|
(this.lastLocation.location !== L.tag)) {
|
||||||
@@ -11799,7 +11829,7 @@ speechSynthesis.getVoices();
|
|||||||
|
|
||||||
API.cachedAvatarNames = new Map();
|
API.cachedAvatarNames = new Map();
|
||||||
|
|
||||||
$app.methods.getAvatarName = function (args) {
|
$app.methods.getAvatarName = function (imageUrl) {
|
||||||
var D = this.userDialog;
|
var D = this.userDialog;
|
||||||
D.$avatarInfo = {
|
D.$avatarInfo = {
|
||||||
ownerId: '',
|
ownerId: '',
|
||||||
@@ -11808,7 +11838,6 @@ speechSynthesis.getVoices();
|
|||||||
if (!D.visible) {
|
if (!D.visible) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
var imageUrl = D.ref.currentAvatarImageUrl;
|
|
||||||
var fileId = extractFileId(imageUrl);
|
var fileId = extractFileId(imageUrl);
|
||||||
if (!fileId) {
|
if (!fileId) {
|
||||||
return;
|
return;
|
||||||
@@ -12441,6 +12470,28 @@ speechSynthesis.getVoices();
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// Parse User URL
|
||||||
|
|
||||||
|
$app.methods.parseUserUrl = function (user) {
|
||||||
|
var url = new URL(user);
|
||||||
|
var urlPath = url.pathname;
|
||||||
|
if ('/user/' === urlPath.substring(5, 11)) {
|
||||||
|
var userId = urlPath.substring(11);
|
||||||
|
return userId;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
// Parse Avatar URL
|
||||||
|
|
||||||
|
$app.methods.parseAvatarUrl = function (avatar) {
|
||||||
|
var url = new URL(avatar);
|
||||||
|
var urlPath = url.pathname;
|
||||||
|
if ('/avatar/' === urlPath.substring(5, 13)) {
|
||||||
|
var avatarId = urlPath.substr(13);
|
||||||
|
return avatarId;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
// userDialog Favorite Worlds
|
// userDialog Favorite Worlds
|
||||||
|
|
||||||
$app.data.userFavoriteWorlds = [];
|
$app.data.userFavoriteWorlds = [];
|
||||||
|
|||||||
+2
-1
@@ -399,7 +399,8 @@ img.friends-list-avatar {
|
|||||||
border-radius: 2px;
|
border-radius: 2px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.x-change-image-item > img {
|
.x-change-image-item > img,
|
||||||
|
.x-change-image-item > .el-popover__reference-wrapper > img {
|
||||||
width: 240px;
|
width: 240px;
|
||||||
height: 180px;
|
height: 180px;
|
||||||
}
|
}
|
||||||
|
|||||||
+3
-2
@@ -1970,8 +1970,9 @@ html
|
|||||||
el-dialog.x-dialog(ref="previousImagesDialog" :visible.sync="previousImagesDialogVisible" title="Previous Images" width="800px")
|
el-dialog.x-dialog(ref="previousImagesDialog" :visible.sync="previousImagesDialogVisible" title="Previous Images" width="800px")
|
||||||
div
|
div
|
||||||
div(style="display:inline-block" v-for="image in previousImagesTable" :key="image.version" v-if="image.file")
|
div(style="display:inline-block" v-for="image in previousImagesTable" :key="image.version" v-if="image.file")
|
||||||
.x-change-image-item
|
el-popover.x-change-image-item(placement="right" width="500px" trigger="click")
|
||||||
img.image(v-lazy="image.file.url")
|
img.x-link(slot="reference" v-lazy="image.file.url")
|
||||||
|
img.x-link(v-lazy="image.file.url" style="width:500px;height:375px" @click="openExternalLink(image.file.url)")
|
||||||
|
|
||||||
//- dialog: Gallery/VRCPlusIcons
|
//- dialog: Gallery/VRCPlusIcons
|
||||||
el-dialog.x-dialog(ref="galleryDialog" :visible.sync="galleryDialogVisible" title="Gallery and Icons" width="100%")
|
el-dialog.x-dialog(ref="galleryDialog" :visible.sync="galleryDialogVisible" title="Gallery and Icons" width="100%")
|
||||||
|
|||||||
Reference in New Issue
Block a user