From d1b7d51bf2009c3acb104752593be00a7a8e6afa Mon Sep 17 00:00:00 2001 From: Natsumi Date: Fri, 22 Jul 2022 18:19:22 +1200 Subject: [PATCH] Small changes and fixes --- html/src/app.js | 41 ++++++++++++++++++++++++++--------------- html/src/index.pug | 33 ++++++++++++++++++++------------- 2 files changed, 46 insertions(+), 28 deletions(-) diff --git a/html/src/app.js b/html/src/app.js index 3f6edb77..f79930f9 100644 --- a/html/src/app.js +++ b/html/src/app.js @@ -1449,6 +1449,7 @@ speechSynthesis.getVoices(); json.statusDescription = $app.replaceBioSymbols( json.statusDescription ); + json.statusDescription = $app.removeEmojis(json.statusDescription); } if (typeof json.bio !== 'undefined') { json.bio = $app.replaceBioSymbols(json.bio); @@ -4251,7 +4252,7 @@ speechSynthesis.getVoices(); } } if (--this.nextAppUpdateCheck <= 0) { - this.nextAppUpdateCheck = 43200; // 6hours + this.nextAppUpdateCheck = 1800; // 15mins if (this.autoUpdateVRCX !== 'Off') { this.checkForVRCXUpdate(); } @@ -7809,7 +7810,6 @@ speechSynthesis.getVoices(); this.photonEvent7List = new Map(); this.photonLastEvent7List = ''; this.moderationEventQueue = new Map(); - this.lastPortalId = ''; this.lastPortalList = new Map(); if (this.photonEventTable.data.length > 0) { this.photonEventTablePrevious.data = this.photonEventTable.data; @@ -8210,7 +8210,7 @@ speechSynthesis.getVoices(); database.addGamelogPortalSpawnToDatabase(entry); break; case 'video-play': - gameLog.videoUrl = encodeURI(gameLog.videoUrl); + gameLog.videoUrl = decodeURI(gameLog.videoUrl); if (this.lastVideoUrl === gameLog.videoUrl) { return; } @@ -8325,7 +8325,6 @@ speechSynthesis.getVoices(); $app.data.recommendedSteamParams = 'https://gist.github.com/Natsumi-sama/d280a58f08ace3da0e8fc7a9a381d44e'; - $app.data.lastPortalId = ''; $app.data.lastPortalList = new Map(); $app.data.moderationEventQueue = new Map(); $app.data.moderationAgainstTable = []; @@ -8952,7 +8951,7 @@ speechSynthesis.getVoices(); eventData.EventName === '_InstantiateObject' && eventData.Data[0] === 'Portals/PortalInternalDynamic' ) { - this.lastPortalId = eventData.Data[3]; + this.lastPortalList.set(eventData.Data[3], Date.parse(datetime)); return; } else if ( eventData.EventName === '_DestroyObject' && @@ -8970,13 +8969,6 @@ speechSynthesis.getVoices(); return; } else if (eventData.EventName === 'ConfigurePortal') { var instanceId = `${eventData.Data[0]}:${eventData.Data[1]}`; - if (this.lastPortalId) { - this.lastPortalList.set( - this.lastPortalId, - Date.parse(datetime) - ); - this.lastPortalId = ''; - } var displayName = this.getDisplayNameFromPhotonId(senderId); if (displayName) { var ref1 = { @@ -15812,11 +15804,20 @@ speechSynthesis.getVoices(); $app.methods.userOnlineFor = function (ctx) { if (ctx.ref.state === 'online' && ctx.ref.$online_for) { - return timeToText(Date.now() - ctx.ref.$online_for); + return Date.now() - ctx.ref.$online_for; } else if (ctx.ref.$offline_for) { - return timeToText(Date.now() - ctx.ref.$offline_for); + return Date.now() - ctx.ref.$offline_for; } - return '-'; + return 0; + }; + + $app.methods.userOnlineForTimestamp = function (ctx) { + if (ctx.ref.state === 'online' && ctx.ref.$online_for) { + return ctx.ref.$online_for; + } else if (ctx.ref.$offline_for) { + return ctx.ref.$offline_for; + } + return 0; }; // App: Invite Messages @@ -18554,6 +18555,16 @@ speechSynthesis.getVoices(); return newText.replace(/ {1,}/g, ' ').trimRight(); }; + $app.methods.removeEmojis = function (text) { + return text + .replace( + /([\u2700-\u27BF]|[\uE000-\uF8FF]|\uD83C[\uDC00-\uDFFF]|\uD83D[\uDC00-\uDFFF]|[\u2011-\u26FF]|\uD83E[\uDD10-\uDDFF])/g, + '' + ) + .replace(/\s+/g, ' ') + .trim(); + }; + $app.methods.checkCanInvite = function (location) { var L = API.parseLocation(location); if (L.accessType === 'invite' || L.accessType === 'friends') { diff --git a/html/src/index.pug b/html/src/index.pug index 42555298..d81e5b8d 100644 --- a/html/src/index.pug +++ b/html/src/index.pug @@ -896,7 +896,8 @@ html el-table-column(label="User Name" min-width="120" prop="username" sortable :sort-method="(a, b) => sortAlphabetically(a, b, 'username')") el-table-column(label="Rank" width="110" prop="$trustSortNum" sortable="custom") template(v-once #default="scope") - span.name(v-text="scope.row.$trustLevel" :class="scope.row.$trustClass") + span.name(v-if="randomUserColours" v-text="scope.row.$trustLevel" :class="scope.row.$trustClass") + span.name(v-else v-text="scope.row.$trustLevel" :style="{'color':scope.row.$userColour}") el-table-column(label="Status" min-width="180" prop="status" sortable :sort-method="(a, b) => sortStatus(a.status, b.status)") template(v-once #default="scope") i.x-user-status(v-if="scope.row.status !== 'offline'" :class="statusClass(scope.row.status)") @@ -1579,18 +1580,24 @@ html span.extra(v-if="userDialog.timeSpent === 0") - span.extra(v-else) {{ userDialog.timeSpent | timeToText }} .x-friend-item(style="cursor:default") - .detail - span.name(v-if="userDialog.ref.state === 'online' && userDialog.ref.$online_for") Online For - el-tooltip(v-if="!hideTooltips" placement="top" style="margin-left:5px" content="Info from local database may not be accurate") - i.el-icon-warning - span.name(v-else) Offline For - el-tooltip(v-if="!hideTooltips" placement="top" style="margin-left:5px" content="Info from local database may not be accurate") - i.el-icon-warning - span.extra(v-text="userOnlineFor(userDialog)") + el-tooltip(placement="top") + template(#content) + span {{ userOnlineForTimestamp(userDialog) | formatDate('short') }} + .detail + span.name(v-if="userDialog.ref.state === 'online' && userDialog.ref.$online_for") Online For + el-tooltip(v-if="!hideTooltips" placement="top" style="margin-left:5px" content="Info from local database may not be accurate") + i.el-icon-warning + span.name(v-else) Offline For + el-tooltip(v-if="!hideTooltips" placement="top" style="margin-left:5px" content="Info from local database may not be accurate") + i.el-icon-warning + span.extra {{ userOnlineFor(userDialog) | timeToText }} .x-friend-item(style="cursor:default") - .detail - span.name Last Activity - span.extra {{ userDialog.ref.last_activity | formatDate('long') }} + el-tooltip(placement="top") + template(#content) + span Last Login {{ userDialog.ref.last_login | formatDate('short') }} + .detail + span.name Last Activity + span.extra {{ userDialog.ref.last_activity | formatDate('long') }} .x-friend-item(style="cursor:default") .detail span.name Date Joined @@ -1730,7 +1737,7 @@ html el-dropdown-item(icon="el-icon-edit" command="Change Tags") Change Tags el-dropdown-item(icon="el-icon-picture-outline" command="Change Image") Change Image el-dropdown-item(v-if="worldDialog.ref.unityPackageUrl" icon="el-icon-download" command="Download Unity Package") Download Unity 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) Unpublish From Labs + el-dropdown-item(v-if="worldDialog.ref.tags.includes('system_approved') || worldDialog.ref.tags.includes('system_labs')" icon="el-icon-view" command="Unpublish" divided) Unpublish el-dropdown-item(v-else icon="el-icon-view" command="Publish" divided) Publish To Labs el-dropdown-item(icon="el-icon-delete" command="Delete" style="color:#F56C6C") Delete el-tabs