Skip to content

Jitsi Meet - Secure, Simple and Scalable Video Conferences that you use as a standalone app or embed in your web application.

Merge branch 'master' into translations-update

damencho547f96c0c14f
diff --cc modules/UI/UI.js
index b461c15905,64690b4116..74917a5ef9
--- a/modules/UI/UI.js
+++ b/modules/UI/UI.js
@@@ -185,17 -190,11 +185,10 @@@ UI.notifyKicked = function ()
UI.notifyConferenceDestroyed = function (reason) {
//FIXME: use Session Terminated from translation, but
// 'reason' text comes from XMPP packet and is not translated
- const title
- = APP.translation.generateTranslationHTML("dialog.sessTerminated");
- messageHandler.openDialog(title, reason, true, {}, () => false);
+ messageHandler.openDialog(
+ "dialog.sessTerminated", reason, true, {}, () => false);
};
- /**
- * Notify user that Jitsi Videobridge is not accessible.
- */
- UI.notifyBridgeDown = function () {
- messageHandler.showError("dialog.error", "dialog.bridgeUnavailable");
- };
-
/**
* Show chat error.
* @param err the Error
diff --cc modules/UI/reload_overlay/PageReloadOverlay.js
index 0000000000,4529ab478b..bcc225491c
mode 000000,100644..100644
--- a/modules/UI/reload_overlay/PageReloadOverlay.js
+++ b/modules/UI/reload_overlay/PageReloadOverlay.js
@@@ -1,0 -1,122 +1,121 @@@
+ /* global $, APP, AJS */
+
+ import Overlay from '../overlay/Overlay';
+
+ /**
+ * An overlay dialog which is shown before the conference is reloaded. Shows
+ * a warning message and counts down towards the reload.
+ */
+ class PageReloadOverlayImpl extends Overlay{
+ /**
+ * Creates new <tt>PageReloadOverlayImpl</tt>
+ * @param {number} timeoutSeconds how long the overlay dialog will be
+ * displayed, before the conference will be reloaded.
+ */
+ constructor(timeoutSeconds) {
+ super();
+ /**
+ * Conference reload counter in seconds.
+ * @type {number}
+ */
+ this.timeLeft = timeoutSeconds;
+ /**
+ * Conference reload timeout in seconds.
+ * @type {number}
+ */
+ this.timeout = timeoutSeconds;
+ }
+ /**
+ * Constructs overlay body with the warning message and count down towards
+ * the conference reload.
+ * @override
+ */
+ _buildOverlayContent() {
+ return `
+ <span data-i18n='dialog.conferenceReloadTitle'
+ class='reload_overlay_title'></span>
+ <span data-i18n='dialog.conferenceReloadMsg'
+ class='reload_overlay_msg'></span>
+ <div>
+ <div id='reloadProgressBar' class="aui-progress-indicator">
+ <span class="aui-progress-indicator-value"></span>
+ </div>
- <span id='reloadSecRemaining' class='reload_overlay_msg'>
++ <span id='reloadSecRemaining'
++ data-i18n="dialog.conferenceReloadTimeLeft"
++ class='reload_overlay_msg'>
+ </span>
+ </div>`;
+ }
+
+ /**
+ * Updates the progress indicator position and the label with the time left.
+ */
+ updateDisplay() {
+
- const timeLeftTxt
- = APP.translation.translateString(
- "dialog.conferenceReloadTimeLeft",
- { seconds: this.timeLeft });
- $("#reloadSecRemaining").text(timeLeftTxt);
++ APP.translation.translateElement(
++ $("#reloadSecRemaining"), { seconds: this.timeLeft });
+
+ const ratio = (this.timeout - this.timeLeft) / this.timeout;
+ AJS.progressBars.update("#reloadProgressBar", ratio);
+ }
+
+ /**
+ * Starts the reload countdown with the animation.
+ * @override
+ */
+ _onShow() {
+
+ // Initialize displays
+ this.updateDisplay();
+
+ var intervalId = window.setInterval(function() {
+
+ if (this.timeLeft >= 1) {
+ this.timeLeft -= 1;
+ }
+
+ this.updateDisplay();
+
+ if (this.timeLeft === 0) {
+ window.clearInterval(intervalId);
+ APP.ConferenceUrl.reload();
+ }
+ }.bind(this), 1000);
+
+ console.info(
+ "The conference will be reloaded after "
+ + this.timeLeft + " seconds.");
+ }
+ }
+
+ /**
+ * Holds the page reload overlay instance.
+ *
+ * {@type PageReloadOverlayImpl}
+ */
+ let overlay;
+
+ export default {
+ /**
+ * Checks whether the page reload overlay has been displayed.
+ * @return {boolean} <tt>true</tt> if the page reload overlay is currently
+ * visible or <tt>false</tt> otherwise.
+ */
+ isVisible() {
+ return overlay && overlay.isVisible();
+ },
+ /**
+ * Shows the page reload overlay which will do the conference reload after
+ * the given amount of time.
+ *
+ * @param {number} timeoutSeconds how many seconds before the conference
+ * reload will happen.
+ */
+ show(timeoutSeconds) {
+
+ if (!overlay) {
+ overlay = new PageReloadOverlayImpl(timeoutSeconds);
+ }
+ overlay.show();
+ }
+ };