Selaa lähdekoodia

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

Close page update
j8
yanas 8 vuotta sitten
vanhempi
commit
3ad1573130
9 muutettua tiedostoa jossa 129 lisäystä ja 34 poistoa
  1. 1
    0
      404.html
  2. 1
    0
      authError.html
  3. 26
    3
      close.html
  4. 33
    0
      close2.html
  5. 18
    13
      conference.js
  6. 31
    2
      css/_redirect_page.scss
  7. 2
    0
      css/_variables.scss
  8. 13
    12
      modules/UI/UI.js
  9. 4
    4
      modules/UI/feedback/FeedbackWindow.js

+ 1
- 0
404.html Näytä tiedosto

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

+ 1
- 0
authError.html Näytä tiedosto

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

+ 26
- 3
close.html Näytä tiedosto

@@ -1,8 +1,31 @@
1 1
 <html>
2 2
 <head>
3 3
     <link rel="stylesheet" href="css/all.css"/>
4
+    <!--#include virtual="title.html" -->
5
+    <script><!--#include virtual="/interface_config.js" --></script>
6
+    <script>function translateStr(id, msg) {
7
+        var div = document.getElementById(id);
8
+        div.innerHTML = msg;
9
+    }
10
+    function translate() {
11
+        translateStr('hintMessage',
12
+            'You can use video calls with '
13
+            + interfaceConfig.APP_NAME +' for your business');
14
+    }
15
+    </script>
4 16
 </head>
5
-<body>
6
-    <div class="redirectPageMessage">Thank you for your feedback!</div>
17
+<body onload="translate();">
18
+<div class="redirectPageMessage">
19
+    <div class="thanks-msg">
20
+        <p id="thanksMessage">Thank you for your feedback!</p>
21
+    </div>
22
+    <div class="hint-msg">
23
+        <p>
24
+            <span>Did you know?</span>
25
+            <span class="hint-msg__holder" id="hintMessage"></span>
26
+        </p>
27
+        <div class="happy-software"></div>
28
+    </div>
29
+</div>
7 30
 </body>
8
-</html>
31
+</html>

+ 33
- 0
close2.html Näytä tiedosto

@@ -0,0 +1,33 @@
1
+<html>
2
+<head>
3
+    <link rel="stylesheet" href="css/all.css"/>
4
+    <!--#include virtual="title.html" -->
5
+    <script><!--#include virtual="/interface_config.js" --></script>
6
+    <script>function translateStr(id, msg) {
7
+        var div = document.getElementById(id);
8
+        div.innerHTML = msg;
9
+    }
10
+    function translate() {
11
+        translateStr('thanksMessage',
12
+            'Thank you for using ' + interfaceConfig.APP_NAME);
13
+        translateStr('hintMessage',
14
+            'You can use video calls with '
15
+            + interfaceConfig.APP_NAME +' for your business');
16
+    }
17
+    </script>
18
+</head>
19
+<body onload="translate();">
20
+    <div class="redirectPageMessage">
21
+        <div class="thanks-msg">
22
+            <p id="thanksMessage"></p>
23
+        </div>
24
+        <div class="hint-msg">
25
+            <p>
26
+                <span>Did you know?</span>
27
+                <span class="hint-msg__holder" id="hintMessage"></span>
28
+            </p>
29
+            <div class="happy-software"></div>
30
+        </div>
31
+    </div>
32
+</body>
33
+</html>

+ 18
- 13
conference.js Näytä tiedosto

