diff --git a/package.json b/package.json index 5adbd1e..ea71675 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "keanuapp-weblite", - "version": "0.1.14", + "version": "0.1.15", "private": true, "scripts": { "serve": "vue-cli-service serve", diff --git a/package.json.bak b/package.json.bak index 1da1202..5adbd1e 100644 --- a/package.json.bak +++ b/package.json.bak @@ -1,6 +1,6 @@ { "name": "keanuapp-weblite", - "version": "0.1.13", + "version": "0.1.14", "private": true, "scripts": { "serve": "vue-cli-service serve", diff --git a/src/App.vue b/src/App.vue index 6fe1f74..80efa91 100644 --- a/src/App.vue +++ b/src/App.vue @@ -8,7 +8,11 @@ fluid fill-height style=" - position: absolute; + position: fixed; + top: 0; + left: 0; + right: 0; + bottom: 0; z-index: 20; background-color: rgba(255, 255, 255, 1); " diff --git a/src/assets/css/chat.scss b/src/assets/css/chat.scss index 44ed99b..8af58d5 100644 --- a/src/assets/css/chat.scss +++ b/src/assets/css/chat.scss @@ -525,9 +525,9 @@ $admin-fg: white; position: absolute; width: fit-content; background-color: white; - height: 45px; - border-radius: 20px; - box-shadow: 4px 4px 8px #888888; + height: 44px; + border-radius: 22px; + box-shadow: 4px 4px 8px rgba(0,0,0,0.15); // &.incoming { // right: 30%; // } @@ -544,7 +544,7 @@ $admin-fg: white; height: 40px; border-radius: 20px; padding: 0px 20px; - box-shadow: 4px 4px 8px #888888; + box-shadow: 4px 4px 8px rgba(0,0,0,0.15); } .message-operations-picker { diff --git a/src/assets/icons/edit.vue b/src/assets/icons/edit.vue new file mode 100644 index 0000000..29e25fe --- /dev/null +++ b/src/assets/icons/edit.vue @@ -0,0 +1,14 @@ + diff --git a/src/assets/icons/globe.vue b/src/assets/icons/globe.vue new file mode 100644 index 0000000..94cdc07 --- /dev/null +++ b/src/assets/icons/globe.vue @@ -0,0 +1,14 @@ + diff --git a/src/assets/icons/password.vue b/src/assets/icons/password.vue new file mode 100644 index 0000000..a223221 --- /dev/null +++ b/src/assets/icons/password.vue @@ -0,0 +1,45 @@ + diff --git a/src/assets/icons/user.vue b/src/assets/icons/user.vue new file mode 100644 index 0000000..0b249bb --- /dev/null +++ b/src/assets/icons/user.vue @@ -0,0 +1,15 @@ + diff --git a/src/assets/translations/en.json b/src/assets/translations/en.json index 5606baf..03060cf 100644 --- a/src/assets/translations/en.json +++ b/src/assets/translations/en.json @@ -1,219 +1,221 @@ { - "language_display_name": "English", - "Keanu Weblite": "Keanu Weblite", - "menu": { - "start_private_chat": "Private chat with this user", - "reply": "Reply", - "edit": "Edit", - "delete": "Delete", - "download": "Download", - "ok": "OK", - "cancel": "Cancel", - "send": "Send", - "back": "BACK", - "login": "Log in", - "logout": "Log out", - "new_room": "New Room", - "undo": "Undo", - "loading": "Loading {appName}" - }, - "message": { - "you": "You", - "user_created_room": "{user} created the room", - "user_aliased_room": "{user} made the room alias {alias}", - "user_changed_display_name": "{user} changed display name to {displayName}", - "user_changed_avatar": "{user} changed the avatar", - "user_changed_room_avatar": "{user} changed the room avatar", - "user_encrypted_room": "{user} made the room encrypted", - "user_was_invited": "{user} was invited to the chat…", - "user_joined": "{user} joined the chat", - "user_left": "{user} left the chat", - "user_said": "{user} said:", - "file_prefix": "File: ", - "edited": "(edited)", - "download_progress": "{percentage}% downloaded", - "upload_progress": "Uploaded {count}", - "upload_progress_with_total": "Uploaded {count} of {total}", - "user_changed_room_history": "{user} made room history {type}", - "room_history_world_readable": "readable by anyone", - "room_history_shared": "readable to all members in the room", - "room_history_invited": "readable to members from when they were invited", - "room_history_joined": "readable to members from when they joined", - "user_changed_join_rules": "{user} made the room {type}", - "room_joinrule_invite": "invite only", - "room_joinrule_public": "public", - "user_changed_room_name": "{user} changed room name to {name}", - "user_changed_room_topic": "{user} changed room topic to {topic}", - "unread_messages": "Unread messages", - "replying_to_event": "REPLYING TO EVENT: {message}", - "your_message": "Your message…", - "scale_image": "Scale image", - "user_is_typing": "{user} is typing", - "users_are_typing": "{count} members are typing", - "room_powerlevel_change": "{user} changed powerlevel of {changes}", - "user_powerlevel_change_from_to": "{user} from {powerOld} to {powerNew}", - "user_changed_guest_access_closed": "{user} disallowed guests to join the room", - "user_changed_guest_access_open": "{user} allowed guests to join the room" - }, - "room": { - "members": "no members | 1 member | {count} members", - "leave": "Leave", - "purge_set_room_state": "Setting room state", - "purge_redacting_events": "Redacting events", - "purge_removing_members": "Removing members", - "purge_failed": "Failed to purge room!", - "room_list_invites": "Invites", - "room_list_rooms": "Rooms" - }, - "room_welcome": { - "info": "Welcome! Here are a few things to know about your room:", - "encrypted": "Messages are end-to-end encrypted.", - "room_history_is": "Room history is {type}.", - "room_history_joined": "People can only see the messages sent after they join.", - "join_public": "Anyone can join by opening this link: {link}.", - "join_invite": "Only people you invite can join.", - "info_permissions": "You can change ‘join permissions’ at any time in the room settings.", - "got_it": "Got it" - }, - "new_room": { - "new_room": "New Room", - "create": "Create", - "next": "Next", - "name_room": "Name group", - "room_topic": "Add a description if you like", - "join_permissions": "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.", - "get_link": "Get link", - "add_people": "Add people", - "link_copied": "Link copied!", - "public_info": "Anyone with a link", - "public_description": "Get a link to share", - "invite_info": "Only people added", - "invite_description": "Choose from a list or search by account ID", - "status_creating": "Creating room", - "status_avatar_total": "Uploading avatar: {count} of {total}", - "status_avatar": "Uploading avatar: {count}" - }, - "device_list": { - "title": "Devices", - "blocked": "Blocked", - "verified": "Verified", - "not_verified": "Not verified" - }, - "login": { - "title": "Login", - "username": "Username", - "password": "Password", - "username_required": "Username is required", - "password_required": "Password is required", - "login": "Login" - }, - "profile": { - "title": "My Profile", - "temporary_identity": "This identity is temporary. Set a password to use it again", - "set_password": "Set password", - "change_name": "Change name", - "change_password": "Change password", - "select_language": "Language", - "password_old": "Old password", - "password_new": "New password", - "password_repeat": "Repeat new password", - "display_name": "Display name" - }, - "profile_info_popup": { - "you_are": "You are", - "identity": "{displayName}", - "identity_temporary": "{displayName}", - "edit_profile": "Edit profile", - "logout": "Log out", - "want_more": "Want more?", - "powered_by": "This room is powered by {product}. Learn more at {productLink} or go ahead and create another room!", - "new_room": "+ New room" - }, - "join": { - "title": "Welcome to {roomName}", - "user_name_label": "User name", - "shared_computer": "Using a shared computer", - "joining_as": "You are joining as:", - "join": "Join room", - "join_guest": "Join as guest", - "status_logging_in": "Logging in…", - "status_joining": "Joining room…", - "join_failed": "Failed to join room." - }, - "invite": { - "title": "Add Friends", - "done": "Done", - "send_invites_to": "Send invites to", - "status_inviting": "Inviting friend {index} of {count}", - "status_error": "Failed to invite one or or more friends!" - }, - "leave": { - "title_public": "Goodbye, {user}", - "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}.", - "title_invite": "Are you sure you want to leave?", - "text_invite": "This group is locked. You cannot rejoin without a special permission.", - "create_account": "create an account", - "go_back": "Go back", - "leave": "Leave" - }, - "purge_room": { - "title": "Delete room?", - "info": "All members and messages will be removed. This action cannot be undone.", - "button": "Delete", - "n_seconds": "{seconds} seconds", - "self_destruct": "Room will self destruct in seconds.", - "deleting": "Deleting room:", - "notified": "We've notified members.", - "room_deletion_notice": "Time to say goodbye! This room has been deleted by {user}. It will self destruct in seconds." - }, - "goodbye": { - "room_deleted": "Room deleted.", - "close_tab": "Close browser tab", - "view_other_rooms": "View other rooms" - }, - "room_info": { - "title": "Room Details", - "created_by": "Created by {user}", - "permissions": "Join Permissions", - "join_invite": "Only People Added", - "join_public": "Anyone with a link", - "copy_link": "Copy invite link", - "link_copied": "Link copied!", - "purge": "Delete room", - "members": "Members", - "user": "{user}", - "user_you": "{user} (you)", - "hide_all": "Hide", - "show_all": "Show all >", - "leave_room": "Leave", - "version_info": "Powered by Guardian Project. Version: {version}", - "scan_code": "Scan to join the room" - }, - "room_info_sheet": { - "this_room": "This group", - "view_details": "View details" - }, - "voice_recorder": { - "swipe_to_cancel": "Swipe to cancel", - "release_to_cancel": "Release to cancel", - "failed_to_record": "Failed to record audio", - "not_supported_title": "Not supported", - "not_supported_text": "Unfortunately, this browser does not support audio recording." - }, - "power_level": { - "admin": "administrator", - "moderator": "moderator", - "default": "default", - "custom": "custom ({level})", - "restricted": "restricted" - }, - "fallbacks": { - "audio_file": "Audio file", - "video_file": "Video file", - "original_text": "", - "download_name": "Download" - } + "language_display_name": "English", + "Keanu Weblite": "Keanu Weblite", + "menu": { + "start_private_chat": "Private chat with this user", + "reply": "Reply", + "edit": "Edit", + "delete": "Delete", + "download": "Download", + "ok": "Ok", + "cancel": "Cancel", + "send": "Send", + "back": "BACK", + "login": "Login", + "logout": "Logout", + "new_room": "New Room", + "undo": "Undo", + "join": "Join", + "ignore": "Ignore", + "loading": "Loading {appName}" + }, + "message": { + "you": "You", + "user_created_room": "{user} created the room", + "user_aliased_room": "{user} made the room alias {alias}", + "user_changed_display_name": "{user} changed display name to {displayName}", + "user_changed_avatar": "{user} changed the avatar", + "user_changed_room_avatar": "{user} changed the room avatar", + "user_encrypted_room": "{user} made the room encrypted", + "user_was_invited": "{user} was invited to the chat...", + "user_joined": "{user} joined the chat", + "user_left": "{user} left the chat", + "user_said": "{user} said:", + "file_prefix": "File: ", + "edited": "(edited)", + "download_progress": "{percentage}% downloaded", + "upload_progress": "Uploaded {count}", + "upload_progress_with_total": "Uploaded {count} of {total}", + "user_changed_room_history": "{user} made room history {type}", + "room_history_world_readable": "readable by anyone", + "room_history_shared": "readable to all members in the room", + "room_history_invited": "readable to members from when they were invited", + "room_history_joined": "readable to members from when they joined", + "user_changed_join_rules": "{user} made the room {type}", + "room_joinrule_invite": "invite only", + "room_joinrule_public": "public", + "user_changed_room_name": "{user} changed room name to {name}", + "user_changed_room_topic": "{user} changed room topic to {topic}", + "unread_messages": "Unread messages", + "replying_to_event": "REPLYING TO EVENT: {message}", + "your_message": "Your message...", + "scale_image": "Scale image", + "user_is_typing": "{user} is typing", + "users_are_typing": "{count} members are typing", + "room_powerlevel_change": "{user} changed powerlevel of {changes}", + "user_powerlevel_change_from_to": "{user} from {powerOld} to {powerNew}", + "user_changed_guest_access_closed": "{user} disallowed guests to join the room", + "user_changed_guest_access_open": "{user} allowed guests to join the room" + }, + "room": { + "members": "no members | 1 member | {count} members", + "leave": "Leave", + "purge_set_room_state": "Setting room state", + "purge_redacting_events": "Redacting events", + "purge_removing_members": "Removing members", + "purge_failed": "Failed to purge room!", + "room_list_invites": "Invites", + "room_list_rooms": "Rooms" + }, + "room_welcome": { + "info": "Welcome! Here are a few things to know about your room:", + "encrypted": "Messages are end-to-end encrypted.", + "room_history_is": "Room history is {type}.", + "room_history_joined": "People can only see the messages sent after they join.", + "join_public": "Anyone can join by opening this link: {link}.", + "join_invite": "Only people you invite can join.", + "info_permissions": "You can change ‘join permissions’ at any time in the room settings.", + "got_it": "Got it" + }, + "new_room": { + "new_room": "New Room", + "create": "Create", + "next": "Next", + "name_room": "Name room", + "room_topic": "Add a description if you like", + "join_permissions": "Join permissions", + "set_join_permissions": "Set Join Permissions", + "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", + "add_people": "Add people", + "link_copied": "Link copied!", + "public_info": "Anyone with a link", + "public_description": "Get a link to share", + "invite_info": "Only people added", + "invite_description": "Choose from a list or search by account ID", + "status_creating": "Creating room", + "status_avatar_total": "Uploading avatar: {count} of {total}", + "status_avatar": "Uploading avatar: {count}" + }, + "device_list": { + "title": "DEVICES", + "blocked": "Blocked", + "verified": "Verified", + "not_verified": "Not verified" + }, + "login": { + "title": "Login", + "username": "Username (ex: marta)", + "password": "Enter Password", + "username_required": "Username is required", + "password_required": "Password is required", + "login": "Login" + }, + "profile": { + "title": "My Profile", + "temporary_identity": "This identity is temporary. Set a password to use it again", + "set_password": "Set password", + "change_name": "Change name", + "change_password": "Change password", + "select_language": "Language", + "password_old": "Old password", + "password_new": "New password", + "password_repeat": "Repeat new password", + "display_name": "Display name" + }, + "profile_info_popup": { + "you_are": "You are", + "identity": "{displayName}", + "identity_temporary": "{displayName}", + "edit_profile": "Edit profile", + "logout": "Logout", + "want_more": "Want more?", + "powered_by": "This room is powered by {product}. Learn more at {productLink} or go ahead and create another room!", + "new_room": "+ New room" + }, + "join": { + "title": "Welcome to {roomName}", + "user_name_label": "User name", + "shared_computer": "This is a shared device", + "joining_as": "You are joining as:", + "join": "Join room", + "join_guest": "Join as guest", + "status_logging_in": "Logging in...", + "status_joining": "Joining room...", + "join_failed": "Failed to join room." + }, + "invite": { + "title": "Add Friends", + "done": "Done", + "send_invites_to": "Send invites to", + "status_inviting": "Inviting friend {index} of {count}", + "status_error": "Failed to invite one or or more friends!" + }, + "leave": { + "title_public": "Goodbye, {user}", + "text_public": "You can always join this room again if you know the link.", + "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?", + "text_invite": "This room is locked. You cannot rejoin without a special permission.", + "create_account": "create an account", + "go_back": "Go back", + "leave": "Leave" + }, + "purge_room": { + "title": "Delete room?", + "info": "All members and messages will be removed. This action cannot be undone.", + "button": "Delete", + "n_seconds": "{seconds} seconds", + "self_destruct": "Room will self destruct in seconds.", + "deleting": "Deleting room:", + "notified": "We've notified members.", + "room_deletion_notice": "Time to say goodbye! This room has been deleted by {user}. It will self destruct in seconds." + }, + "goodbye": { + "room_deleted": "Room deleted.", + "close_tab": "Close browser tab", + "view_other_rooms": "View other rooms" + }, + "room_info": { + "title": "Room Details", + "created_by": "Created by {user}", + "permissions": "Join Permissions", + "join_invite": "Only People Added", + "join_public": "Anyone with a link", + "copy_link": "Copy invite link", + "link_copied": "Link copied!", + "purge": "Delete room", + "members": "Members", + "user": "{user}", + "user_you": "{user} (you)", + "hide_all": "Hide", + "show_all": "Show all >", + "leave_room": "Leave", + "version_info": "Powered by Guardian Project. Version: {version}", + "scan_code": "Scan to join the room" + }, + "room_info_sheet": { + "this_room": "This room", + "view_details": "View details" + }, + "voice_recorder": { + "swipe_to_cancel": "Swipe to cancel", + "release_to_cancel": "Release to cancel", + "failed_to_record": "Failed to record audio", + "not_supported_title": "Not supported", + "not_supported_text": "Unfortunately, this browser does not support audio recording." + }, + "power_level": { + "admin": "administrator", + "moderator": "moderator", + "default": "default", + "custom": "custom ({level})", + "restricted": "restricted" + }, + "fallbacks": { + "audio_file": "Audio file", + "video_file": "Video file", + "original_text": "", + "download_name": "Download" + } } diff --git a/src/components/Chat.vue b/src/components/Chat.vue index 4d21986..b429527 100644 --- a/src/components/Chat.vue +++ b/src/components/Chat.vue @@ -20,7 +20,7 @@ showContextMenu = false; showContextMenuAnchor = null; " - v-if="selectedEvent && showContextMenu" + v-if="showMessageOperations" v-on:addreaction="addReaction" v-on:addquickreaction="addQuickReaction" v-on:addreply="addReply(selectedEvent)" @@ -609,6 +609,9 @@ export default { /** An array of recent emojis. Used in the "message operations" popup. */ recentEmojis: [], + + /** Calculated style for message operations. We position the "popup" at the selected message. */ + opStyle: "", }; }, @@ -690,25 +693,8 @@ export default { return ""; } }, - opStyle() { - // 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(); - 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"; + showMessageOperations() { + return this.selectedEvent && this.showContextMenu; }, avatarOpStyle() { // 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: { diff --git a/src/components/CreateRoom.vue b/src/components/CreateRoom.vue index 97edf25..9d5d2dd 100644 --- a/src/components/CreateRoom.vue +++ b/src/components/CreateRoom.vue @@ -2,7 +2,7 @@
-
{{ $t("new_room.new_room") }}
+
{{ $t("new_room.new_room") }}
{{ data.item.name }}
- + diff --git a/src/components/Join.vue b/src/components/Join.vue index e11557f..f79a590 100644 --- a/src/components/Join.vue +++ b/src/components/Join.vue @@ -62,10 +62,7 @@
{{ data.item.name }}
- + diff --git a/src/components/Login.vue b/src/components/Login.vue index a63ddec..36cdcfd 100644 --- a/src/components/Login.vue +++ b/src/components/Login.vue @@ -4,34 +4,34 @@ - + -
{{ $t("login.title") }}
+
{{ $t("login.title") }}
- - close - + + close +
- -
- {{$t('login.login')}} + + {{ $t("login.login") }}
@@ -92,11 +101,25 @@ export default { }, showCloseButton() { return this.$navigation && this.$navigation.canPop(); - } + }, + sharedComputer: { + get: function () { + return !this.$store.state.useLocalStorage; + }, + set: function (sharedComputer) { + this.$store.commit("setUseLocalStorage", !sharedComputer); + }, + }, }, created() { 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: { @@ -109,18 +132,12 @@ export default { deep: true, }, message() { - if ( - this.message && - this.message.toLowerCase().includes("user") - ) { + if (this.message && this.message.toLowerCase().includes("user")) { this.userErrorMessage = this.message; } else { this.userErrorMessage = null; } - if ( - this.message && - this.message.toLowerCase().includes("pass") - ) { + if (this.message && this.message.toLowerCase().includes("pass")) { this.passErrorMessage = this.message; } else { this.passErrorMessage = null; @@ -130,9 +147,8 @@ export default { methods: { handleLogin() { if (this.user.user_id && this.user.password) { - - // Reset errors - this.message = null; + // Reset errors + this.message = null; // Is it a full matrix user id? Modify a copy, so that the UI will still show the full ID. var user = Object.assign({}, this.user); @@ -142,9 +158,17 @@ export default { this.$store.dispatch("login", user).then( () => { 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 { - this.$navigation.push({name: "Home"}, -1); + this.$navigation.push({ name: "Home" }, -1); } }, (error) => { diff --git a/src/components/Profile.vue b/src/components/Profile.vue index 3d7fe06..b0887f3 100644 --- a/src/components/Profile.vue +++ b/src/components/Profile.vue @@ -2,7 +2,7 @@
-
{{ $t("profile.title") }}
+
{{ $t("profile.title") }}
{{ displayName }}
{{ $matrix.currentUser.user_id }}
-
+ {{ $t("menu.logout") }} @@ -51,7 +51,7 @@ diff --git a/src/components/RoomInfoBottomSheet.vue b/src/components/RoomInfoBottomSheet.vue index d6bbec0..bfdfbac 100644 --- a/src/components/RoomInfoBottomSheet.vue +++ b/src/components/RoomInfoBottomSheet.vue @@ -21,7 +21,7 @@ >{{$t('room_info_sheet.view_details')}}
- +
@@ -63,4 +63,4 @@ export default { \ No newline at end of file + diff --git a/src/components/RoomList.vue b/src/components/RoomList.vue index 4db9152..53bd481 100644 --- a/src/components/RoomList.vue +++ b/src/components/RoomList.vue @@ -1,40 +1,5 @@