Merge branch 'main' of gitlab.com:keanuapp/keanuapp-weblite into main

This commit is contained in:
Nathan Freitas 2021-07-22 11:31:43 -04:00
commit f11cf6c84e
No known key found for this signature in database
GPG key ID: A801183E69B37AA9
17 changed files with 497 additions and 340 deletions

View file

@ -1,6 +1,6 @@
{ {
"name": "keanuapp-weblite", "name": "keanuapp-weblite",
"version": "0.1.14", "version": "0.1.15",
"private": true, "private": true,
"scripts": { "scripts": {
"serve": "vue-cli-service serve", "serve": "vue-cli-service serve",

View file

@ -1,6 +1,6 @@
{ {
"name": "keanuapp-weblite", "name": "keanuapp-weblite",
"version": "0.1.13", "version": "0.1.14",
"private": true, "private": true,
"scripts": { "scripts": {
"serve": "vue-cli-service serve", "serve": "vue-cli-service serve",

View file

@ -8,7 +8,11 @@
fluid fluid
fill-height fill-height
style=" style="
position: absolute; position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
z-index: 20; z-index: 20;
background-color: rgba(255, 255, 255, 1); background-color: rgba(255, 255, 255, 1);
" "

View file

@ -525,9 +525,9 @@ $admin-fg: white;
position: absolute; position: absolute;
width: fit-content; width: fit-content;
background-color: white; background-color: white;
height: 45px; height: 44px;
border-radius: 20px; border-radius: 22px;
box-shadow: 4px 4px 8px #888888; box-shadow: 4px 4px 8px rgba(0,0,0,0.15);
// &.incoming { // &.incoming {
// right: 30%; // right: 30%;
// } // }
@ -544,7 +544,7 @@ $admin-fg: white;
height: 40px; height: 40px;
border-radius: 20px; border-radius: 20px;
padding: 0px 20px; padding: 0px 20px;
box-shadow: 4px 4px 8px #888888; box-shadow: 4px 4px 8px rgba(0,0,0,0.15);
} }
.message-operations-picker { .message-operations-picker {

14
src/assets/icons/edit.vue Normal file
View file

@ -0,0 +1,14 @@
<template>
<svg
width="20"
height="21"
viewBox="0 0 20 21"
fill="none"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M18.8271 19.027H7.68959L18.9785 7.73448C19.2199 7.49799 19.4117 7.2157 19.5426 6.90414C19.6736 6.59258 19.741 6.25802 19.741 5.92006C19.741 5.5821 19.6736 5.24754 19.5426 4.93599C19.4117 4.62443 19.2199 4.34213 18.9785 4.10565L16.3943 1.52154C16.1571 1.28145 15.8746 1.09084 15.5631 0.960752C15.2516 0.830659 14.9175 0.763672 14.5799 0.763672C14.2424 0.763672 13.9082 0.830659 13.5968 0.960752C13.2853 1.09084 13.0028 1.28145 12.7655 1.52154L0.214124 14.0729C0.145696 14.1419 0.0915588 14.2237 0.0548167 14.3137C0.0180747 14.4036 -0.00054944 14.5 1.23405e-05 14.5971V19.7654C1.23405e-05 19.9612 0.0777991 20.149 0.21626 20.2874C0.354722 20.4259 0.542516 20.5037 0.73833 20.5037H18.8271C19.0229 20.5037 19.2107 20.4259 19.3492 20.2874C19.4876 20.149 19.5654 19.9612 19.5654 19.7654C19.5654 19.5695 19.4876 19.3817 19.3492 19.2433C19.2107 19.1048 19.0229 19.027 18.8271 19.027ZM13.8102 2.56626C14.0167 2.36665 14.2927 2.25507 14.5799 2.25507C14.8671 2.25507 15.1431 2.36665 15.3496 2.56626L17.9337 5.15037C18.0361 5.25072 18.1174 5.37049 18.1729 5.50265C18.2284 5.63481 18.257 5.77672 18.257 5.92006C18.257 6.06341 18.2284 6.20531 18.1729 6.33748C18.1174 6.46964 18.0361 6.5894 17.9337 6.68976L16.0879 8.53555L11.9792 4.40098L13.8102 2.56626ZM4.79907 19.027H1.47665V14.9035L10.9345 5.442L15.0617 9.56919L5.60015 19.027H4.79907Z"
fill="black"
/>
</svg>
</template>

View file

@ -0,0 +1,14 @@
<template>
<svg
width="23"
height="23"
viewBox="0 0 23 23"
fill="none"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M21.0495 17.2908C22.1446 15.5067 22.7229 13.4536 22.72 11.3602L22.72 11.36L22.72 11.3598C22.7229 9.26641 22.1446 7.21331 21.0495 5.42919L21.0433 5.41946C20.0273 3.76355 18.6036 2.39584 16.9084 1.44703C15.2131 0.49822 13.3028 7.9387e-06 11.36 0C9.4173 -7.93851e-06 7.50702 0.498188 5.81172 1.44698C4.11643 2.39578 2.69277 3.76347 1.67678 5.41938L1.67047 5.42924C0.578083 7.21458 8.10833e-06 9.26694 0 11.36C-8.10816e-06 13.453 0.57805 15.5054 1.67042 17.2907L1.67684 17.3007C2.69283 18.9566 4.11649 20.3243 5.81177 21.273C7.50706 22.2218 9.41733 22.72 11.3601 22.72C13.3028 22.72 15.213 22.2218 16.9083 21.273C18.6036 20.3242 20.0272 18.9565 21.0432 17.3006L21.0495 17.2908ZM12.8121 20.773C12.5956 20.9819 12.3464 21.154 12.0745 21.2825C11.8512 21.3886 11.6072 21.4436 11.36 21.4436C11.1128 21.4436 10.8688 21.3886 10.6455 21.2825C10.128 21.0181 9.68489 20.6282 9.35685 20.1484C8.68691 19.1804 8.19042 18.1031 7.8896 16.9649C9.04523 16.8938 10.202 16.8576 11.36 16.8563C12.5175 16.8563 13.6744 16.8925 14.8306 16.9649C14.6641 17.5502 14.4561 18.1228 14.2082 18.6784C13.8818 19.4599 13.4078 20.1711 12.8121 20.7731V20.773ZM1.29861 11.9982H5.88065C5.91049 13.2768 6.04907 14.5505 6.29491 15.8055C5.04236 15.9157 3.79301 16.0671 2.54686 16.2597C1.81713 14.9505 1.39057 13.4942 1.29861 11.9982ZM2.54685 6.46034C3.79251 6.65337 5.0423 6.80479 6.29622 6.91459C6.0499 8.16956 5.91101 9.44324 5.88106 10.7218H1.29861C1.39056 9.22581 1.81712 7.76952 2.54684 6.46034H2.54685ZM9.90793 1.94694C10.1244 1.73806 10.3735 1.56598 10.6455 1.4375C10.8688 1.33142 11.1128 1.27639 11.36 1.27639C11.6072 1.27639 11.8512 1.33142 12.0745 1.4375C12.592 1.70187 13.0351 2.09177 13.3631 2.57154C14.0331 3.53962 14.5296 4.61685 14.8304 5.75506C13.6748 5.82617 12.518 5.8624 11.36 5.86374C10.2025 5.86372 9.04565 5.82749 7.88939 5.75504C8.05591 5.16983 8.26389 4.59722 8.51178 4.04156C8.83818 3.26009 9.31222 2.5489 9.90793 1.94694ZM21.4214 10.7218H16.8394C16.8095 9.44324 16.6709 8.16954 16.4251 6.91448C17.6777 6.80426 18.927 6.65288 20.1732 6.46033C20.9029 7.76952 21.3295 9.2258 21.4214 10.7218ZM7.57867 15.7063C7.32906 14.4851 7.18808 13.2442 7.15739 11.9982H15.5628C15.5323 13.2442 15.3916 14.4851 15.1422 15.7063C13.8829 15.6237 12.6221 15.5815 11.36 15.5799C10.0988 15.5799 8.83835 15.622 7.57867 15.7063ZM15.1413 7.01371C15.3909 8.23488 15.5319 9.47576 15.5626 10.7218H7.15725C7.18766 9.47576 7.32838 8.23486 7.57776 7.01365C8.83712 7.09628 10.0979 7.13844 11.36 7.14013C12.6212 7.14013 13.8817 7.09799 15.1413 7.01372V7.01371ZM16.8389 11.9982H21.4214C21.3294 13.4942 20.9029 14.9505 20.1732 16.2597C18.9275 16.0666 17.6777 15.9152 16.4238 15.8054C16.6701 14.5504 16.809 13.2768 16.8389 11.9982ZM19.4078 5.28553C18.3187 5.44267 17.2264 5.56708 16.1307 5.65876C15.9338 4.92561 15.6798 4.209 15.3712 3.51546C15.0893 2.87725 14.7347 2.27374 14.3143 1.71694C16.3458 2.33996 18.1285 3.58894 19.4078 5.28553ZM4.22979 4.22979C5.39513 3.06335 6.8288 2.20057 8.40514 1.71709C8.38122 1.74806 8.35662 1.77766 8.33305 1.80928C7.52281 2.97565 6.93263 4.28032 6.59161 5.65895C5.49592 5.56615 4.40277 5.44168 3.31216 5.28553C3.59344 4.91297 3.90004 4.56022 4.22979 4.22979ZM3.31216 17.4345C4.40126 17.2773 5.49363 17.1529 6.58927 17.0612C6.78619 17.7944 7.04015 18.511 7.34885 19.2045C7.63069 19.8427 7.98531 20.4463 8.40567 21.0031C6.37418 20.38 4.59149 19.1311 3.31216 17.4345V17.4345ZM18.4902 18.4902C17.3249 19.6567 15.8912 20.5194 14.3149 21.0029C14.3388 20.9719 14.3634 20.9423 14.387 20.9107C15.1972 19.7443 15.7874 18.4397 16.1284 17.061C17.2241 17.1538 18.3172 17.2783 19.4079 17.4345C19.1266 17.807 18.82 18.1598 18.4902 18.4902V18.4902Z"
fill="black"
/>
</svg>
</template>

View file

@ -0,0 +1,45 @@
<template>
<svg
width="24"
height="22"
viewBox="0 0 24 22"
fill="none"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M20.685 21.0489H8.32761C6.80505 21.0489 5.56665 19.8096 5.56665 18.287V16.1513C5.56665 14.6288 6.80505 13.3894 8.32761 13.3894H20.6847C22.2073 13.3894 23.4466 14.6288 23.4466 16.1513V18.287C23.4466 19.8096 22.2073 21.0489 20.685 21.0489ZM8.32761 14.8297C7.59929 14.8297 7.00665 15.423 7.00665 16.1516V18.2873C7.00665 19.0156 7.59929 19.6092 8.32761 19.6092H20.6847C21.413 19.6092 22.0066 19.016 22.0066 18.2873V16.1516C22.0066 15.4233 21.4134 14.8297 20.6847 14.8297H8.32761Z"
fill="black"
fill-opacity="0.7"
/>
<path
d="M9.75095 18.2263C10.3066 18.2263 10.757 17.7758 10.757 17.2202C10.757 16.6646 10.3066 16.2141 9.75095 16.2141C9.19531 16.2141 8.74487 16.6646 8.74487 17.2202C8.74487 17.7758 9.19531 18.2263 9.75095 18.2263Z"
fill="black"
fill-opacity="0.7"
/>
<path
d="M12.7998 18.2263C13.3554 18.2263 13.8059 17.7758 13.8059 17.2202C13.8059 16.6646 13.3554 16.2141 12.7998 16.2141C12.2441 16.2141 11.7937 16.6646 11.7937 17.2202C11.7937 17.7758 12.2441 18.2263 12.7998 18.2263Z"
fill="black"
fill-opacity="0.7"
/>
<path
d="M15.8473 18.2263C16.4033 18.2263 16.854 17.7756 16.854 17.2196C16.854 16.6636 16.4033 16.2129 15.8473 16.2129C15.2913 16.2129 14.8406 16.6636 14.8406 17.2196C14.8406 17.7756 15.2913 18.2263 15.8473 18.2263Z"
fill="black"
fill-opacity="0.7"
/>
<path
d="M18.8964 16.2144C19.4512 16.2144 19.9015 16.6643 19.9015 17.2195C19.9015 17.7753 19.4516 18.2262 18.8964 18.2262C18.3396 18.2262 17.8896 17.7753 17.8896 17.2195C17.8893 16.6643 18.3396 16.2144 18.8964 16.2144Z"
fill="black"
fill-opacity="0.7"
/>
<path
d="M9.8905 8.91388C9.49306 8.91388 9.1705 8.59132 9.1705 8.19388V5.0102C9.1705 3.5654 7.99578 2.39068 6.55098 2.39068C5.10618 2.39068 3.93146 3.5654 3.93146 5.0102V8.19388C3.93146 8.59132 3.6089 8.91388 3.21146 8.91388C2.81402 8.91388 2.49146 8.59132 2.49146 8.19388V5.0102C2.49146 2.77148 4.31194 0.950684 6.55098 0.950684C8.79002 0.950684 10.6105 2.77116 10.6105 5.0102V8.19388C10.6105 8.59164 10.2879 8.91388 9.8905 8.91388Z"
fill="black"
fill-opacity="0.7"
/>
<path
d="M4.17562 18.1775H2.62874C1.4841 18.1775 0.553223 17.2457 0.553223 16.1001V9.56474C0.553223 8.41914 1.4841 7.4873 2.62874 7.4873H10.8956C12.0403 7.4873 12.9711 8.41914 12.9711 9.56474V13.2201C12.9711 13.6175 12.6486 13.9401 12.2511 13.9401C11.8537 13.9401 11.5311 13.6175 11.5311 13.2201V9.56474C11.5311 9.21307 11.246 8.9273 10.8956 8.9273H2.62874C2.27802 8.9273 1.99322 9.21338 1.99322 9.56474V16.1001C1.99322 16.4518 2.27834 16.7375 2.62874 16.7375H4.17562C4.57306 16.7375 4.89562 17.0601 4.89562 17.4575C4.89562 17.855 4.57306 18.1775 4.17562 18.1775Z"
fill="black"
fill-opacity="0.7"
/>
</svg>
</template>

15
src/assets/icons/user.vue Normal file
View file

@ -0,0 +1,15 @@
<template>
<svg
width="24"
height="24"
viewBox="0 0 24 24"
fill="none"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M11.9999 0.639893C5.72789 0.639893 0.639893 5.72789 0.639893 11.9999C0.639893 18.2719 5.72789 23.3599 11.9999 23.3599C18.2719 23.3599 23.3599 18.2719 23.3599 11.9999C23.3599 5.72789 18.2719 0.639893 11.9999 0.639893ZM5.27989 19.0719C7.13589 16.6719 9.50389 15.3599 11.9999 15.3599C14.4959 15.3599 16.8639 16.6719 18.7199 19.0719C16.9599 20.7359 14.5919 21.7599 11.9999 21.7599C9.40789 21.7599 7.03989 20.7359 5.27989 19.0719ZM11.9999 13.4399C10.1439 13.4399 8.67189 11.9359 8.67189 10.1119C8.67189 8.28789 10.1439 6.78389 11.9999 6.78389C13.8559 6.78389 15.3279 8.28789 15.3279 10.1119C15.3279 11.9359 13.8559 13.4399 11.9999 13.4399ZM19.8079 17.8559C18.3679 16.0639 16.6399 14.8159 14.7839 14.2079C16.0959 13.3119 16.9599 11.8079 16.9599 10.1119C16.9599 7.39189 14.7519 5.18389 12.0319 5.18389C9.31189 5.18389 7.10389 7.39189 7.10389 10.1119C7.10389 11.8079 7.96789 13.3119 9.27989 14.2079C7.42389 14.8159 5.69589 16.0639 4.25589 17.8559C3.00789 16.2239 2.30389 14.1759 2.30389 11.9999C2.30389 6.62389 6.68789 2.23989 12.0639 2.23989C17.4399 2.23989 21.7599 6.62389 21.7599 11.9999C21.7599 14.2079 21.0239 16.2239 19.8079 17.8559Z"
fill="black"
fill-opacity="0.7"
/>
</svg>
</template>

View file

@ -7,7 +7,7 @@
"edit": "Edit", "edit": "Edit",
"delete": "Delete", "delete": "Delete",
"download": "Download", "download": "Download",
"ok": "OK", "ok": "Ok",
"cancel": "Cancel", "cancel": "Cancel",
"send": "Send", "send": "Send",
"back": "BACK", "back": "BACK",
@ -15,6 +15,8 @@
"logout": "Logout", "logout": "Logout",
"new_room": "New Room", "new_room": "New Room",
"undo": "Undo", "undo": "Undo",
"join": "Join",
"ignore": "Ignore",
"loading": "Loading {appName}" "loading": "Loading {appName}"
}, },
"message": { "message": {
@ -25,7 +27,7 @@
"user_changed_avatar": "{user} changed the avatar", "user_changed_avatar": "{user} changed the avatar",
"user_changed_room_avatar": "{user} changed the room avatar", "user_changed_room_avatar": "{user} changed the room avatar",
"user_encrypted_room": "{user} made the room encrypted", "user_encrypted_room": "{user} made the room encrypted",
"user_was_invited": "{user} was invited to the chat", "user_was_invited": "{user} was invited to the chat...",
"user_joined": "{user} joined the chat", "user_joined": "{user} joined the chat",
"user_left": "{user} left the chat", "user_left": "{user} left the chat",
"user_said": "{user} said:", "user_said": "{user} said:",
@ -46,7 +48,7 @@
"user_changed_room_topic": "{user} changed room topic to {topic}", "user_changed_room_topic": "{user} changed room topic to {topic}",
"unread_messages": "Unread messages", "unread_messages": "Unread messages",
"replying_to_event": "REPLYING TO EVENT: {message}", "replying_to_event": "REPLYING TO EVENT: {message}",
"your_message": "Your message", "your_message": "Your message...",
"scale_image": "Scale image", "scale_image": "Scale image",
"user_is_typing": "{user} is typing", "user_is_typing": "{user} is typing",
"users_are_typing": "{count} members are typing", "users_are_typing": "{count} members are typing",
@ -79,11 +81,11 @@
"new_room": "New Room", "new_room": "New Room",
"create": "Create", "create": "Create",
"next": "Next", "next": "Next",
"name_room": "Name group", "name_room": "Name room",
"room_topic": "Add a description if you like", "room_topic": "Add a description if you like",
"join_permissions": "Join permissions", "join_permissions": "Join permissions",
"set_join_permissions": "Set Join Permissions", "set_join_permissions": "Set Join Permissions",
"join_permissions_info": "These permissions determine how people can join the group and how easily others can be invited. They can be changed anytime.", "join_permissions_info": "These permissions determine how people can join the room and how easily others can be invited. They can be changed anytime.",
"get_link": "Get link", "get_link": "Get link",
"add_people": "Add people", "add_people": "Add people",
"link_copied": "Link copied!", "link_copied": "Link copied!",
@ -96,15 +98,15 @@
"status_avatar": "Uploading avatar: {count}" "status_avatar": "Uploading avatar: {count}"
}, },
"device_list": { "device_list": {
"title": "Devices", "title": "DEVICES",
"blocked": "Blocked", "blocked": "Blocked",
"verified": "Verified", "verified": "Verified",
"not_verified": "Not verified" "not_verified": "Not verified"
}, },
"login": { "login": {
"title": "Login", "title": "Login",
"username": "Username", "username": "Username (ex: marta)",
"password": "Password", "password": "Enter Password",
"username_required": "Username is required", "username_required": "Username is required",
"password_required": "Password is required", "password_required": "Password is required",
"login": "Login" "login": "Login"
@ -134,12 +136,12 @@
"join": { "join": {
"title": "Welcome to {roomName}", "title": "Welcome to {roomName}",
"user_name_label": "User name", "user_name_label": "User name",
"shared_computer": "Using a shared computer", "shared_computer": "This is a shared device",
"joining_as": "You are joining as:", "joining_as": "You are joining as:",
"join": "Join room", "join": "Join room",
"join_guest": "Join as guest", "join_guest": "Join as guest",
"status_logging_in": "Logging in", "status_logging_in": "Logging in...",
"status_joining": "Joining room", "status_joining": "Joining room...",
"join_failed": "Failed to join room." "join_failed": "Failed to join room."
}, },
"invite": { "invite": {
@ -152,9 +154,9 @@
"leave": { "leave": {
"title_public": "Goodbye, {user}", "title_public": "Goodbye, {user}",
"text_public": "You can always join this room again if you know the link.", "text_public": "You can always join this room again if you know the link.",
"text_public_lastroom": "If you want to join this group again, you can join under a new identity. To keep {user}, {action}.", "text_public_lastroom": "If you want to join this room again, you can join under a new identity. To keep {user}, {action}.",
"title_invite": "Are you sure you want to leave?", "title_invite": "Are you sure you want to leave?",
"text_invite": "This group is locked. You cannot rejoin without a special permission.", "text_invite": "This room is locked. You cannot rejoin without a special permission.",
"create_account": "create an account", "create_account": "create an account",
"go_back": "Go back", "go_back": "Go back",
"leave": "Leave" "leave": "Leave"
@ -193,7 +195,7 @@
"scan_code": "Scan to join the room" "scan_code": "Scan to join the room"
}, },
"room_info_sheet": { "room_info_sheet": {
"this_room": "This group", "this_room": "This room",
"view_details": "View details" "view_details": "View details"
}, },
"voice_recorder": { "voice_recorder": {

View file

@ -20,7 +20,7 @@
showContextMenu = false; showContextMenu = false;
showContextMenuAnchor = null; showContextMenuAnchor = null;
" "
v-if="selectedEvent && showContextMenu" v-if="showMessageOperations"
v-on:addreaction="addReaction" v-on:addreaction="addReaction"
v-on:addquickreaction="addQuickReaction" v-on:addquickreaction="addQuickReaction"
v-on:addreply="addReply(selectedEvent)" v-on:addreply="addReply(selectedEvent)"
@ -609,6 +609,9 @@ export default {
/** An array of recent emojis. Used in the "message operations" popup. */ /** An array of recent emojis. Used in the "message operations" popup. */
recentEmojis: [], recentEmojis: [],
/** Calculated style for message operations. We position the "popup" at the selected message. */
opStyle: "",
}; };
}, },
@ -690,25 +693,8 @@ export default {
return ""; return "";
} }
}, },
opStyle() { showMessageOperations() {
// Calculate where to show the context menu. return this.selectedEvent && this.showContextMenu;
//
const ref = this.selectedEvent && this.$refs[this.selectedEvent.getId()];
var top = 0;
var left = 0;
if (ref && ref[0]) {
if (this.showContextMenuAnchor) {
var rectAnchor = this.showContextMenuAnchor.getBoundingClientRect();
var rectChat =
this.$refs.messageOperationsStrut.getBoundingClientRect();
top = rectAnchor.top - rectChat.top;
left = rectAnchor.left - rectChat.left;
if (left + 250 > rectChat.right) {
left = rectChat.right - 250; // Pretty ugly, but we want to make sure it does not escape the screen, and we don't have the exakt width of it (yet)!
}
}
}
return "top:" + top + "px;left:" + left + "px";
}, },
avatarOpStyle() { avatarOpStyle() {
// Calculate where to show the context menu. // Calculate where to show the context menu.
@ -783,6 +769,34 @@ export default {
} }
}, },
}, },
showMessageOperations() {
if (this.showMessageOperations) {
this.$nextTick(() => {
// Calculate where to show the context menu.
//
const ref =
this.selectedEvent && this.$refs[this.selectedEvent.getId()];
var top = 0;
var left = 0;
if (ref && ref[0]) {
if (this.showContextMenuAnchor) {
var rectAnchor =
this.showContextMenuAnchor.getBoundingClientRect();
var rectChat =
this.$refs.messageOperationsStrut.getBoundingClientRect();
var rectOps =
this.$refs.messageOperations.$el.getBoundingClientRect();
top = rectAnchor.top - rectChat.top;
left = rectAnchor.left - rectChat.left;
if (left + rectOps.width >= rectChat.right) {
left = rectChat.right - rectOps.width - 10; // No overflow
}
}
}
this.opStyle = "top:" + top + "px;left:" + left + "px";
});
}
},
}, },
methods: { methods: {

View file

@ -2,7 +2,7 @@
<div class="create-room"> <div class="create-room">
<div> <div>
<v-container fluid> <v-container fluid>
<div class="room-name">{{ $t("new_room.new_room") }}</div> <div class="room-name no-upper">{{ $t("new_room.new_room") }}</div>
<v-btn <v-btn
text text
class="header-button-left" class="header-button-left"
@ -66,10 +66,7 @@
<div class="ms-2">{{ data.item.name }}</div> <div class="ms-2">{{ data.item.name }}</div>
</template> </template>
</v-select> </v-select>
<v-switch <v-checkbox class="mt-0" v-model="sharedComputer" :label="$t('join.shared_computer')" />
v-model="sharedComputer"
:label="$t('join.shared_computer')"
/>
</v-col> </v-col>
</v-row> </v-row>
</v-container> </v-container>

View file

@ -62,10 +62,7 @@
<div class="ms-2">{{ data.item.name }}</div> <div class="ms-2">{{ data.item.name }}</div>
</template> </template>
</v-select> </v-select>
<v-switch <v-checkbox class="mt-0" v-model="sharedComputer" :label="$t('join.shared_computer')" />
v-model="sharedComputer"
:label="$t('join.shared_computer')"
/>
</v-col> </v-col>
</v-row> </v-row>
<v-row v-else> <v-row v-else>

View file

@ -4,17 +4,18 @@
<v-container fluid> <v-container fluid>
<v-row no-gutters> <v-row no-gutters>
<v-col> <v-col>
<v-img src="@/assets/logo.svg" width="32" height="32" xclass="d-inline-block header-button-left" /> <v-img
src="@/assets/logo.svg"
width="32"
height="32"
xclass="d-inline-block header-button-left"
/>
</v-col> </v-col>
<v-col> <v-col>
<div class="room-name">{{ $t("login.title") }}</div> <div class="room-name no-upper">{{ $t("login.title") }}</div>
</v-col> </v-col>
<v-col class="text-right"> <v-col class="text-right">
<v-btn <v-btn text v-if="showCloseButton" @click.stop="$navigation.pop">
text
v-if="showCloseButton"
@click.stop="$navigation.pop"
>
<v-icon>close</v-icon> <v-icon>close</v-icon>
</v-btn> </v-btn>
</v-col> </v-col>
@ -22,16 +23,15 @@
</v-container> </v-container>
</div> </div>
<div color="rgba(255,255,255,0.1)" class="text-center"> <div color="rgba(255,255,255,0.1)" class="text-center">
<v-form v-model="isValid"> <v-form v-model="isValid">
<v-text-field <v-text-field
prepend-inner-icon="$vuetify.icons.user"
v-model="user.user_id" v-model="user.user_id"
:label="$t('login.username')" :label="$t('login.username')"
color="black" color="black"
background-color="white" background-color="white"
outlined solo
:rules="[(v) => !!v || $t('login.username_required')]" :rules="[(v) => !!v || $t('login.username_required')]"
:error="userErrorMessage != null" :error="userErrorMessage != null"
:error-messages="userErrorMessage" :error-messages="userErrorMessage"
@ -39,27 +39,36 @@
v-on:keyup.enter="$refs.password.focus()" v-on:keyup.enter="$refs.password.focus()"
></v-text-field> ></v-text-field>
<v-text-field <v-text-field
prepend-inner-icon="$vuetify.icons.password"
ref="password" ref="password"
v-model="user.password" v-model="user.password"
:label="$t('login.password')" :label="$t('login.password')"
color="black" color="black"
background-color="white" background-color="#f5f5f5"
outlined filled
type="password" type="password"
:rules="[(v) => !!v || $t('login.password_required')]" :rules="[(v) => !!v || $t('login.password_required')]"
:error="passErrorMessage != null" :error="passErrorMessage != null"
:error-messages="passErrorMessage" :error-messages="passErrorMessage"
required required
v-on:keyup.enter="() => { if (isValid && !loading) { handleLogin() }}" v-on:keyup.enter="
() => {
if (isValid && !loading) {
handleLogin();
}
}
"
></v-text-field> ></v-text-field>
<v-checkbox class="mt-0" v-model="sharedComputer" :label="$t('join.shared_computer')" />
<v-btn <v-btn
:disabled="!isValid || loading" :disabled="!isValid || loading"
primary color="black"
large depressed
block block
@click.stop="handleLogin" @click.stop="handleLogin"
:loading="loading" :loading="loading"
>{{$t('login.login')}}</v-btn class="filled-button mt-8"
>{{ $t("login.login") }}</v-btn
> >
</v-form> </v-form>
</div> </div>
@ -92,11 +101,25 @@ export default {
}, },
showCloseButton() { showCloseButton() {
return this.$navigation && this.$navigation.canPop(); return this.$navigation && this.$navigation.canPop();
} },
sharedComputer: {
get: function () {
return !this.$store.state.useLocalStorage;
},
set: function (sharedComputer) {
this.$store.commit("setUseLocalStorage", !sharedComputer);
},
},
}, },
created() { created() {
if (this.loggedIn) { if (this.loggedIn) {
this.$navigation.push({name: "Chat", params: { roomId: util.sanitizeRoomId(this.$matrix.currentRoomId) }}, -1); this.$navigation.push(
{
name: "Chat",
params: { roomId: util.sanitizeRoomId(this.$matrix.currentRoomId) },
},
-1
);
} }
}, },
watch: { watch: {
@ -109,18 +132,12 @@ export default {
deep: true, deep: true,
}, },
message() { message() {
if ( if (this.message && this.message.toLowerCase().includes("user")) {
this.message &&
this.message.toLowerCase().includes("user")
) {
this.userErrorMessage = this.message; this.userErrorMessage = this.message;
} else { } else {
this.userErrorMessage = null; this.userErrorMessage = null;
} }
if ( if (this.message && this.message.toLowerCase().includes("pass")) {
this.message &&
this.message.toLowerCase().includes("pass")
) {
this.passErrorMessage = this.message; this.passErrorMessage = this.message;
} else { } else {
this.passErrorMessage = null; this.passErrorMessage = null;
@ -130,7 +147,6 @@ export default {
methods: { methods: {
handleLogin() { handleLogin() {
if (this.user.user_id && this.user.password) { if (this.user.user_id && this.user.password) {
// Reset errors // Reset errors
this.message = null; this.message = null;
@ -142,7 +158,15 @@ export default {
this.$store.dispatch("login", user).then( this.$store.dispatch("login", user).then(
() => { () => {
if (this.$matrix.currentRoomId) { if (this.$matrix.currentRoomId) {
this.$navigation.push({name: "Chat", params: { roomId: util.sanitizeRoomId(this.$matrix.currentRoomId) }}, -1); this.$navigation.push(
{
name: "Chat",
params: {
roomId: util.sanitizeRoomId(this.$matrix.currentRoomId),
},
},
-1
);
} else { } else {
this.$navigation.push({ name: "Home" }, -1); this.$navigation.push({ name: "Home" }, -1);
} }

View file

@ -2,7 +2,7 @@
<div v-if="user" class="profile"> <div v-if="user" class="profile">
<div class="chat-header"> <div class="chat-header">
<v-container fluid> <v-container fluid>
<div class="room-name">{{ $t("profile.title") }}</div> <div class="room-name no-upper">{{ $t("profile.title") }}</div>
<v-btn <v-btn
text text
class="header-button-right" class="header-button-right"
@ -38,9 +38,9 @@
<v-col class="flex-shrink-1 flex-grow-1"> <v-col class="flex-shrink-1 flex-grow-1">
<div class="h1">{{ displayName }}</div> <div class="h1">{{ displayName }}</div>
<div class="text-center">{{ $matrix.currentUser.user_id }}</div> <div class="text-center">{{ $matrix.currentUser.user_id }}</div>
<div v-if="$matrix.currentUser.is_guest"> <!-- <div v-if="$matrix.currentUser.is_guest">
{{ $t("profile.temporary_identity") }} {{ $t("profile.temporary_identity") }}
</div> </div> -->
<v-btn depressed block class="outlined-button" @click.stop="logout">{{ <v-btn depressed block class="outlined-button" @click.stop="logout">{{
$t("menu.logout") $t("menu.logout")
}}</v-btn> }}</v-btn>
@ -51,7 +51,7 @@
<v-container class="mt-2 pa-5"> <v-container class="mt-2 pa-5">
<ActionRow <ActionRow
@click="showEditPasswordDialog = true" @click="showEditPasswordDialog = true"
:icon="'lock'" :icon="'$vuetify.icons.password'"
:text="$t('profile.set_password')" :text="$t('profile.set_password')"
/> />
<ActionRow <ActionRow
@ -59,12 +59,12 @@
editValue = displayName; editValue = displayName;
showEditDisplaynameDialog = true; showEditDisplaynameDialog = true;
" "
:icon="'edit'" :icon="'$vuetify.icons.edit'"
:text="$t('profile.change_name')" :text="$t('profile.change_name')"
/> />
<ActionRow <ActionRow
@click="showSelectLanguageDialog = true" @click="showSelectLanguageDialog = true"
:icon="'language'" :icon="'$vuetify.icons.globe'"
:text="$t('profile.select_language')" :text="$t('profile.select_language')"
/> />
</v-container> </v-container>

View file

@ -21,7 +21,7 @@
>{{$t('room_info_sheet.view_details')}}</v-btn >{{$t('room_info_sheet.view_details')}}</v-btn
> >
</div> </div>
<room-list :title="'Other groups'" v-on:close="close" v-on:newroom="createRoom" :showCreate="true" /> <room-list :title="'Other rooms'" v-on:close="close" v-on:newroom="createRoom" :showCreate="true" />
</div> </div>
</BottomSheet> </BottomSheet>
</template> </template>

View file

@ -1,17 +1,19 @@
<template> <template>
<v-list dense class="room-list"> <v-list dense class="room-list">
<div v-if="showInvites && $matrix.invites.length > 0" class="h4"> <div class="h4">{{ title }}</div>
{{ invitesTitle }} <v-list-item-group v-model="currentRoomId" color="primary">
</div> <v-list-item v-if="showCreate" @click.stop="$emit('newroom')">
<v-list-item-group <v-list-item-content>
v-if="showInvites" <v-list-item-title class="new-room">{{
v-model="currentRoomId" $t("menu.new_room")
color="primary" }}</v-list-item-title>
> </v-list-item-content>
<v-slide-y-transition group> </v-list-item>
<!-- invites -->
<v-list-item <v-list-item
:disabled="roomsProcessing[room.roomId]" :disabled="roomsProcessing[room.roomId]"
v-for="room in $matrix.invites" v-for="room in invitedRooms"
:key="room.roomId" :key="room.roomId"
:value="room.roomId" :value="room.roomId"
> >
@ -25,28 +27,17 @@
<v-list-item-subtitle>{{ room.topic }}</v-list-item-subtitle> <v-list-item-subtitle>{{ room.topic }}</v-list-item-subtitle>
</v-list-item-content> </v-list-item-content>
<v-list-item-action> <v-list-item-action>
<v-btn @click.stop="acceptInvitation(room)" icon <v-btn class="filled-button" depressed color="black" @click.stop="acceptInvitation(room)"
><v-icon>check_circle</v-icon></v-btn >{{$t('menu.join')}}</v-btn
> >
<v-btn @click.stop="rejectInvitation(room)" icon <v-btn class="filled-button" color="black" @click.stop="rejectInvitation(room)" text
><v-icon>cancel</v-icon></v-btn >{{$t('menu.ignore')}}</v-btn
> >
</v-list-item-action> </v-list-item-action>
</v-list-item> </v-list-item>
</v-slide-y-transition>
</v-list-item-group>
<div class="h4">{{ title }}</div>
<v-list-item-group v-model="currentRoomId" color="primary">
<v-list-item v-if="showCreate" @click.stop="$emit('newroom')">
<v-list-item-content>
<v-list-item-title class="new-room">{{
$t("menu.new_room")
}}</v-list-item-title>
</v-list-item-content>
</v-list-item>
<v-list-item <v-list-item
v-for="room in $matrix.joinedRooms" v-for="room in joinedRooms"
:key="room.roomId" :key="room.roomId"
:value="room.roomId" :value="room.roomId"
style="position: relative" style="position: relative"
@ -78,10 +69,6 @@ export default {
type: String, type: String,
default: "Rooms", default: "Rooms",
}, },
invitesTitle: {
type: String,
default: "Invites",
},
showInvites: { showInvites: {
type: Boolean, type: Boolean,
default: false, default: false,
@ -98,7 +85,32 @@ export default {
roomsProcessing: {}, roomsProcessing: {},
}), }),
computed: {
invitedRooms() {
return this.sortItemsOnName(this.$matrix.invites);
},
joinedRooms() {
return this.sortItemsOnName(this.$matrix.joinedRooms);
},
},
methods: { methods: {
sortItemsOnName(items) {
if (items == null) {
return [];
}
return items.sort(function(a, b) {
const titleA = a.name || a.summary.info.title;
const titleB = b.name || b.summary.info.title
if (titleA == null) {
return 1;
} else if (titleB == null) {
return -1;
}
return titleA.localeCompare(titleB);
});
},
notificationCount(room) { notificationCount(room) {
return room.getUnreadNotificationCount("total") || 0; return room.getUnreadNotificationCount("total") || 0;
}, },

View file

@ -1,10 +1,29 @@
import Vue from 'vue'; import Vue from 'vue';
import Vuetify from 'vuetify/lib'; import Vuetify from 'vuetify/lib';
import icUser from '@/assets/icons/user.vue';
import icPassword from '@/assets/icons/password.vue';
import icEdit from '@/assets/icons/edit.vue';
import icGlobe from '@/assets/icons/globe.vue';
Vue.use(Vuetify); Vue.use(Vuetify);
export default new Vuetify({ export default new Vuetify({
icons: { icons: {
iconfont: 'md', iconfont: 'md',
values: {
user: {
component: icUser
},
password: {
component: icPassword
},
edit: {
component: icEdit
},
globe: {
component: icGlobe
},
},
user: icUser
}, },
}); });