BIN
src/assets/avatars/av_baboon.png
Normal file
|
After Width: | Height: | Size: 31 KiB |
BIN
src/assets/avatars/av_badger.png
Normal file
|
After Width: | Height: | Size: 24 KiB |
BIN
src/assets/avatars/av_bear.png
Normal file
|
After Width: | Height: | Size: 33 KiB |
BIN
src/assets/avatars/av_bee.png
Normal file
|
After Width: | Height: | Size: 23 KiB |
BIN
src/assets/avatars/av_beta.png
Normal file
|
After Width: | Height: | Size: 30 KiB |
BIN
src/assets/avatars/av_bunny.png
Normal file
|
After Width: | Height: | Size: 28 KiB |
BIN
src/assets/avatars/av_butterfly.png
Normal file
|
After Width: | Height: | Size: 33 KiB |
BIN
src/assets/avatars/av_cardinal.png
Normal file
|
After Width: | Height: | Size: 21 KiB |
BIN
src/assets/avatars/av_cat.png
Normal file
|
After Width: | Height: | Size: 30 KiB |
BIN
src/assets/avatars/av_cockatoo.png
Normal file
|
After Width: | Height: | Size: 25 KiB |
BIN
src/assets/avatars/av_crab_2.png
Normal file
|
After Width: | Height: | Size: 30 KiB |
BIN
src/assets/avatars/av_crane.png
Normal file
|
After Width: | Height: | Size: 26 KiB |
BIN
src/assets/avatars/av_dragonfly.png
Normal file
|
After Width: | Height: | Size: 24 KiB |
BIN
src/assets/avatars/av_eagle.png
Normal file
|
After Width: | Height: | Size: 28 KiB |
BIN
src/assets/avatars/av_egret.png
Normal file
|
After Width: | Height: | Size: 21 KiB |
BIN
src/assets/avatars/av_elephant.png
Normal file
|
After Width: | Height: | Size: 28 KiB |
BIN
src/assets/avatars/av_flamingo.png
Normal file
|
After Width: | Height: | Size: 19 KiB |
BIN
src/assets/avatars/av_fox.png
Normal file
|
After Width: | Height: | Size: 25 KiB |
BIN
src/assets/avatars/av_gazelle.png
Normal file
|
After Width: | Height: | Size: 28 KiB |
BIN
src/assets/avatars/av_giraffe.png
Normal file
|
After Width: | Height: | Size: 22 KiB |
BIN
src/assets/avatars/av_gorilla.png
Normal file
|
After Width: | Height: | Size: 32 KiB |
BIN
src/assets/avatars/av_hedgehog.png
Normal file
|
After Width: | Height: | Size: 35 KiB |
BIN
src/assets/avatars/av_hippo.png
Normal file
|
After Width: | Height: | Size: 29 KiB |
BIN
src/assets/avatars/av_horse.png
Normal file
|
After Width: | Height: | Size: 25 KiB |
BIN
src/assets/avatars/av_hummingbird.png
Normal file
|
After Width: | Height: | Size: 21 KiB |
BIN
src/assets/avatars/av_iguna.png
Normal file
|
After Width: | Height: | Size: 28 KiB |
BIN
src/assets/avatars/av_jellyfish.png
Normal file
|
After Width: | Height: | Size: 25 KiB |
BIN
src/assets/avatars/av_leopard.png
Normal file
|
After Width: | Height: | Size: 37 KiB |
BIN
src/assets/avatars/av_lion.png
Normal file
|
After Width: | Height: | Size: 34 KiB |
BIN
src/assets/avatars/av_lionfish.png
Normal file
|
After Width: | Height: | Size: 26 KiB |
BIN
src/assets/avatars/av_lizard.png
Normal file
|
After Width: | Height: | Size: 23 KiB |
BIN
src/assets/avatars/av_macaw.png
Normal file
|
After Width: | Height: | Size: 29 KiB |
BIN
src/assets/avatars/av_mantis.png
Normal file
|
After Width: | Height: | Size: 19 KiB |
BIN
src/assets/avatars/av_octopus.png
Normal file
|
After Width: | Height: | Size: 26 KiB |
BIN
src/assets/avatars/av_orangutan.png
Normal file
|
After Width: | Height: | Size: 30 KiB |
BIN
src/assets/avatars/av_osprey.png
Normal file
|
After Width: | Height: | Size: 24 KiB |
BIN
src/assets/avatars/av_otter.png
Normal file
|
After Width: | Height: | Size: 25 KiB |
BIN
src/assets/avatars/av_owl.png
Normal file
|
After Width: | Height: | Size: 35 KiB |
BIN
src/assets/avatars/av_panda.png
Normal file
|
After Width: | Height: | Size: 23 KiB |
BIN
src/assets/avatars/av_pangolin.png
Normal file
|
After Width: | Height: | Size: 26 KiB |
BIN
src/assets/avatars/av_panther.png
Normal file
|
After Width: | Height: | Size: 29 KiB |
BIN
src/assets/avatars/av_peacock.png
Normal file
|
After Width: | Height: | Size: 40 KiB |
BIN
src/assets/avatars/av_penguin.png
Normal file
|
After Width: | Height: | Size: 20 KiB |
BIN
src/assets/avatars/av_polar bear.png
Normal file
|
After Width: | Height: | Size: 21 KiB |
BIN
src/assets/avatars/av_puffin.png
Normal file
|
After Width: | Height: | Size: 23 KiB |
BIN
src/assets/avatars/av_puppy.png
Normal file
|
After Width: | Height: | Size: 24 KiB |
BIN
src/assets/avatars/av_rhino.png
Normal file
|
After Width: | Height: | Size: 30 KiB |
BIN
src/assets/avatars/av_rooster.png
Normal file
|
After Width: | Height: | Size: 33 KiB |
BIN
src/assets/avatars/av_shark.png
Normal file
|
After Width: | Height: | Size: 19 KiB |
BIN
src/assets/avatars/av_sloth.png
Normal file
|
After Width: | Height: | Size: 29 KiB |
BIN
src/assets/avatars/av_snake.png
Normal file
|
After Width: | Height: | Size: 24 KiB |
BIN
src/assets/avatars/av_squirrel.png
Normal file
|
After Width: | Height: | Size: 29 KiB |
BIN
src/assets/avatars/av_starfish.png
Normal file
|
After Width: | Height: | Size: 20 KiB |
BIN
src/assets/avatars/av_stingray.png
Normal file
|
After Width: | Height: | Size: 21 KiB |
BIN
src/assets/avatars/av_tiger.png
Normal file
|
After Width: | Height: | Size: 37 KiB |
BIN
src/assets/avatars/av_tucan.png
Normal file
|
After Width: | Height: | Size: 22 KiB |
BIN
src/assets/avatars/av_turtle.png
Normal file
|
After Width: | Height: | Size: 34 KiB |
BIN
src/assets/avatars/av_walrus.png
Normal file
|
After Width: | Height: | Size: 30 KiB |
BIN
src/assets/avatars/av_whaleshark.png
Normal file
|
After Width: | Height: | Size: 23 KiB |
BIN
src/assets/avatars/av_yak.png
Normal file
|
After Width: | Height: | Size: 29 KiB |
BIN
src/assets/avatars/av_zebra.png
Normal file
|
After Width: | Height: | Size: 24 KiB |
|
Before Width: | Height: | Size: 17 KiB |
|
Before Width: | Height: | Size: 14 KiB |
|
Before Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 13 KiB |
|
Before Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 10 KiB |
|
Before Width: | Height: | Size: 13 KiB |
|
Before Width: | Height: | Size: 10 KiB |
|
Before Width: | Height: | Size: 15 KiB |
|
Before Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 15 KiB |
|
Before Width: | Height: | Size: 15 KiB |
|
|
@ -1,5 +0,0 @@
|
||||||
Guest Pangolin
|
|
||||||
Guest Cat
|
|
||||||
Guest Dog
|
|
||||||
Guest Iguana
|
|
||||||
Guest Sloth
|
|
||||||
|
|
@ -24,20 +24,32 @@
|
||||||
<v-container class="join-user-info">
|
<v-container class="join-user-info">
|
||||||
<v-row>
|
<v-row>
|
||||||
<v-col class="flex-grow-0 flex-shrink-0">
|
<v-col class="flex-grow-0 flex-shrink-0">
|
||||||
<v-avatar @click="showAvatarPicker = true">
|
<v-avatar @click="showAvatarPickerList">
|
||||||
<v-img v-if="avatar" :src="avatar.image" />
|
<v-img v-if="profile" :src="profile.image" />
|
||||||
</v-avatar>
|
</v-avatar>
|
||||||
</v-col>
|
</v-col>
|
||||||
<v-col class="flex-shrink-1 flex-grow-1">
|
<v-col class="flex-shrink-1 flex-grow-1">
|
||||||
<v-combobox
|
<v-select
|
||||||
v-if="!currentUser || currentUser"
|
ref="avatar"
|
||||||
@update:search-input="updateDisplayName"
|
:items="availableAvatars"
|
||||||
:items="defaultDisplayNames"
|
cache-items
|
||||||
:value="userDisplayName || displayName"
|
|
||||||
label="User name"
|
label="User name"
|
||||||
outlined
|
outlined
|
||||||
dense
|
dense
|
||||||
></v-combobox>
|
@change="selectAvatar"
|
||||||
|
:value="availableAvatars[0]"
|
||||||
|
single-line
|
||||||
|
>
|
||||||
|
<template v-slot:selection>
|
||||||
|
<v-text-field background-color="transparent" solo flat hide-details @click.native.stop="{}" v-model="profile.name"></v-text-field>
|
||||||
|
</template>
|
||||||
|
<template v-slot:item="data">
|
||||||
|
<v-avatar size="32">
|
||||||
|
<v-img :src="data.item.image" />
|
||||||
|
</v-avatar>
|
||||||
|
<div class="ml-2">{{ data.item.name }}</div>
|
||||||
|
</template>
|
||||||
|
</v-select>
|
||||||
</v-col>
|
</v-col>
|
||||||
</v-row>
|
</v-row>
|
||||||
</v-container>
|
</v-container>
|
||||||
|
|
@ -78,48 +90,6 @@
|
||||||
|
|
||||||
<div v-if="loadingMessage">{{ loadingMessage }}</div>
|
<div v-if="loadingMessage">{{ loadingMessage }}</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<v-dialog
|
|
||||||
scrollable
|
|
||||||
:fullscreen="$vuetify.breakpoint.xs"
|
|
||||||
width="500"
|
|
||||||
transition="dialog-bottom-transition"
|
|
||||||
v-model="showAvatarPicker"
|
|
||||||
>
|
|
||||||
<v-card>
|
|
||||||
<v-toolbar dark flat color="primary">
|
|
||||||
<v-btn icon dark @click="showAvatarPicker = false">
|
|
||||||
<v-icon>close</v-icon>
|
|
||||||
</v-btn>
|
|
||||||
<v-toolbar-title>Select an Avatar</v-toolbar-title>
|
|
||||||
<v-spacer></v-spacer>
|
|
||||||
</v-toolbar>
|
|
||||||
<v-card-text>
|
|
||||||
<v-container row wrap>
|
|
||||||
<v-col
|
|
||||||
v-for="avatar in availableAvatars"
|
|
||||||
:key="avatar.id"
|
|
||||||
xs4
|
|
||||||
sm3
|
|
||||||
d-flex
|
|
||||||
>
|
|
||||||
<v-card tile flat class="d-flex">
|
|
||||||
<v-card-text class="d-flex">
|
|
||||||
<v-avatar
|
|
||||||
size="48"
|
|
||||||
@click="selectAvatar(avatar)"
|
|
||||||
class="avatar-picker-avatar"
|
|
||||||
:class="{ current: avatar === selectedAvatar }"
|
|
||||||
>
|
|
||||||
<img :src="avatar.image" />
|
|
||||||
</v-avatar>
|
|
||||||
</v-card-text>
|
|
||||||
</v-card>
|
|
||||||
</v-col>
|
|
||||||
</v-container>
|
|
||||||
</v-card-text>
|
|
||||||
</v-card>
|
|
||||||
</v-dialog>
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|
@ -138,27 +108,15 @@ export default {
|
||||||
loadingMessage: null,
|
loadingMessage: null,
|
||||||
waitingForInfo: true,
|
waitingForInfo: true,
|
||||||
waitingForMembership: false,
|
waitingForMembership: false,
|
||||||
selectedAvatar: null,
|
|
||||||
displayName: null,
|
|
||||||
defaultDisplayNames: [],
|
|
||||||
availableAvatars: [],
|
availableAvatars: [],
|
||||||
showAvatarPicker: false,
|
randomProfile: null,
|
||||||
shouldSetAvatar: false,
|
selectedProfile: null,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
this.$matrix.on("Room.myMembership", this.onMyMembership);
|
this.$matrix.on("Room.myMembership", this.onMyMembership);
|
||||||
this.availableAvatars = util.getDefaultAvatars();
|
this.availableAvatars = util.getDefaultAvatars();
|
||||||
this.selectedAvatar = this.userAvatar || this.availableAvatars[0];
|
this.randomProfile = this.availableAvatars[Math.floor(Math.random() * this.availableAvatars.length)];
|
||||||
if (!this.currentUser || this.currentUser.is_guest) {
|
|
||||||
var values = require("!!raw-loader!../assets/usernames.txt")
|
|
||||||
.default.split("\n")
|
|
||||||
.filter((item) => {
|
|
||||||
return item.length > 0;
|
|
||||||
});
|
|
||||||
this.displayName = values[Math.floor(Math.random() * values.length)];
|
|
||||||
this.defaultDisplayNames = values;
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
destroyed() {
|
destroyed() {
|
||||||
this.$matrix.off("Room.myMembership", this.onMyMembership);
|
this.$matrix.off("Room.myMembership", this.onMyMembership);
|
||||||
|
|
@ -182,21 +140,38 @@ export default {
|
||||||
}
|
}
|
||||||
return this.$matrix.currentRoomId;
|
return this.$matrix.currentRoomId;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
profile() {
|
||||||
|
return {
|
||||||
|
image: (this.selectedProfile ? this.selectedProfile.image : null) || this.userAvatar || this.randomProfile.image,
|
||||||
|
name: (this.selectedProfile ? this.selectedProfile.name : null) || this.userDisplayName || this.randomProfile.name
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
hasChangedAvatar() {
|
||||||
|
return this.userAvatar != this.profile.image;
|
||||||
|
},
|
||||||
|
|
||||||
|
hasChangedDisplayName() {
|
||||||
|
return this.userDisplayName != this.profile.name;
|
||||||
|
},
|
||||||
|
|
||||||
userDisplayName() {
|
userDisplayName() {
|
||||||
return this.$matrix.userDisplayName;
|
return this.$matrix.userDisplayName;
|
||||||
},
|
},
|
||||||
|
|
||||||
userAvatar() {
|
userAvatar() {
|
||||||
if (!this.$matrix.userAvatar) {
|
if (!this.$matrix.userAvatar) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
return { id: 'user', image: this.$matrix.matrixClient.mxcUrlToHttp(this.$matrix.userAvatar, 80, 80, 'scale', true) };
|
return this.$matrix.matrixClient.mxcUrlToHttp(
|
||||||
|
this.$matrix.userAvatar,
|
||||||
|
80,
|
||||||
|
80,
|
||||||
|
"scale",
|
||||||
|
true
|
||||||
|
);
|
||||||
},
|
},
|
||||||
avatar() {
|
|
||||||
if (!this.shouldSetAvatar) {
|
|
||||||
return this.userAvatar || this.selectedAvatar; // TODO - Use random
|
|
||||||
}
|
|
||||||
return this.selectedAvatar;
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
roomId: {
|
roomId: {
|
||||||
|
|
@ -205,7 +180,9 @@ export default {
|
||||||
if (!value || (value && value == oldVal)) {
|
if (!value || (value && value == oldVal)) {
|
||||||
return; // No change.
|
return; // No change.
|
||||||
}
|
}
|
||||||
console.log("Join: Current room changed to " + (value ? value : "null"));
|
console.log(
|
||||||
|
"Join: Current room changed to " + (value ? value : "null")
|
||||||
|
);
|
||||||
this.roomName = this.roomId;
|
this.roomName = this.roomId;
|
||||||
if (this.currentUser) {
|
if (this.currentUser) {
|
||||||
this.waitingForMembership = true;
|
this.waitingForMembership = true;
|
||||||
|
|
@ -299,12 +276,12 @@ export default {
|
||||||
function (user) {
|
function (user) {
|
||||||
if (
|
if (
|
||||||
(this.currentUser && !this.currentUser.is_guest) ||
|
(this.currentUser && !this.currentUser.is_guest) ||
|
||||||
!this.displayName || this.displayName == this.userDisplayName /* No change */
|
!this.hasChangedDisplayName /* No change */
|
||||||
) {
|
) {
|
||||||
return Promise.resolve(user);
|
return Promise.resolve(user);
|
||||||
} else {
|
} else {
|
||||||
return this.$matrix.matrixClient.setDisplayName(
|
return this.$matrix.matrixClient.setDisplayName(
|
||||||
this.displayName,
|
this.profile.name,
|
||||||
undefined
|
undefined
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
@ -314,13 +291,13 @@ export default {
|
||||||
function () {
|
function () {
|
||||||
if (
|
if (
|
||||||
(this.currentUser && !this.currentUser.is_guest) ||
|
(this.currentUser && !this.currentUser.is_guest) ||
|
||||||
!this.shouldSetAvatar
|
!this.hasChangedAvatar /* No change */
|
||||||
) {
|
) {
|
||||||
return Promise.resolve("no avatar");
|
return Promise.resolve("no avatar");
|
||||||
} else {
|
} else {
|
||||||
return util.setAvatar(
|
return util.setAvatar(
|
||||||
this.$matrix.matrixClient,
|
this.$matrix.matrixClient,
|
||||||
this.selectedAvatar.image,
|
this.profile.image,
|
||||||
function (progress) {
|
function (progress) {
|
||||||
console.log("Progress: " + JSON.stringify(progress));
|
console.log("Progress: " + JSON.stringify(progress));
|
||||||
}
|
}
|
||||||
|
|
@ -355,17 +332,13 @@ export default {
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
updateDisplayName(value) {
|
selectAvatar(value) {
|
||||||
this.displayName = value;
|
this.selectedProfile = Object.assign({}, value); // Make a copy, so editing does not destroy data
|
||||||
},
|
},
|
||||||
|
|
||||||
selectAvatar(avatar) {
|
showAvatarPickerList() {
|
||||||
if (avatar && (!this.userAvatar || this.userAvatar.image != avatar.image)) {
|
this.$refs.avatar.$refs.input.click();
|
||||||
this.selectedAvatar = avatar;
|
}
|
||||||
this.shouldSetAvatar = true;
|
|
||||||
}
|
|
||||||
this.showAvatarPicker = false;
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
|
||||||
|
|
@ -376,14 +376,11 @@ class Util {
|
||||||
r.keys().forEach(res => {
|
r.keys().forEach(res => {
|
||||||
console.log("Avatar", res);
|
console.log("Avatar", res);
|
||||||
// // Remove"./"
|
// // Remove"./"
|
||||||
// const parts = res.split("/");
|
var name = res.split("_")[1];
|
||||||
// const pack = parts[1];
|
name = name.slice(0, name.indexOf("."));
|
||||||
// const sticker = parts[2].split(".")[0];
|
name = name.charAt(0).toUpperCase() + name.slice(1);
|
||||||
const image = r(res);
|
const image = r(res);
|
||||||
images.push({ id: res, image: image });
|
images.push({ id: res, image: image, name: "Guest " + name });
|
||||||
// if (stickerPacks[pack] !== undefined) {
|
|
||||||
// stickerPacks[pack].push({ image: image, name: sticker });
|
|
||||||
// }
|
|
||||||
});
|
});
|
||||||
return images;
|
return images;
|
||||||
}
|
}
|
||||||
|
|
|
||||||