mirror of
https://github.com/MrUnknownDE/VRCX.git
synced 2026-05-07 14:56:06 +02:00
Bulk unfavorite mode
This commit is contained in:
+55
-3
@@ -12579,7 +12579,8 @@ speechSynthesis.getVoices();
|
|||||||
type,
|
type,
|
||||||
groupKey: favorite.$groupKey,
|
groupKey: favorite.$groupKey,
|
||||||
ref: null,
|
ref: null,
|
||||||
name: ''
|
name: '',
|
||||||
|
$selected: false
|
||||||
};
|
};
|
||||||
this.favoriteObjects.set(objectId, ctx);
|
this.favoriteObjects.set(objectId, ctx);
|
||||||
if (type === 'friend') {
|
if (type === 'friend') {
|
||||||
@@ -14444,9 +14445,8 @@ speechSynthesis.getVoices();
|
|||||||
$app.methods.updateOpenVR = function () {
|
$app.methods.updateOpenVR = function () {
|
||||||
if (
|
if (
|
||||||
this.openVR &&
|
this.openVR &&
|
||||||
!this.isGameNoVR &&
|
|
||||||
this.isSteamVRRunning &&
|
this.isSteamVRRunning &&
|
||||||
(this.isGameRunning || this.openVRAlways)
|
((this.isGameRunning && !this.isGameNoVR) || this.openVRAlways)
|
||||||
) {
|
) {
|
||||||
var hmdOverlay = false;
|
var hmdOverlay = false;
|
||||||
if (
|
if (
|
||||||
@@ -24427,6 +24427,58 @@ speechSynthesis.getVoices();
|
|||||||
this.avatarRemoteDatabaseProvider = provider;
|
this.avatarRemoteDatabaseProvider = provider;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// #endregion
|
||||||
|
// #region | App: bulk unfavorite
|
||||||
|
|
||||||
|
$app.data.bulkUnfavoriteMode = false;
|
||||||
|
|
||||||
|
$app.methods.showBulkUnfavoriteSelectionConfirm = function () {
|
||||||
|
var elementsTicked = [];
|
||||||
|
// check favorites type
|
||||||
|
for (var ctx of this.favoriteFriends) {
|
||||||
|
if (ctx.$selected) {
|
||||||
|
elementsTicked.push(ctx.id);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for (var ctx of this.favoriteWorlds) {
|
||||||
|
if (ctx.$selected) {
|
||||||
|
elementsTicked.push(ctx.id);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for (var ctx of this.favoriteAvatars) {
|
||||||
|
if (ctx.$selected) {
|
||||||
|
elementsTicked.push(ctx.id);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (elementsTicked.length === 0) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.$confirm(
|
||||||
|
`Are you sure you want to unfavorite ${elementsTicked.length} favorites?
|
||||||
|
This action cannot be undone.`,
|
||||||
|
`Delete ${elementsTicked.length} favorites?`,
|
||||||
|
{
|
||||||
|
confirmButtonText: 'Confirm',
|
||||||
|
cancelButtonText: 'Cancel',
|
||||||
|
type: 'info',
|
||||||
|
callback: (action) => {
|
||||||
|
if (action === 'confirm') {
|
||||||
|
this.bulkUnfavoriteSelection(elementsTicked);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
$app.methods.bulkUnfavoriteSelection = function (elementsTicked) {
|
||||||
|
for (var id of elementsTicked) {
|
||||||
|
API.deleteFavorite({
|
||||||
|
objectId: id
|
||||||
|
});
|
||||||
|
}
|
||||||
|
this.bulkUnfavoriteMode = false;
|
||||||
|
};
|
||||||
|
|
||||||
// #endregion
|
// #endregion
|
||||||
// #region | App: local world favorites
|
// #region | App: local world favorites
|
||||||
|
|
||||||
|
|||||||
@@ -741,3 +741,18 @@ i.x-user-status.busy {
|
|||||||
.zero-margin-tabs .el-tabs__header {
|
.zero-margin-tabs .el-tabs__header {
|
||||||
margin-bottom: 0;
|
margin-bottom: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.x-friend-item .el-checkbox__inner,
|
||||||
|
.el-table__row .el-checkbox__inner {
|
||||||
|
width: 28px;
|
||||||
|
height: 28px;
|
||||||
|
border-radius: 4px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.x-friend-item .el-checkbox__inner::after,
|
||||||
|
.el-table__row .el-checkbox__inner::after {
|
||||||
|
width: 8px;
|
||||||
|
height: 14px;
|
||||||
|
left: 8px;
|
||||||
|
top: 2px;
|
||||||
|
}
|
||||||
|
|||||||
@@ -92,6 +92,8 @@
|
|||||||
"avatars": {
|
"avatars": {
|
||||||
"header": "Avatars"
|
"header": "Avatars"
|
||||||
},
|
},
|
||||||
|
"bulk_unfavorite_mode": "Bulk Unfavorite Mode",
|
||||||
|
"bulk_unfavorite_selection": "Bulk Unfavorite Selection",
|
||||||
"refresh_tooltip": "Refresh all favorites",
|
"refresh_tooltip": "Refresh all favorites",
|
||||||
"export": "Export",
|
"export": "Export",
|
||||||
"import": "Import",
|
"import": "Import",
|
||||||
|
|||||||
@@ -1,7 +1,13 @@
|
|||||||
mixin favoritesTab()
|
mixin favoritesTab()
|
||||||
.x-container(v-show="$refs.menu && $refs.menu.activeIndex === 'favorite'")
|
.x-container(v-show="$refs.menu && $refs.menu.activeIndex === 'favorite'")
|
||||||
el-tooltip(placement="bottom" :content="$t('view.favorite.refresh_tooltip')" :disabled="hideTooltips")
|
div(style="font-size:13px;position:absolute;right:0;z-index:1")
|
||||||
el-button(type="default" :loading="API.isFavoriteLoading" @click="API.refreshFavorites(); getLocalWorldFavorites()" size="small" icon="el-icon-refresh" circle style="position:relative;float:right;z-index:1")
|
div(v-if="bulkUnfavoriteMode" style="display:inline-block;margin-right:10px")
|
||||||
|
el-button(size="small" @click="showBulkUnfavoriteSelectionConfirm") {{ $t('view.favorite.bulk_unfavorite_selection') }}
|
||||||
|
div(style="display:inline-block;margin-right:10px")
|
||||||
|
span.name {{ $t('view.favorite.bulk_unfavorite_mode') }}
|
||||||
|
el-switch(v-model="bulkUnfavoriteMode" style="margin-left:5px")
|
||||||
|
el-tooltip(placement="bottom" :content="$t('view.favorite.refresh_tooltip')" :disabled="hideTooltips")
|
||||||
|
el-button(type="default" :loading="API.isFavoriteLoading" @click="API.refreshFavorites(); getLocalWorldFavorites()" size="small" icon="el-icon-refresh" circle)
|
||||||
el-tabs(ref="favoriteTabRef" type="card" v-loading="API.isFavoriteLoading" style="height:100%")
|
el-tabs(ref="favoriteTabRef" type="card" v-loading="API.isFavoriteLoading" style="height:100%")
|
||||||
el-tab-pane(:label="$t('view.favorite.friends.header')")
|
el-tab-pane(:label="$t('view.favorite.friends.header')")
|
||||||
el-collapse(v-if="$refs.menu && $refs.menu.activeIndex === 'favorite' && $refs.favoriteTabRef && $refs.favoriteTabRef.currentName === '0'" style="border:0")
|
el-collapse(v-if="$refs.menu && $refs.menu.activeIndex === 'favorite' && $refs.favoriteTabRef && $refs.favoriteTabRef.currentName === '0'" style="border:0")
|
||||||
@@ -25,6 +31,10 @@ mixin favoritesTab()
|
|||||||
span.name(v-text="favorite.ref.displayName" :style="{'color':favorite.ref.$userColour}")
|
span.name(v-text="favorite.ref.displayName" :style="{'color':favorite.ref.$userColour}")
|
||||||
location.extra(v-if="favorite.ref.location !== 'offline'" :location="favorite.ref.location" :traveling="favorite.ref.travelingToLocation" :link="false")
|
location.extra(v-if="favorite.ref.location !== 'offline'" :location="favorite.ref.location" :traveling="favorite.ref.travelingToLocation" :link="false")
|
||||||
span(v-else v-text="favorite.ref.statusDescription")
|
span(v-else v-text="favorite.ref.statusDescription")
|
||||||
|
template(v-if="bulkUnfavoriteMode")
|
||||||
|
el-button(type="text" size="mini" @click.stop style="margin-left:5px")
|
||||||
|
el-checkbox(v-model="favorite.$selected")
|
||||||
|
template(v-else-if="favorite.ref")
|
||||||
el-tooltip(placement="left" :content="$t('view.favorite.move_tooltip')" :disabled="hideTooltips")
|
el-tooltip(placement="left" :content="$t('view.favorite.move_tooltip')" :disabled="hideTooltips")
|
||||||
el-dropdown(trigger="click" @click.native.stop size="mini" style="margin-left:5px")
|
el-dropdown(trigger="click" @click.native.stop size="mini" style="margin-left:5px")
|
||||||
el-button(type="default" icon="el-icon-back" size="mini" circle)
|
el-button(type="default" icon="el-icon-back" size="mini" circle)
|
||||||
@@ -65,6 +75,10 @@ mixin favoritesTab()
|
|||||||
span.name(v-text="favorite.ref.name")
|
span.name(v-text="favorite.ref.name")
|
||||||
span.extra(v-if="favorite.ref.occupants") {{ favorite.ref.authorName }} ({{ favorite.ref.occupants }})
|
span.extra(v-if="favorite.ref.occupants") {{ favorite.ref.authorName }} ({{ favorite.ref.occupants }})
|
||||||
span.extra(v-else v-text="favorite.ref.authorName")
|
span.extra(v-else v-text="favorite.ref.authorName")
|
||||||
|
template(v-if="bulkUnfavoriteMode")
|
||||||
|
el-button(type="text" size="mini" @click.stop style="margin-left:5px")
|
||||||
|
el-checkbox(v-model="favorite.$selected")
|
||||||
|
template(v-else-if="favorite.ref")
|
||||||
el-tooltip(placement="left" :content="$t('view.favorite.move_tooltip')" :disabled="hideTooltips")
|
el-tooltip(placement="left" :content="$t('view.favorite.move_tooltip')" :disabled="hideTooltips")
|
||||||
el-dropdown(trigger="click" @click.native.stop size="mini" style="margin-left:5px")
|
el-dropdown(trigger="click" @click.native.stop size="mini" style="margin-left:5px")
|
||||||
el-button(type="default" icon="el-icon-back" size="mini" circle)
|
el-button(type="default" icon="el-icon-back" size="mini" circle)
|
||||||
@@ -122,6 +136,10 @@ mixin favoritesTab()
|
|||||||
.detail
|
.detail
|
||||||
span.name(v-text="favorite.ref.name")
|
span.name(v-text="favorite.ref.name")
|
||||||
span.extra(v-text="favorite.ref.authorName")
|
span.extra(v-text="favorite.ref.authorName")
|
||||||
|
template(v-if="bulkUnfavoriteMode")
|
||||||
|
el-button(type="text" size="mini" @click.stop style="margin-left:5px")
|
||||||
|
el-checkbox(v-model="favorite.$selected")
|
||||||
|
template(v-else-if="favorite.ref")
|
||||||
el-tooltip(placement="left" :content="$t('view.favorite.move_tooltip')" :disabled="hideTooltips")
|
el-tooltip(placement="left" :content="$t('view.favorite.move_tooltip')" :disabled="hideTooltips")
|
||||||
el-dropdown(trigger="click" @click.native.stop size="mini" style="margin-left:5px")
|
el-dropdown(trigger="click" @click.native.stop size="mini" style="margin-left:5px")
|
||||||
el-button(type="default" icon="el-icon-back" size="mini" circle)
|
el-button(type="default" icon="el-icon-back" size="mini" circle)
|
||||||
|
|||||||
@@ -1865,8 +1865,11 @@ i.x-user-status {
|
|||||||
.el-checkbox__inner::after,
|
.el-checkbox__inner::after,
|
||||||
.el-checkbox__input.is-checked .el-checkbox__inner,
|
.el-checkbox__input.is-checked .el-checkbox__inner,
|
||||||
.el-checkbox__input.is-indeterminate .el-checkbox__inner {
|
.el-checkbox__input.is-indeterminate .el-checkbox__inner {
|
||||||
all: unset;
|
color: unset;
|
||||||
|
background-color: unset;
|
||||||
|
border: unset;
|
||||||
}
|
}
|
||||||
|
|
||||||
.el-checkbox__inner::after {
|
.el-checkbox__inner::after {
|
||||||
all: unset;
|
all: unset;
|
||||||
height: 20px;
|
height: 20px;
|
||||||
|
|||||||
Reference in New Issue
Block a user