Skip to content
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

Ravem: Show correct name of connected VC #193

Merged
merged 1 commit into from
Feb 10, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions ravem/indico_ravem/client/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,16 @@
// them and/or modify them under the terms of the MIT License; see
// the LICENSE file for more details.

/* eslint-disable func-name-matching */
/* eslint-disable import/unambiguous */

(function() {
const $t = $T.domain('ravem');
const ravemButton = (function makeRavemButton() {
const states = {
connected: {
icon: 'x',
tooltip: $t.gettext('Disconnect {0} from the videoconference room {1}'),
tooltip: $t.gettext('Disconnect {0} from the videoconference room {3}'),
action: 'disconnect',
handler: function disconnectHandler(data, btn) {
const name = btn.data('roomName');
Expand Down Expand Up @@ -192,7 +195,7 @@
/**
* Sets a new state for the button and update its icon, label and tool tip.
*/
function setButtonState(btn, newState, tooltipMessage) {
function setButtonState(btn, newState, tooltipMessage = '', currentVCRoom = '') {
btn.data('state', newState);

const name = btn.data('roomName');
Expand All @@ -203,7 +206,7 @@

tooltipMessage = tooltipMessage ? `${tooltipMessage}<br>` : '';
const qtip = {
content: states[newState].tooltip.format(name, vcRoomName, tooltipMessage),
content: states[newState].tooltip.format(name, vcRoomName, tooltipMessage, currentVCRoom),
position: {my: 'top center', at: 'bottom center'},
show: 'mouseover',
hide: {
Expand Down Expand Up @@ -316,7 +319,7 @@
return;
}
const connected = data.connected;
setButtonState(btn, connected ? 'connected' : 'disconnected');
setButtonState(btn, connected ? 'connected' : 'disconnected', '', data.vc_room_id);
});
return btn;
}
Expand Down