From 330a5f3bcc12df907c89917db9dbc87b4f42f0bf Mon Sep 17 00:00:00 2001 From: Natsumi Date: Tue, 12 Jul 2022 19:14:38 +1200 Subject: [PATCH] Small fixes --- html/src/app.js | 50 ++++++++++++++++++++++++++-------------------- html/src/index.pug | 2 +- 2 files changed, 29 insertions(+), 23 deletions(-) diff --git a/html/src/app.js b/html/src/app.js index e7413ea6..71281157 100644 --- a/html/src/app.js +++ b/html/src/app.js @@ -8210,11 +8210,11 @@ speechSynthesis.getVoices(); database.addGamelogPortalSpawnToDatabase(entry); break; case 'video-play': - var videoUrl = encodeURI(gameLog.videoUrl); - if (this.lastVideoUrl === videoUrl) { + gameLog.videoUrl = encodeURI(gameLog.videoUrl); + if (this.lastVideoUrl === gameLog.videoUrl) { return; } - this.lastVideoUrl = videoUrl; + this.lastVideoUrl = gameLog.videoUrl; this.addGameLogVideo(gameLog, location, userId); return; case 'video-sync': @@ -9613,6 +9613,10 @@ speechSynthesis.getVoices(); if (videoId === -1) { videoId = 'YouTube'; } + if (parseInt(videoPos, 10) === parseInt(videoLength, 10)) { + // ummm okay + videoPos = 0; + } if (videoUrl === this.nowPlaying.url) { var entry = { created_at: gameLog.dt, @@ -12424,13 +12428,13 @@ speechSynthesis.getVoices(); } } } else if (input.substring(0, 4) === 'usr_') { - this.showUserDialog(input); + this.showUserDialog(input.trim()); return true; } else if (input.substring(0, 5) === 'wrld_') { - this.showWorldDialog(input); + this.showWorldDialog(input.trim()); return true; } else if (input.substring(0, 5) === 'avtr_') { - this.showAvatarDialog(input); + this.showAvatarDialog(input.trim()); return true; } return false; @@ -12655,16 +12659,16 @@ speechSynthesis.getVoices(); distinguishCancelAndClose: true, confirmButtonText: 'Save', cancelButtonText: 'Cancel', - inputValue: this.maxTableSize, - inputPattern: /\d+$/, - inputErrorMessage: 'Valid number is required', - callback: (action, instance) => { - if (action === 'confirm' && instance.inputValue) { - this.maxTableSize = instance.inputValue; - configRepository.setString( - 'VRCX_maxTableSize', - this.maxTableSize - ); + inputValue: this.maxTableSize, + inputPattern: /\d+$/, + inputErrorMessage: 'Valid number is required', + callback: (action, instance) => { + if (action === 'confirm' && instance.inputValue) { + this.maxTableSize = instance.inputValue; + configRepository.setString( + 'VRCX_maxTableSize', + this.maxTableSize + ); database.setmaxTableSize(this.maxTableSize); this.feedTableLookup(); this.gameLogTableLookup(); @@ -16719,11 +16723,12 @@ speechSynthesis.getVoices(); r.onload = async function (file) { var base64File = btoa(r.result); var fileMd5 = await $app.genMd5(base64File); - var fileSizeInBytes = file.total; + var fileSizeInBytes = parseInt(file.total, 10); var base64SignatureFile = await $app.genSig(base64File); var signatureMd5 = await $app.genMd5(base64SignatureFile); - var signatureSizeInBytes = await $app.genLength( - base64SignatureFile + var signatureSizeInBytes = parseInt( + await $app.genLength(base64SignatureFile), + 10 ); var avatarId = $app.avatarDialog.id; var {imageUrl} = $app.avatarDialog.ref; @@ -17053,11 +17058,12 @@ speechSynthesis.getVoices(); r.onload = async function (file) { var base64File = btoa(r.result); var fileMd5 = await $app.genMd5(base64File); - var fileSizeInBytes = file.total; + var fileSizeInBytes = parseInt(file.total, 10); var base64SignatureFile = await $app.genSig(base64File); var signatureMd5 = await $app.genMd5(base64SignatureFile); - var signatureSizeInBytes = await $app.genLength( - base64SignatureFile + var signatureSizeInBytes = parseInt( + await $app.genLength(base64SignatureFile), + 10 ); var worldId = $app.worldDialog.id; var {imageUrl} = $app.worldDialog.ref; diff --git a/html/src/index.pug b/html/src/index.pug index c0b50a22..1466ee6e 100644 --- a/html/src/index.pug +++ b/html/src/index.pug @@ -2017,7 +2017,7 @@ html el-button(@click="languageDialog.languageValue='';languageDialog.languageChoice=true" size="mini") Add Language //- dialog: bio - el-dialog.x-dialog(:before-close="beforeDialogClose" @mousedown.native="dialogMouseDown" @mouseup.native="dialogMouseUp" ref="bioDialog" :visible.sync="bioDialog.visible" title="Bio" width="400px") + el-dialog.x-dialog(:before-close="beforeDialogClose" @mousedown.native="dialogMouseDown" @mouseup.native="dialogMouseUp" ref="bioDialog" :visible.sync="bioDialog.visible" title="Bio" width="600px") div(v-loading="bioDialog.loading") el-input(type="textarea" v-model="bioDialog.bio" size="mini" maxlength="512" show-word-limit :autosize="{ minRows:2, maxRows:5 }" placeholder="Please input a bio") el-input(v-for="(link, index) in bioDialog.bioLinks" :key="index" :value="link" v-model="bioDialog.bioLinks[index]" size="small" style="margin-top:5px")