From be6568db387a90a5513fdaf9304569c59e903e3d Mon Sep 17 00:00:00 2001 From: Natsumi Date: Sat, 19 Jun 2021 10:53:05 +1200 Subject: [PATCH] Copy world/avatar button --- html/src/app.js | 16 ++++++++++++++++ html/src/index.pug | 6 ++++-- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/html/src/app.js b/html/src/app.js index 924dd6b8..da4e9475 100644 --- a/html/src/app.js +++ b/html/src/app.js @@ -10212,6 +10212,22 @@ speechSynthesis.getVoices(); return true; }; + $app.methods.copyAvatar = function (avatarId) { + this.copyToClipboard(`https://vrchat.com/home/avatar/${avatarId}`); + this.$message({ + message: 'Avatar URL copied to clipboard', + type: 'success' + }); + }; + + $app.methods.copyWorld = function (worldId) { + this.$message({ + message: 'World URL copied to clipboard', + type: 'success' + }); + this.copyToClipboard(`https://vrchat.com/home/world/${worldId}`); + }; + // App: VRCPlus Icons API.$on('LOGIN', function () { diff --git a/html/src/index.pug b/html/src/index.pug index a80fd6eb..e4a6f70c 100644 --- a/html/src/index.pug +++ b/html/src/index.pug @@ -1323,7 +1323,8 @@ html .x-friend-item(style="width:100%;cursor:default") .detail span.name World ID - span.extra(v-text="worldDialog.id") + span.extra {{ worldDialog.id }} + el-button(@click="copyWorld(worldDialog.id)" size="mini" icon="el-icon-s-order" style="margin-left:5px" circle) .x-friend-item(style="cursor:default") .detail span.name Players @@ -1417,7 +1418,8 @@ html .x-friend-item(style="width:100%;cursor:default") .detail span.name Avatar ID - span.extra(v-text="avatarDialog.id") + span.extra {{ avatarDialog.id }} + el-button(@click="copyAvatar(avatarDialog.id)" size="mini" icon="el-icon-s-order" style="margin-left:5px" circle) .x-friend-item(style="cursor:default") .detail span.name Created