@@ -184,29 +184,34 @@ function muteLocalVideo (muted) {
184 184
  * If requested show a thank you dialog before that.
185 185
  * If we have a close page enabled, redirect to it without
186 186
  * showing any other dialog.
187
- * @param {boolean} showThankYou whether we should show a thank you dialog
187
+ *
188
+ * @param {object} options Feedback data
189
+ * @param {boolean} options.thankYouDialogVisible - whether we should
190
+ * show thank you dialog
191
+ * @param {boolean} options.feedbackSubmitted - whether feedback was submitted
188 192
  */
189
-function maybeRedirectToWelcomePage(showThankYou) {
190
-
193
+function maybeRedirectToWelcomePage(options) {
191 194
     // if close page is enabled redirect to it, without further action
192 195
     if (config.enableClosePage) {
193
-        window.location.pathname = "close.html";
196
+        if (options.feedbackSubmitted)
197
+            window.location.pathname = "close.html";
198
+        else
199
+            window.location.pathname = "close2.html";
194 200
         return;
195 201
     }
196 202
 
197
-    if (showThankYou) {
203
+    // else: show thankYou dialog only if there is no feedback
204
+    if (options.thankYouDialogVisible)
198 205
         APP.UI.messageHandler.openMessageDialog(
199 206
             null, "dialog.thankYou", {appName:interfaceConfig.APP_NAME});
200
-    }
201 207
 
202
-    if (!config.enableWelcomePage) {
203
-        return;
208
+    // if Welcome page is enabled redirect to welcome page after 3 sec.
209
+    if (config.enableWelcomePage) {
210
+        setTimeout(() => {
211
+            APP.settings.setWelcomePageEnabled(true);
212
+            window.location.pathname = "/";
213
+        }, 3000);
204 214
     }
205
-    // redirect to welcome page
206
-    setTimeout(() => {
207
-        APP.settings.setWelcomePageEnabled(true);
208
-        window.location.pathname = "/";
209
-    }, 3000);
210 215
 }
211 216
 
212 217
 /**

+ 31
- 2
css/_redirect_page.scss Näytä tiedosto

@@ -6,7 +6,36 @@ html, body {
6 6
 }
7 7
 
8 8
 .redirectPageMessage {
9
+    width: 30%;
10
+    margin: 20% auto;
9 11
     text-align: center;
10
-    font-size: 36px;
11
-    margin-top: 20%;
12
+    font-size: 24px;
13
+
14
+    .thanks-msg {
15
+        border-bottom: 1px solid $selectBg;
16
+        padding-left: 30px;
17
+        padding-right: 30px;
18
+        p {
19
+            margin: 30px auto;
20
+            font-size: 24px;
21
+            line-height: 24px;
22
+        }
23
+    }
24
+    .hint-msg{
25
+        p {
26
+            margin: 26px auto;
27
+            font-weight: 600;
28
+            font-size: 16px;
29
+            line-height: 18px;
30
+            .hint-msg__holder{
31
+                font-weight: 200;
32
+            }
33
+        }
34
+        .happy-software{
35
+            width: 120px;
36
+            height: 86px;
37
+            margin: 0 auto;
38
+            background: $happySoftwareBackground;
39
+        }
40
+    }
12 41
 }

+ 2
- 0
css/_variables.scss Näytä tiedosto

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

+ 13
- 12
modules/UI/UI.js Näytä tiedosto

@@ -1037,25 +1037,26 @@ UI.requestFeedbackOnHangup = function () {
1037 1037
     if (Feedback.isVisible())
1038 1038
         return Promise.reject(UIErrors.FEEDBACK_REQUEST_IN_PROGRESS);
1039 1039
     // Feedback has been submitted already.
1040
-    else if (Feedback.isEnabled() && Feedback.isSubmitted())
1041
-        return Promise.resolve(true);
1040
+    else if (Feedback.isEnabled() && Feedback.isSubmitted()) {
1041
+        return Promise.resolve({
1042
+            thankYouDialogVisible : true,
1043
+            feedbackSubmitted: true
1044
+        });
1045
+    }
1042 1046
     else
1043 1047
         return new Promise(function (resolve) {
1044 1048
             if (Feedback.isEnabled()) {
1045
-                // If the user has already entered feedback, we'll show the
1046
-                // window and immidiately start the conference dispose timeout.
1047
-                if (Feedback.getFeedbackScore() > 0) {
1048
-                    Feedback.openFeedbackWindow();
1049
-                    resolve(false);
1050
-
1051
-                } else { // Otherwise we'll wait for user's feedback.
1052
-                    Feedback.openFeedbackWindow(() => resolve(false));
1053
-                }
1049
+                Feedback.openFeedbackWindow(
1050
+                    (options) => {
1051
+                        options.thankYouDialogVisible = false;
1052
+                        resolve(options);
1053
+                    });
1054 1054
             } else {
1055 1055
                 // If the feedback functionality isn't enabled we show a thank
1056 1056
                 // you dialog. Signaling it (true), so the caller
1057 1057
                 // of requestFeedback can act on it
1058
-                resolve(true);
1058
+                resolve(
1059
+                    {thankYouDialogVisible : true, feedbackSubmitted: false});
1059 1060
             }
1060 1061
         });
1061 1062
 };

+ 4
- 4
modules/UI/feedback/FeedbackWindow.js Näytä tiedosto

@@ -164,9 +164,7 @@ export default class Dialog {
164 164
     }
165 165
 
166 166
     setFeedbackMessage() {
167
-        let message = $('#feedbackTextArea').val();
168
-
169
-        this.feedbackMessage = message;
167
+        this.feedbackMessage = $('#feedbackTextArea').val();
170 168
     }
171 169
 
172 170
     show(cb) {
@@ -179,6 +177,8 @@ export default class Dialog {
179 177
     }
180 178
 
181 179
     onHide() {
182
-        this.onCloseCallback(this.feedbackScore, this.feedbackMessage);
180
+        this.onCloseCallback({
181
+            feedbackSubmitted: this.submitted
182
+        });
183 183
     }
184 184
 }

Loading…
Peruuta
Tallenna