-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding Room type with Converse.js replacing jitsi #385
Merged
Merged
Changes from all commits
Commits
Show all changes
26 commits
Select commit
Hold shift + click to select a range
5adf316
initial converse inclusion with creation of streaming room
7c00673
Merge branch 'master' into chat
f865b07
cleaned up converse init
671a839
pushing for andrew to look at
02165d2
initial configuration for converse
rene-grigory dfde39e
Merge branch 'master' into chat
rene-grigory 1d57567
merged from upstream
rene-grigory c10398c
merged from upstream
rene-grigory dfcdb08
removed node_modules from git
rene-grigory 09b1df7
created auto logout when leaving the room
1fe98b3
got rid of needless code
b85be73
ready for styling and cleanup
f155948
finished hijacking css
rene-grigory 7c00179
Merge branch 'master' into chat
rene-grigory 21f35c3
revered iframe link
rene-grigory fd36859
code clean up
rene-grigory d7599ec
Merge branch 'master' into chat
80adc18
fixed comment in rooms.proto
rene-grigory 9c99bb2
logout user in beforeUnload
rene-grigory a093676
hide offline users and brought in the latest convers.js lib
rene-grigory 85c5117
Merge branch 'master' into chat
rene-grigory 5165ca7
format cleanup
rene-grigory 30346f8
more cleanup and useing Config.baseUrl to point at the bash service
rene-grigory 4eaa9ed
replaced old listener with MutationObserver since none of the convers…
rene-grigory 83df75c
removed comment and fixed console.error
rene-grigory f3b7421
added style variables for the chat box
rene-grigory File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,100 @@ | ||
import React, { useEffect } from "react"; | ||
import Config from "./Config.jsx"; | ||
|
||
/** | ||
* This component is used to render a Converse.js chat component on the | ||
* left side and an IFrame on the right. While this component does have | ||
* the jitsi-video class in the render it is only for placement: there | ||
* is no jitsi video in this component. | ||
* | ||
* This component works in conjunction with the CHATSTREAM room type. | ||
* | ||
* @param props a combo of roomData and jitsiData | ||
* @returns | ||
*/ | ||
export const ChatStreamRoom = ({ | ||
id: roomId, | ||
displayName, | ||
iframeOptions: { src }, | ||
}) => { | ||
// register the 'jitsi-plugin' and initialize converse and cleanup after close | ||
useEffect(() => { | ||
let logout = null; | ||
let plugins = null; | ||
|
||
// configure the 'jitsi-plugin' to get our hands on the converse api logout | ||
try { | ||
window.converse.plugins.add("jitsi-plugin", { | ||
initialize: function () { | ||
logout = this._converse.api.user.logout; | ||
plugins = this._converse.pluggable.plugins; | ||
}, | ||
}); | ||
} catch (error) { | ||
// do nothing since the plugin is already registered | ||
console.error(error); | ||
} | ||
|
||
// initialize converse | ||
window.converse.initialize({ | ||
authentication: "anonymous", | ||
auto_login: true, | ||
auto_join_rooms: [ | ||
{ jid: `${roomId}@muc.party.jitsi`, nick: displayName }, | ||
], | ||
bosh_service_url: `${Config.baseUrl}jitsi/http-bind`, | ||
jid: "guest.party.jitsi", | ||
singleton: true, | ||
hide_offline_users: true, | ||
clear_cache_on_logout: true, | ||
time_format: "hh:mm a", | ||
visible_toolbar_buttons: { | ||
call: false, | ||
spoiler: false, | ||
emoji: true, | ||
toggle_occupants: false, | ||
}, | ||
whitelisted_plugins: ["jitsi-plugin"], | ||
view_mode: "embedded", | ||
}); | ||
|
||
// use MutationObserver to restucture the chatbox | ||
const observer = new MutationObserver((muts) => { | ||
if (document.querySelector(".chatbox-title__buttons") !== null) { | ||
document.querySelector(".chat-head").remove(); | ||
} | ||
|
||
if (document.querySelector(".send-button") !== null) { | ||
document.querySelector(".send-button").remove(); | ||
observer.disconnect(); | ||
} | ||
}); | ||
|
||
observer.observe(document, { | ||
childList: true, | ||
attributes: true, | ||
subtree: true, | ||
}); | ||
|
||
// listen to beforeunload to logout and cleanup | ||
window.addEventListener("beforeunload", () => { | ||
plugins["jitsi-plugin"] = undefined; | ||
logout(); | ||
}); | ||
|
||
// call the converse api logout at cleanup | ||
return () => { | ||
plugins["jitsi-plugin"] = undefined; | ||
logout(); | ||
}; | ||
}, []); | ||
|
||
return ( | ||
<div className="iframe-room"> | ||
<div className="jitsi-video"></div> | ||
<div className="iframe-section"> | ||
<iframe src={src} height="100%" width="100%" frameBorder="0px"></iframe> | ||
</div> | ||
</div> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,154 @@ | ||
$mobile_landscape_height: 450px !default; | ||
$mobile_portrait_length: 480px !default; | ||
|
||
#conversejs { | ||
position: absolute !important; | ||
top: 10% !important; | ||
bottom: auto !important; | ||
width: 45vw !important; | ||
left: 1vw !important; | ||
height: 66% !important; | ||
z-index: 9 !important; | ||
|
||
.badge, | ||
.chat-info, | ||
.hide-occupants { | ||
display: none !important; | ||
} | ||
|
||
.chat-head { | ||
background-color: $background-color !important; | ||
} | ||
|
||
.occupants-heading { | ||
color: $background-color !important; | ||
} | ||
|
||
.occupant-status { | ||
vertical-align: sub; | ||
} | ||
|
||
.occupant-nick { | ||
font-size: 0.9rem; | ||
} | ||
|
||
.chatroom { | ||
// color themes | ||
.separator { | ||
border-bottom: 2px solid $chat-separator-bars !important; | ||
} | ||
|
||
.separator-text { | ||
color: $chat-separator-text !important; | ||
background-color: $chat-separator-text-bg !important; | ||
} | ||
|
||
.chat-content { | ||
background-color: $chat-content; | ||
} | ||
|
||
.chat-msg__author { | ||
color: $chat-msg-author !important; | ||
} | ||
|
||
.chat-msg__time { | ||
color: $chat-msg-time !important; | ||
} | ||
|
||
.chat-msg__text { | ||
color: $chat-msg-text !important; | ||
} | ||
|
||
.fa-bars { | ||
color: $chat-msg-menu !important | ||
} | ||
|
||
.dropdown-menu { | ||
background-color: $chat-msg-menu-bg !important; | ||
} | ||
|
||
.chat-msg__action { | ||
color: $chat-msg-menu-items !important; | ||
svg { | ||
fill: $chat-msg-menu-items !important; | ||
} | ||
} | ||
|
||
.chat-content__notifications { | ||
background-color: $chat-notification-bg !important; | ||
color: $chat-notification-text !important; | ||
} | ||
|
||
converse-muc-sidebar { | ||
background-color: $chat-participants !important; | ||
border-left-color: $chat-participants-resize !important; | ||
} | ||
|
||
.occupants-heading { | ||
color: $participants-title !important; | ||
} | ||
|
||
.occupant-nick { | ||
color: $participants-name !important; | ||
} | ||
|
||
.suggestion-box { | ||
border-top: 1px solid $message-input-top-border !important; | ||
} | ||
|
||
.chat-textarea { | ||
background-color: $message-area-bg !important; | ||
margin-bottom: -5px !important; | ||
color: $message-text !important; | ||
&::placeholder { | ||
color: lighten($message-text, 20%) !important; | ||
} | ||
&:focus { | ||
outline: 0px !important; | ||
border: 2px solid $message-focus !important; | ||
border-bottom: 3px solid $message-focus !important; | ||
} | ||
} | ||
|
||
.sendXMPPMessage { | ||
background-color: $message-area-bg !important; | ||
} | ||
|
||
.emoji-picker__header, | ||
.emoji-skintone-picker { | ||
background-color: $emoji-header-footer !important; | ||
} | ||
|
||
.emoji-picker { | ||
background-color: $emoji-separator !important; | ||
} | ||
|
||
.emoji-picker__lists { | ||
background-color: $emoji-popup-bg !important; | ||
} | ||
|
||
.emoji-category__heading { | ||
color: $emoji-category-heading !important; | ||
} | ||
|
||
.toggle-emojis:focus { | ||
outline: 0px !important; | ||
} | ||
|
||
// other adjustments | ||
.chat-content__help { | ||
border: 0px !important; | ||
} | ||
|
||
converse-chat-toolbar { | ||
border-top: 0px !important; | ||
background-color: $toolbox-bg !important; | ||
|
||
svg { | ||
fill: $toolbox-emoji-color !important; | ||
} .separator { | ||
border-bottom: 2px solid $toolbox-bg !important; | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,6 +13,34 @@ $dark-grey: #404040; | |
$matte-blue: #294b7f; | ||
$light-grey: #ece9e9; | ||
|
||
// Chat color variables | ||
$chat-separator-bars: $matte-blue; // separator bars at the top of the chat area | ||
$chat-separator-text: $matte-blue; // text between the separators | ||
$chat-separator-text-bg: $fuckyou-turquoise; // background for the text area | ||
$chat-content: $fuckyou-turquoise; // the main chat area on the left | ||
$chat-notification-bg: $fuckyou-turquoise; // entry/exit notification background | ||
$chat-notification-text: $matte-blue; // entry/exit notification text color | ||
$chat-msg-author: $matte-blue; // color of user name | ||
$chat-msg-time: $matte-blue; // color of the chat time | ||
$chat-msg-text: $matte-blue; // color the chat text | ||
$chat-msg-menu: $matte-blue; // color the hamburgar menu to the right of the chat message | ||
$chat-msg-menu-bg: $fuckyou-turquoise; // background color of the menu dropdown | ||
$chat-msg-menu-items: $matte-blue; // color for the menu items | ||
$toolbox-bg: $fuckyou-turquoise; // background color for the location of the emoji picker icon | ||
$toolbox-emoji-color: $matte-blue; // the color for the emoji icon | ||
$emoji-header-footer: $matte-blue; // color for the header and footer inside the emoji popup | ||
$emoji-category-heading: $matte-blue; // color for the emoji heading text in the popup | ||
$emoji-popup-bg: $matte-purple; // background color of the emoji popup | ||
$emoji-separator: $fuckyou-turquoise; // color for th emoji separator bar | ||
$message-area-bg: $fuckyou-turquoise; // background for the message text area | ||
$message-input-top-border: $matte-blue; // the border at the top of the message area | ||
$message-focus: $matte-blue; // the color of the message area border when focused | ||
$message-text: $matte-blue; // the text color in the message area | ||
$chat-participants: $fuckyou-turquoise; // the participants sidebar on the right of the chat | ||
$chat-participants-resize: $matte-blue; // color of the participants resize handle | ||
$participants-title: $matte-blue; // the title of the participants list | ||
$participants-name: $matte-blue; // the name of each participant in the list | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks for adding these comments, that's very helpful |
||
|
||
// Hexing notifications & icon | ||
$accent-color: $fuckyou-turquoise; | ||
|
||
|
@@ -73,21 +101,21 @@ $modal-overlay-color: rgba(129, 62, 62, 0.25); | |
$art-image-border-color: color("grey-50"); //white | ||
|
||
body { | ||
font-family: $accent-font !important; | ||
font-family: $accent-font !important; | ||
} | ||
|
||
.vestibule .header { | ||
margin-bottom: 0 !important; | ||
margin-bottom: 0 !important; | ||
} | ||
|
||
.custom-login-description { | ||
text-align: center; | ||
font-size: smaller; | ||
opacity: 0.8; | ||
text-align: center; | ||
font-size: smaller; | ||
opacity: 0.8; | ||
} | ||
|
||
// .tst, | ||
// .room-header h2, | ||
// .room-header h2, | ||
// #map-info .room-name, | ||
// .events-view .events-header, | ||
// .events-view .event-list .event-info .event-name, | ||
|
@@ -96,6 +124,6 @@ body { | |
// } | ||
|
||
.room .room-content { | ||
max-height: 120px; | ||
padding: .5em 50px; | ||
max-height: 120px; | ||
padding: 0.5em 50px; | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The diff in this file is a little confusing because of what I presume is linting…is there any chance you could commit without the linting? That way our history will be cleaner and reviews will be easier!