mirror of
https://github.com/MrUnknownDE/VRCX.git
synced 2026-04-19 14:53:50 +02:00
chagne menu item order, cleanup code
This commit is contained in:
46
html/app.js
46
html/app.js
@@ -1803,6 +1803,20 @@ CefSharp.BindObjectAsync(
|
|||||||
return '';
|
return '';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
API.parseInviteLocation = function (ref) {
|
||||||
|
try {
|
||||||
|
var L = API.parseLocation(ref.details.worldId);
|
||||||
|
if (L.worldId !== '' && L.instanceId !== '') {
|
||||||
|
return `${ref.details.worldName} #${L.instanceName} ${L.accessType}`;
|
||||||
|
}
|
||||||
|
return ref.message ||
|
||||||
|
ref.details.worldId ||
|
||||||
|
ref.details.worldName;
|
||||||
|
} catch (err) {
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
// API: PlayerModeration
|
// API: PlayerModeration
|
||||||
|
|
||||||
API.cachedPlayerModerations = new Map();
|
API.cachedPlayerModerations = new Map();
|
||||||
@@ -4834,20 +4848,21 @@ CefSharp.BindObjectAsync(
|
|||||||
});
|
});
|
||||||
|
|
||||||
API.$on('PLAYER-MODERATION', function (args) {
|
API.$on('PLAYER-MODERATION', function (args) {
|
||||||
|
var { ref } = args;
|
||||||
var insertOrUpdate = $app.playerModerationTable.data.some((val, idx, arr) => {
|
var insertOrUpdate = $app.playerModerationTable.data.some((val, idx, arr) => {
|
||||||
if (val.id === args.ref.id) {
|
if (val.id === ref.id) {
|
||||||
if (args.ref.$isExpired) {
|
if (ref.$isExpired) {
|
||||||
Vue.delete(arr, idx);
|
Vue.delete(arr, idx);
|
||||||
} else {
|
} else {
|
||||||
Vue.set(arr, idx, args.ref);
|
Vue.set(arr, idx, ref);
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
if (!insertOrUpdate &&
|
if (!insertOrUpdate &&
|
||||||
!args.ref.$isExpired) {
|
!ref.$isExpired) {
|
||||||
$app.playerModerationTable.data.push(args.ref);
|
$app.playerModerationTable.data.push(ref);
|
||||||
$app.notifyMenu('moderation');
|
$app.notifyMenu('moderation');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -4920,20 +4935,21 @@ CefSharp.BindObjectAsync(
|
|||||||
});
|
});
|
||||||
|
|
||||||
API.$on('NOTIFICATION', function (args) {
|
API.$on('NOTIFICATION', function (args) {
|
||||||
|
var { ref } = args;
|
||||||
var insertOrUpdate = $app.notificationTable.data.some((val, idx, arr) => {
|
var insertOrUpdate = $app.notificationTable.data.some((val, idx, arr) => {
|
||||||
if (val.id === args.ref.id) {
|
if (val.id === ref.id) {
|
||||||
if (args.ref.$isExpired) {
|
if (ref.$isExpired) {
|
||||||
Vue.delete(arr, idx);
|
Vue.delete(arr, idx);
|
||||||
} else {
|
} else {
|
||||||
Vue.set(arr, idx, args.ref);
|
Vue.set(arr, idx, ref);
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
if (!insertOrUpdate &&
|
if (!insertOrUpdate &&
|
||||||
!args.ref.$isExpired) {
|
!ref.$isExpired) {
|
||||||
$app.notificationTable.data.push(args.ref);
|
$app.notificationTable.data.push(ref);
|
||||||
$app.notifyMenu('notification');
|
$app.notifyMenu('notification');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -4948,16 +4964,6 @@ CefSharp.BindObjectAsync(
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
$app.methods.parseInviteLocation = function (row) {
|
|
||||||
try {
|
|
||||||
var L = API.parseLocation(row.details.worldId);
|
|
||||||
return `${row.details.worldName} #${L.instanceName} ${L.accessType}`;
|
|
||||||
} catch (err) {
|
|
||||||
console.error(err);
|
|
||||||
return '';
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
$app.methods.acceptNotification = function (row) {
|
$app.methods.acceptNotification = function (row) {
|
||||||
// FIXME: 메시지 수정
|
// FIXME: 메시지 수정
|
||||||
this.$confirm('Continue? Accept Friend Request', 'Confirm', {
|
this.$confirm('Continue? Accept Friend Request', 'Confirm', {
|
||||||
|
|||||||
@@ -510,7 +510,7 @@
|
|||||||
<template v-once #default="scope">
|
<template v-once #default="scope">
|
||||||
<el-tooltip placement="top" v-if="scope.row.type === 'invite'">
|
<el-tooltip placement="top" v-if="scope.row.type === 'invite'">
|
||||||
<template #content>
|
<template #content>
|
||||||
<span v-text="parseInviteLocation(scope.row)"></span>
|
<span v-text="API.parseInviteLocation(scope.row)"></span>
|
||||||
</template>
|
</template>
|
||||||
<span v-text="scope.row.type" @click="showWorldDialog(scope.row.details.worldId)" class="x-link"></span>
|
<span v-text="scope.row.type" @click="showWorldDialog(scope.row.details.worldId)" class="x-link"></span>
|
||||||
</el-tooltip>
|
</el-tooltip>
|
||||||
@@ -914,10 +914,8 @@
|
|||||||
<el-dropdown trigger="click" @command="userDialogCommand" size="small">
|
<el-dropdown trigger="click" @command="userDialogCommand" size="small">
|
||||||
<el-button :type="(userDialog.incomingRequest || userDialog.outgoingRequest) ? 'success' : (userDialog.isBlock || userDialog.isMute || userDialog.isHideAvatar) ? 'danger' : 'default'" icon="el-icon-more" circle></el-button>
|
<el-button :type="(userDialog.incomingRequest || userDialog.outgoingRequest) ? 'success' : (userDialog.isBlock || userDialog.isMute || userDialog.isHideAvatar) ? 'danger' : 'default'" icon="el-icon-more" circle></el-button>
|
||||||
<el-dropdown-menu #default="dropdown">
|
<el-dropdown-menu #default="dropdown">
|
||||||
<el-dropdown-item icon="el-icon-s-custom" command="Show Avatar Author">Show Avatar Author</el-dropdown-item>
|
|
||||||
<template v-if="userDialog.isFriend">
|
<template v-if="userDialog.isFriend">
|
||||||
<el-dropdown-item icon="el-icon-message" command="Message">Message</el-dropdown-item>
|
<el-dropdown-item icon="el-icon-message" command="Message">Message</el-dropdown-item>
|
||||||
<el-dropdown-item icon="el-icon-delete" command="Unfriend" divided>Unfriend</el-dropdown-item>
|
|
||||||
</template>
|
</template>
|
||||||
<template v-else-if="userDialog.incomingRequest">
|
<template v-else-if="userDialog.incomingRequest">
|
||||||
<el-dropdown-item icon="el-icon-check" command="Accept Friend Request">Accept Friend Request</el-dropdown-item>
|
<el-dropdown-item icon="el-icon-check" command="Accept Friend Request">Accept Friend Request</el-dropdown-item>
|
||||||
@@ -925,12 +923,16 @@
|
|||||||
</template>
|
</template>
|
||||||
<el-dropdown-item v-else-if="userDialog.outgoingRequest" icon="el-icon-close" command="Cancel Friend Request">Cancel Friend Request</el-dropdown-item>
|
<el-dropdown-item v-else-if="userDialog.outgoingRequest" icon="el-icon-close" command="Cancel Friend Request">Cancel Friend Request</el-dropdown-item>
|
||||||
<el-dropdown-item v-else icon="el-icon-plus" command="Send Friend Request">Send Friend Request</el-dropdown-item>
|
<el-dropdown-item v-else icon="el-icon-plus" command="Send Friend Request">Send Friend Request</el-dropdown-item>
|
||||||
|
<el-dropdown-item icon="el-icon-s-custom" command="Show Avatar Author" divided>Show Avatar Author</el-dropdown-item>
|
||||||
<el-dropdown-item v-if="userDialog.isBlock" icon="el-icon-circle-check" command="Unblock" divided style="color:#F56C6C">Unblock</el-dropdown-item>
|
<el-dropdown-item v-if="userDialog.isBlock" icon="el-icon-circle-check" command="Unblock" divided style="color:#F56C6C">Unblock</el-dropdown-item>
|
||||||
<el-dropdown-item v-else icon="el-icon-circle-close" command="Block" divided>Block</el-dropdown-item>
|
<el-dropdown-item v-else icon="el-icon-circle-close" command="Block" divided>Block</el-dropdown-item>
|
||||||
<el-dropdown-item v-if="userDialog.isMute" icon="el-icon-microphone" command="Unmute" style="color:#F56C6C">Unmute</el-dropdown-item>
|
<el-dropdown-item v-if="userDialog.isMute" icon="el-icon-microphone" command="Unmute" style="color:#F56C6C">Unmute</el-dropdown-item>
|
||||||
<el-dropdown-item v-else icon="el-icon-turn-off-microphone" command="Mute">Mute</el-dropdown-item>
|
<el-dropdown-item v-else icon="el-icon-turn-off-microphone" command="Mute">Mute</el-dropdown-item>
|
||||||
<el-dropdown-item v-if="userDialog.isHideAvatar" icon="el-icon-user-solid" command="Show Avatar" style="color:#F56C6C">Show Avatar</el-dropdown-item>
|
<el-dropdown-item v-if="userDialog.isHideAvatar" icon="el-icon-user-solid" command="Show Avatar" style="color:#F56C6C">Show Avatar</el-dropdown-item>
|
||||||
<el-dropdown-item v-else icon="el-icon-user" command="Hide Avatar">Hide Avatar</el-dropdown-item>
|
<el-dropdown-item v-else icon="el-icon-user" command="Hide Avatar">Hide Avatar</el-dropdown-item>
|
||||||
|
<template v-if="userDialog.isFriend">
|
||||||
|
<el-dropdown-item icon="el-icon-delete" command="Unfriend" divided>Unfriend</el-dropdown-item>
|
||||||
|
</template>
|
||||||
</el-dropdown-menu>
|
</el-dropdown-menu>
|
||||||
</el-dropdown>
|
</el-dropdown>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user