Skip to content

Commit

Permalink
Change Allowed Video Player Domains
Browse files Browse the repository at this point in the history
  • Loading branch information
Natsumi-sama committed Nov 16, 2024
1 parent 84e8de3 commit 4841478
Show file tree
Hide file tree
Showing 4 changed files with 57 additions and 3 deletions.
40 changes: 39 additions & 1 deletion html/src/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -4497,6 +4497,10 @@ speechSynthesis.getVoices();
if (typeof ref !== 'undefined') {
ctx.name = ref.displayName;
}
if (!this.friendLogInitStatus) {
this.updateFriendDelayedCheck(ctx, location, $location_at);
return;
}
// prevent status flapping
if (ctx.pendingOffline) {
if (this.debugFriendState) {
Expand Down Expand Up @@ -11328,6 +11332,9 @@ speechSynthesis.getVoices();
case 'Change Tags':
this.showSetWorldTagsDialog();
break;
case 'Change Allowed Domains':
this.showWorldAllowedDomainsDialog();
break;
case 'Download Unity Package':
this.openExternalLink(
this.replaceVrcPackageUrl(
Expand Down Expand Up @@ -15805,7 +15812,7 @@ speechSynthesis.getVoices();
this.VRChatConfigList = {
cache_size: {
name: $t('dialog.config_json.max_cache_size'),
default: '20',
default: '30',
type: 'number',
min: 20
},
Expand Down Expand Up @@ -21858,6 +21865,37 @@ speechSynthesis.getVoices();

// #endregion

$app.data.worldAllowedDomainsDialog = {
visible: false,
worldId: '',
urlList: []
};

$app.methods.showWorldAllowedDomainsDialog = function () {
this.$nextTick(() =>
$app.adjustDialogZ(this.$refs.worldAllowedDomainsDialog.$el)
);
var D = this.worldAllowedDomainsDialog;
D.worldId = this.worldDialog.id;
D.urlList = this.worldDialog.ref?.urlList ?? [];
D.visible = true;
};

$app.methods.saveWorldAllowedDomains = function () {
var D = this.worldAllowedDomainsDialog;
API.saveWorld({
id: D.worldId,
urlList: D.urlList
}).then((args) => {
this.$message({
message: 'Allowed Video Player Domains updated',
type: 'success'
});
return args;
});
D.visible = false;
};

$app.data.ossDialog = false;

// "$app" is being replaced by Vue, update references inside all the classes
Expand Down
6 changes: 6 additions & 0 deletions html/src/localization/en/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -724,6 +724,7 @@
"change_preview": "Change Youtube Preview",
"change_tags": "Change Tags",
"change_image": "Change Image",
"change_allowed_video_player_domains": "Change Allowed Video Player Domains",
"download_package": "Download Unity Package",
"publish_to_labs": "Publish To Labs",
"unpublish": "Unpublish",
Expand Down Expand Up @@ -1408,6 +1409,11 @@
"default_emojis": "Default Emojis",
"cancel": "Cancel",
"send": "Send"
},
"allowed_video_player_domains": {
"header": "Allowed Video Player Domains",
"add_domain": "Add Domain",
"save": "Save"
}
},
"prompt": {
Expand Down
10 changes: 10 additions & 0 deletions html/src/mixins/dialogs/worldDialog.pug
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ mixin worldDialog()
el-dropdown-item(icon="el-icon-edit" command="Change Recommended Capacity") {{ $t('dialog.world.actions.change_recommended_capacity') }}
el-dropdown-item(icon="el-icon-edit" command="Change YouTube Preview") {{ $t('dialog.world.actions.change_preview') }}
el-dropdown-item(icon="el-icon-edit" command="Change Tags") {{ $t('dialog.world.actions.change_tags') }}
el-dropdown-item(icon="el-icon-edit" command="Change Allowed Domains") {{ $t('dialog.world.actions.change_allowed_video_player_domains') }}
el-dropdown-item(icon="el-icon-picture-outline" command="Change Image") {{ $t('dialog.world.actions.change_image') }}
el-dropdown-item(v-if="worldDialog.ref.unityPackageUrl" icon="el-icon-download" command="Download Unity Package") {{ $t('dialog.world.actions.download_package') }}
el-dropdown-item(v-if="worldDialog.ref.tags.includes('system_approved') || worldDialog.ref.tags.includes('system_labs')" icon="el-icon-view" command="Unpublish" divided) {{ $t('dialog.world.actions.unpublish') }}
Expand Down Expand Up @@ -215,3 +216,12 @@ mixin worldDialog()
span
span(v-text="scope.data.key" style="font-weight:bold;margin-right:5px")
span(v-if="!scope.data.children" v-text="scope.data.value")

//- dialog: change Allowed Video Player Domains
el-dialog.x-dialog(:before-close="beforeDialogClose" @mousedown.native="dialogMouseDown" @mouseup.native="dialogMouseUp" ref="worldAllowedDomainsDialog" :visible.sync="worldAllowedDomainsDialog.visible" :title="$t('dialog.allowed_video_player_domains.header')" width="600px")
div(v-loading="bioDialog.loading")
el-input(v-for="(domain, index) in worldAllowedDomainsDialog.urlList" :key="index" :value="domain" v-model="worldAllowedDomainsDialog.urlList[index]" size="small" style="margin-top:5px")
el-button(slot="append" icon="el-icon-delete" @click="worldAllowedDomainsDialog.urlList.splice(index, 1)")
el-button(@click="worldAllowedDomainsDialog.urlList.push('')" size="mini" style="margin-top:5px") {{ $t('dialog.allowed_video_player_domains.add_domain') }}
template(#footer)
el-button(type="primary" size="small" :disabled="!worldAllowedDomainsDialog.worldId" @click="saveWorldAllowedDomains") {{ $t('dialog.allowed_video_player_domains.save') }}
4 changes: 2 additions & 2 deletions html/src/mixins/tabs/notifications.pug
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ mixin notificationsTab()
template(#tool)
div(style="margin:0 0 10px;display:flex;align-items:center")
el-select(v-model="notificationTable.filters[0].value" @change="saveTableFilters" multiple clearable collapse-tags style="flex:1" :placeholder="$t('view.notification.filter_placeholder')")
el-option(v-once v-for="type in ['requestInvite', 'invite', 'requestInviteResponse', 'inviteResponse', 'friendRequest', 'ignoredFriendRequest', 'message', 'boop', 'groupChange', 'group.announcement', 'group.informative', 'group.invite', 'group.joinRequest', 'group.transfer', 'group.queueReady', 'moderation.warning.group', 'instance.closed']" :key="type" :label="type" :value="type")
el-option(v-once v-for="type in ['requestInvite', 'invite', 'requestInviteResponse', 'inviteResponse', 'friendRequest', 'ignoredFriendRequest', 'message', 'boop', 'groupChange', 'group.announcement', 'group.informative', 'group.invite', 'group.joinRequest', 'group.transfer', 'group.queueReady', 'moderation.warning.group', 'moderation.report.closed', 'instance.closed']" :key="type" :label="type" :value="type")
el-input(v-model="notificationTable.filters[1].value" :placeholder="$t('view.notification.search_placeholder')" style="flex:none;width:150px;margin:0 10px")
el-tooltip(placement="bottom" :content="$t('view.notification.refresh_tooltip')" :disabled="hideTooltips")
el-button(type="default" :loading="API.isNotificationsLoading" @click="API.refreshNotifications()" icon="el-icon-refresh" circle style="flex:none")
Expand All @@ -14,7 +14,7 @@ mixin notificationsTab()
template(#content)
span {{ scope.row.created_at | formatDate('long') }}
span {{ scope.row.created_at | formatDate('short') }}
el-table-column(:label="$t('table.notification.type')" prop="type" width="160")
el-table-column(:label="$t('table.notification.type')" prop="type" width="180")
template(v-once #default="scope")
el-tooltip(v-if="scope.row.type === 'invite'" placement="top")
template(#content)
Expand Down

0 comments on commit 4841478

Please sign in to comment.