Merge pull request #1100 from jitsi/close-page-update

Close page update
This commit is contained in:
yanas 2016-11-01 15:31:43 -05:00 committed by GitHub
commit 3ad1573130
9 changed files with 129 additions and 34 deletions

View File

@ -1,6 +1,7 @@
<html>
<head>
<link rel="stylesheet" href="css/all.css"/>
<!--#include virtual="title.html" -->
</head>
<body>
<div class="error_page">

View File

@ -1,6 +1,7 @@
<html>
<head>
<link rel="stylesheet" href="css/all.css"/>
<!--#include virtual="title.html" -->
</head>
<body>
<div class="redirectPageMessage">Sorry! You are not allowed to be here :(</div>

View File

@ -1,8 +1,31 @@
<html>
<head>
<link rel="stylesheet" href="css/all.css"/>
<!--#include virtual="title.html" -->
<script><!--#include virtual="/interface_config.js" --></script>
<script>function translateStr(id, msg) {
var div = document.getElementById(id);
div.innerHTML = msg;
}
function translate() {
translateStr('hintMessage',
'You can use video calls with '
+ interfaceConfig.APP_NAME +' for your business');
}
</script>
</head>
<body>
<div class="redirectPageMessage">Thank you for your feedback!</div>
<body onload="translate();">
<div class="redirectPageMessage">
<div class="thanks-msg">
<p id="thanksMessage">Thank you for your feedback!</p>
</div>
<div class="hint-msg">
<p>
<span>Did you know?</span>
<span class="hint-msg__holder" id="hintMessage"></span>
</p>
<div class="happy-software"></div>
</div>
</div>
</body>
</html>

33
close2.html Normal file
View File

@ -0,0 +1,33 @@
<html>
<head>
<link rel="stylesheet" href="css/all.css"/>
<!--#include virtual="title.html" -->
<script><!--#include virtual="/interface_config.js" --></script>
<script>function translateStr(id, msg) {
var div = document.getElementById(id);
div.innerHTML = msg;
}
function translate() {
translateStr('thanksMessage',
'Thank you for using ' + interfaceConfig.APP_NAME);
translateStr('hintMessage',
'You can use video calls with '
+ interfaceConfig.APP_NAME +' for your business');
}
</script>
</head>
<body onload="translate();">
<div class="redirectPageMessage">
<div class="thanks-msg">
<p id="thanksMessage"></p>
</div>
<div class="hint-msg">
<p>
<span>Did you know?</span>
<span class="hint-msg__holder" id="hintMessage"></span>
</p>
<div class="happy-software"></div>
</div>
</div>
</body>
</html>

View File

@ -184,29 +184,34 @@ function muteLocalVideo (muted) {
* If requested show a thank you dialog before that.
* If we have a close page enabled, redirect to it without
* showing any other dialog.
* @param {boolean} showThankYou whether we should show a thank you dialog
*
* @param {object} options Feedback data
* @param {boolean} options.thankYouDialogVisible - whether we should
* show thank you dialog
* @param {boolean} options.feedbackSubmitted - whether feedback was submitted
*/
function maybeRedirectToWelcomePage(showThankYou) {
function maybeRedirectToWelcomePage(options) {
// if close page is enabled redirect to it, without further action
if (config.enableClosePage) {
if (options.feedbackSubmitted)
window.location.pathname = "close.html";
else
window.location.pathname = "close2.html";
return;
}
if (showThankYou) {
// else: show thankYou dialog only if there is no feedback
if (options.thankYouDialogVisible)
APP.UI.messageHandler.openMessageDialog(
null, "dialog.thankYou", {appName:interfaceConfig.APP_NAME});
}
if (!config.enableWelcomePage) {
return;
}
// redirect to welcome page
// if Welcome page is enabled redirect to welcome page after 3 sec.
if (config.enableWelcomePage) {
setTimeout(() => {
APP.settings.setWelcomePageEnabled(true);
window.location.pathname = "/";
}, 3000);
}
}
/**

View File

@ -6,7 +6,36 @@ html, body {
}
.redirectPageMessage {
width: 30%;
margin: 20% auto;
text-align: center;
font-size: 36px;
margin-top: 20%;
font-size: 24px;
.thanks-msg {
border-bottom: 1px solid $selectBg;
padding-left: 30px;
padding-right: 30px;
p {
margin: 30px auto;
font-size: 24px;
line-height: 24px;
}
}
.hint-msg{
p {
margin: 26px auto;
font-weight: 600;
font-size: 16px;
line-height: 18px;
.hint-msg__holder{
font-weight: 200;
}
}
.happy-software{
width: 120px;
height: 86px;
margin: 0 auto;
background: $happySoftwareBackground;
}
}
}

View File

@ -92,6 +92,8 @@ $borderRadius: 4px;
$defaultWatermarkLink: '../images/watermark.png';
$sidebarWidth: 200px;
$happySoftwareBackground: transparent;
/**
* Z-indexes. TODO: Replace this by a function.
*/

View File

@ -1037,25 +1037,26 @@ UI.requestFeedbackOnHangup = function () {
if (Feedback.isVisible())
return Promise.reject(UIErrors.FEEDBACK_REQUEST_IN_PROGRESS);
// Feedback has been submitted already.
else if (Feedback.isEnabled() && Feedback.isSubmitted())
return Promise.resolve(true);
else if (Feedback.isEnabled() && Feedback.isSubmitted()) {
return Promise.resolve({
thankYouDialogVisible : true,
feedbackSubmitted: true
});
}
else
return new Promise(function (resolve) {
if (Feedback.isEnabled()) {
// If the user has already entered feedback, we'll show the
// window and immidiately start the conference dispose timeout.
if (Feedback.getFeedbackScore() > 0) {
Feedback.openFeedbackWindow();
resolve(false);
} else { // Otherwise we'll wait for user's feedback.
Feedback.openFeedbackWindow(() => resolve(false));
}
Feedback.openFeedbackWindow(
(options) => {
options.thankYouDialogVisible = false;
resolve(options);
});
} else {
// If the feedback functionality isn't enabled we show a thank
// you dialog. Signaling it (true), so the caller
// of requestFeedback can act on it
resolve(true);
resolve(
{thankYouDialogVisible : true, feedbackSubmitted: false});
}
});
};

View File

@ -164,9 +164,7 @@ export default class Dialog {
}
setFeedbackMessage() {
let message = $('#feedbackTextArea').val();
this.feedbackMessage = message;
this.feedbackMessage = $('#feedbackTextArea').val();
}
show(cb) {
@ -179,6 +177,8 @@ export default class Dialog {
}
onHide() {
this.onCloseCallback(this.feedbackScore, this.feedbackMessage);
this.onCloseCallback({
feedbackSubmitted: this.submitted
});
}
}