mirror of
https://github.com/MrUnknownDE/VRCX.git
synced 2026-05-06 22:46:06 +02:00
Invite images can only be png's
This commit is contained in:
+35
-7
@@ -3689,7 +3689,7 @@ speechSynthesis.getVoices();
|
|||||||
if ((this.isGameRunning) && ((this.sharedFeedFilters.wrist.OnPlayerJoining === 'Friends') || (this.sharedFeedFilters.wrist.OnPlayerJoining === 'VIP') ||
|
if ((this.isGameRunning) && ((this.sharedFeedFilters.wrist.OnPlayerJoining === 'Friends') || (this.sharedFeedFilters.wrist.OnPlayerJoining === 'VIP') ||
|
||||||
(this.sharedFeedFilters.noty.OnPlayerJoining === 'Friends') || (this.sharedFeedFilters.noty.OnPlayerJoining === 'VIP'))) {
|
(this.sharedFeedFilters.noty.OnPlayerJoining === 'Friends') || (this.sharedFeedFilters.noty.OnPlayerJoining === 'VIP'))) {
|
||||||
var bias = new Date(Date.now() - 120000).toJSON();
|
var bias = new Date(Date.now() - 120000).toJSON();
|
||||||
var locationBias = new Date(Date.now() - 10000).toJSON();
|
var locationBias = new Date(Date.now() - 15000).toJSON(); //15 seconds
|
||||||
for (var i = 0; i < wristFeed.length; i++) {
|
for (var i = 0; i < wristFeed.length; i++) {
|
||||||
var ctx = wristFeed[i];
|
var ctx = wristFeed[i];
|
||||||
if ((ctx.created_at < bias) || (ctx.type === 'Location')) {
|
if ((ctx.created_at < bias) || (ctx.type === 'Location')) {
|
||||||
@@ -3780,7 +3780,7 @@ speechSynthesis.getVoices();
|
|||||||
}
|
}
|
||||||
// on Location change remove OnPlayerJoined
|
// on Location change remove OnPlayerJoined
|
||||||
if ((ctx.type === 'Location') && (this.hideOnPlayerJoined)) {
|
if ((ctx.type === 'Location') && (this.hideOnPlayerJoined)) {
|
||||||
var locationBias = new Date(Date.parse(ctx.created_at) + 10000).toJSON(); //10 seconds
|
var locationBias = new Date(Date.parse(ctx.created_at) + 15000).toJSON(); //15 seconds
|
||||||
for (var k = w - 1; k > -1; k--) {
|
for (var k = w - 1; k > -1; k--) {
|
||||||
var feedItem = wristArr[k];
|
var feedItem = wristArr[k];
|
||||||
if ((feedItem.created_at > locationBias) || (feedItem.type === 'Location')) {
|
if ((feedItem.created_at > locationBias) || (feedItem.type === 'Location')) {
|
||||||
@@ -8734,12 +8734,12 @@ speechSynthesis.getVoices();
|
|||||||
json,
|
json,
|
||||||
params
|
params
|
||||||
};
|
};
|
||||||
this.$emit('FILES', args);
|
this.$emit('VRCPLUSICON:LIST', args);
|
||||||
return args;
|
return args;
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
API.$on('FILES', function (args) {
|
API.$on('VRCPLUSICON:LIST', function (args) {
|
||||||
$app.VRCPlusIconsTable = args.json;
|
$app.VRCPlusIconsTable = args.json;
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -8774,11 +8774,22 @@ speechSynthesis.getVoices();
|
|||||||
|
|
||||||
$app.methods.deleteVRCPlusIcon = function (userIcon) {
|
$app.methods.deleteVRCPlusIcon = function (userIcon) {
|
||||||
API.deleteVRCPlusIcon(userIcon).then((args) => {
|
API.deleteVRCPlusIcon(userIcon).then((args) => {
|
||||||
this.displayVRCPlusIconsTable();
|
API.$emit('VRCPLUSICON:DELETE', args);
|
||||||
return args;
|
return args;
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
API.$on('VRCPLUSICON:DELETE', function (args) {
|
||||||
|
var array = $app.VRCPlusIconsTable;
|
||||||
|
var { length } = array;
|
||||||
|
for (var i = 0; i < length; ++i) {
|
||||||
|
if (args.userIcon === array[i].id) {
|
||||||
|
array.splice(i, 1);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
API.deleteVRCPlusIcon = function (userIcon) {
|
API.deleteVRCPlusIcon = function (userIcon) {
|
||||||
return this.call(`file/${userIcon}`, {
|
return this.call(`file/${userIcon}`, {
|
||||||
method: 'DELETE'
|
method: 'DELETE'
|
||||||
@@ -8805,6 +8816,11 @@ speechSynthesis.getVoices();
|
|||||||
};
|
};
|
||||||
|
|
||||||
$app.methods.onFileChangeVRCPlusIcon = function (e) {
|
$app.methods.onFileChangeVRCPlusIcon = function (e) {
|
||||||
|
var clearFile = function() {
|
||||||
|
if (document.querySelector('#VRCPlusIconUploadButton')) {
|
||||||
|
document.querySelector('#VRCPlusIconUploadButton').value = '';
|
||||||
|
}
|
||||||
|
};
|
||||||
var files = e.target.files || e.dataTransfer.files;
|
var files = e.target.files || e.dataTransfer.files;
|
||||||
if (!files.length) {
|
if (!files.length) {
|
||||||
return;
|
return;
|
||||||
@@ -8814,6 +8830,7 @@ speechSynthesis.getVoices();
|
|||||||
message: 'File size too large',
|
message: 'File size too large',
|
||||||
type: 'error'
|
type: 'error'
|
||||||
});
|
});
|
||||||
|
clearFile();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!files[0].type.match(/image.*/)) {
|
if (!files[0].type.match(/image.*/)) {
|
||||||
@@ -8821,6 +8838,7 @@ speechSynthesis.getVoices();
|
|||||||
message: 'File isn\'t an image',
|
message: 'File isn\'t an image',
|
||||||
type: 'error'
|
type: 'error'
|
||||||
});
|
});
|
||||||
|
clearFile();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
var r = new FileReader();
|
var r = new FileReader();
|
||||||
@@ -8835,6 +8853,7 @@ speechSynthesis.getVoices();
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
r.readAsBinaryString(files[0]);
|
r.readAsBinaryString(files[0]);
|
||||||
|
clearFile();
|
||||||
};
|
};
|
||||||
|
|
||||||
$app.methods.displayVRCPlusIconUpload = function () {
|
$app.methods.displayVRCPlusIconUpload = function () {
|
||||||
@@ -8850,10 +8869,17 @@ speechSynthesis.getVoices();
|
|||||||
json,
|
json,
|
||||||
params
|
params
|
||||||
};
|
};
|
||||||
|
this.$emit('VRCPLUSICON:ADD', args);
|
||||||
return args;
|
return args;
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
API.$on('VRCPLUSICON:ADD', function (args) {
|
||||||
|
if (Object.keys($app.VRCPlusIconsTable).length !== 0) {
|
||||||
|
$app.VRCPlusIconsTable.push(args.json);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
$app.data.uploadImage = '';
|
$app.data.uploadImage = '';
|
||||||
|
|
||||||
$app.methods.inviteImageUpload = function (e) {
|
$app.methods.inviteImageUpload = function (e) {
|
||||||
@@ -8866,13 +8892,15 @@ speechSynthesis.getVoices();
|
|||||||
message: 'File size too large',
|
message: 'File size too large',
|
||||||
type: 'error'
|
type: 'error'
|
||||||
});
|
});
|
||||||
|
this.clearInviteImageUpload();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!files[0].type.match(/image.*/)) {
|
if (!files[0].type.match(/image.png/)) {
|
||||||
$app.$message({
|
$app.$message({
|
||||||
message: 'File isn\'t an image',
|
message: 'File isn\'t a png',
|
||||||
type: 'error'
|
type: 'error'
|
||||||
});
|
});
|
||||||
|
this.clearInviteImageUpload();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
var r = new FileReader();
|
var r = new FileReader();
|
||||||
|
|||||||
+4
-4
@@ -1513,7 +1513,7 @@ html
|
|||||||
//- dialog Table: Send Invite Response Message
|
//- dialog Table: Send Invite Response Message
|
||||||
el-dialog.x-dialog(ref="sendInviteResponseDialog" :visible.sync="sendInviteResponseDialogVisible" title="Send Invite Response Message" width="800px")
|
el-dialog.x-dialog(ref="sendInviteResponseDialog" :visible.sync="sendInviteResponseDialogVisible" title="Send Invite Response Message" width="800px")
|
||||||
template(v-if="API.currentUser.$isVRCPlus")
|
template(v-if="API.currentUser.$isVRCPlus")
|
||||||
input.inviteImageUploadButton(type="file" multiple accept="image/*" @change="inviteImageUpload")
|
input.inviteImageUploadButton(type="file" multiple accept="image/png" @change="inviteImageUpload")
|
||||||
data-tables(v-bind="inviteResponseMessageTable" @row-click="showSendInviteResponseConfirmDialog" style="margin-top:10px;cursor:pointer")
|
data-tables(v-bind="inviteResponseMessageTable" @row-click="showSendInviteResponseConfirmDialog" style="margin-top:10px;cursor:pointer")
|
||||||
el-table-column(label="Slot" prop="slot" sortable="custom" width="70")
|
el-table-column(label="Slot" prop="slot" sortable="custom" width="70")
|
||||||
el-table-column(label="Message" prop="message")
|
el-table-column(label="Message" prop="message")
|
||||||
@@ -1530,7 +1530,7 @@ html
|
|||||||
//- dialog Table: Send Invite Request Response Message
|
//- dialog Table: Send Invite Request Response Message
|
||||||
el-dialog.x-dialog(ref="sendInviteRequestResponseDialog" :visible.sync="sendInviteRequestResponseDialogVisible" title="Send Invite Request Response Message" width="800px")
|
el-dialog.x-dialog(ref="sendInviteRequestResponseDialog" :visible.sync="sendInviteRequestResponseDialogVisible" title="Send Invite Request Response Message" width="800px")
|
||||||
template(v-if="API.currentUser.$isVRCPlus")
|
template(v-if="API.currentUser.$isVRCPlus")
|
||||||
input.inviteImageUploadButton(type="file" multiple accept="image/*" @change="inviteImageUpload")
|
input.inviteImageUploadButton(type="file" multiple accept="image/png" @change="inviteImageUpload")
|
||||||
data-tables(v-bind="inviteRequestResponseMessageTable" @row-click="showSendInviteResponseConfirmDialog" style="margin-top:10px;cursor:pointer")
|
data-tables(v-bind="inviteRequestResponseMessageTable" @row-click="showSendInviteResponseConfirmDialog" style="margin-top:10px;cursor:pointer")
|
||||||
el-table-column(label="Slot" prop="slot" sortable="custom" width="70")
|
el-table-column(label="Slot" prop="slot" sortable="custom" width="70")
|
||||||
el-table-column(label="Message" prop="message")
|
el-table-column(label="Message" prop="message")
|
||||||
@@ -1555,7 +1555,7 @@ html
|
|||||||
//- dialog Table: Send Invite Message
|
//- dialog Table: Send Invite Message
|
||||||
el-dialog.x-dialog(ref="sendInviteDialog" :visible.sync="sendInviteDialogVisible" title="Send Invite Message" width="800px")
|
el-dialog.x-dialog(ref="sendInviteDialog" :visible.sync="sendInviteDialogVisible" title="Send Invite Message" width="800px")
|
||||||
template(v-if="API.currentUser.$isVRCPlus")
|
template(v-if="API.currentUser.$isVRCPlus")
|
||||||
input.inviteImageUploadButton(type="file" multiple accept="image/*" @change="inviteImageUpload")
|
input.inviteImageUploadButton(type="file" multiple accept="image/png" @change="inviteImageUpload")
|
||||||
data-tables(v-bind="inviteMessageTable" @row-click="showSendInviteConfirmDialog" style="margin-top:10px;cursor:pointer")
|
data-tables(v-bind="inviteMessageTable" @row-click="showSendInviteConfirmDialog" style="margin-top:10px;cursor:pointer")
|
||||||
el-table-column(label="Slot" prop="slot" sortable="custom" width="70")
|
el-table-column(label="Slot" prop="slot" sortable="custom" width="70")
|
||||||
el-table-column(label="Message" prop="message")
|
el-table-column(label="Message" prop="message")
|
||||||
@@ -1572,7 +1572,7 @@ html
|
|||||||
//- dialog Table: Send Invite Request Message
|
//- dialog Table: Send Invite Request Message
|
||||||
el-dialog.x-dialog(ref="sendInviteRequestDialog" :visible.sync="sendInviteRequestDialogVisible" title="Send Invite Request Message" width="800px")
|
el-dialog.x-dialog(ref="sendInviteRequestDialog" :visible.sync="sendInviteRequestDialogVisible" title="Send Invite Request Message" width="800px")
|
||||||
template(v-if="API.currentUser.$isVRCPlus")
|
template(v-if="API.currentUser.$isVRCPlus")
|
||||||
input.inviteImageUploadButton(type="file" multiple accept="image/*" @change="inviteImageUpload")
|
input.inviteImageUploadButton(type="file" multiple accept="image/png" @change="inviteImageUpload")
|
||||||
data-tables(v-bind="inviteRequestMessageTable" @row-click="showSendInviteConfirmDialog" style="margin-top:10px;cursor:pointer")
|
data-tables(v-bind="inviteRequestMessageTable" @row-click="showSendInviteConfirmDialog" style="margin-top:10px;cursor:pointer")
|
||||||
el-table-column(label="Slot" prop="slot" sortable="custom" width="70")
|
el-table-column(label="Slot" prop="slot" sortable="custom" width="70")
|
||||||
el-table-column(label="Message" prop="message")
|
el-table-column(label="Message" prop="message")
|
||||||
|
|||||||
Reference in New Issue
Block a user